Refactor StatusEffectContainer to better handle messages using

CommandResultContainer.

Alter Modifiers to be the same as ParamNames.

Add LoseOnClassChange flag for status effects.

Add a few missing status effects.

Fix EndTime for stance status effects to stop icon from blinking.
This commit is contained in:
Yogurt 2019-05-27 23:05:20 -07:00
parent cc07e1f453
commit 26ef649a6c
17 changed files with 586 additions and 381 deletions

View file

@ -0,0 +1,11 @@
require("modifiers")
function onGain(target, effect)
local newMaxHP = target.GetMaxHP() * 0.75;
target.SetMaxHP(newMaxHP);
end;
function onLose(target, effect)
target.SetMaxHP(target.GetMaxHP() / 0.75);
end;

View file

@ -0,0 +1,23 @@
require("modifiers")
require("battleutils")
function onCommandStart(effect, attacker, command, actionContainer)
--Random guess
command.enmityModifier += 0.25;
end
function onHit(effect, attacker, defender, action, actionContainer)
if skill.id == 27259 then
--Effect stacks up to 3 times
if effect.GetTier() < 3 then
effect.SetTier(effect.GetTier() + 1);
end
end
end
function onMiss(effect, attacker, defender, action, actionContainer)
if skill.id == 27259 then
effect.SetTier(0);
end
end

View file

@ -36,13 +36,13 @@ function onTick(owner, effect)
--Enduring march prevents fading of rampage effect
if not owner.statusEffects.HasStatusEffect(223078) and (effect.GetExtra() > 0) then
--Going to assume that every 5 seconds a single hits worth of rampage is lost.
attacker.SubtractMod(modifiersGlobal.Parry, parryPerDT);
attacker.AddMod(modifiersGlobal.Delay, delayMsPerDT);
owner.SubtractMod(modifiersGlobal.Parry, parryPerDT);
owner.AddMod(modifiersGlobal.Delay, delayMsPerDT);
effect.SetExtra(effect.GetExtra() - 1);
end
end
function onLose(owner, effect)
attacker.SubtractMod(modifiersGlobal.Parry, effect.GetExtra() * parryPerDT);
attacker.AddMod(modifiersGlobal.Delay, effect.GetExtra() * delayMsPerDT);
owner.SubtractMod(modifiersGlobal.Parry, effect.GetExtra() * parryPerDT);
owner.AddMod(modifiersGlobal.Delay, effect.GetExtra() * delayMsPerDT);
end