public override void ConfirmAttackPushResult(AttackResult attackResult, IEnumerable <int> availablePushDestinationIds, int attackingMonsterTypeId, int defendingMonsterTypeId, int actionNumber, int subActionNumber) { Vector3 battlePosition = new Vector3(BattleSmoke.transform.localPosition.x, BattleSmoke.transform.localPosition.y, BattleSmoke.transform.localPosition.z); if (availablePushDestinationIds.Any()) { AvailablePushDestinations = availablePushDestinationIds.Select(n => GameGraph.Nodes[n]); } if (attackResult == AttackResult.Push) { AttackResultTextPrefab.GetComponent <TextMesh>().text = "push"; AttackResultTextPrefab.gameObject.SetActive(true); AttackResultTextPrefab.transform.localPosition = battlePosition; AttackResultTextPrefab.LerpDestination = AttackResultTextPrefab.transform.localPosition + Vector3.up; BattleSmoke.SetActive(false); } else if (attackResult == AttackResult.CounterPush) { AttackResultTextPrefab.GetComponent <TextMesh>().text = "Counter push"; AttackResultTextPrefab.gameObject.SetActive(true); AttackResultTextPrefab.transform.localPosition = battlePosition; AttackResultTextPrefab.LerpDestination = AttackResultTextPrefab.transform.localPosition + Vector3.up; BattleSmoke.SetActive(false); } _actionNumber = actionNumber; _subActionNumber = subActionNumber; }
public override void ConfirmAvailableMonsters(List <int> availableMonsterNodeIds, int actionNumber, int subActionNumber) { _actionNumber = actionNumber; _subActionNumber = subActionNumber; BattleSmoke.SetActive(false); }
private void ProcessAttackAction(Monster attacker, Monster defender) { if (attacker == null && defender == null) { return; } Vector3 battleSmokePosition = new Vector3((attacker.CurrentNode.XPosition + defender.CurrentNode.XPosition) / 2f, 0, (attacker.CurrentNode.YPosition + defender.CurrentNode.YPosition) / 2f); BattleSmoke.SetActive(true); BattleSmoke.transform.localPosition = battleSmokePosition; attacker.SendMessage("OnBeginBattle", defender.CurrentNode); defender.SendMessage("OnBeginBattle", attacker.CurrentNode); int number = _random.Next(0, AttackSounds.Count - 1); int number2 = _random.Next(0, AttackSounds.Count - 1); attacker.PlaySound(AttackSounds[number]); defender.PlaySound(AttackSounds[number2]); }