Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.94 KB | None | 0 0
  1. //Config stuff
  2. #define SYNDICATE_ELITE_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
  3. #define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station
  4. #define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock
  5.  
  6. var/syndicate_elite_shuttle_moving_to_station = 0
  7. var/syndicate_elite_shuttle_moving_to_mothership = 0
  8. var/syndicate_elite_shuttle_at_station = 0
  9. var/syndicate_elite_shuttle_can_send = 1
  10. var/syndicate_elite_shuttle_time = 0
  11. var/syndicate_elite_shuttle_timeleft = 0
  12.  
  13. /obj/machinery/computer/syndicate_elite_shuttle
  14. name = "Elite Syndicate Squad Shuttle Console"
  15. icon = 'computer.dmi'
  16. icon_state = "syndishuttle"
  17. req_access = list(access_cent_specops)
  18. var/temp = null
  19. var/hacked = 0
  20. var/allowedtocall = 0
  21.  
  22. /proc/syndicate_elite_process()
  23. var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work.
  24. var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located?
  25. var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
  26.  
  27. var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
  28. var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
  29. if(announcer)
  30. announcer.say(message)
  31. // message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
  32. announcer.say(message)
  33.  
  34. while(syndicate_elite_shuttle_time - world.timeofday > 0)
  35. var/ticksleft = syndicate_elite_shuttle_time - world.timeofday
  36.  
  37. if(ticksleft > 1e5)
  38. syndicate_elite_shuttle_time = world.timeofday 10 // midnight rollover
  39. syndicate_elite_shuttle_timeleft = (ticksleft / 10)
  40.  
  41. //All this does is announce the time before launch.
  42. if(announcer)
  43. var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
  44. if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
  45. message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
  46. if(rounded_time_left==0)
  47. message = "ALERT: TAKEOFF"
  48. announcer.say(message)
  49. message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
  50. //Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
  51.  
  52. sleep(5)
  53.  
  54. syndicate_elite_shuttle_moving_to_station = 0
  55. syndicate_elite_shuttle_moving_to_mothership = 0
  56.  
  57. syndicate_elite_shuttle_at_station = 1
  58. if (syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_centcom) return
  59.  
  60. if (!syndicate_elite_can_move())
  61. usr << "\red The Syndicate Elite shuttle is unable to leave."
  62. return
  63.  
  64. /* //Begin Marauder launchpad.
  65. spawn(0)//So it parallel processes it.
  66. for(var/obj/machinery/door/poddoor/M in special_ops)
  67. switch(M.id)
  68. if("ASSAULT0")
  69. spawn(10)//1 second delay between each.
  70. M.open()
  71. if("ASSAULT1")
  72. spawn(20)
  73. M.open()
  74. if("ASSAULT2")
  75. spawn(30)
  76. M.open()
  77. if("ASSAULT3")
  78. spawn(40)
  79. M.open()
  80.  
  81. sleep(10)
  82.  
  83. var/spawn_marauder[] = new()
  84. for(var/obj/landmark/L in world)
  85. if(L.name == "Marauder Entry")
  86. spawn_marauder.Add(L)
  87. for(var/obj/landmark/L in world)
  88. if(L.name == "Marauder Exit")
  89. var/obj/portal/P = new(L.loc)
  90. P.invisibility = 101//So it is not seen by anyone.
  91. P.failchance = 0//So it has no fail chance when teleporting.
  92. P.target = pick(spawn_marauder)//Where the marauder will arrive.
  93. spawn_marauder.Remove(P.target)
  94.  
  95. sleep(10)
  96.  
  97. for(var/obj/machinery/mass_driver/M in special_ops)
  98. switch(M.id)
  99. if("ASSAULT0")
  100. spawn(10)
  101. M.drive()
  102. if("ASSAULT1")
  103. spawn(20)
  104. M.drive()
  105. if("ASSAULT2")
  106. spawn(30)
  107. M.drive()
  108. if("ASSAULT3")
  109. spawn(40)
  110. M.drive()
  111.  
  112. sleep(50)//Doors remain open for 5 seconds.
  113.  
  114. for(var/obj/machinery/door/poddoor/M in special_ops)
  115. switch(M.id)//Doors close at the same time.
  116. if("ASSAULT0")
  117. spawn(0)
  118. M.close()
  119. if("ASSAULT1")
  120. spawn(0)
  121. M.close()
  122. if("ASSAULT2")
  123. spawn(0)
  124. M.close()
  125. if("ASSAULT3")
  126. spawn(0)
  127. M.close()
  128. special_ops.readyreset()//Reset firealarm after the team launched.
  129. //End Marauder launchpad.
  130. */
  131.  
  132. var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership)
  133. var/area/end_location = locate(/area/shuttle/syndicate_elite/station)
  134.  
  135. var/obj/explosionmarker = locate("Syndicate Breach Area")
  136. if(explosionmarker)
  137. var/turf/simulated/T = explosionmarker.loc
  138. if(T)
  139. explosion(T,4,6,8,10,0)
  140.  
  141. sleep(40)
  142. // proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
  143.  
  144. var/list/dstturfs = list()
  145. var/throwy = world.maxy
  146.  
  147. for(var/turf/T in end_location)
  148. dstturfs = T
  149. if(T.y < throwy)
  150. throwy = T.y
  151.  
  152. // hey you, get out of the way!
  153. for(var/turf/T in dstturfs)
  154. // find the turf to move things to
  155. var/turf/D = locate(T.x, throwy - 1, 1)
  156. //var/turf/E = get_step(D, SOUTH)
  157. for(var/atom/movable/AM as mob|obj in T)
  158. AM.Move(D)
  159. if(istype(T, /turf/simulated))
  160. del(T)
  161.  
  162. start_location.move_contents_to(end_location)
  163.  
  164. for(var/turf/T in get_area_turfs(end_location) )
  165. var/mob/M = locate(/mob) in T
  166. M << "\red You have arrived to [station_name]. Commence operation!"
  167.  
  168. /proc/syndicate_elite_can_move()
  169. if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0
  170. else return 1
  171.  
  172. /obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob)
  173. return attack_hand(user)
  174.  
  175. /obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
  176. return attack_hand(user)
  177.  
  178. /obj/machinery/computer/syndicate_elite_shuttle/attack_paw(var/mob/user as mob)
  179. return attack_hand(user)
  180.  
  181. /obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob)
  182. if(istype(I,/obj/item/weapon/card/emag))
  183. user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals."
  184. else
  185. return attack_hand(user)
  186.  
  187. /obj/machinery/computer/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
  188. if(!allowed(user))
  189. user << "\red Access Denied."
  190. return
  191.  
  192. if (sent_syndicate_strike_team == 0)
  193. usr << "\red The strike team has not yet deployed."
  194. return
  195.  
  196. if(..())
  197. return
  198.  
  199. user.machine = src
  200. var/dat
  201. if (temp)
  202. dat = temp
  203. else
  204. dat = {"<BR><B>Special Operations Shuttle</B><HR>
  205. \nLocation: [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]<BR>
  206. [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*<BR>\n<BR>":syndicate_elite_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
  207. \n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
  208.  
  209. user << browse(dat, "window=computer;size=575x450")
  210. onclose(user, "computer")
  211. return
  212.  
  213. /obj/machinery/computer/syndicate_elite_shuttle/Topic(href, href_list)
  214. if(..())
  215. return
  216.  
  217. if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
  218. usr.machine = src
  219.  
  220. if (href_list["sendtodock"])
  221. if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
  222.  
  223. usr << "\blue The Syndicate will not allow the Elite Squad shuttle to return."
  224. return
  225.  
  226. else if (href_list["sendtostation"])
  227. if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_centcom) return
  228.  
  229. if (!specops_can_move())
  230. usr << "\red The Syndicate Elite shuttle is unable to leave."
  231. return
  232.  
  233. usr << "\blue The Syndicate Elite shuttle will arrive on [station_name] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds."
  234.  
  235. temp = "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
  236. updateUsrDialog()
  237.  
  238. var/area/syndicate_mothership/elite_squad/elite_squad = locate()
  239. if(elite_squad)
  240. elite_squad.readyalert()//Trigger alarm for the spec ops area.
  241. syndicate_elite_shuttle_moving_to_station = 1
  242.  
  243. syndicate_elite_shuttle_time = world.timeofday SPECOPS_MOVETIME
  244. spawn(0)
  245. syndicate_elite_process()
  246.  
  247.  
  248. else if (href_list["mainmenu"])
  249. temp = null
  250.  
  251. add_fingerprint(usr)
  252. updateUsrDialog()
  253. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement