Beispiel #1
0
 public static void SimpleDeath(List <DeathServerData> deaths, List <ObjectHitInfo> objs, Player killer, Player victim, int damage, int weapon, int hitPart, CHARA_DEATH deathType)
 {
     victim._life -= damage;
     if (victim._life <= 0)
     {
         DamageManager.SetDeath(deaths, victim, deathType);
     }
     else
     {
         DamageManager.SetHitEffect(objs, victim, killer, deathType, hitPart);
     }
     objs.Add(new ObjectHitInfo(2)
     {
         objId     = victim._slot,
         objLife   = victim._life,
         hitPart   = hitPart,
         killerId  = killer._slot,
         Position  = (Half3)((Vector3)victim.Position - (Vector3)killer.Position),
         deathType = deathType,
         weaponId  = weapon
     });
 }
Beispiel #2
0
 public static void BoomDeath(Room room, Player pl, int weaponId, List <DeathServerData> deaths, List <ObjectHitInfo> objs, List <int> BoomPlayers)
 {
     if (BoomPlayers == null || BoomPlayers.Count == 0)
     {
         return;
     }
     for (int index = 0; index < BoomPlayers.Count; ++index)
     {
         int    boomPlayer = BoomPlayers[index];
         Player p;
         if (room.getPlayer(boomPlayer, out p) && !p.isDead)
         {
             DamageManager.SetDeath(deaths, p, CHARA_DEATH.OBJECT_EXPLOSION);
             objs.Add(new ObjectHitInfo(2)
             {
                 hitPart   = 1,
                 deathType = CHARA_DEATH.OBJECT_EXPLOSION,
                 objId     = boomPlayer,
                 killerId  = pl._slot,
                 weaponId  = weaponId
             });
         }
     }
 }