Ejemplo n.º 1
0
    public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main role)     // 技能被动说明:普攻伤害
    {
        if (!IsDeath)
        {
            this.RoleAtk = role;
            Hp           = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100);
            if (Hp <= 0)
            {
                Hp = 0;
                GetComponent <HpShow> ().HpSilider.value = 0f;
                role.soliderKillCount++;
                role.ReceiveExpAndGold(worthExp, worthMoney);

                Collider[] cols = Physics.OverlapSphere(transform.position, expRadius, EnemyLayer);                   //给周围的英雄加金币
                if (cols.Length > 0)
                {
                    for (int i = 0; i < cols.Length; i++)
                    {
                        if (cols [i].gameObject.layer == EnemyLayerNum && cols[i].GetComponent <Role_Main>() != null)
                        {
                            cols [i].GetComponent <Role_Main> ().ReceiveExpAndGold(worthExp, 0);
                        }
                    }
                }
                transform.GetComponent <CharacterController> ().enabled = false;
                Destroy(this.gameObject, 0.2f);
            }
        }
    }
Ejemplo n.º 2
0
 public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main role)     // 技能被动说明:普攻伤害
 {
     Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100);
     if (Hp <= 0)
     {
         Debug.Log("你补到一个小兵啦");
         Hp = 0;
         GetComponent <HpShow> ().HpSilider.value = 0f;
         Destroy(this.gameObject, 1f);
         role.soliderKillCount++;
         role.ReceiveExpAndGold(worthExp, worthMoney);
     }
 }
Ejemplo n.º 3
0
 public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main roleMain)
 {
     if (IsDeath == false)
     {
         Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100);
         if (Hp <= 0)
         {
             roleMain.ReceiveExpAndGold(worthExp, worthMoney);
             IsDeath         = true;
             colRole.enabled = false;
             Destroy(transform.Find("Tower_base/Tower_Long").gameObject, 1f);
         }
     }
 }
Ejemplo n.º 4
0
 public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main roleMain)
 {
     if (IsDeath == false)
     {
         Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100);
         if (Hp <= 0)
         {
             roleMain.ReceiveExpAndGold(worthExp, worthMoney);
             IsDeath = true;
             ani.SetTrigger("CanDeath");
             colRole.enabled = false;
         }
     }
 }