Skip to content

Commit

Permalink
Ports "Ports "Revives "Adds sound effects to surgeries"" and others" …
Browse files Browse the repository at this point in the history
…and "Adds medical sounds" (#1317)
  • Loading branch information
nmajask authored Aug 17, 2022
1 parent c5d0118 commit 8d8b4ad
Show file tree
Hide file tree
Showing 37 changed files with 204 additions and 47 deletions.
10 changes: 10 additions & 0 deletions code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
var/other_delay = 0
var/repeating = FALSE
var/experience_given = 1
///Sound/Sounds to play when this is applied
var/apply_sounds

/obj/item/stack/medical/attack(mob/living/M, mob/user)
. = ..()
Expand All @@ -28,17 +30,20 @@
if(!M.can_inject(user, TRUE))
return
if(M == user)
playsound(src, islist(apply_sounds) ? pick(apply_sounds) : apply_sounds, 25)
if(!silent)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [user.p_them()]self...</span>", "<span class='notice'>You begin applying \the [src] on yourself...</span>")
if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject, user, TRUE)))
return
else if(other_delay)
playsound(src, islist(apply_sounds) ? pick(apply_sounds) : apply_sounds, 25)
if(!silent)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [M].</span>", "<span class='notice'>You begin applying \the [src] on [M]...</span>")
if(!do_mob(user, M, other_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject, user, TRUE)))
return

if(heal(M, user))
playsound(src, islist(apply_sounds) ? pick(apply_sounds) : apply_sounds, 25)
user?.mind.adjust_experience(/datum/skill/healing, experience_given)
log_combat(user, M, "healed", src.name)
use(1)
Expand Down Expand Up @@ -104,6 +109,7 @@
icon_state = "brutepack"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
apply_sounds = list('sound/effects/rip1.ogg', 'sound/effects/rip2.ogg')
var/heal_brute = 40
self_delay = 20
grind_results = list(/datum/reagent/medicine/styptic_powder = 10)
Expand Down Expand Up @@ -137,6 +143,7 @@
gender = PLURAL
singular_name = "medical gauze"
icon_state = "gauze"
apply_sounds = list('sound/effects/rip1.ogg', 'sound/effects/rip2.ogg')
var/stop_bleeding = 1800
self_delay = 20
max_amount = 12
Expand Down Expand Up @@ -193,6 +200,7 @@
icon_state = "ointment"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
apply_sounds = 'sound/effects/ointment.ogg'
var/heal_burn = 40
self_delay = 20
grind_results = list(/datum/reagent/medicine/silver_sulfadiazine = 10)
Expand Down Expand Up @@ -336,6 +344,7 @@
desc = "A healing paste you can apply on wounds."

icon_state = "aloe_paste"
apply_sounds = 'sound/effects/ointment.ogg'
self_delay = 20
other_delay = 10
novariants = TRUE
Expand Down Expand Up @@ -383,6 +392,7 @@
singular_name = "splint"
icon = 'whitesands/icons/obj/items_and_weapons.dmi'
icon_state = "splint"
apply_sounds = list('sound/effects/rip1.ogg', 'sound/effects/rip2.ogg')
self_delay = 40
other_delay = 15
splint_fracture = TRUE
Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/advanced/brainwashing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
/datum/surgery_step/brainwash
name = "brainwash"
implements = list(TOOL_HEMOSTAT = 85, TOOL_WIRECUTTER = 50, /obj/item/stack/packageWrap = 35, /obj/item/stack/cable_coil = 15)
time = 200
time = 20 SECONDS
preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = MEDICAL_SKILL_ADVANCED
var/objective

Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/advanced/lobotomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
name = "perform lobotomy"
implements = list(TOOL_SCALPEL = 85, /obj/item/melee/transforming/energy/sword = 55, /obj/item/kitchen/knife = 35,
/obj/item/shard = 25, /obj/item = 20)
time = 100
time = 10 SECONDS
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/scalpel2.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = MEDICAL_SKILL_ADVANCED //lose XP if you end up giving them bad traumas

/datum/surgery_step/lobotomize/tool_check(mob/user, obj/item/tool)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/advanced/pacification.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
/datum/surgery_step/pacify
name = "rewire brain"
implements = list(TOOL_HEMOSTAT = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15)
time = 40
time = 4 SECONDS
preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = MEDICAL_SKILL_ADVANCED

/datum/surgery_step/pacify/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/amputation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
/datum/surgery_step/sever_limb
name = "sever limb"
implements = list(/obj/item/shears = 300, TOOL_SCALPEL = 100, TOOL_SAW = 100, /obj/item/melee/arm_blade = 80, /obj/item/fireaxe = 50, /obj/item/hatchet = 40, /obj/item/kitchen/knife/butcher = 25)
time = 6.4 SECONDS
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/organ2.ogg'
time = 64
experience_given = MEDICAL_SKILL_ORGAN_FIX

Expand Down
5 changes: 3 additions & 2 deletions code/modules/surgery/bone_repair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

/datum/surgery_step/set_bone
name = "set bone"

time = 64
time = 6.4 SECONDS
implements = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 25, TOOL_WRENCH = 35)
preop_sound = 'sound/surgery/bone1.ogg'
success_sound = 'sound/surgery/bone3.ogg'

/datum/surgery_step/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(target_zone == BODY_ZONE_HEAD)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/brain_surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
name = "fix brain"
implements = list(TOOL_HEMOSTAT = 85, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) //don't worry, pouring some alcohol on their open brain will get that chance to 100
repeatable = TRUE
time = 100 //long and complicated
time = 10 SECONDS //long and complicated
preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = 0 // per_trauma

/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/surgery/cavity_implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
//handle cavity
/datum/surgery_step/handle_cavity
name = "implant item"
accept_hand = 1
accept_hand = TRUE
implements = list(/obj/item = 100)
repeatable = TRUE
time = 32
time = 3.2 SECONDS
preop_sound = 'sound/surgery/organ1.ogg'
success_sound = 'sound/surgery/organ2.ogg'
var/obj/item/IC = null

/datum/surgery_step/handle_cavity/tool_check(mob/user, obj/item/tool)
Expand Down
10 changes: 8 additions & 2 deletions code/modules/surgery/coronary_bypass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
name = "incise heart"
implements = list(TOOL_SCALPEL = 90, /obj/item/melee/transforming/energy/sword = 45, /obj/item/kitchen/knife = 45,
/obj/item/shard = 25)
time = 16
time = 1.6 SECONDS
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/scalpel2.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/incise_heart/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 make an incision in [target]'s heart...</span>",
Expand Down Expand Up @@ -55,7 +58,10 @@
/datum/surgery_step/coronary_bypass
name = "graft coronary bypass"
implements = list(TOOL_HEMOSTAT = 90, TOOL_WIRECUTTER = 35, /obj/item/stack/packageWrap = 15, /obj/item/stack/cable_coil = 5)
time = 90
time = 9 SECONDS
preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = MEDICAL_SKILL_ORGAN_FIX

/datum/surgery_step/coronary_bypass/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand Down
4 changes: 3 additions & 1 deletion code/modules/surgery/healing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
name = "repair body"
implements = list(TOOL_HEMOSTAT = 100, TOOL_SCREWDRIVER = 65, /obj/item/pen = 55)
repeatable = TRUE
time = 25
time = 2.5 SECONDS
success_sound = 'sound/surgery/retractor2.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
var/brutehealing = 0
var/burnhealing = 0
var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing!
Expand Down
3 changes: 2 additions & 1 deletion code/modules/surgery/implant_removal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
/datum/surgery_step/extract_implant
name = "extract implant"
implements = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 65, /obj/item/kitchen/fork = 35)
time = 64
time = 6.4 SECONDS
success_sound = 'sound/surgery/hemostat1.ogg'
experience_given = MEDICAL_SKILL_MEDIUM
var/obj/item/implant/I = null

Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/lobectomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
name = "excise damaged lung node"
implements = list(TOOL_SCALPEL = 95, /obj/item/melee/transforming/energy/sword = 65, /obj/item/kitchen/knife = 45,
/obj/item/shard = 35)
time = 42
time = 4.2 SECONDS
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/organ1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'
experience_given = MEDICAL_SKILL_ORGAN_FIX

/datum/surgery_step/lobectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand Down
57 changes: 40 additions & 17 deletions code/modules/surgery/mechanic_steps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
name = "unscrew shell"
implements = list(
TOOL_SCREWDRIVER = 100,
TOOL_SCALPEL = 75, // med borgs could try to unskrew shell with scalpel
TOOL_SCALPEL = 75, // med borgs could try to unscrew shell with scalpel
/obj/item/kitchen/knife = 50,
/obj/item = 10) // 10% success with any sharp item.
time = 24
time = 2.4 SECONDS
preop_sound = 'sound/items/screwdriver.ogg'
success_sound = 'sound/items/screwdriver2.ogg'

/datum/surgery_step/mechanic_open/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 unscrew the shell of [target]'s [parse_zone(target_zone)]...</span>",
"<span class='notice'>[user] begins to unscrew the shell of [target]'s [parse_zone(target_zone)].</span>",
"<span class='notice'>[user] begins to unscrew the shell of [target]'s [parse_zone(target_zone)].</span>")

/datum/surgery_step/mechanic_incise/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.get_sharpness())
return FALSE

return TRUE
/datum/surgery_step/mechanic_open/tool_check(mob/user, obj/item/tool)
if(istype(tool))
if(!tool.get_sharpness())
return FALSE
if(tool.usesound)
preop_sound = tool.usesound

