public void Perform() { MutableBattleCommand command = CreateCommand(); Byte scriptId = PrepareCommand(command); SBattleCalculator.Calc(_v.Caster, _v.Target, command, scriptId); }
private Byte PrepareCommand(MutableBattleCommand command) { Byte scriptId; if (_v.Target.IsPlayer) { command.AbilityId = BattleAbilityId.RebirthFlame; scriptId = ReviveScript.Id; } else { command.AbilityId = BattleAbilityId.Phoenix; scriptId = MagicAttackScript.Id; } command.LoadAbility(); return(scriptId); }
public void Perform() { if (!_v.CheckHasCommandItem()) { return; } Byte itemId = _v.Command.Power; BattleItem item = BattleItem.Find(itemId); Byte itemScript = item.ScriptId; MutableBattleCommand itemCommand = new MutableBattleCommand(); itemCommand.Id = BattleCommandId.Item; itemCommand.AbilityId = BattleAbilityId.Void; itemCommand.LoadAbility(); itemCommand.AbilityId = (BattleAbilityId)itemId; SBattleCalculator.Calc(_v.Caster, _v.Target, itemCommand, itemScript); BattleItem.RemoveFromInventory(itemId); }