Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. freeslot(
  2. "MT_SPECIALRING",
  3. "S_SRING",
  4. "S_SRING2",
  5. "S_SRING3",
  6. "S_SRING4",
  7. "S_SRING5",
  8. "S_SRING6",
  9. "S_SRING7"
  10. )
  11.  
  12. // goal thinker to spawn special stage token !!!!!
  13.  
  14. addHook("MobjThinker", function(sign)
  15. if not sign.lock then
  16. sign.lock = true
  17. mapsign = sign.lock
  18. end
  19. end, MT_SIGN)
  20.  
  21. addHook("MobjThinker", function(sign)
  22. if sign.canspawn == nil
  23. sign.canspawn = true
  24. end
  25. if (modeattacking) return end // buuh, record attack and chaos emeralds!
  26. if not sign.target // poor sign, it doesn't have a target : <
  27. or (sign.target.health < 51 // the target has less than 50 rings, we don't give a fuck about it, then!
  28. and sign.target.player.health < 51) // the target has less than 50 rings, we don't give a fuck about it, then!
  29. and not token
  30. and not warped == true
  31. P_SupermanLook4Players(sign) // look for player, anywhere in the map!
  32. sign.canspawn = true // sign can spawn token again, then
  33. end
  34. if sign.target
  35. and sign.target.valid
  36. if not All7Emeralds(emeralds)
  37. if sign.target.player.health >= 51
  38. and sign.target.health >= 51
  39. and R_PointToDist2(sign.target.x, sign.target.y, sign.x, sign.y) < 5000*FRACUNIT
  40. if mapsign == false
  41. mapsign = true
  42. //if (netgame)
  43. //S_StartSound(sign.target, sfx_s3k74, sign.target.player)
  44. //end
  45. end
  46. if sign.canspawn == true
  47. and sign.target.the_sign == false
  48. local token = P_SpawnMobj(sign.x, sign.y, sign.z + 80*FRACUNIT, MT_EMMY)
  49. token.dvdss = true
  50. token.scale = 4*FRACUNIT
  51. local p = sign.target
  52. token.target = p
  53. p.the_sign = true
  54. sign.canspawn = false
  55. token.disapear = 0
  56. end
  57. else
  58. sign.target.the_sign = false
  59. sign.canspawn = true
  60. mapsign = false
  61. end
  62. end
  63. end
  64. end, MT_SIGN)
  65.  
  66. /*local function hud_ring(v, stplyr)
  67.  
  68. //Cache 10 ring sprite frames
  69. local p_ring0 = v.cachePatch("NHUD1")
  70. local p_ring1 = v.cachePatch("NHUD2")
  71. local p_ring2 = v.cachePatch("NHUD3")
  72. local p_ring3 = v.cachePatch("NHUD4")
  73. local p_ring4 = v.cachePatch("NHUD5")
  74. local p_ring5 = v.cachePatch("NHUD6")
  75. local p_ring6 = v.cachePatch("NHUD7")
  76. local p_ring7 = v.cachePatch("NHUD8")
  77. local p_ring8 = v.cachePatch("NHUD9")
  78. local p_ring9 = v.cachePatch("NHUD10")
  79. local p_ring10 = v.cachePatch("NHUD11")
  80. local p_ring11 = v.cachePatch("NHUD12")
  81.  
  82. if mapsign == true
  83. and not warped == true
  84. and (netgame)
  85. //convert the leveltime from tics to double centisecond digits
  86. local time=G_TicsToCentiseconds(leveltime)
  87.  
  88. local STime //The Centiseconds # as s string
  89.  
  90. //if time is a single digit (<10), append a 0 to string
  91. if (time<10)
  92. STime="0"+tostring(time)
  93. else
  94. //else just grab the string
  95. STime=tostring(time)
  96. end
  97.  
  98. STime=string.sub(STime,1) //Get the 10's digits as a string
  99. local frame=tonumber(STime)/10 //Get the frame # (Convert 10's digit to #, divide by 10)
  100. local patch //Ring sprite patch to draw
  101.  
  102. //Fixed 16,176 coordinates
  103. local x=16
  104. local y=160
  105.  
  106. //@Optimize this later as a select case or table!
  107. //Draw the appropriate sprite frame
  108. if (frame==0)
  109. v.draw(x,y,p_ring0)
  110. end
  111.  
  112. if (frame==1)
  113. v.draw(x,y,p_ring1)
  114. end
  115.  
  116. if (frame==2)
  117. v.draw(x,y,p_ring2)
  118. end
  119.  
  120. if (frame==3)
  121. v.draw(x,y,p_ring3)
  122. end
  123.  
  124. if (frame==4)
  125. v.draw(x,y,p_ring4)
  126. end
  127.  
  128. if (frame==5)
  129. v.draw(x,y,p_ring5)
  130. end
  131.  
  132. if (frame==6)
  133. v.draw(x,y,p_ring6)
  134. end
  135.  
  136. if (frame==7)
  137. v.draw(x,y,p_ring7)
  138. end
  139.  
  140. if (frame==8)
  141. v.draw(x,y,p_ring8)
  142. end
  143.  
  144. if (frame==9)
  145. v.draw(x,y,p_ring9)
  146. end
  147.  
  148. if (frame==10)
  149. v.draw(x,y,p_ring10)
  150. end
  151.  
  152. if (frame==11)
  153. v.draw(x,y,p_ring11)
  154. end
  155. else
  156. return
  157. end
  158. end
  159.  
  160. //Add the hud_ring function to HUD coroutine
  161. hud.add(hud_ring)*/
  162.  
  163. // Giant ring
  164.  
  165. addHook("TouchSpecial", function(ring, inflictor, source)
  166. if inflictor.type == MT_PLAYER
  167. if inflictor.player.bot then return false end
  168. ring.touched = false
  169. inflictor.flags = $1 | MF_NOGRAVITY
  170. P_InstaThrust(inflictor, inflictor.angle, 0*FRACUNIT)
  171. P_DoPlayerExit(inflictor.player)
  172. P_SetObjectMomZ(inflictor, 0)
  173. for d=1,16 do
  174. P_SpawnParaloop(ring.x, ring.y, ring.z+ring.height,192*FRACUNIT, 16, MT_NIGHTSPARKLE, d*(ANGLE_22h), S_NULL, true)
  175. end
  176. local flash = P_SpawnMobj(ring.x, ring.y, ring.z-(ring.height/2), MT_THOK)
  177. flash.scale = 4*FRACUNIT
  178. inflictor.player.pflags = $1 & ~PF_JUMPED
  179. inflictor.player.pflags = $1 & ~PF_THOKKED
  180. //inflictor.state = S_PLAY_STND
  181. inflictor.state = S_SSNULL
  182. inflictor.flags2 = $1|MF2_DONTDRAW
  183. inflictor.player.powers[pw_shield] = SH_NONE
  184. if (netgame)
  185. print(inflictor.player.name.." is also warping to a special stage!")
  186. end
  187. end
  188. end, MT_EMMY)
  189.  
  190. addHook("TouchSpecial", function(ring, inflictor, source)
  191.  
  192. if inflictor.type == MT_PLAYER
  193. inflictor.health = $1 + 50
  194. inflictor.player.health = $1 + 50
  195. end
  196. end, MT_SPECIALRING)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement