Combat additions

Added formulas for base EXP gain and chain experience
Added basic scripts for most player abilities and effects
Added stat gains for some abilities
Changed status flags
Fixed bug with player death
Fixed bug where auto attacks didnt work when not locked on
Added traits
This commit is contained in:
yogurt 2018-04-18 16:06:41 -05:00
parent b8d6a943aa
commit c5ce2ec771
239 changed files with 5125 additions and 1237 deletions

View file

@ -0,0 +1,59 @@
require("modifiers");
require("battleutils");
function onGain(owner, effect)
owner.statusEffects.RemoveStatusEffect(223208);
end
--Increases attack power and reduces defense with each successful attack
--Does this include weaponskills?
--Is this on every hit or every succesfull skill useage?
function onHit(effect, attacker, defender, action, actionContainer)
--Trait increases effect by 20%. Does this include the reduced defense,
--does this increase the cap or the rate at which you get AP or both?
if (effect.GetExtra() < 10) then
--This will count how many hits there have been
effect.SetExtra(effect.GetExtra() + 1);
--If you update these make sure to update them in Whirlwind as well
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
--Just going to say every hit adds 20 AP up to 200
--Same for defense
--Traited will be 24 up to 240
--assuming defense is static
attacker.AddMod(modifiersGlobal.Attack, apPerHit);
attacker.SubtractMod(modifiersGlobal.Defense, defPerHit);
end
end;
function onDamageTaken(effect, attacker, defender, action, actionContainer)
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
defender.SubtractMod(modifiersGlobal.Attack, effect.GetExtra() * apPerHit);
defender.SubtractMod(modifiersGlobal.Defense, effect.GetExtra() * defPerHit);
effect.SetExtra(0);
end
function onLose(owner, effect)
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
owner.SubtractMod(modifiersGlobal.Attack, effect.GetExtra() * apPerHit);
owner.SubtractMod(modifiersGlobal.Defense, effect.GetExtra() * defPerHit);
end