New scripts

New scripts for commands and effects that use the new function
signatures and work with the new statuseffectcontainer
This commit is contained in:
Yogurt 2019-05-29 23:05:40 -07:00
parent 4f80023156
commit 00017468cc
129 changed files with 884 additions and 396 deletions

View file

@ -1,7 +1,8 @@
require("modifiers");
require("battleutils")
--Absorb HP on next WS or ability
function onHit(effect, attacker, defender, action, actionContainer)
function onHit(effect, attacker, defender, skill, action, actionContainer)
--1.21: Absorb HP amount no longer affected by player VIT rating.
--Bloodbath seems based on both defener and attacker's stats, even after 1.21.
@ -11,14 +12,14 @@ function onHit(effect, attacker, defender, action, actionContainer)
--Possibly magic resist? Slashing resist?
--For now using 1.0 as baseline since that seems to be the average
if action.commandType == CommandType.Weaponskill or action.commandType == CommandType.Ability then
if skill.GetCommandType() == CommandType.Weaponskill or skill.GetCommandType() == CommandType.Ability then
local absorbModifier = 1.0
local absorbAmount = action.amount * absorbModifier;
attacker.AddHP(absorbAmount);
--30332: You absorb hp from target
actionContainer.AddHPAction(defender.actorId, 30332, absorbAmount)
actionContainer.AddHPAbsorbAction(defender.actorId, 30332, absorbAmount)
--Bloodbath is lost after absorbing hp
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
defender.statusEffects.RemoveStatusEffect(effect,actionContainer, 30331, false);
end
end;