Esempio n. 1
0
        private void ProcessAttackAction(Monster attacker, Monster defender)
        {
            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]);

            Client.Send(CustomMessageTypes.AttackRequest, new AttackRequestMessage
            {
                ActionNumber           = GetAdjustedActionNumber(),
                SubActionNumber        = _subActionNumber,
                AttackingMonsterTypeId = attacker.MonsterTypeId,
                DefendingMonsterTypeId = defender.MonsterTypeId,
                Message = "Requesting attack"
            });
        }
        private void ProcessMoveAction(Monster selectedMonster, NodePath path)
        {
            if (selectedMonster != null)
            {
                int number = _random.Next(0, MovementSounds.Count - 1);
                selectedMonster.PlaySound(MovementSounds[number]);

                selectedMonster.CurrentNode = GameGraph.Nodes[path.DestinationNode.Id];

                _isAnimationRunning = true;

                selectedMonster.SendMessage("OnBeginMoveAnimation", path);
            }
        }
        private void ProcessKill(Monster killed, bool isFriendlyMonster)
        {
            MonsterPrefabs.Remove(killed);

            if (isFriendlyMonster)
            {
                FriendlyMonsters.Remove(killed);
            }
            else
            {
                EnemyMonsters.Remove(killed);
            }

            _isAnimationRunning = true;
            killed.SendMessage("OnLoseBattle", BattleSmoke);
        }
Esempio n. 4
0
        private void ProcessMoveAction(Monster selectedMonster, NodePath path)
        {
            int number = _random.Next(0, MovementSounds.Count - 1);

            selectedMonster.PlaySound(MovementSounds[number]);

            selectedMonster.CurrentNode = GameGraph.Nodes[path.DestinationNode.Id];

            _isAnimationRunning = true;

            foreach (BoardSpace space in BoardSpaces.Values)
            {
                space.SendMessage("OnClearHighlighting");
            }

            selectedMonster.SendMessage("OnBeginMoveAnimation", path);
        }
        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]);
        }