Gustavo6046

[Not-working] Depressurizing Zone ACS for ZDoom

Feb 19th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include "zcommon.acs"
  2.  
  3. #DEFINE player_MAX 64
  4. #DEFINE player_TID 60460
  5.  
  6. bool PlayersPresent = false;
  7. int TargetTID = 0;
  8.  
  9. //check if anybody entered the zone
  10. script "EnterZone" (void)
  11. {
  12. PlayersPresent = ( LineSide() == LINE_FRONT );
  13. if ( LineSide() == LINE_FRONT ) TargetTID = ActivatorTID();
  14. }
  15.  
  16. script "PlayerTID" ENTER
  17. {
  18. Thing_ChangeTID(0, player_TID + PlayerNumber());
  19. }
  20.  
  21. script "DecompressionZone" (int pdoortag, int pdoorspeed)
  22. {
  23. log(s:"ScriTpt DecompressionZone: Script executed!");
  24. if ( !PlayersPresent )
  25. terminate;
  26.  
  27. log(s:"Script DecompressionZone: Players inside!");
  28.  
  29. for ( int i = 0; i < player_MAX; i++ )
  30. {
  31. log(s: "Script DecompressionZone: FOR executed");
  32.  
  33. Door_Close(pdoortag, pdoorspeed);
  34.  
  35. Thing_Damage2(player_TID + i, 5, "Depressurization");
  36.  
  37. if ( ClassifyActor(player_TID + i) & ACTOR_DEAD )
  38. {
  39. Door_Open(pdoortag, pdoorspeed);
  40. log(s:"An unsuspecting bitch was depressurized!");
  41. break;
  42. }
  43. else
  44. {
  45. Delay(20);
  46. log(s:"This should work");
  47. ACS_NamedExecute("DecompressionZone", 0, pdoortag, pdoorspeed);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment