コード例 #1
0
        public void CastSpellWhileTravelCommand(Spell spell)
        {
            CheckGameState(GameState.Travel);

            if (!CanPlayerCastSpell(spell))
            {
                RaiseMessage(CurrentPlayer.Name + " does not have enough mana to cast " + spell.Name);
                return;
            }

            if (spell is ReplenishSpell)
            {
                int replenishValue = CurrentPlayer.CastSpellWhileTravel(spell);
                PlayerCastReplenish(replenishValue, (ReplenishSpell)spell);
            }
            else
            {
                throw new Exception("Player is using a spell that cannot be used in the travel screen");
            }
        }