Esempio n. 1
0
 public void Hit(int seq, int damage, float rigidFactor, int weaponBy, Vector3 ammopos, Vector3 ammodir, int curammo)
 {
     if (damage > 0)
     {
         MonDesc desc = GetDesc(seq);
         if (desc != null)
         {
             desc.rigidity = rigidFactor;
             desc.Xp      -= damage;
             desc.LogAttacker(MyInfoManager.Instance.Seq, damage);
             desc.IsHit = true;
             if (!GlobalVars.Instance.applyNewP2P)
             {
                 P2PManager.Instance.SendPEER_MON_HIT(MyInfoManager.Instance.Seq, desc.Seq, damage, rigidFactor, ammopos, ammodir, curammo);
             }
             if (desc.Xp <= 0)
             {
                 P2PManager.Instance.SendPEER_MON_DIE(desc.Seq, arrived: false);
                 CSNetManager.Instance.Sock.SendCS_INFLICTED_DAMAGE_REQ(desc.dicInflictedDamage);
                 CSNetManager.Instance.Sock.SendCS_KILL_LOG_REQ(0, MyInfoManager.Instance.Seq, 1, desc.Seq, weaponBy, -1, -1, 0, desc.dicDamageLog);
                 desc.clearLog();
             }
         }
     }
 }