Пример #1
0
    void Choose(Vector2 position)
    {
        if (BoardUtils.IsInsideBoard(position) &&
            BattleSceneController.Main.SelectedActor.CanAttackAt(position))
        {
            BattleObject obj = GameData.CurrentBattle.Board.GetObjectAt(position);
            obj.TakeDamage(BattleSceneController.Main.SelectedActor.Type.Attack);

            BattleSceneController.Main.PerformedAttack = true;
            GameObject.Destroy(currentPattern);

            if (obj.Properties.ContainsKey("isOrb") && obj.Properties["isOrb"] == "true")
            {
                GameData.CurrentBattle.EndGameWithWinner(obj.Owner.GetEnemy());
            }
            else
            {
                BattleSceneController.Main.SwitchFlow(FlowState.ChooseActorToPerform);
            }
        }
    }