-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathlimb_augmentation.dm
103 lines (87 loc) · 4.84 KB
/
limb_augmentation.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/////AUGMENTATION SURGERIES//////
//SURGERY STEPS
/datum/surgery_step/replace
name = "sever muscles"
implements = list(TOOL_SCALPEL = 100, TOOL_WIRECUTTER = 55)
time = 32
/datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class ='notice'>You begin to sever the muscles on [target]'s [parse_zone(user.zone_selected)]...</span>",
"[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_selected)].",
"[user] begins an incision on [target]'s [parse_zone(user.zone_selected)].")
/datum/surgery_step/replace_limb
name = "replace limb"
implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100)
time = 32
var/obj/item/bodypart/L = null // L because "limb"
var/blacklisted_self_zones = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST) // list of body zones you can't self-augment
/datum/surgery_step/replace_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)//change this so digitigrade species can only use digitigrade limbs
if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart))
tool = tool.contents[1]
var/obj/item/bodypart/aug = tool
if(aug.status != BODYPART_ROBOTIC || aug.sub_status != BODYPART_SUBTYPE_ROBOTIC)
to_chat(user, span_warning("That's not an augment, silly!"))
return -1
if(aug.body_zone != target_zone)
to_chat(user, span_warning("[tool] isn't the right type for [parse_zone(target_zone)]."))
return -1
if(target == user && (aug.body_zone in blacklisted_self_zones)) // can't exactly replace your entire chest or head all by yourself
to_chat(user, span_warning("You can't augment your own [parse_zone(aug.body_zone)]!"))
return -1
L = surgery.operated_bodypart
if(L)
display_results(user, target, "<span class ='notice'>You begin to augment [target]'s [parse_zone(user.zone_selected)]...</span>",
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)] with [aug].",
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)].")
else
user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You look for [target]'s [parse_zone(user.zone_selected)]...</span>")
//ACTUAL SURGERIES
/datum/surgery/augmentation
name = "Augmentation"
desc = "Replace a limb with a robot part."
icon_state = "augmentation"
steps = list(/datum/surgery_step/incise,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/retract_skin,
/datum/surgery_step/replace,
/datum/surgery_step/saw,
/datum/surgery_step/replace_limb
)
target_mobtypes = list(/mob/living/carbon/human)
possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD)
requires_real_bodypart = TRUE
/datum/surgery/augmentation/can_start(mob/user, mob/living/carbon/target)
if(isgolem(target)) // no armor stacking
return FALSE
if(isshadowperson(target)) // no augmenting the species made of shadows
return FALSE
return TRUE
/datum/surgery/augmentation/mechanic
steps = list(/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/replace_limb)
requires_bodypart_type = BODYPART_ROBOTIC
self_operable = TRUE // you can swap out your own arms and legs yourself, but chest and head have to be done by someone else
// "no you cannot augment already mechanical beings" it's called replacement, silly
//SURGERY STEP SUCCESSES
/datum/surgery_step/replace_limb/success(mob/living/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery)
if(L)
if(istype(tool, /obj/item/organ_storage))
tool.icon_state = initial(tool.icon_state)
tool.desc = initial(tool.desc)
tool.cut_overlays()
tool = tool.contents[1]
if(istype(tool) && user.temporarilyRemoveItemFromInventory(tool))
tool.replace_limb(target, TRUE)
display_results(user, target, span_notice("You successfully augment [target]'s [parse_zone(target_zone)]."),
"[user] successfully augments [target]'s [parse_zone(target_zone)] with [tool]!",
"[user] successfully augments [target]'s [parse_zone(target_zone)]!")
log_combat(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] COMBAT MODE: [user.combat_mode ? "ON" : "OFF"]")
var/points = 150 * (target.client ? 1 : 0.1) * (5 + user.get_skill(SKILL_SCIENCE)) / 5
user.add_exp(SKILL_SCIENCE, points / 2)
SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = points))
to_chat(user, "<span class = 'notice'>The augment uploads diagnostic data to the research cloud, giving a bonus of research points!</span>")
else
to_chat(user, span_warning("[target] has no organic [parse_zone(target_zone)] there!"))
return TRUE