REDIVIVUS

Proposals / #633

Name DAMAGE_CalculatePhysicalDamage's parameters, tested in the running game

applied · by dtchitt · submitted 2026-11-01, applied 2026-11-01

Ghidra v1799 · 2663303

Five generic parameters with clear jobs. EDX nonzero makes the function read min and max from the unit's stats; zero uses the two arguments as given. Stack[0xc] is the maximum beside the existing nMinDmg, Stack[0x10] a percent bonus, Stack[0x14] flat damage added to the roll, and Stack[0x18] a scale where 0x80 means 100%. Beyond reading the code, I called this function in a running 1.14d game with the unit's seed set so each draw was a chosen number, and every result matched a prediction from these meanings.

Changes 5, applied together

  1. Rename variable win 0x0057b420 EDX

    namenParam1→bUseWeaponStats
  2. Rename variable win 0x0057b420 Stack[0xc]

    namenParam2→nMaxDmg
  3. Rename variable win 0x0057b420 Stack[0x10]

    namenParam3→nBonusPercent
  4. Rename variable win 0x0057b420 Stack[0x14]

    namenParam→nFlatDamage
  5. Rename variable win 0x0057b420 Stack[0x18]

    namebParam→byScale