Files
isaac-port/notes/items/weapons.md
T

53 lines
4.2 KiB
Markdown

# Weapons (isaac-classic rif/weapons)
Repentance+'s weapon selection and four weapons, as isaac-classic's Items = Repentance+ transcribes them (its records'
`attributes/weapon` in resources/data/repentance_plus/items.json). Full Mom's Knife trace: weapons_knife.md.
## Weapon selection (Entity_Player::EvaluateItems 0x763570, cache 0x100, asm 0x763bc5-0x763f74)
EnableWeaponType(type, 1) for the first that holds (types: 1 tears, 2 brimstone, 3 laser, 4 knife, 5 bombs, 6 rockets,
7 Monstro's Lung, 8 Ludovico, 9 Tech X, 10 bone, 13 spirit sword, 14 fetus):
1. player type 16 / 35, baby skin 57, effect 0x2c0 (Berserk) -> 10
2. effect 0x271 (Mega Mush) -> 1; null effect 0x6e -> 4
3. 0x243 Spirit Sword -> 13 (14 with 0x2a6 C Section)
4. 0xa8 Epic Fetus -> 6; 0x2a6 C Section -> 14; 0x72 Mom's Knife -> 4
5. 0x213 Haemolacria -> 1 (7 with 0xe5 Monstro's Lung)
6. 0x34 Dr. Fetus -> 5 (7 with Monstro's Lung: `lea ecx,[ecx*2+5]`)
7. (0x76 Brimstone, or Azazel 7 / trinket 0xa2 / T.Azazel 0x1c) without 0x18b Tech X -> 2; else Tech X -> 9
8. 0x44 Technology -> 3; 0x149 Ludovico -> 8; Monstro's Lung -> 7; else 1
Then: 2 && 4 drop 2; 14 with Brimstone (no Tech X) -> 2; 7 && 5 drop 5; 2 && 3 drop 3.
Port: priorities bag 15 > bone/berserk 14 > sword 13 > Epic Fetus 12 > knife 11 > Haemolacria (a "tear" weapon) 10 >
Dr. Fetus 9 > Tech X 8 > Brimstone 7 > Technology 6 > Ludovico 5 > Lung 4 > Chocolate Milk 1, Lung `beats` Dr. Fetus and
Haemolacria. Weapon-type-gated stat terms in EvaluateItems (fire delay /3 brimstone, /2.5 bombs, /2 bone, /4.3 lung;
damage x1.5 Brimstone+Technology...) are not ported by weapon type.
## Chocolate Milk (Weapon_Tears charge mode)
- GetWeaponModifiers 0x779a20: 0x45 -> bit 1. Weapon_Tears::GetMaxCharge 0xa0d8e0: (MaxFireDelay + 1) x 2.5 - 1.
- Weapon_Tears::Fire 0xa0a720: shooting -> charge = min(charge + speedMult, max) (head HeadXCharge frame charge/max x 18,
HeadXChargeFull once full); not shooting with charge > 0 -> fires at once (the fire delay +0xc is not read in charge
mode), damage multiplier clamp((charge + 1) x 4 / ((delay + 1) x 2.5), 0.1, 4) into fire_tear -> FireTear ->
GetTearHitParams (damage x it); then charge = 0. With delay <= 0 (or Soy/Almond Milk 0x80, or a seeded variant) a held
charge >= delay x 2.5 is released each tick. The "drain" branch (charge -= speed x ((delay) x ratio^2 + 1)) is
Neptunus' (modifier 0x100) only, not Chocolate Milk's.
- GetTearHitParams 0x7bf6c0 ~line 2063: tear scale = (sqrt(d) x 0.23 + s' x 0.55 + d x 0.01) x .. — tears grow with
damage; isaac-classic has no damage-sized tears.
## Technology (Weapon_Laser::Fire 0xa052b0, FireTechLaser 0x7aab70)
- Fires when fireDelay <= 0 like tears (bumped by MaxFireDelay + 1, at most 8 a tick, one volley). Way = cardinal aim x
10 + GetTearMovementInheritance (lastVelocity x 1.2, minus a backward part) x 0.4 (not with Tractor Beam 0x18d), unit.
- Entity_Laser::ShootAngle(variant 2 thin red laser, timeout 3), oneHit, damage GetTearHitParams(3, 1.0); from the
"LeftEye" null's x (GetLaserOffset 0x7aa850). Entity_Laser::calc_end_point 0x96fc70 / CalculateEndPoint 0x96fd60:
to the room's bounds plus 20 margin, no grid stop (passes over rocks).
- Weapon_Laser::GetMaxCharge 0xa06870: Chocolate Milk x2.5 (charge lasers, damage clamp((c+1) x 4 / (max+1), .1, 4)).
## Epic Fetus (Weapon_Rockets::Fire 0xa08d40; Entity_Effect::Update jump table 0x606f8c: 30 -> 0x5f15b2, 31 -> 0x5f1ea6)
- Target +0x44: velocity += aim x 8 x speedMult each Fire. Shooting, no target, fireDelay < 0: Spawn 1000.30 on Isaac,
state = rockets (multishot count), timeout = lifespan = (rockets x 5 + 20) x 2; fireDelay = MaxFireDelay. While the
target is dead, fireDelay = MaxFireDelay.
- 1000.30: friction x0.5 (x0.95 for familiar 120), Room::GetClampedPosition(pos, 0); Blink frame on = timeout %
max(2, (int)sqrt(timeout)) < n/2; at timeout == rockets x 10 each rocket i (1..n) spawned (1000.31, timeout i x 10,
parent = target); at rockets x 10 + 12 sound 855 (drsremote_warning).
- 1000.31: posOffset.y = -timeout x 100; timeout < 3 SetFrame("Falling", 1); follows its parent; dead ->
Game::BombExplosionEffects(pos, GetTearHitParams(6, 1.0).damage x 20, player tear flags (some laser/brimstone flags
cleared with Brimstone/Knife/Technology/Tech X), radius x1) — 80 damage without a player.