Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes lack of immersive wound treatment #11239

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/datums/surgery/steps/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
loot = parent_organ.implants
else
for(var/datum/wound/W in parent_organ.wounds)
loot |= W.embedded_objects
if(LAZYLEN(W.embedded_objects))
loot |= W.embedded_objects
find_prob += 50

if(!length(loot))
Expand Down
8 changes: 8 additions & 0 deletions code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,15 @@
W.heal_damage(heal_brute)
used++
affecting.update_damages()
if(affecting.update_damstate())
H.UpdateDamageIcon()
if(used == get_amount())
if(affecting.is_bandaged())
to_chat(user, SPAN("warning", "\The [src] is used up."))
else
to_chat(user, SPAN("warning", "\The [src] is used up, but there are more wounds to treat on \the [affecting.name]."))
use(used)
H.update_bandages(1)

/obj/item/stack/medical/ointment
name = "ointment"
Expand Down Expand Up @@ -270,12 +273,15 @@
W.heal_damage(heal_brute)
used++
affecting.update_damages()
if(affecting.update_damstate())
H.UpdateDamageIcon()
if(used == get_amount())
if(affecting.is_bandaged())
to_chat(user, SPAN("warning", "\The [src] is used up."))
else
to_chat(user, SPAN("warning", "\The [src] is used up, but there are more wounds to treat on \the [affecting.name]."))
use(used)
H.update_bandages(1)

/obj/item/stack/medical/advanced/ointment
name = "burn gel"
Expand Down Expand Up @@ -429,6 +435,8 @@
W.bandage()
used++
affecting.update_damages()
if(affecting.update_damstate())
H.UpdateDamageIcon()
if(used == get_amount())
if(affecting.is_bandaged())
to_chat(user, SPAN("warning", "\The [src] is used up."))
Expand Down
13 changes: 10 additions & 3 deletions code/modules/mob/living/carbon/human/body_build.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ var/global/datum/body_build/default_body_build = new
"slot_r_hand" = 'icons/mob/onmob/items/righthand.dmi'
)

var/rig_back = 'icons/inv_slots/rig/mob.dmi'
var/blood_icon = 'icons/mob/human_races/masks/blood_human.dmi'
var/dam_mask = 'icons/mob/human_races/masks/dam_mask_human.dmi'
var/rig_back = 'icons/inv_slots/rig/mob.dmi'
var/blood_icon = 'icons/mob/human_races/masks/blood_human.dmi'
var/dam_mask = 'icons/mob/human_races/masks/dam_mask_human.dmi'
var/bandages_icon = 'icons/mob/human_races/bandages/mob.dmi'

var/slowdown = 0 // Movement slowdown
var/equipment_modifier = 0 // Positive values allow to partially ignore equipment_slowdown, negative values apply additional slowdown if any slowing-down equipment is being worn
Expand Down Expand Up @@ -80,6 +81,7 @@ var/global/datum/body_build/default_body_build = new
rig_back = 'icons/inv_slots/rig/mob_slim.dmi'
blood_icon = 'icons/mob/human_races/masks/blood_human_slim.dmi'
dam_mask = 'icons/mob/human_races/masks/dam_mask_human_slim.dmi'
bandages_icon = 'icons/mob/human_races/bandages/mob_slim.dmi'

stomach_capacity = STOMACH_CAPACITY_LOW
poise_pool = HUMAN_LOW_POISE
Expand Down Expand Up @@ -110,6 +112,7 @@ var/global/datum/body_build/default_body_build = new
)
blood_icon = 'icons/mob/human_races/masks/blood_human_slim_alt.dmi'
dam_mask = 'icons/mob/human_races/masks/dam_mask_human_slim_alt.dmi'
bandages_icon = 'icons/mob/human_races/bandages/mob_slim_alt.dmi'

/datum/body_build/slim/male
name = "Slim"
Expand Down Expand Up @@ -165,6 +168,7 @@ var/global/datum/body_build/default_body_build = new
rig_back = 'icons/inv_slots/rig/mob_fat.dmi'
blood_icon = 'icons/mob/human_races/masks/blood_human.dmi'
dam_mask = 'icons/mob/human_races/masks/dam_mask_human.dmi'
bandages_icon = 'icons/mob/human_races/bandages/mob_fat.dmi'

stomach_capacity = STOMACH_CAPACITY_HIGH
slowdown = 0.5
Expand Down Expand Up @@ -249,6 +253,7 @@ var/global/datum/body_build/default_body_build = new
"slot_r_hand" = 'icons/mob/onmob/items/righthand.dmi'
)
rig_back = 'icons/inv_slots/rig/mob_fat.dmi'
bandages_icon = 'icons/mob/human_races/bandages/mob_fat.dmi'

slowdown = 0.5
equipment_modifier = 0.5
Expand Down Expand Up @@ -327,6 +332,7 @@ var/global/datum/body_build/default_body_build = new
)
blood_icon = 'icons/mob/human_races/masks/blood_monkey.dmi'
dam_mask = 'icons/mob/human_races/masks/dam_mask_monkey.dmi'
bandages_icon = null

stomach_capacity = STOMACH_CAPACITY_LOW

Expand All @@ -337,5 +343,6 @@ var/global/datum/body_build/default_body_build = new
genders = list(MALE, FEMALE, NEUTER)
blood_icon = null // Fuck it, I ain't gonna spend all day showering if I'm an apex predator
dam_mask = 'icons/mob/human_races/masks/dam_mask_xenos.dmi'
bandages_icon = null

poise_pool = HUMAN_MAX_POISE
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
else
if(E.is_stump())
wound_flavor_text[E.name] += "<b>[T.He] [T.has] a stump where [T.his] [organ_descriptor] should be.</b>\n"
if(E.wounds.len && E.parent)
if(LAZYLEN(E.wounds) && E.parent)
wound_flavor_text[E.name] += "[T.He] [T.has] [E.get_wounds_desc()] on [T.his] [E.parent.name].<br>"
else
if(!is_synth && BP_IS_ROBOTIC(E) && (E.parent && !BP_IS_ROBOTIC(E.parent) && !BP_IS_ASSISTED(E.parent)))
Expand All @@ -261,7 +261,7 @@

for(var/datum/wound/wound in E.wounds)
var/list/embedlist = wound.embedded_objects
if(embedlist.len)
if(LAZYLEN(embedlist))
shown_objects += embedlist
var/parsedembed[0]
for(var/obj/embedded in embedlist)
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -379,20 +379,25 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t
//Heal MANY external organs, in random order
/mob/living/carbon/human/heal_overall_damage(brute, burn)
var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn)
var/should_update_damage_icon = FALSE

while(parts.len && (brute>0 || burn>0) )
var/obj/item/organ/external/picked = pick(parts)

var/brute_was = picked.brute_dam
var/burn_was = picked.burn_dam

picked.heal_damage(brute,burn)
if(picked.heal_damage(brute,burn, update_damage_icon = FALSE))
should_update_damage_icon = TRUE

brute -= (brute_was-picked.brute_dam)
burn -= (burn_was-picked.burn_dam)

parts -= picked
updatehealth()
if(should_update_damage_icon)
UpdateDamageIcon()

BITSET(hud_updateflag, HEALTH_HUD)

// damage MANY external organs, in random order
Expand Down
12 changes: 10 additions & 2 deletions code/modules/mob/living/carbon/human/human_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,22 @@
handle_stance()
handle_grasp()

if(!force_process && !bad_external_organs.len)
if(!force_process && !LAZYLEN(bad_external_organs))
return

var/should_update_damage_icon = FALSE

for(var/obj/item/organ/external/E in bad_external_organs)
if(!E)
continue
if(!E.need_process())
bad_external_organs -= E
should_update_damage_icon = TRUE
continue
else
E.think()
if(E.should_update_damage_icons_this_tick)
should_update_damage_icon = TRUE

if(!lying && !buckled && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
Expand All @@ -121,11 +126,14 @@
Stun(2)

//Moving makes open wounds get infected much faster
if(E.wounds.len)
if(LAZYLEN(E.wounds))
for(var/datum/wound/W in E.wounds)
if(W.infection_check())
W.germ_level += 1

if(should_update_damage_icon)
UpdateDamageIcon()

/mob/living/carbon/human/proc/handle_stance()
// Don't need to process any of this if they aren't standing anyways
// unless their stance is damaged, and we want to check if they should stay down
Expand Down
67 changes: 43 additions & 24 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,31 @@ Please contact me on #coderbus IRC. ~Carn x
#define HO_SURGERY_LAYER 5
#define HO_UNDERWEAR_LAYER 6
#define HO_UNIFORM_LAYER 7
#define HO_ID_LAYER 8
#define HO_SHOES_LAYER 9
#define HO_GLOVES_LAYER 10
#define HO_BELT_LAYER 11
#define HO_SUIT_LAYER 12
#define HO_TAIL_LAYER 13 //bs12 specific. this hack is probably gonna come back to haunt me
#define HO_GLASSES_LAYER 14
#define HO_BELT_LAYER_ALT 15
#define HO_SUIT_STORE_LAYER 16
#define HO_BACK_LAYER 17
#define HO_DEFORM_LAYER 18
#define HO_HAIR_LAYER 19
#define HO_GOGGLES_LAYER 20
#define HO_EARS_LAYER 21
#define HO_FACEMASK_LAYER 22
#define HO_HEAD_LAYER 23
#define HO_COLLAR_LAYER 24
#define HO_HANDCUFF_LAYER 25
#define HO_L_HAND_LAYER 26
#define HO_R_HAND_LAYER 27
#define HO_FIRE_LAYER 28 //If you're on fire
#define HO_MODIFIER_EFFECTS_LAYER 29
#define HO_TARGETED_LAYER 30 //BS12: Layer for the target overlay from weapon targeting system
#define HO_TOTAL_LAYERS 30
#define HO_BANDAGE_LAYER 8
#define HO_ID_LAYER 9
#define HO_SHOES_LAYER 10
#define HO_GLOVES_LAYER 11
#define HO_BELT_LAYER 12
#define HO_SUIT_LAYER 13
#define HO_TAIL_LAYER 14 //bs12 specific. this hack is probably gonna come back to haunt me
#define HO_GLASSES_LAYER 15
#define HO_BELT_LAYER_ALT 16
#define HO_SUIT_STORE_LAYER 17
#define HO_BACK_LAYER 18
#define HO_DEFORM_LAYER 19
#define HO_HAIR_LAYER 20
#define HO_GOGGLES_LAYER 21
#define HO_EARS_LAYER 22
#define HO_FACEMASK_LAYER 23
#define HO_HEAD_LAYER 24
#define HO_COLLAR_LAYER 25
#define HO_HANDCUFF_LAYER 26
#define HO_L_HAND_LAYER 27
#define HO_R_HAND_LAYER 28
#define HO_FIRE_LAYER 29 //If you're on fire
#define HO_MODIFIER_EFFECTS_LAYER 30
#define HO_TARGETED_LAYER 31 //BS12: Layer for the target overlay from weapon targeting system
#define HO_TOTAL_LAYERS 31
//////////////////////////////////

/mob/living/carbon/human
Expand Down Expand Up @@ -249,10 +250,28 @@ var/global/list/damage_icon_parts = list()
standing_image.AddOverlays(DI)

overlays_standing[HO_DAMAGE_LAYER] = standing_image
update_bandages(update_icons)

if(update_icons)
queue_icon_update()

/mob/living/carbon/human/proc/update_bandages(update_icons = TRUE)
var/bandage_icon = body_build.bandages_icon
if(!bandage_icon)
return
var/image/standing_image = image(bandage_icon, icon_state = "0")
if(overlays_standing[HO_DAMAGE_LAYER])
for(var/obj/item/organ/external/O in organs)
if(O.is_stump())
continue
var/bandage_level = O.bandage_level()
if(bandage_level)
standing_image.AddOverlays(image(bandage_icon, "[O.icon_name][bandage_level]"))

overlays_standing[HO_BANDAGE_LAYER] = standing_image
if(update_icons)
queue_icon_update()

//BASE MOB SPRITE
/mob/living/carbon/human/proc/update_body(update_icons = TRUE)
//Update all limbs and visible organs one by one
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@

affected.implants -= selection
for(var/datum/wound/wound in affected.wounds)
wound.embedded_objects -= selection
LAZYREMOVE(wound.embedded_objects, selection)

H.shock_stage+=20
affected.take_external_damage((selection.w_class * 3), 0, DAM_EDGE, "Embedded object extraction")
Expand Down
Loading
Loading