Ejemplo n.º 1
0
        public override void ConfirmAttackKillResult(AttackResult attackResult, int attackingMonsterTypeId, int defendingMonsterTypeId, int actionNumber, int subActionNumber)
        {
            bool isFriendlyMonster = _actionNumber == 1 || _actionNumber == 2;

            Monster attacker = FriendlyMonsters.SingleOrDefault(m => m.MonsterTypeId == attackingMonsterTypeId) ??
                               EnemyMonsters.SingleOrDefault(m => m.MonsterTypeId == attackingMonsterTypeId);

            Monster defender = FriendlyMonsters.SingleOrDefault(m => m.MonsterTypeId == defendingMonsterTypeId) ??
                               EnemyMonsters.SingleOrDefault(m => m.MonsterTypeId == defendingMonsterTypeId);

            Vector3 battlePosition = new Vector3(BattleSmoke.transform.localPosition.x, BattleSmoke.transform.localPosition.y, BattleSmoke.transform.localPosition.z);

            if (attackResult == AttackResult.Kill)
            {
                AttackResultTextPrefab.GetComponent <TextMesh>().text = "KiLL";
                AttackResultTextPrefab.gameObject.SetActive(true);
                AttackResultTextPrefab.transform.localPosition = battlePosition;

                AttackResultTextPrefab.LerpDestination = AttackResultTextPrefab.transform.localPosition + Vector3.up;

                ProcessKill(defender, !isFriendlyMonster);
            }
            else if (attackResult == AttackResult.CounterKill)
            {
                AttackResultTextPrefab.GetComponent <TextMesh>().text = "Counter KiLL";
                AttackResultTextPrefab.gameObject.SetActive(true);
                AttackResultTextPrefab.transform.localPosition = battlePosition;

                AttackResultTextPrefab.LerpDestination = AttackResultTextPrefab.transform.localPosition + Vector3.up;

                ProcessKill(attacker, isFriendlyMonster);
                SelectedMonster = null;
            }

            _actionNumber    = actionNumber;
            _subActionNumber = subActionNumber;
        }
Ejemplo n.º 2
0
 public override void ConfirmSelectMonster(int selectedMonsterId, int actionNumber, int subActionNumber)
 {
     SelectedMonster  = FriendlyMonsters.SingleOrDefault(m => m.MonsterTypeId == selectedMonsterId) ?? EnemyMonsters.SingleOrDefault(m => m.MonsterTypeId == selectedMonsterId);
     _actionNumber    = actionNumber;
     _subActionNumber = subActionNumber;
 }