mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fixes a few issues with the organ system.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4722 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -290,9 +290,9 @@
|
||||
flavor_text_string += ","
|
||||
flavor_text_string += flavor_text[text]
|
||||
flavor_text_string += " on [t_his] [temp.display_name].</span><br>"
|
||||
wound_flavor_text["[temp.name]"] = flavor_text_string
|
||||
wound_flavor_text["[temp.display_name]"] = flavor_text_string
|
||||
if(temp.status & ORGAN_BLEEDING)
|
||||
is_bleeding["[temp.name]"] = 1
|
||||
is_bleeding["[temp.display_name]"] = 1
|
||||
else
|
||||
wound_flavor_text["[temp.display_name]"] = ""
|
||||
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
organ.parent = organs_by_name["l_leg"]
|
||||
organ = organs_by_name["r_foot"]
|
||||
organ.parent = organs_by_name["r_leg"]
|
||||
organ = organs_by_name["r_foot"]
|
||||
organ.parent = organs_by_name["r_leg"]
|
||||
organ = organs_by_name["head"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["r_leg"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["l_leg"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["r_arm"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["l_arm"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
|
||||
for(var/name in organs_by_name)
|
||||
organs += organs_by_name[name]
|
||||
@@ -218,6 +230,15 @@
|
||||
Paralyse(10)
|
||||
|
||||
var/update = 0
|
||||
|
||||
// focus most of the blast on one organ
|
||||
var/datum/organ/external/take_blast = pick(organs)
|
||||
update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9)
|
||||
|
||||
// distribute the remaining 10% on all limbs equally
|
||||
b_loss *= 0.1
|
||||
f_loss *= 0.1
|
||||
|
||||
for(var/datum/organ/external/temp in organs)
|
||||
switch(temp.name)
|
||||
if("head")
|
||||
@@ -542,7 +563,7 @@
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
/mob/living/carbon/human/proc/get_face_name()
|
||||
var/datum/organ/external/head/head = get_organ("head")
|
||||
if( !head || head.disfigured || !real_name ) //disfigured. use id-name if possible
|
||||
if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name ) //disfigured. use id-name if possible
|
||||
return "Unknown"
|
||||
return real_name
|
||||
|
||||
|
||||
@@ -152,15 +152,13 @@
|
||||
if(!zone) zone = "chest"
|
||||
return organs_by_name[zone]
|
||||
|
||||
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/obj/item/weapon)
|
||||
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0)
|
||||
if((damagetype != BRUTE) && (damagetype != BURN))
|
||||
..(damage, damagetype, def_zone, blocked)
|
||||
return 1
|
||||
|
||||
if(blocked >= 2) return 0
|
||||
|
||||
var/sharp = weapon.sharp
|
||||
|
||||
var/datum/organ/external/organ = null
|
||||
if(isorgan(def_zone))
|
||||
organ = def_zone
|
||||
|
||||
@@ -126,7 +126,7 @@ emp_act
|
||||
if(armor >= 2) return 0
|
||||
if(!I.force) return 0
|
||||
|
||||
apply_damage(I.force, I.damtype, affecting, armor , I)
|
||||
apply_damage(I.force, I.damtype, affecting, armor , I.sharp)
|
||||
|
||||
var/bloody = 0
|
||||
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
|
||||
|
||||
@@ -19,6 +19,13 @@
|
||||
if(shoes)
|
||||
tally += shoes.slowdown
|
||||
|
||||
for(var/organ_name in list("l_foot","r_foot","l_leg","r_leg"))
|
||||
var/datum/organ/external/E = get_organ(organ_name)
|
||||
if(!E || (E.status & ORGAN_DESTROYED))
|
||||
tally += 4
|
||||
else if(E.status & ORGAN_BROKEN)
|
||||
tally += 1.5
|
||||
|
||||
if(FAT in src.mutations)
|
||||
tally += 1.5
|
||||
if (bodytemperature < 283.222)
|
||||
|
||||
@@ -6,6 +6,54 @@
|
||||
del(W)
|
||||
return null
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/has_organ(name)
|
||||
var/datum/organ/external/O = organs_by_name[name]
|
||||
|
||||
return (O && !(O.status & ORGAN_DESTROYED) )
|
||||
|
||||
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
|
||||
switch(slot)
|
||||
if(slot_back)
|
||||
return has_organ("chest")
|
||||
if(slot_wear_mask)
|
||||
return has_organ("head")
|
||||
if(slot_handcuffed)
|
||||
return has_organ("l_hand") && has_organ("r_hand")
|
||||
if(slot_legcuffed)
|
||||
return has_organ("l_leg") && has_organ("r_leg")
|
||||
if(slot_l_hand)
|
||||
return has_organ("l_hand")
|
||||
if(slot_r_hand)
|
||||
return has_organ("r_hand")
|
||||
if(slot_belt)
|
||||
return has_organ("groin")
|
||||
if(slot_wear_id)
|
||||
// the only relevant check for this is the uniform check
|
||||
return 1
|
||||
if(slot_ears)
|
||||
return has_organ("head")
|
||||
if(slot_glasses)
|
||||
return has_organ("head")
|
||||
if(slot_gloves)
|
||||
return has_organ("l_hand") && has_organ("r_hand")
|
||||
if(slot_head)
|
||||
return has_organ("head")
|
||||
if(slot_shoes)
|
||||
return has_organ("r_foot") && has_organ("l_foot")
|
||||
if(slot_wear_suit)
|
||||
return has_organ("chest")
|
||||
if(slot_w_uniform)
|
||||
return has_organ("chest")
|
||||
if(slot_l_store)
|
||||
return has_organ("groin")
|
||||
if(slot_r_store)
|
||||
return has_organ("chest")
|
||||
if(slot_s_store)
|
||||
return has_organ("chest")
|
||||
if(slot_in_backpack)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/u_equip(obj/item/W as obj)
|
||||
if(!W) return 0
|
||||
|
||||
@@ -124,6 +172,7 @@
|
||||
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
|
||||
if(!slot) return
|
||||
if(!istype(W)) return
|
||||
if(!has_organ_for_slot(slot)) return
|
||||
|
||||
if(W == src.l_hand)
|
||||
src.l_hand = null
|
||||
@@ -550,7 +599,7 @@ It can still be worn/put on as normal.
|
||||
if(target.r_store)
|
||||
target.u_equip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
|
||||
else
|
||||
if(item) //Placing an item on the mob
|
||||
if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob
|
||||
if(item.mob_can_equip(target, slot_to_process, 0))
|
||||
source.u_equip(item)
|
||||
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
|
||||
|
||||
@@ -228,8 +228,8 @@
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
if(!(E.status & ORGAN_SPLINTED))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
// can't stand
|
||||
if(leg_tally == 0 && !paralysis && !(lying || resting))
|
||||
// standing is poor
|
||||
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
@@ -295,6 +295,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
stand_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
if(update_icons) update_icons()
|
||||
|
||||
|
||||
//HAIR OVERLAY
|
||||
@@ -303,8 +304,13 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
overlays_lying[HAIR_LAYER] = null
|
||||
overlays_standing[HAIR_LAYER] = null
|
||||
|
||||
var/datum/organ/external/head/head = get_organ("head")
|
||||
if( !head || (head.status & ORGAN_DESTROYED) )
|
||||
if(update_icons) update_icons()
|
||||
return
|
||||
|
||||
//mutants don't have hair. masks and helmets can obscure our hair too.
|
||||
if( (dna && dna.mutantrace) || (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)) )
|
||||
if( (dna && dna.mutantrace) || (head && (head.status & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
|
||||
if(update_icons) update_icons()
|
||||
return
|
||||
|
||||
@@ -425,6 +431,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
update_inv_handcuffed(0)
|
||||
update_inv_legcuffed(0)
|
||||
update_inv_pockets(0)
|
||||
UpdateDamageIcon()
|
||||
update_icons()
|
||||
//Hud Stuff
|
||||
update_hud()
|
||||
|
||||
Reference in New Issue
Block a user