zscript.zc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. version "4.1.3"
  2. // global constants
  3. const STAT_NashGore_Gore = Thinker.STAT_USER + 1;
  4. // Actor that does the bare minumum of ticking
  5. // Use for static, non-interactive actors
  6. //
  7. // Derived from bits and pieces of p_mobj.cpp
  8. class SimpleActor : Actor
  9. {
  10. Vector2 floorxy;
  11. Vector3 oldpos;
  12. override void Tick()
  13. {
  14. if (IsFrozen()) { return; }
  15. Vector2 curfloorxy = (curSector.GetXOffset(sector.floor), curSector.GetYOffset(sector.floor)); // Hacky scroll check because MF8_INSCROLLSEC not externalized to ZScript?
  16. bool dotick = (curfloorxy != floorxy) || curSector.flags & sector.SECF_PUSH || (pos != oldpos);
  17. if (dotick) // Only run a full Tick once; or if we are on a carrying floor, pushers are enabled in the sector (wind), or if we moved by some external force
  18. {
  19. oldpos = pos;
  20. Super.Tick();
  21. floorxy = curfloorxy;
  22. return;
  23. }
  24. if (vel != (0, 0, 0)) // Apply velocity as required
  25. {
  26. SetXYZ(Vec3Offset(vel.X, vel.Y, vel.Z)); // Vec3Offset is portal-aware; use instead of just pos + vel, which is not
  27. }
  28. // Tick through actor states as normal
  29. if (tics == -1) { return; }
  30. else if (--tics <= 0)
  31. {
  32. SetState(CurState.NextState);
  33. }
  34. }
  35. }
  36. class ParticleBase : SimpleActor
  37. {
  38. int checktimer;
  39. int flags;
  40. FlagDef CHECKPOSITION:flags, 0;
  41. States
  42. {
  43. Fade:
  44. "####" "#" 1 A_FadeOut(0.1, FTF_REMOVE);
  45. Loop;
  46. }
  47. override void PostBeginPlay()
  48. {
  49. Super.PostBeginPlay();
  50. // Set the initial check at a random tick so they don't all check at once...
  51. checktimer = Random(0, 35);
  52. }
  53. override void Tick()
  54. {
  55. Super.Tick();
  56. if (bCheckPosition && checktimer-- <= 0)
  57. {
  58. // If it's outside the level, remove it
  59. if (!level.IsPointInLevel(pos)) { Destroy(); return; }
  60. checktimer = 35; // Check once every second.
  61. }
  62. }
  63. }
  64. class isIntro : Inventory //prevent Motion Blur working over cutscenes if we move mouse, give it to players at start and remove it at level start
  65. {
  66. Default
  67. {
  68. Inventory.Amount 1;
  69. Inventory.MaxAmount 1;
  70. }
  71. }
  72. #include "zscript/TNTE1_Int.zc"
  73. #include "zscript/TNTE1_MBlur.zc"
  74. #include "zscript/TNTE1_Water.zc"
  75. #include "zscript/TNTE1_Props.zc"
  76. #include "zscript/TNTE1_Torch.zc"
  77. #include "zscript/NashGoreCommon.zc"
  78. #include "zscript/NashGoreStatics.zc"
  79. #include "zscript/NashGoreHandler.zc"
  80. #include "zscript/NashGoreBlood.zc"
  81. #include "zscript/NashGoreBloodPlane.zc"
  82. #include "zscript/NashGoreGibs.zc"
  83. #include "zscript/NashGoreCrushedGibs.zc"
  84. #include "zscript/NashGoreSquishyGibs.zc"
  85. #include "zscript/NashGoreIceChunk.zc"
  86. #include "zscript/NashGoreLiquidBlood.zc"
  87. #include "zscript/NashGoreWallBlood.zc"
  88. #include "zscript/NashGoreActor.zc"
  89. #include "zscript/NashGoreMenu.zc"