//close shell
/datum/surgery_step/mechanic_close
Expand All @@ -27,26 +30,32 @@
TOOL_SCALPEL = 75,
/obj/item/kitchen/knife = 50,
/obj/item = 10) // 10% success with any sharp item.
time = 24
time = 2.4 SECONDS
preop_sound = 'sound/items/screwdriver.ogg'
success_sound = 'sound/items/screwdriver2.ogg'

/datum/surgery_step/mechanic_close/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 screw the shell of [target]'s [parse_zone(target_zone)]...</span>",
"<span class='notice'>[user] begins to screw the shell of [target]'s [parse_zone(target_zone)].</span>",
"<span class='notice'>[user] begins to screw the shell of [target]'s [parse_zone(target_zone)].</span>")

/datum/surgery_step/mechanic_close/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.get_sharpness())
return FALSE

return TRUE
if(istype(tool))
if(!tool.get_sharpness())
return FALSE
if(tool.usesound)
preop_sound = tool.usesound

//prepare electronics
/datum/surgery_step/prepare_electronics
name = "prepare electronics"
implements = list(
TOOL_MULTITOOL = 100,
TOOL_HEMOSTAT = 10) // try to reboot internal controllers via short circuit with some conductor
time = 24
time = 2.4 SECONDS
preop_sound = 'sound/items/tape_flip.ogg'
success_sound = 'sound/items/taperecorder_close.ogg'
failure_sound = 'sound/machines/defib_zap.ogg'

/datum/surgery_step/prepare_electronics/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 prepare electronics in [target]'s [parse_zone(target_zone)]...</span>",
Expand All @@ -59,31 +68,45 @@
implements = list(
TOOL_WRENCH = 100,
TOOL_RETRACTOR = 10)
time = 24
time = 2.4 SECONDS
preop_sound = 'sound/items/ratchet.ogg'

/datum/surgery_step/mechanic_unwrench/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 unwrench some bolts in [target]'s [parse_zone(target_zone)]...</span>",
"<span class='notice'>[user] begins to unwrench some bolts in [target]'s [parse_zone(target_zone)].</span>",
"<span class='notice'>[user] begins to unwrench some bolts in [target]'s [parse_zone(target_zone)].</span>")

/datum/surgery_step/mechanic_unwrench/tool_check(mob/user, obj/item/tool)
if(tool.usesound)
preop_sound = tool.usesound
return TRUE

//wrench
/datum/surgery_step/mechanic_wrench
name = "wrench bolts"
implements = list(
TOOL_WRENCH = 100,
TOOL_RETRACTOR = 10)
time = 24
time = 2.4 SECONDS
preop_sound = 'sound/items/ratchet.ogg'

/datum/surgery_step/mechanic_wrench/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 wrench some bolts in [target]'s [parse_zone(target_zone)]...</span>",
"<span class='notice'>[user] begins to wrench some bolts in [target]'s [parse_zone(target_zone)].</span>",
"<span class='notice'>[user] begins to wrench some bolts in [target]'s [parse_zone(target_zone)].</span>")

/datum/surgery_step/mechanic_wrench/tool_check(mob/user, obj/item/tool)
if(tool.usesound)
preop_sound = tool.usesound
return TRUE

//open hatch
/datum/surgery_step/open_hatch
name = "open the hatch"
accept_hand = 1
time = 10
accept_hand = TRUE
time = 1 SECONDS
preop_sound = 'sound/items/ratchet.ogg'
success_sound = 'sound/machines/doorclick.ogg'

/datum/surgery_step/open_hatch/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 open the hatch holders in [target]'s [parse_zone(target_zone)]...</span>",
Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/mechanical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/datum/surgery_step/heal/mechanic
name = "repair components"
implements = list(TOOL_WELDER = 100, TOOL_CAUTERY = 60, /obj/item/melee/transforming/energy = 40, /obj/item/gun/energy/laser = 20, TOOL_WIRECUTTER = 100, TOOL_HEMOSTAT = 60, TOOL_RETRACTOR = 60)
time = 20
time = 2 SECONDS
missinghpbonus = 10

/datum/surgery_step/heal/mechanic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand All @@ -37,10 +37,13 @@
brutehealing = 5
burnhealing = 0
repairtype = "dents"
preop_sound = 'sound/items/welder.ogg'
success_sound = 'sound/items/welder2.ogg'
if(tool.tool_behaviour == TOOL_WIRECUTTER || tool.tool_behaviour == TOOL_HEMOSTAT || tool.tool_behaviour == TOOL_RETRACTOR)
burnhealing = 5
brutehealing = 0
repairtype = "wiring"
success_sound = 'sound/items/wirecutter.ogg'
if(istype(surgery,/datum/surgery/healing))
var/datum/surgery/healing/the_surgery = surgery
if(!the_surgery.antispam)
Expand Down
Loading

0 comments on commit 8d8b4ad

Please sign in to comment.