コード例 #1
0
        public override Message Execute()
        {
            //UInt16 targetHP = _target.GetStatBasic(Creature.StatBasic.HP, true);
            //_target.SetStatBasic(Creature.StatBasic.HP, true, (UInt16)Math.Max(0, targetHP - _damage));
            _target.AddToStatBasic(Creature.StatBasic.HP, -_damage); // casting problems?

            //Actor.AP -= APCost; //fix attack cost in AP later
            (Actor as Creature).AddToStatBasic(Creature.StatBasic.AP, -(Actor as Creature).GetAPActionCost(APCostTypes.AttackMelee));

            return(new Message(this.Actor.ToString() + " hit " + _target.ToString() + " for " + _damage + "."));
        }