Example #1
0
        public IEnumerator BeginBattle(Tile_Actor player, Tile_Actor monster)
        {
            mPlayer  = player;
            mMonster = monster;

            yield return(battleInit());

            Tile_Actor attaker  = mPlayer;
            Tile_Actor defender = mMonster;
            Tile_Actor winner   = null;

            while (true)
            {
                Damage dam = attaker.AttackTo(defender);
                yield return(mDisplay.BattleAttack(attaker, defender, dam));

                if (defender.IsDead || attaker.IsDead)
                {
                    winner = defender.IsDead ? attaker : defender;
                    break;
                }
                else
                {
                    var tmp = attaker;
                    attaker  = defender;
                    defender = tmp;
                }
            }

            yield return(mDisplay.BattleEnd(winner));
        }
Example #2
0
 public abstract Damage AttackTo(Tile_Actor actor);