Advertisement
Chronos_Ouroboros

JGP thing 2

Jul 26th, 2020
1,324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 KB | None | 0 0
  1.     override void WorldTick() {
  2.         if (players[consoleplayer].mo.FindInventory("PK_DemonWeapon"))
  3.             Shader.SetEnabled( players[consoleplayer], "DemonMorph", true);
  4.         else
  5.             Shader.SetEnabled( players[consoleplayer], "DemonMorph", false);
  6.  
  7.         bool demonMorphActive = false;
  8.         for (int pn = 0; pn < MAXPLAYERS; pn++) {
  9.             if (!playerInGame[pn])
  10.                 continue;
  11.  
  12.             PlayerInfo player   = players[pn];
  13.             PlayerPawn mo       = player.mo;
  14.  
  15.             if (!player || !mo)
  16.                 continue;
  17.  
  18.             let weap = PK_DemonWeapon(mo.FindInventory("PK_DemonWeapon"));
  19.  
  20.             demonMorphActive |= (weap != null);
  21.         }
  22.  
  23.         if (demonMorphActive) {
  24.             for (int i = 0; i < demontargets.Size(); i++) {
  25.                 if (demontargets[i] && !(demontargets[i].FindInventory("PK_SlowMoControl")) && !(demontargets[i].FindInventory("PK_DemonWeapon")))
  26.                     demontargets[i].GiveInventory("PK_SlowMoControl",1);
  27.             }
  28.         }
  29.         else {
  30.             for (int i = 0; i < demontargets.Size(); i++) {
  31.                 if (demontargets[i])
  32.                     demontargets[i].TakeInventory("PK_SlowMoControl",1);
  33.             }
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement