Skip to content

Commit

Permalink
Merge pull request Civ13#2636 from savethetreez/skibidibranch
Browse files Browse the repository at this point in the history
Some runtime fixes
  • Loading branch information
savethetreez authored Mar 24, 2024
2 parents eeaaa76 + 0498e45 commit e7caa0e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 68 deletions.
2 changes: 1 addition & 1 deletion code/modules/1713/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@
pixel_y = 32
else
pixel_y = 0
if (storage.contents.len > 0)
if (storage && storage.contents.len > 0)
for (var/obj/item/flashlight/torch/TOR in src.storage.contents)
if (TOR.on == TRUE)
icon_state = "torch_stand1_on"
Expand Down
135 changes: 68 additions & 67 deletions code/modules/surgery/prosthesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,72 +27,73 @@
flammable = TRUE

/obj/item/weapon/prosthesis/attack(mob/living/human/C as mob, mob/living/human/user as mob)
if (user.a_intent == I_HELP)
if (user.getStatCoeff("medical") < 1.5)
user << "Your medical skill is too low for such a complicated procedure!"
return
var/mod = 1
if (user.religious_clergy == "Shamans")
mod = 2
switch (limb_type)
if ("leg")
var/obj/item/organ/external/GR = C.get_organ("groin")
if (GR.is_stump())
user << "The whole lower body is missing! You have nowhere to attach \the [src] to!"
return
var/obj/item/organ/external/LL = C.get_organ("l_leg")
var/obj/item/organ/external/RL = C.get_organ("r_leg")
if ((LL && LL.is_stump() && LL.prosthesis == FALSE || !LL))
visible_message("[user] starts to attatch \the [src] to [C]'s left leg stump...","You start attaching \the [src] to [C]'s left leg stump...")
if (do_after(user, 150*user.getStatCoeff("medical"), C))
if (!LL)
return
visible_message("[user] finishes attaching \the [src] to [C]'s left leg stump.","You finish attaching \the [src] to [C]'s left leg stump.")
LL.prosthesis = TRUE
LL.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 4*mod)
qdel(src)
return
else if (RL.is_stump() && RL.prosthesis == FALSE)
visible_message("[user] starts to attatch \the [src] to [C]'s right leg stump...","You start attaching \the [src] to [C]'s right leg stump...")
if (do_after(user, 150*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s right leg stump.","You finish attaching \the [src] to [C]'s right leg stump.")
RL.prosthesis = TRUE
RL.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 4*mod)
qdel(src)
return
if ("foot")
var/obj/item/organ/external/LL = C.get_organ("l_leg")
var/obj/item/organ/external/RL = C.get_organ("r_leg")
if ((RL && RL.is_stump() && RL.prosthesis == FALSE) || !RL)
if ((LL && LL.is_stump() && LL.prosthesis == FALSE) || !LL)
user << "Both legs are missing! There is nowhere to attach the [src]!"
return
if (user.a_intent != I_HELP)
return ..()

var/obj/item/organ/external/LF = C.get_organ("l_foot")
var/obj/item/organ/external/RF = C.get_organ("r_foot")
if (LF && LF.is_stump() && LF.prosthesis == FALSE && !LL.is_stump())
visible_message("[user] starts to attatch \the [src] to [C]'s left foot stump...","You start attaching \the [src] to [C]'s left foot stump...")
if (do_after(user, 130*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s left foot stump.","You finish attaching \the [src] to [C]'s left foot stump.")
LF.prosthesis = TRUE
LF.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 3*mod)
qdel(src)
return
else if (RF && RF.is_stump() && RF.prosthesis == FALSE && !RL.is_stump())
visible_message("[user] starts to attatch \the [src] to [C]'s right foot stump...","You start attaching \the [src] to [C]'s right foot stump...")
if (do_after(user, 130*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s right foot stump.","You finish attaching \the [src] to [C]'s right foot stump.")
RF.prosthesis = TRUE
RF.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 3*mod)
qdel(src)
if (user.getStatCoeff("medical") < 1.5)
user << "Your medical skill is too low for a such complicated procedure!"
return

var/mod = 1
if (user.religious_clergy == "Shamans")
mod = 2
switch (limb_type)
if ("leg")
var/obj/item/organ/external/GR = C.get_organ("groin")
if (GR.is_stump())
user << "The whole lower body is missing! You have nowhere to attach \the [src] to!"
return
var/obj/item/organ/external/LL = C.get_organ("l_leg")
var/obj/item/organ/external/RL = C.get_organ("r_leg")
if ((LL && LL.is_stump() && LL.prosthesis == FALSE || !LL))
visible_message("[user] starts to attatch \the [src] to [C]'s left leg stump...","You start attaching \the [src] to [C]'s left leg stump...")
if (do_after(user, 150*user.getStatCoeff("medical"), C))
if (!LL)
return
visible_message("[user] finishes attaching \the [src] to [C]'s left leg stump.","You finish attaching \the [src] to [C]'s left leg stump.")
LL.prosthesis = TRUE
LL.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 4*mod)
qdel(src)
return
else if ((RL && RL.is_stump() && RL.prosthesis == FALSE || !RL))
visible_message("[user] starts to attatch \the [src] to [C]'s right leg stump...","You start attaching \the [src] to [C]'s right leg stump...")
if (do_after(user, 150*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s right leg stump.","You finish attaching \the [src] to [C]'s right leg stump.")
RL.prosthesis = TRUE
RL.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 4*mod)
qdel(src)
return
if ("foot")
var/obj/item/organ/external/LL = C.get_organ("l_leg")
var/obj/item/organ/external/RL = C.get_organ("r_leg")
if ((RL && RL.is_stump() && RL.prosthesis == FALSE) || !RL)
if ((LL && LL.is_stump() && LL.prosthesis == FALSE) || !LL)
user << "Both legs are missing! There is nowhere to attach the [src]!"
return
else
..()

var/obj/item/organ/external/LF = C.get_organ("l_foot")
var/obj/item/organ/external/RF = C.get_organ("r_foot")
if (LF && LF.is_stump() && LF.prosthesis == FALSE && !LL.is_stump())
visible_message("[user] starts to attatch \the [src] to [C]'s left foot stump...","You start attaching \the [src] to [C]'s left foot stump...")
if (do_after(user, 130*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s left foot stump.","You finish attaching \the [src] to [C]'s left foot stump.")
LF.prosthesis = TRUE
LF.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 3*mod)
qdel(src)
return
else if (RF && RF.is_stump() && RF.prosthesis == FALSE && !RL.is_stump())
visible_message("[user] starts to attatch \the [src] to [C]'s right foot stump...","You start attaching \the [src] to [C]'s right foot stump...")
if (do_after(user, 130*user.getStatCoeff("medical"), C))
visible_message("[user] finishes attaching \the [src] to [C]'s right foot stump.","You finish attaching \the [src] to [C]'s right foot stump.")
RF.prosthesis = TRUE
RF.prosthesis_type = icon_state
C.update_mutations(1)
user.adaptStat("medical", 3*mod)
qdel(src)
return

0 comments on commit e7caa0e

Please sign in to comment.