Advertisement
Chronos_Ouroboros

eh

Apr 10th, 2019
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.35 KB | None | 0 0
  1. version "4.0"
  2.  
  3. class MyHandler : EventHandler
  4. {
  5.     int rocketHits [MAXPLAYERS];
  6.     int railgunHits [MAXPLAYERS];
  7.  
  8.     override void WorldThingDied(WorldEvent e) {
  9.         if (!victim)
  10.             return;
  11.  
  12.         let victim = e.Thing;
  13.         let killer = e.Thing.Target;
  14.  
  15.         if (!killer) {
  16.             if (victim.player)
  17.                 Console.Printf("\ck%s\c- was killed by something in the world.", victim.player.GetUserName());
  18.             else
  19.                 Console.Printf("\ck%s\c- was killed by something in the world.", victim.GetClassName());
  20.  
  21.             return;
  22.         }
  23.  
  24.         if (victim.player && killer.player)
  25.             Console.Printf("\ck%s\c- was killed by %s using \ck%s\c-", victim.player.GetUserName(), killer.player.GetUserName(), killer.player.ReadyWeapon.GetClassName());
  26.         else if (victim.player)
  27.             Console.Printf("\ck%s\c- was killed by \ck%s\c-", victim.player.GetUserName(), killer.GetClassName());
  28.  
  29.         name killerWeap = '';
  30.         int killerNum = 0;
  31.         if (killer.player) {
  32.             killerWeap = killer.player.ReadyWeapon.GetClassName ();
  33.             killerNum = killer.PlayerNumber ();
  34.         }
  35.  
  36.         if (killerWeap == "QCRocketLauncher") {
  37.             Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
  38.  
  39.             if (rocketHits [killerNum] < 5)
  40.                 rocketHits [killerNum]++;
  41.             else if (rocketHits [killerNum] >= 5) {
  42.                 killer.A_PlaySound ("player/excellent", CHAN_AUTO, 0.5, false, ATTN_NONE);
  43.                 rocketHits [killerNum] = 0;
  44.             }
  45.         } else if (killerWeap == "QCRailGun") {
  46.             Console.Printf ("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
  47.  
  48.             if (railgunHits [killerNum] == 0)
  49.                 railgunHits [killerNum]++;
  50.             else if (railgunHits [killerNum] >= 1) {
  51.                 killer.A_PlaySound("player/impressive", CHAN_AUTO, 0.5, false, ATTN_NONE);
  52.                 railgunHits [killerNum] = 0;
  53.             }
  54.         } else if (killer.player)
  55.             Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
  56.         else
  57.             Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.GetClassName(), victim.GetClassName());
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement