Beispiel #1
0
        public override void SpecialHit(int oponId)
        {
            Util.Abstract.Soldier enemy = _player.GetOpponent().GetSoldiers().Where(s => s.Id == oponId).ElementAt(0);
            GridManager.instance.Special.onClick.RemoveAllListeners();
            photonView.RPC("MageSpecial", PhotonTargets.Others);

            if (IsAttacking || !SkillBar.DecSkillPoints(30))
            {
                return;
            }
            FloatingText.Show("Special!!!", "PlayerSpecialText",
                              new FromWorldPointTextPositioner(Camera.main, transform.position, 2f, 60f));

            int damage = CalHit();

            if (CheckIfCritical())
            {
                damage *= CriticalHit;
            }
            damage *= SpecialHitParameter;

            enemy.photonView.RPC("AtkDamage", PhotonTargets.All, damage);
            enemy.photonView.RPC("StopHitAni", PhotonTargets.All);
            photonView.RPC("EndAtkAni", PhotonTargets.All);
            if (!enemy.GetHealth().IsAlive())
            {
                enemy.photonView.RPC("Die", PhotonTargets.All);
            }
        }
Beispiel #2
0
        void BuildClientSoliders()
        {
            List <ChoiceUnit> choices = GameMenu.Instanse.GetOpSoldiers();

            foreach (ChoiceUnit choice in choices)
            {
                GameObject soldier = null;
                switch (choice.Unit)
                {
                case Unit.Hunter:
                    soldier = PhotonNetwork.Instantiate(Hunter.name, Vector3.zero, Quaternion.identity, 0);
                    break;

                case Unit.Warrior:

                    soldier = PhotonNetwork.Instantiate(Warrior.name, Vector3.zero, Quaternion.identity, 0);
                    break;

                case Unit.Mage:

                    soldier = PhotonNetwork.Instantiate(Mage.name, Vector3.zero, Quaternion.identity, 0);
                    break;
                }
                Util.Abstract.Soldier action = soldier.GetComponent <Util.Abstract.Soldier>();
                action.photonView.RPC("SetSoldier", PhotonTargets.AllBuffered, "B", choice.Position);
            }
            photonView.RPC("CilentFinishBuilding", PhotonTargets.All);
        }
Beispiel #3
0
        public void MageBuff(int teamSoldierId)
        {
            Util.Abstract.Soldier teamSoldier = _player.GetSoldiers().Where(s => s.Id == teamSoldierId).ElementAt(0);
            MageBuff buff = new MageBuff();

            buff.DoBuff(teamSoldier);
            EndOfTurnAction();
        }
Beispiel #4
0
        public void HunterBuff(int teamSoldierId)
        {
            Util.Abstract.Soldier teamSoldier = _player.GetSoldiers().Where(s => s.Id == teamSoldierId).ElementAt(0);
            ArcherBuff            buff        = new ArcherBuff();

            buff.DoBuff(teamSoldier);
            Buffs.Add(buff);
            EndOfTurnAction();
        }
Beispiel #5
0
        public void WorriorBuff(int teamSoldierId)
        {
            Util.Abstract.Soldier teamSoldier = _player.GetSoldiers().Where(s => s.Id == teamSoldierId).ElementAt(0);;
            WarCryBuff            warCryBuff  = new WarCryBuff();

            warCryBuff.DoBuff(teamSoldier);
            Buffs.Add(warCryBuff);
            EndOfTurnAction();
        }
        public void ClearSoldier()
        {
            SelectedSoldier.ClearAll();
            SelectedSoldier.ResetDes();
            SelectedSoldier = null;

            Cancel.gameObject.SetActive(false);
            Action.gameObject.SetActive(false);
            Special.gameObject.SetActive(false);

            Action.onClick.RemoveAllListeners();
            Special.onClick.RemoveAllListeners();
        }
Beispiel #7
0
 public void RemoveSoldier(Util.Abstract.Soldier soldier)
 {
     _soldiers.Remove(soldier);
 }
Beispiel #8
0
 public void AddSoldier(Util.Abstract.Soldier soldier)
 {
     soldier.Id = _idGen++;
     _soldiers.Add(soldier);
 }