zscript.zc 2.6 KB

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