mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 12:47:16 +01:00
Moved same code into single organ helper to handle embedding.
This commit is contained in:
@@ -65,13 +65,13 @@
|
||||
|
||||
if (organ_name in organs_by_name)
|
||||
var/datum/organ/external/O = get_organ(organ_name)
|
||||
|
||||
|
||||
if(amount > 0)
|
||||
O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
else
|
||||
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
|
||||
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
|
||||
|
||||
|
||||
hud_updateflag |= 1 << HEALTH_HUD
|
||||
|
||||
/mob/living/carbon/human/proc/adjustFireLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
|
||||
@@ -80,13 +80,13 @@
|
||||
|
||||
if (organ_name in organs_by_name)
|
||||
var/datum/organ/external/O = get_organ(organ_name)
|
||||
|
||||
|
||||
if(amount > 0)
|
||||
O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
else
|
||||
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
|
||||
O.heal_damage(0, -amount, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
|
||||
|
||||
|
||||
hud_updateflag |= 1 << HEALTH_HUD
|
||||
|
||||
/mob/living/carbon/human/Stun(amount)
|
||||
@@ -302,14 +302,6 @@ This function restores all organs.
|
||||
if(istype(used_weapon,/obj/item/weapon))
|
||||
var/obj/item/weapon/W = used_weapon //Sharp objects will always embed if they do enough damage.
|
||||
if( (damage > (10*W.w_class)) && ( (sharp && !ismob(W.loc)) || prob(damage/W.w_class) ) )
|
||||
organ.implants += W
|
||||
visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
embedded_flag = 1
|
||||
src.verbs += /mob/proc/yank_out_object
|
||||
W.add_blood(src)
|
||||
if(ismob(W.loc))
|
||||
var/mob/living/H = W.loc
|
||||
H.drop_item()
|
||||
W.loc = src
|
||||
organ.embed(W)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -98,11 +98,7 @@ emp_act
|
||||
(SP.name) = "[P.name] shrapnel"
|
||||
(SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
|
||||
(SP.loc) = organ
|
||||
organ.implants += SP
|
||||
visible_message("<span class='danger'>The projectile sticks in the wound!</span>")
|
||||
embedded_flag = 1
|
||||
src.verbs += /mob/proc/yank_out_object
|
||||
SP.add_blood(src)
|
||||
organ.embed(SP)
|
||||
|
||||
return (..(P , def_zone))
|
||||
|
||||
@@ -236,7 +232,7 @@ emp_act
|
||||
if ((weapon_sharp || weapon_edge) && prob(getarmor(def_zone, "melee")))
|
||||
weapon_sharp = 0
|
||||
weapon_edge = 0
|
||||
|
||||
|
||||
if(armor >= 2) return 0
|
||||
if(!I.force) return 0
|
||||
|
||||
@@ -314,4 +310,4 @@ emp_act
|
||||
var/obj/item/clothing/suit/space/SS = wear_suit
|
||||
var/penetrated_dam = max(0,(damage - max(0,(SS.breach_threshold - SS.damage))))
|
||||
|
||||
if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam)
|
||||
if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam)
|
||||
|
||||
@@ -703,6 +703,19 @@ This function completely restores a damaged organ to perfect condition.
|
||||
/datum/organ/external/proc/is_usable()
|
||||
return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD))
|
||||
|
||||
/datum/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
|
||||
if(!silent)
|
||||
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
implants += W
|
||||
owner.embedded_flag = 1
|
||||
owner.verbs += /mob/proc/yank_out_object
|
||||
W.add_blood(owner)
|
||||
if(ismob(W.loc))
|
||||
var/mob/living/H = W.loc
|
||||
H.drop_item()
|
||||
W.loc = owner
|
||||
|
||||
|
||||
/****************************************************
|
||||
ORGAN DEFINES
|
||||
****************************************************/
|
||||
|
||||
@@ -1569,7 +1569,7 @@
|
||||
surprise.icon_state = "skrellkey1"
|
||||
specie = "neaera"
|
||||
surprise.name = "malformed [specie]"
|
||||
surprise.desc = "Looks like \a very deformed [specie], a little small for its kind."
|
||||
surprise.desc = "Looks like \a very deformed [specie], a little small for its kind. It shows no signs of life."
|
||||
surprise.transform *= 0.6
|
||||
surprise.add_blood(M)
|
||||
|
||||
@@ -1585,10 +1585,7 @@
|
||||
E.cavity = 0
|
||||
else //someone is having a bad day
|
||||
E.createwound(CUT, 30)
|
||||
E.implants += surprise
|
||||
H.visible_message("<span class='danger'>Something that looks like \a [surprise] sticks out of a wound!</span>")
|
||||
H.embedded_flag = 1
|
||||
H.verbs += /mob/proc/yank_out_object
|
||||
E.embed(surprise)
|
||||
else if (ismonkey(M))
|
||||
M.visible_message("<span class='danger'>[M] suddenly tears in half!</span>")
|
||||
surprise.loc = M.loc
|
||||
|
||||
Reference in New Issue
Block a user