Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Paralyze(unitID, frameCount)
- local health, maxHealth, paralyzeDamage = Spring.GetUnitHealth(unitID)
- local second = math.abs(frameCount*(1/30)) --because each frame took 1/30 second
- second = second-1-1/16 --because at 0% it took 1 second to recover, and paralyze is in slow update (1/16)
- --Note: ZK use
- --paralyzeAtMaxHealth=true, and
- --unitParalysisDeclineScale=40
- local paralyze = maxHealth+maxHealth*second/40 --a full health of paralyzepoints represent 1 second of paralyze, additional health/40 paralyzepoints represent +1 second of paralyze. Reference: modrules.lua, Unit.cpp(spring).
- Spring.SetUnitHealth(unitID, { paralyze = paralyze })
- end
Advertisement
Add Comment
Please, Sign In to add comment