Medical Expansion

This commit is contained in:
Mechoid
2019-10-19 20:27:39 -07:00
committed by VirgoBot
parent 0287ce5527
commit 169d8acedd
80 changed files with 2799 additions and 168 deletions

View File

@@ -50,4 +50,9 @@
/datum/matter_synth/wire
name = "Wire Synthesizer"
max_energy = 50
recharge_rate = 2
recharge_rate = 2
/datum/matter_synth/bandage
name = "Bandage Synthesizer"
max_energy = 10
recharge_rate = 1

View File

@@ -11,6 +11,8 @@
var/heal_burn = 0
var/apply_sounds
var/upgrade_to // The type path this stack can be upgraded to.
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
if (!istype(M))
user << "<span class='warning'>\The [src] cannot be applied to [M]!</span>"
@@ -59,6 +61,80 @@
use(1)
M.updatehealth()
/obj/item/stack/medical/proc/upgrade_stack(var/upgrade_amount)
. = FALSE
var/turf/T = get_turf(src)
if(ispath(upgrade_to) && use(upgrade_amount))
var/obj/item/stack/medical/M = new upgrade_to(T, upgrade_amount)
return M
return .
/obj/item/stack/medical/crude_pack
name = "crude bandage"
singular_name = "crude bandage length"
desc = "Some bandages to wrap around bloody stumps."
icon_state = "gauze"
origin_tech = list(TECH_BIO = 1)
no_variants = FALSE
apply_sounds = list('sound/effects/rip1.ogg','sound/effects/rip2.ogg')
upgrade_to = /obj/item/stack/medical/bruise_pack
/obj/item/stack/medical/crude_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open)
to_chat(user, "<span class='notice'>The [affecting.name] is cut open, you'll need more than a bandage!</span>")
return
if(affecting.is_bandaged())
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
return 1
else
user.visible_message("<span class='notice'>\The [user] starts bandaging [M]'s [affecting.name].</span>", \
"<span class='notice'>You start bandaging [M]'s [affecting.name].</span>" )
var/used = 0
for (var/datum/wound/W in affecting.wounds)
if (W.internal)
continue
if(W.bandaged)
continue
if(used == amount)
break
if(!do_mob(user, M, W.damage/3))
to_chat(user, "<span class='notice'>You must stand still to bandage wounds.</span>")
break
if(affecting.is_bandaged()) // We do a second check after the delay, in case it was bandaged after the first check.
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
return 1
if (W.current_stage <= W.max_bleeding_stage)
user.visible_message("<span class='notice'>\The [user] bandages \a [W.desc] on [M]'s [affecting.name].</span>", \
"<span class='notice'>You bandage \a [W.desc] on [M]'s [affecting.name].</span>" )
else
user.visible_message("<span class='notice'>\The [user] places a bandage over \a [W.desc] on [M]'s [affecting.name].</span>", \
"<span class='notice'>You place a bandage over \a [W.desc] on [M]'s [affecting.name].</span>" )
W.bandage()
playsound(src, pick(apply_sounds), 25)
used++
affecting.update_damages()
if(used == amount)
if(affecting.is_bandaged())
to_chat(user, "<span class='warning'>\The [src] is used up.</span>")
else
to_chat(user, "<span class='warning'>\The [src] is used up, but there are more wounds to treat on \the [affecting.name].</span>")
use(used)
/obj/item/stack/medical/bruise_pack
name = "roll of gauze"
singular_name = "gauze length"
@@ -68,6 +144,8 @@
no_variants = FALSE
apply_sounds = list('sound/effects/rip1.ogg','sound/effects/rip2.ogg')
upgrade_to = /obj/item/stack/medical/advanced/bruise_pack
/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1

View File

@@ -24,6 +24,9 @@
var/list/datum/matter_synth/synths = null
var/no_variants = TRUE // Determines whether the item should update it's sprites based on amount.
var/pass_color = FALSE // Will the item pass its own color var to the created item? Dyed cloth, wood, etc.
var/strict_color_stacking = FALSE // Will the stack merge with other stacks that are different colors? (Dyed cloth, wood, etc)
/obj/item/stack/New(var/loc, var/amount=null)
..()
if (!stacktype)
@@ -159,6 +162,17 @@
for (var/obj/item/I in O)
qdel(I)
if ((pass_color || recipe.pass_color))
if(!color)
if(recipe.use_material)
var/material/MAT = get_material_by_name(recipe.use_material)
if(MAT.icon_colour)
O.color = MAT.icon_colour
else
return
else
O.color = color
/obj/item/stack/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.get_active_hand() != src))
@@ -242,6 +256,9 @@
return 0
if ((stacktype != S.stacktype) && !type_verified)
return 0
if ((strict_color_stacking || S.strict_color_stacking) && S.color != color)
return 0
if (isnull(tamount))
tamount = src.get_amount()
@@ -355,8 +372,9 @@
var/one_per_turf = 0
var/on_floor = 0
var/use_material
var/pass_color
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, supplied_material = null)
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, supplied_material = null, pass_stack_color)
src.title = title
src.result_type = result_type
src.req_amount = req_amount
@@ -366,6 +384,7 @@
src.one_per_turf = one_per_turf
src.on_floor = on_floor
src.use_material = supplied_material
src.pass_color = pass_stack_color
/*
* Recipe list datum