mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-28 21:36:09 +02:00
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:
parent
4f80023156
commit
00017468cc
129 changed files with 884 additions and 396 deletions
|
@ -6,19 +6,19 @@ require("modifiers");
|
|||
--This could mean traited hawk's eye gives 28.125% (18.75% * 1.5) or it could mean it gives 68.75% (18.75% + 50%)
|
||||
--It's also possible that Hawk's Eye gives 15 + 15% accuracy untraited, which would give 450.85, which would be rounded down.
|
||||
--In that case, traited hawks eye could be 15 + 22.5% or 22.5 + 22.5% or (15 + 15%) * 1.5
|
||||
function onGain(target, effect)
|
||||
function onGain(owner, effect, actionContainer)
|
||||
local accuracyMod = 0.1875;
|
||||
|
||||
if effect.GetTier() == 2 then
|
||||
accuracyMod = 0.28125;
|
||||
end
|
||||
|
||||
local amountGained = accuracyMod * target.GetMod(modifiersGlobal.Accuracy);
|
||||
local amountGained = accuracyMod * owner.GetMod(modifiersGlobal.Accuracy);
|
||||
effect.SetMagnitude(amountGained);
|
||||
target.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
function onLose(owner, effect, actionContainer)
|
||||
|
||||
target.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
end;
|
Loading…
Add table
Add a link
Reference in a new issue