Skip to content

Commit

Permalink
Merge pull request #4209 from MistakeNot4892/feature/splints
Browse files Browse the repository at this point in the history
Adding some medical equipment to Shaded Hills.
  • Loading branch information
out-of-phaze authored Jul 17, 2024
2 parents ce681ae + 908dc07 commit a4f88b4
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 15 deletions.
33 changes: 30 additions & 3 deletions code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
/obj/item/stack/medical/bruise_pack/bandage/five
amount = 5

/obj/item/stack/medical/bruise_pack/bandage/ten
amount = 10

/obj/item/stack/medical/bruise_pack/bandage/proc/get_poultice_requirement_string()
. = list()
for(var/reagent in poultice_reagent_requirements)
Expand Down Expand Up @@ -212,6 +215,9 @@
/obj/item/stack/medical/ointment/poultice/five
amount = 5

/obj/item/stack/medical/ointment/poultice/ten
amount = 10

/obj/item/stack/medical/ointment/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)

. = ..()
Expand Down Expand Up @@ -352,19 +358,37 @@
/obj/item/stack/medical/splint
name = "medical splints"
singular_name = "medical splint"
plural_name = "medical splints"
desc = "Modular splints capable of supporting and immobilizing bones in both limbs and appendages."
icon_state = "splint"
amount = 5
max_amount = 5
animal_heal = 0
var/list/splintable_organs = list(BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG, BP_L_HAND, BP_R_HAND, BP_L_FOOT, BP_R_FOOT) //List of organs you can splint, natch.

/obj/item/stack/medical/splint/proc/get_splitable_organs()
var/static/list/splintable_organs = list(BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG, BP_L_HAND, BP_R_HAND, BP_L_FOOT, BP_R_FOOT) //List of organs you can splint, natch.
return splintable_organs

/obj/item/stack/medical/splint/check_limb_state(var/mob/user, var/obj/item/organ/external/limb)
if(BP_IS_PROSTHETIC(limb))
to_chat(user, SPAN_WARNING("You cannot use \the [src] to treat a prosthetic limb."))
return FALSE
return TRUE

/obj/item/stack/medical/splint/simple
name = "splints"
singular_name = "splint"
plural_name = "splints"
icon_state = "simple-splint"
amount = 1
material = /decl/material/solid/organic/wood
matter = list(
/decl/material/solid/organic/cloth = MATTER_AMOUNT_REINFORCEMENT
)

/obj/item/stack/medical/splint/simple/five
amount = 5

/obj/item/stack/medical/splint/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)

. = ..()
Expand All @@ -374,7 +398,7 @@
var/mob/living/human/H = target
var/obj/item/organ/external/affecting = GET_EXTERNAL_ORGAN(H, user.get_target_zone())

if(!(affecting.organ_tag in splintable_organs))
if(!(affecting.organ_tag in get_splitable_organs()))
to_chat(user, SPAN_WARNING("You can't use \the [src] to apply a splint there!"))
return TRUE

Expand Down Expand Up @@ -440,7 +464,10 @@
desc = "For holding your limbs in place with duct tape and scrap metal."
icon_state = "tape-splint"
amount = 1
splintable_organs = list(BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG)

/obj/item/stack/medical/splint/ghetto/get_splitable_organs()
var/static/list/splintable_organs = list(BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG)
return splintable_organs

/obj/item/stack/medical/resin
name = "resin patches"
Expand Down
38 changes: 27 additions & 11 deletions code/game/objects/items/weapons/material/stick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,38 @@

if(!sharp && (istype(W, /obj/item/stack/material/bolt) || istype(W, /obj/item/stack/material/bundle)))

// Ugly way to check for dried grass vs regular grass.
var/obj/item/stack/material/fuel = W
if(!fuel.special_crafting_check())
return ..()
var/choice = input(user, "Do you want to make a torch, or a splint?", "Stick Crafting") as null|anything in list("Torch", "Splint")
if(!choice || QDELETED(user) || user.get_active_held_item() != W || QDELETED(W) || !QDELETED(src) || (loc != user && !Adjacent(user)) || sharp)
return TRUE

if(fuel.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need at least five units of flammable material to create a torch."))
var/obj/item/stack/material/cloth = W

var/atom/product_type
var/cloth_cost
if(choice == "Splint")
product_type = /obj/item/stack/medical/splint/simple
cloth_cost = 5
else if(choice == "Torch")
product_type = /obj/item/flame/torch
cloth_cost = 3
else
return TRUE

var/was_held = loc == user
if(cloth.get_amount() < cloth_cost)
to_chat(user, SPAN_WARNING("You need at least [cloth_cost] unit\s of material to create \a [initial(product_type.name)]."))
return TRUE

// Ugly way to check for dried grass vs regular grass.
if(!cloth.special_crafting_check())
return ..()

var/was_held = (loc == user)
cloth.use(cloth_cost)
if(!was_held || user.try_unequip(src))
var/obj/item/flame/torch/torch = new(get_turf(src), material?.type, W.material?.type)
fuel.use(5)
var/obj/item/thing = new product_type(get_turf(src), material?.type, W.material?.type)
if(was_held)
user.put_in_hands(torch)
to_chat(user, SPAN_NOTICE("You fashion \the [src] into \a [torch]."))
user.put_in_hands(thing)
to_chat(user, SPAN_NOTICE("You fashion \the [src] into \a [thing]."))
qdel(src)
return TRUE

Expand Down
Binary file modified icons/obj/medical_kits.dmi
Binary file not shown.
5 changes: 5 additions & 0 deletions maps/shaded_hills/outfits/shrine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name = "Shaded Hills - Shrine Attendant"
uniform = /obj/item/clothing/suit/robe
shoes = /obj/item/clothing/shoes/sandal
backpack_contents = list(
/obj/item/stack/medical/bruise_pack/bandage/five = 1,
/obj/item/stack/medical/ointment/poultice/five = 1,
/obj/item/stack/medical/splint/simple/five = 1
)

/decl/hierarchy/outfit/job/shaded_hills/shrine/keeper
name = "Shaded Hills - Shrine Keeper"
Expand Down
6 changes: 5 additions & 1 deletion maps/shaded_hills/outfits/visitors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@

/decl/hierarchy/outfit/job/shaded_hills/traveller/cleric
name = "Shaded Hills - Travelling Cleric"

backpack_contents = list(
/obj/item/stack/medical/bruise_pack/bandage/ten = 1,
/obj/item/stack/medical/ointment/poultice/ten = 1,
/obj/item/stack/medical/splint/simple/five = 1
)

0 comments on commit a4f88b4

Please sign in to comment.