Advertisement
skroton

SSP decorate

Jun 1st, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.89 KB | None | 0 0
  1. /* here is relevant base spawner class from main decorate file */
  2.  
  3. ACTOR Base_Spawner
  4. {
  5.   +THRUACTORS
  6.   +NOGRAVITY
  7.   +NOCLIP
  8.   +NOINTERACTION
  9.   Damage 100
  10.   var int user_player[64];
  11.   States
  12.   {
  13.   Spawn:
  14.     TNT1 AAAAAA 0
  15.     TNT1 AAAAAA 0
  16.     TNT1 A 1 A_JumpIf(TRUE,"Spawn2")
  17.     Wait
  18.   Spawn2:
  19.     TNT1 AAAAAA 0
  20.     TNT1 AAAAAA 0
  21.     TNT1 A 1 ACS_ExecuteWithResult(860, Damage) /* item spawning script */
  22.     TNT1 AAAAAA 0
  23.     TNT1 AAAAAA 0
  24.     TNT1 A 1 A_JumpIf(TRUE,"Spawn3")
  25.     Wait
  26.   Spawn3:
  27.     TNT1 A 105
  28.     TNT1 A 0 A_JumpIf(TRUE,"Spawn2")
  29.     Wait
  30.   }
  31. }
  32.  
  33. /* here is a typical _Spawner actor and typical *_Pickup actor; all *_Spawner actors inherit from Base_Spawner, and each Pickup_** actor inherits from the 00 pickup actor, all have different explicit args they send to the pickup script */
  34.  
  35. ACTOR Clip_Spawner : Base_Spawner Replaces Clip { Damage 3 }
  36.  
  37. ACTOR Clip_Pickup_00 : CustomInventory
  38. {
  39.   Inventory.PickupMessage "$GOTCLIP"
  40.   +INVENTORY.AUTOACTIVATE
  41.   States
  42.   {
  43.   Spawn:
  44.     "----" AAAAAA 0
  45.     "----" AAAAAA 0
  46.     "----" A 1 ACS_ExecuteAlways(OPPP_vis) /* clientside script to make pickup visible or invisible */
  47.     Loop /* Wait */
  48.   NoSee:
  49.     TNT1 A 1
  50.     Loop
  51.   CanSee:
  52.     CLIP A 1
  53.     Loop
  54.   Pickup:
  55.     "----" A 0 A_JumpIf(ACS_ExecuteWithResult(OPPP_pickup, 00),"PickupSuccess") /* pickup script */
  56.     Goto PickupFail
  57.   PickupSuccess:
  58.     "----" A 0 A_JumpIfInventory("Clip", 0, "PickupFail")
  59.     "----" A 0 A_GiveInventory("Clip", 10)
  60.     Stop
  61.   PickupFail:
  62.     "----" A 0
  63.     Fail
  64.   }
  65. }
  66.  
  67. ACTOR Clip_Pickup_01 : Clip_Pickup_00
  68. {
  69.   States
  70.   {
  71.   Pickup:
  72.     "----" A 0 A_JumpIf(ACS_ExecuteWithResult(OPPP_pickup, 01),"PickupSuccess") /* pickup script */
  73.     Goto PickupFail
  74.   }
  75. }
  76.  
  77. ACTOR Clip_Pickup_02 : Clip_Pickup_00
  78. {
  79.   States
  80.   {
  81.   Pickup:
  82.     "----" A 0 A_JumpIf(ACS_ExecuteWithResult(OPPP_pickup, 02),"PickupSuccess") /* pickup script */
  83.     Goto PickupFail
  84.   }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement