Advertisement
EditorRUS

borer.dm

Jun 9th, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.17 KB | None | 0 0
  1. /mob/living/captive_brain
  2. name = "host brain"
  3. real_name = "host brain"
  4.  
  5. /mob/living/captive_brain/say(var/message)
  6.  
  7. if (src.client)
  8. if(client.prefs.muted & MUTE_IC)
  9. src << "\red You cannot speak in IC (muted)."
  10. return
  11. if (src.client.handle_spam_prevention(message,MUTE_IC))
  12. return
  13.  
  14. if(istype(src.loc,/mob/living/simple_animal/borer))
  15. var/mob/living/simple_animal/borer/B = src.loc
  16. src << "You whisper silently, \"[message]\""
  17. B.host << "The captive mind of [src] whispers, \"[message]\""
  18.  
  19. /mob/living/captive_brain/emote(var/message)
  20. return
  21.  
  22. /mob/living/simple_animal/borer
  23. name = "cortical borer"
  24. real_name = "cortical borer"
  25. desc = "A small, quivering sluglike creature."
  26. speak_emote = list("chirrups")
  27. emote_hear = list("chirrups")
  28. response_help = "pokes the"
  29. response_disarm = "prods the"
  30. response_harm = "stomps on the"
  31. icon_state = "brainslug"
  32. icon_living = "brainslug"
  33. icon_dead = "brainslug_dead"
  34. speed = 5
  35. a_intent = "harm"
  36. stop_automated_movement = 1
  37. status_flags = CANPUSH
  38. attacktext = "nips"
  39. friendly = "prods"
  40. wander = 0
  41. pass_flags = PASSTABLE
  42.  
  43. var/chemicals = 10 // Chemicals used for reproduction and spitting neurotoxin.
  44. var/mob/living/carbon/human/host // Human host for the brain worm.
  45. var/truename // Name used for brainworm-speak.
  46. var/mob/living/captive_brain/host_brain // Used for swapping control of the body back and forth.
  47. var/controlling // Used in human death check.
  48.  
  49. /mob/living/simple_animal/borer/Life()
  50.  
  51. ..()
  52. if(host)
  53. if(!stat && !host.stat)
  54. if(chemicals < 250)
  55. chemicals++
  56. if(controlling)
  57. if(prob(5))
  58. host.adjustBrainLoss(rand(1,2))
  59.  
  60. if(prob(host.brainloss/20))
  61. host.say("*[pick(list("blink","blink_r","choke","aflap","drool","twitch","twitch_s","gasp"))]")
  62.  
  63. //if(host.brainloss > 100)
  64.  
  65. /mob/living/simple_animal/borer/New()
  66. ..()
  67. truename = "[pick("Primary","Secondary","Tertiary","Quaternary")] [rand(1000,9999)]"
  68. host_brain = new/mob/living/captive_brain(src)
  69.  
  70. request_player()
  71.  
  72.  
  73. /mob/living/simple_animal/borer/say(var/message)
  74.  
  75. message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
  76. message = capitalize(message)
  77.  
  78. if(!message)
  79. return
  80.  
  81. if (stat == 2)
  82. return say_dead(message)
  83.  
  84. if (stat)
  85. return
  86.  
  87. if (src.client)
  88. if(client.prefs.muted & MUTE_IC)
  89. src << "\red You cannot speak in IC (muted)."
  90. return
  91. if (src.client.handle_spam_prevention(message,MUTE_IC))
  92. return
  93.  
  94. if (copytext(message, 1, 2) == "*")
  95. return emote(copytext(message, 2))
  96.  
  97. if (copytext(message, 1, 2) == ";") //Brain borer hivemind.
  98. return borer_speak(message)
  99.  
  100. if(!host)
  101. src << "You have no host to speak to."
  102. return //No host, no audible speech.
  103.  
  104. src << "You drop words into [host]'s mind: \"[message]\""
  105. host << "Your own thoughts speak: \"[message]\""
  106.  
  107. /mob/living/simple_animal/borer/Stat()
  108. ..()
  109. statpanel("Status")
  110.  
  111. if(emergency_shuttle)
  112. if(emergency_shuttle.online && emergency_shuttle.location < 2)
  113. var/timeleft = emergency_shuttle.timeleft()
  114. if (timeleft)
  115. stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
  116.  
  117. if (client.statpanel == "Status")
  118. stat("Chemicals", chemicals)
  119.  
  120. // VERBS!
  121.  
  122. /mob/living/simple_animal/borer/proc/borer_speak(var/message)
  123. if(!message)
  124. return
  125.  
  126. for(var/mob/M in mob_list)
  127. if(M.mind && (istype(M, /mob/living/simple_animal/borer) || istype(M, /mob/dead/observer)))
  128. M << "<i>Cortical link, <b>[truename]:</b> [copytext(message, 2)]</i>"
  129.  
  130. /mob/living/simple_animal/borer/verb/bond_brain()
  131. set category = "Alien"
  132. set name = "Assume Control"
  133. set desc = "Fully connect to the brain of your host."
  134.  
  135. if(!host)
  136. src << "You are not inside a host body."
  137. return
  138.  
  139. if(src.stat)
  140. src << "You cannot do that in your current state."
  141. return
  142.  
  143. src << "You begin delicately adjusting your connection to the host brain..."
  144.  
  145. spawn(300+(host.brainloss*5))
  146.  
  147. if(!host || !src || controlling) return
  148.  
  149. else
  150. src << "\red <B>You plunge your probosci deep into the cortex of the host brain, interfacing directly with their nervous system.</B>"
  151. host << "\red <B>You feel a strange shifting sensation behind your eyes as an alien consciousness displaces yours.</B>"
  152.  
  153. host_brain.ckey = host.ckey
  154. host.ckey = src.ckey
  155. controlling = 1
  156.  
  157. host.verbs += /mob/living/carbon/proc/release_control
  158. host.verbs += /mob/living/carbon/proc/punish_host
  159. host.verbs += /mob/living/carbon/proc/spawn_larvae
  160.  
  161. /mob/living/simple_animal/borer/verb/secrete_chemicals()
  162. set category = "Alien"
  163. set name = "Secrete Chemicals"
  164. set desc = "Push some chemicals into your host's bloodstream."
  165.  
  166. if(!host)
  167. src << "You are not inside a host body."
  168. return
  169.  
  170. if(stat)
  171. src << "You cannot secrete chemicals in your current state."
  172.  
  173. if(chemicals < 50)
  174. src << "You don't have enough chemicals!"
  175.  
  176. var/chem = input("Select a chemical to secrete.", "Chemicals") in list("bicaridine","tramadol","hyperzine")
  177.  
  178. if(chemicals < 50 || !host || controlling || !src || stat) //Sanity check.
  179. return
  180.  
  181. src << "\red <B>You squirt a measure of [chem] from your reservoirs into [host]'s bloodstream.</B>"
  182. host.reagents.add_reagent(chem, 15)
  183. chemicals -= 50
  184.  
  185. /mob/living/simple_animal/borer/verb/release_host()
  186. set category = "Alien"
  187. set name = "Release Host"
  188. set desc = "Slither out of your host."
  189.  
  190. if(!host)
  191. src << "You are not inside a host body."
  192. return
  193.  
  194. if(stat)
  195. src << "You cannot leave your host in your current state."
  196.  
  197.  
  198. if(!host || !src) return
  199.  
  200. src << "You begin disconnecting from [host]'s synapses and prodding at their internal ear canal."
  201.  
  202. if(!host.stat)
  203. host << "An odd, uncomfortable pressure begins to build inside your skull, behind your ear..."
  204.  
  205. spawn(200)
  206.  
  207. if(!host || !src) return
  208.  
  209. if(src.stat)
  210. src << "You cannot infest a target in your current state."
  211. return
  212.  
  213. src << "You wiggle out of [host]'s ear and plop to the ground."
  214. if(!host.stat)
  215. host << "Something slimy wiggles out of your ear and plops to the ground!"
  216.  
  217. detatch()
  218.  
  219. mob/living/simple_animal/borer/proc/detatch()
  220.  
  221. if(!host) return
  222.  
  223. if(istype(host,/mob/living/carbon/human))
  224. var/mob/living/carbon/human/H = host
  225. var/datum/organ/external/head = H.get_organ("head")
  226. head.implants -= src
  227.  
  228. src.loc = get_turf(host)
  229. controlling = 0
  230.  
  231. reset_view(null)
  232. machine = null
  233.  
  234. host.reset_view(null)
  235. host.machine = null
  236.  
  237. host.verbs -= /mob/living/carbon/proc/release_control
  238. host.verbs -= /mob/living/carbon/proc/punish_host
  239. host.verbs -= /mob/living/carbon/proc/spawn_larvae
  240.  
  241. if(host_brain.ckey)
  242. src.ckey = host.ckey
  243. host.ckey = host_brain.ckey
  244. host_brain.ckey = null
  245. host_brain.name = "host brain"
  246. host_brain.real_name = "host brain"
  247.  
  248. host = null
  249.  
  250. /mob/living/simple_animal/borer/verb/infest()
  251. set category = "Alien"
  252. set name = "Infest"
  253. set desc = "Infest a suitable humanoid host."
  254.  
  255. if(host)
  256. src << "You are already within a host."
  257. return
  258.  
  259. if(stat)
  260. src << "You cannot infest a target in your current state."
  261. return
  262.  
  263. var/list/choices = list()
  264. for(var/mob/living/carbon/C in view(1,src))
  265. if(C.stat != 2)
  266. choices += C
  267.  
  268. var/mob/living/carbon/M = input(src,"Who do you wish to infest?") in null|choices
  269.  
  270. if(!M || !src) return
  271.  
  272. if(M.has_brain_worms())
  273. src << "You cannot infest someone who is already infested!"
  274. return
  275.  
  276. M << "Something slimy begins probing at the opening of your ear canal..."
  277. src << "You slither up [M] and begin probing at their ear canal..."
  278.  
  279. if(!do_after(src,50))
  280. src << "As [M] moves away, you are dislodged and fall to the ground."
  281. return
  282.  
  283. if(!M || !src) return
  284.  
  285. if(src.stat)
  286. src << "You cannot infest a target in your current state."
  287. return
  288.  
  289. if(M.stat == 2)
  290. src << "That is not an appropriate target."
  291. return
  292.  
  293. if(M in view(1, src))
  294. src << "You wiggle into [M]'s ear."
  295. if(!M.stat)
  296. M << "Something disgusting and slimy wiggles into your ear!"
  297.  
  298. src.host = M
  299. src.loc = M
  300.  
  301. if(istype(M,/mob/living/carbon/human))
  302. var/mob/living/carbon/human/H = M
  303. var/datum/organ/external/head = H.get_organ("head")
  304. head.implants += src
  305.  
  306. host_brain.name = M.name
  307. host_brain.real_name = M.real_name
  308.  
  309. return
  310. else
  311. src << "They are no longer in range!"
  312. return
  313.  
  314. /mob/living/simple_animal/borer/verb/ventcrawl()
  315. set name = "Crawl through Vent"
  316. set desc = "Enter an air vent and crawl through the pipe system."
  317. set category = "Alien"
  318.  
  319. // if(!istype(V,/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent))
  320. // return
  321. var/obj/machinery/atmospherics/unary/vent_pump/vent_found
  322. var/welded = 0
  323. for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
  324. if(!v.welded)
  325. vent_found = v
  326. break
  327. else
  328. welded = 1
  329. if(vent_found)
  330. if(vent_found.network&&vent_found.network.normal_members.len)
  331. var/list/vents = list()
  332. for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
  333. if(temp_vent.loc == loc)
  334. continue
  335. vents.Add(temp_vent)
  336. var/list/choices = list()
  337. for(var/obj/machinery/atmospherics/unary/vent_pump/vent in vents)
  338. if(vent.loc.z != loc.z)
  339. continue
  340. var/atom/a = get_turf(vent)
  341. choices.Add(a.loc)
  342. var/turf/startloc = loc
  343. var/obj/selection = input("Select a destination.", "Duct System") in choices
  344. var/selection_position = choices.Find(selection)
  345. if(loc==startloc)
  346. var/obj/target_vent = vents[selection_position]
  347. if(target_vent)
  348. loc = target_vent.loc
  349. else
  350. src << "\blue You need to remain still while entering a vent."
  351. else
  352. src << "\blue This vent is not connected to anything."
  353. else if(welded)
  354. src << "\red That vent is welded."
  355. else
  356. src << "\blue You must be standing on or beside an air vent to enter it."
  357. return
  358.  
  359. //copy paste from alien/larva, if that func is updated please update this one alsoghost
  360. /mob/living/simple_animal/borer/verb/hide()
  361. set name = "Hide"
  362. set desc = "Allows to hide beneath tables or certain items. Toggled on or off."
  363. set category = "Alien"
  364.  
  365. if (layer != TURF_LAYER+0.2)
  366. layer = TURF_LAYER+0.2
  367. src << text("\blue You are now hiding.")
  368. else
  369. layer = MOB_LAYER
  370. src << text("\blue You have stopped hiding.")
  371.  
  372. //Procs for grabbing players.
  373. mob/living/simple_animal/borer/proc/request_player()
  374. for(var/mob/dead/observer/O in player_list)
  375. if(jobban_isbanned(O, "Syndicate"))
  376. continue
  377. if(O.client)
  378. if(O.client.prefs.be_special & BE_ALIEN)
  379. question(O.client)
  380.  
  381. mob/living/simple_animal/borer/proc/question(var/client/C)
  382. spawn(0)
  383. if(!C) return
  384. var/response = alert(C, "A cortical borer needs a player. Are you interested?", "Cortical borer request", "Yes", "No", "Never for this round")
  385. if(!C || ckey)
  386. return
  387. if(response == "Yes")
  388. transfer_personality(C)
  389. else if (response == "Never for this round")
  390. C.prefs.be_special ^= BE_ALIEN
  391.  
  392. mob/living/simple_animal/borer/proc/transfer_personality(var/client/candidate)
  393.  
  394. if(!candidate)
  395. return
  396.  
  397. src.mind = candidate.mob.mind
  398. src.ckey = candidate.ckey
  399. if(src.mind)
  400. src.mind.assigned_role = "Cortical Borer"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement