コード例 #1
0
 public void swingAnimal(NetworkViewID id, int limb)
 {
     if (!base.GetComponent <Life>().dead)
     {
         GameObject gameObject = NetworkView.Find(id).gameObject;
         if (gameObject != null && !gameObject.GetComponent <AI>().dead)
         {
             gameObject.GetComponent <AI>().damage((int)((float)MeleeStats.getDamage(base.GetComponent <Clothes>().item) * (1f + base.GetComponent <Skills>().warrior() * 0.4f) * DamageMultiplier.getMultiplierZombie(limb)));
             if (gameObject.GetComponent <AI>().dead)
             {
                 base.GetComponent <Skills>().learn(UnityEngine.Random.Range(gameObject.GetComponent <AI>().xp - 1, gameObject.GetComponent <AI>().xp + 2));
                 if (gameObject.name == "zombie")
                 {
                     if (!base.networkView.isMine)
                     {
                         base.networkView.RPC("killedZombie", base.networkView.owner, new object[0]);
                     }
                     else
                     {
                         base.GetComponent <Player>().killedZombie();
                     }
                 }
                 else if (!base.networkView.isMine)
                 {
                     base.networkView.RPC("killedAnimal", base.networkView.owner, new object[0]);
                 }
                 else
                 {
                     base.GetComponent <Player>().killedAnimal();
                 }
             }
         }
     }
 }
コード例 #2
0
 public void punchAnimal(NetworkViewID id, int limb)
 {
     if (!base.GetComponent <Life>().dead)
     {
         GameObject gameObject = NetworkView.Find(id).gameObject;
         if (gameObject != null && !gameObject.GetComponent <AI>().dead)
         {
             gameObject.GetComponent <AI>().damage((int)(14f * (1f + base.GetComponent <Skills>().warrior() * 0.4f) * DamageMultiplier.getMultiplierZombie(limb)));
             if (gameObject.GetComponent <AI>().dead)
             {
                 base.GetComponent <Skills>().learn(UnityEngine.Random.Range(2, 4));
             }
         }
     }
 }