Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 KB | None | 0 0
  1. /datum/species/ipc // im fucking lazy mk2 and cant get sprites to normally work
  2. name = "IPC" //inherited from the real species, for health scanners and things
  3. id = "ipc"
  4. say_mod = "states" //inherited from a user's real species
  5. sexes = 0
  6. species_traits = list(NOTRANSSTING,NOEYESPRITES,NO_DNA_COPY,NOBLOOD,TRAIT_EASYDISMEMBER,ROBOTIC_LIMBS,NOZOMBIE,MUTCOLORS,REVIVESBYHEALING,NOHUSK,NOMOUTH) //all of these + whatever we inherit from the real species
  7. inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_VIRUSIMMUNE,TRAIT_NOBREATH,TRAIT_RADIMMUNE,TRAIT_LIMBATTACHMENT)
  8. inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID)
  9. mutant_brain = /obj/item/organ/brain/positron
  10. mutanteyes = /obj/item/organ/eyes/robotic
  11. mutanttongue = /obj/item/organ/tongue/robot
  12. mutantliver = /obj/item/organ/liver/cybernetic/upgraded/ipc
  13. mutantstomach = /obj/item/organ/stomach/cell
  14. mutantears = /obj/item/organ/ears/robot
  15. mutant_organs = list(/obj/item/organ/cyberimp/arm/power_cord)
  16. mutant_bodyparts = list("ipc_screen", "ipc_antenna", "ipc_chassis")
  17. default_features = list("mcolor" = "#7D7D7D", "ipc_screen" = "Static", "ipc_antenna" = "None", "ipc_chassis" = "Morpheus Cyberkinetics(Greyscale)")
  18. meat = /obj/item/stack/sheet/plasteel{amount = 5}
  19. skinned_type = /obj/item/stack/sheet/iron{amount = 10}
  20. exotic_blood = "oil"
  21. damage_overlay_type = "synth"
  22. limbs_id = "synth"
  23. mutant_bodyparts = list("ipc_screen", "ipc_antenna", "ipc_chassis")
  24. default_features = list("ipc_screen" = "BSOD", "ipc_antenna" = "None")
  25. burnmod = 2
  26. heatmod = 1.5
  27. brutemod = 1
  28. toxmod = 0
  29. clonemod = 0
  30. staminamod = 0.8
  31. siemens_coeff = 1.5
  32. reagent_tag = PROCESS_SYNTHETIC
  33. species_gibs = "robotic"
  34. attack_sound = 'sound/items/trayhit1.ogg'
  35. allow_numbers_in_name = TRUE
  36. deathsound = "sound/voice/borg_deathsound.ogg"
  37. var/saved_screen //for saving the screen when they die
  38. var/list/initial_species_traits //for getting these values back for assume_disguise()
  39. var/list/initial_inherent_traits
  40. changesource_flags = MIRROR_BADMIN | WABBAJACK
  41.  
  42. var/datum/action/innate/change_screen/change_screen
  43.  
  44. /datum/species/ipc/random_name(unique)
  45. var/ipc_name = "[pick(GLOB.posibrain_names)]-[rand(100, 999)]"
  46. return ipc_name
  47.  
  48. /datum/species/ipc/on_species_gain(mob/living/carbon/C) // Let's make that IPC actually robotic.
  49. . = ..()
  50. var/obj/item/organ/appendix/appendix = C.getorganslot("appendix") // Easiest way to remove it.
  51. appendix.Remove(C)
  52. QDEL_NULL(appendix)
  53. if(ishuman(C) && !change_screen)
  54. change_screen = new
  55. change_screen.Grant(C)
  56. for(var/obj/item/bodypart/O in C.bodyparts)
  57. O.render_like_organic = TRUE // Makes limbs render like organic limbs instead of augmented limbs, check bodyparts.dm
  58. var/chassis = C.dna.features["ipc_chassis"]
  59. var/datum/sprite_accessory/ipc_chassis/chassis_of_choice = GLOB.ipc_chassis_list[chassis]
  60. C.dna.species.limbs_id = chassis_of_choice.limbs_id
  61. if(chassis_of_choice.color_src == MUTCOLORS && !(MUTCOLORS in C.dna.species.species_traits)) // If it's a colorable(Greyscale) chassis, we use MUTCOLORS.
  62. C.dna.species.species_traits += MUTCOLORS
  63. else if(MUTCOLORS in C.dna.species.species_traits)
  64. C.dna.species.species_traits -= MUTCOLORS
  65.  
  66. datum/species/ipc/on_species_loss(mob/living/carbon/C)
  67. . = ..()
  68. if(change_screen)
  69. change_screen.Remove(C)
  70.  
  71. /datum/species/ipc/get_spans()
  72. return SPAN_ROBOT
  73.  
  74. /datum/species/ipc/after_equip_job(datum/job/J, mob/living/carbon/human/H)
  75. H.grant_language(/datum/language/machine)
  76.  
  77. /datum/species/ipc/spec_death(gibbed, mob/living/carbon/C)
  78. saved_screen = C.dna.features["ipc_screen"]
  79. C.dna.features["ipc_screen"] = "BSOD"
  80. C.update_body()
  81. sleep(3 SECONDS)
  82. C.dna.features["ipc_screen"] = null // Turns off their monitor on death.
  83. C.update_body()
  84.  
  85. /datum/action/innate/change_screen
  86. name = "Change Display"
  87. check_flags = AB_CHECK_CONSCIOUS
  88. icon_icon = 'icons/mob/actions/actions_silicon.dmi'
  89. button_icon_state = "drone_vision"
  90.  
  91. /datum/action/innate/change_screen/Activate()
  92. var/screen_choice = input(usr, "Which screen do you want to use?", "Screen Change") as null | anything in GLOB.ipc_screens_list
  93. var/color_choice = input(usr, "Which color do you want your screen to be?", "Color Change") as null | color
  94. if(!screen_choice)
  95. return
  96. if(!color_choice)
  97. return
  98. if(!ishuman(owner))
  99. return
  100. var/mob/living/carbon/human/H = owner
  101. H.dna.features["ipc_screen"] = screen_choice
  102. H.eye_color = sanitize_hexcolor(color_choice)
  103. H.update_body()
  104.  
  105. /obj/item/apc_powercord
  106. name = "power cord"
  107. desc = "An internal power cord hooked up to a battery. Useful if you run on electricity. Not so much otherwise."
  108. icon = 'icons/obj/power.dmi'
  109. icon_state = "wire1"
  110.  
  111. /obj/item/apc_powercord/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
  112. if(!istype(target, /obj/machinery/power/apc) || !ishuman(user) || !proximity_flag)
  113. return ..()
  114. user.changeNext_move(CLICK_CD_MELEE)
  115. var/obj/machinery/power/apc/A = target
  116. var/mob/living/carbon/human/H = user
  117. var/obj/item/organ/stomach/cell/cell = H.internal_organs_slot["stomach"]
  118. if(!cell)
  119. to_chat(H, "<span class='warning'>You try to siphon energy from the [A], but your power cell is gone!</span>")
  120. return
  121.  
  122. if(A.cell && A.cell.charge > 0)
  123. if(H.nutrition >= NUTRITION_LEVEL_WELL_FED)
  124. to_chat(user, "<span class='warning'>You are already fully charged!</span>")
  125. return
  126. else
  127. powerdraw_loop(A, H)
  128. return
  129.  
  130. to_chat(user, "<span class='warning'>There is no charge to draw from that APC.</span>")
  131.  
  132. /obj/item/apc_powercord/proc/powerdraw_loop(obj/machinery/power/apc/A, mob/living/carbon/human/H)
  133. H.visible_message("<span class='notice'>[H] inserts a power connector into the [A].</span>", "<span class='notice'>You begin to draw power from the [A].</span>")
  134. while(do_after(H, 10, target = A))
  135. if(loc != H)
  136. to_chat(H, "<span class='warning'>You must keep your connector out while charging!</span>")
  137. break
  138. if(A.cell.charge == 0)
  139. to_chat(H, "<span class='warning'>The [A] doesn't have enough charge to spare.</span>")
  140. break
  141. A.charging = 1
  142. if(A.cell.charge >= 500)
  143. H.nutrition += 50
  144. A.cell.charge -= 250
  145. to_chat(H, "<span class='notice'>You siphon off some of the stored charge for your own use.</span>")
  146. else
  147. H.nutrition += A.cell.charge/10
  148. A.cell.charge = 0
  149. to_chat(H, "<span class='notice'>You siphon off as much as the [A] can spare.</span>")
  150. break
  151. if(H.nutrition > NUTRITION_LEVEL_WELL_FED)
  152. to_chat(H, "<span class='notice'>You are now fully charged.</span>")
  153. break
  154. H.visible_message("<span class='notice'>[H] unplugs from the [A].</span>", "<span class='notice'>You unplug from the [A].</span>")
  155.  
  156. /datum/species/ipc/spec_life(mob/living/carbon/human/H)
  157. . = ..()
  158. if(H.health <= HEALTH_THRESHOLD_CRIT && H.stat != DEAD) // So they die eventually instead of being stuck in crit limbo.
  159. H.adjustFireLoss(6) // After bodypart_robotic resistance this is ~2/second
  160. if(prob(5))
  161. to_chat(H, "<span class='warning'>Alert: Internal temperature regulation systems offline; thermal damage sustained. Shutdown imminent.</span>")
  162. H.visible_message("[H]'s cooling system fans stutter and stall. There is a faint, yet rapid beeping coming from inside their chassis.")
  163.  
  164. /datum/species/ipc/spec_revival(mob/living/carbon/human/H)
  165. H.dna.features["ipc_screen"] = "BSOD"
  166. H.update_body()
  167. H.say("Reactivating [pick("core systems", "central subroutines", "key functions")]...")
  168. sleep(3 SECONDS)
  169. H.say("Reinitializing [pick("personality matrix", "behavior logic", "morality subsystems")]...")
  170. sleep(3 SECONDS)
  171. H.say("Finalizing setup...")
  172. sleep(3 SECONDS)
  173. H.say("Unit [H.real_name] is fully functional. Have a nice day.")
  174. H.dna.features["ipc_screen"] = saved_screen
  175. H.update_body()
  176. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement