mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Moved code from parent class with checks to subclasses.
Lots of copypaste code, but better that bloating that one main function even more IMHO. As for bloat reason - readded advanced medithingies. Work same as lesser ones, but heal some damage directly instead, and have different messages/
This commit is contained in:
@@ -11,15 +11,6 @@
|
||||
var/heal_burn = 0
|
||||
|
||||
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if (M.stat == 2)
|
||||
var/t_him = "it"
|
||||
if (M.gender == MALE)
|
||||
t_him = "him"
|
||||
else if (M.gender == FEMALE)
|
||||
t_him = "her"
|
||||
user << "\red \The [M] is dead, you cannot help [t_him]!"
|
||||
return 1
|
||||
|
||||
if (!istype(M))
|
||||
user << "\red \The [src] cannot be applied to [M]!"
|
||||
return 1
|
||||
@@ -47,42 +38,16 @@
|
||||
user << "\red This isn't useful at all on a robotic limb.."
|
||||
return 1
|
||||
|
||||
if(src.heal_brute)
|
||||
if(!affecting.bandage())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged."
|
||||
return 1
|
||||
else
|
||||
for (var/datum/wound/W in affecting.wounds)
|
||||
if (W.internal)
|
||||
continue
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You bandage [W.desc] on [M]'s [affecting.display_name]." )
|
||||
//H.add_side_effect("Itch")
|
||||
else if (istype(W,/datum/wound/bruise))
|
||||
user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You place bruise patch over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
else
|
||||
user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
|
||||
else if(src.heal_burn)
|
||||
if(!affecting.salve())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
|
||||
return 1
|
||||
else
|
||||
user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \
|
||||
"\blue You salve wounds on [M]'s [affecting.display_name]." )
|
||||
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
else
|
||||
|
||||
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
|
||||
user.visible_message( \
|
||||
"\blue [M] has been applied with [src] by [user].", \
|
||||
"\blue You apply \the [src] to [M]." \
|
||||
)
|
||||
|
||||
use(1)
|
||||
use(1)
|
||||
|
||||
M.updatehealth()
|
||||
/obj/item/stack/medical/bruise_pack
|
||||
@@ -90,18 +55,60 @@
|
||||
singular_name = "gauze length"
|
||||
desc = "Some sterile gauze to wrap around bloody stumps."
|
||||
icon_state = "brutepack"
|
||||
heal_brute = 60
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/obj/item/stack/medical/bruise_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/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(!affecting.bandage())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged."
|
||||
return 1
|
||||
else
|
||||
for (var/datum/wound/W in affecting.wounds)
|
||||
if (W.internal)
|
||||
continue
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You bandage [W.desc] on [M]'s [affecting.display_name]." )
|
||||
//H.add_side_effect("Itch")
|
||||
else if (istype(W,/datum/wound/bruise))
|
||||
user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You place bruise patch over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
else
|
||||
user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
use(1)
|
||||
|
||||
/obj/item/stack/medical/ointment
|
||||
name = "ointment"
|
||||
desc = "Used to treat those nasty burns."
|
||||
gender = PLURAL
|
||||
singular_name = "ointment"
|
||||
icon_state = "ointment"
|
||||
heal_burn = 40
|
||||
heal_burn = 1
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/obj/item/stack/medical/ointment/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/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(!affecting.salve())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
|
||||
return 1
|
||||
else
|
||||
user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \
|
||||
"\blue You salve wounds on [M]'s [affecting.display_name]." )
|
||||
use(1)
|
||||
|
||||
/obj/item/stack/medical/bruise_pack/tajaran
|
||||
name = "\improper S'rendarr's Hand leaf"
|
||||
singular_name = "S'rendarr's Hand leaf"
|
||||
@@ -126,6 +133,34 @@
|
||||
heal_brute = 12
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/obj/item/stack/medical/advanced/bruise_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/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(!affecting.bandage())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been treated."
|
||||
return 1
|
||||
else
|
||||
for (var/datum/wound/W in affecting.wounds)
|
||||
if (W.internal)
|
||||
continue
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.display_name] and seals edges with bioglue.", \
|
||||
"\blue You clean and seal [W.desc] on [M]'s [affecting.display_name]." )
|
||||
//H.add_side_effect("Itch")
|
||||
else if (istype(W,/datum/wound/bruise))
|
||||
user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You place medicine patch over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
else
|
||||
user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \
|
||||
"\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." )
|
||||
affecting.heal_damage(heal_brute,0)
|
||||
use(1)
|
||||
|
||||
/obj/item/stack/medical/advanced/ointment
|
||||
name = "advanced burn kit"
|
||||
singular_name = "advanced burn kit"
|
||||
@@ -134,8 +169,26 @@
|
||||
heal_burn = 12
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
|
||||
/obj/item/stack/medical/advanced/ointment/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/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(!affecting.salve())
|
||||
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
|
||||
return 1
|
||||
else
|
||||
user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.display_name] with regenerative membrane.", \
|
||||
"\blue You cover wounds on [M]'s [affecting.display_name] with regenerative membrane." )
|
||||
affecting.heal_damage(0,heal_burn)
|
||||
use(1)
|
||||
|
||||
/obj/item/stack/medical/splint
|
||||
name = "medical splint"
|
||||
name = "medical splints"
|
||||
singular_name = "medical splint"
|
||||
icon_state = "splint"
|
||||
amount = 5
|
||||
@@ -143,3 +196,38 @@
|
||||
|
||||
/obj/item/stack/medical/splint/single
|
||||
amount = 1
|
||||
|
||||
|
||||
/obj/item/stack/medical/splint/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/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
var/limb = affecting.display_name
|
||||
if(!((affecting.name == "l_arm") || (affecting.name == "r_arm") || (affecting.name == "l_leg") || (affecting.name == "r_leg")))
|
||||
user << "\red You can't apply a splint there!"
|
||||
return
|
||||
if(affecting.status & ORGAN_SPLINTED)
|
||||
user << "\red [M]'s [limb] is already splinted!"
|
||||
return
|
||||
if (M != user)
|
||||
user.visible_message("\red [user] starts to apply \the [src] to [M]'s [limb].", "\red You start to apply \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
|
||||
else
|
||||
if((!user.hand && affecting.name == "r_arm") || (user.hand && affecting.name == "l_arm"))
|
||||
user << "\red You can't apply a splint to the arm you're using!"
|
||||
return
|
||||
user.visible_message("\red [user] starts to apply \the [src] to their [limb].", "\red You start to apply \the [src] to your [limb].", "\red You hear something being wrapped.")
|
||||
if(do_after(user, 50))
|
||||
if (M != user)
|
||||
user.visible_message("\red [user] finishes applying \the [src] to [M]'s [limb].", "\red You finish applying \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
|
||||
else
|
||||
if(prob(25))
|
||||
user.visible_message("\red [user] successfully applies \the [src] to their [limb].", "\red You successfully apply \the [src] to your [limb].", "\red You hear something being wrapped.")
|
||||
else
|
||||
user.visible_message("\red [user] fumbles \the [src].", "\red You fumble \the [src].", "\red You hear something being wrapped.")
|
||||
return
|
||||
affecting.status |= ORGAN_SPLINTED
|
||||
use(1)
|
||||
return
|
||||
Reference in New Issue
Block a user