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

[IDB IGNORE] [MDB IGNORE] HUD datum cleanup. #3114

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fc9ef41
Adding get_max_health() to mobs.
MistakeNot4892 Jul 24, 2023
74de147
Condensing updatehealth().
MistakeNot4892 Jul 24, 2023
1b02408
Removing unneeded health var setting.
MistakeNot4892 Jul 24, 2023
c2d4bf4
mob health > current_health.
MistakeNot4892 Jul 24, 2023
545294f
Post-rebase update.
MistakeNot4892 Aug 12, 2023
4eada00
updatehealth() => update_health()
MistakeNot4892 Aug 12, 2023
dead6e4
Adding update health skips to human organ init.
MistakeNot4892 Aug 12, 2023
97f8141
Reviewing calls to update_health().
MistakeNot4892 Aug 12, 2023
1fb2b67
Wrapping update_health() with adjustFooLoss() where possible.
MistakeNot4892 Aug 12, 2023
4b05e1a
Removing hivebot telebeacon and preventing drones from sparking in qdel.
MistakeNot4892 Aug 23, 2023
6b6aa24
Fixing runtimes in /mob/living creation/qdel.
MistakeNot4892 Aug 30, 2023
9623a75
Splitting up borer Life() proc.
MistakeNot4892 Jul 1, 2023
f725f56
Splitting up Ascent nymph Life() proc.
MistakeNot4892 Jul 1, 2023
f547224
Removing construct Life() overrides.
MistakeNot4892 Jul 2, 2023
da63fed
Collapsed deity life proc.
MistakeNot4892 Jul 2, 2023
0384393
Collapsing other Life() overrides.
MistakeNot4892 Jul 2, 2023
6384fed
Tweaking robot life() overrides.
MistakeNot4892 Jul 2, 2023
261f335
Collapsing more life overrides.
MistakeNot4892 Jul 2, 2023
ef668e9
Slime life override broken up.
MistakeNot4892 Jul 2, 2023
a7a75e8
Collapsing carbon/Life() into living/Life().
MistakeNot4892 Jul 2, 2023
cb2e54c
Dismantling simple_animal Life().
MistakeNot4892 Jul 2, 2023
2ff07e8
Dismantling exosuit Life().
MistakeNot4892 Jul 2, 2023
0b69a97
Further refinement of various life procs and processes.
MistakeNot4892 Jul 2, 2023
d7a3463
Cleaning up, condensing blinded status.
MistakeNot4892 Jul 2, 2023
0f33314
Dismantling human life().
MistakeNot4892 Jul 2, 2023
905a73d
Further refining status updates.
MistakeNot4892 Jul 2, 2023
a44a017
Dismantling pAI Life().
MistakeNot4892 Jul 2, 2023
817450b
Dismantling robot life().
MistakeNot4892 Jul 2, 2023
5640831
Dismantling AI life().
MistakeNot4892 Jul 2, 2023
a15e1be
Reverting some status changes.
MistakeNot4892 Jul 2, 2023
c536508
Post-rebase update.
MistakeNot4892 Jul 2, 2023
df08fd4
Condensed HUD rewrite commit, do not merge.
MistakeNot4892 Jun 16, 2023
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
Prev Previous commit
Next Next commit
Cleaning up, condensing blinded status.
  • Loading branch information
MistakeNot4892 committed Nov 3, 2023
commit d7a34632ec19c113279e980f01b84217936cf5e0
7 changes: 3 additions & 4 deletions code/__defines/mob_status.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#define PENDING_STATUS(MOB, COND) (LAZYACCESS(MOB.pending_status_counters, COND) || LAZYACCESS(MOB.status_counters, COND))
#define GET_STATUS(MOB, COND) (LAZYACCESS(MOB.status_counters, COND))
#define HAS_STATUS(MOB, COND) (GET_STATUS(MOB, COND) > 0)
#define ADJ_STATUS(MOB, COND, AMT) (MOB.set_status(COND, PENDING_STATUS(MOB, COND) + AMT))
#define SET_STATUS_MAX(MOB, COND, AMT) (MOB.set_status(COND, max(PENDING_STATUS(MOB, COND), AMT)))
#define HAS_STATUS(MOB, COND) ((LAZYACCESS(MOB.pending_status_counters, COND) || LAZYACCESS(MOB.status_counters, COND)) > 0)
#define ADJ_STATUS(MOB, COND, AMT) (MOB.set_status(COND, HAS_STATUS(MOB, COND) + AMT))
#define SET_STATUS_MAX(MOB, COND, AMT) (MOB.set_status(COND, max(HAS_STATUS(MOB, COND), AMT)))
2 changes: 1 addition & 1 deletion code/modules/clothing/_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

/obj/item/clothing/equipped(var/mob/user)
if(needs_vision_update())
update_vision()
update_wearer_vision()
return ..()

/obj/item/clothing/proc/refit_for_bodytype(var/target_bodytype)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/glasses/_glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
active = _active
update_icon()
update_clothing_icon()
update_vision()
update_wearer_vision()

/obj/item/clothing/glasses/on_update_icon()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/head/misc_special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
to_chat(usr, "You push the [src] up out of your face.")
update_icon()
update_vision()
update_wearer_vision()
usr.update_action_buttons()

/obj/item/clothing/head/welding/on_update_icon()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/rig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
LAZYSET(chest.slowdown_per_slot, slot_wear_suit_str, (active? online_slowdown : offline_slowdown))
if(helmet)
helmet.tint = (active? vision_restriction : offline_vision_restriction)
helmet.update_vision()
helmet.update_wearer_vision()

/obj/item/rig/proc/suit_is_deployed()
if(!istype(wearer) || src.loc != wearer || wearer.get_equipped_item(slot_back_str) != src)
Expand Down
13 changes: 8 additions & 5 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@
return ONE_ATMOSPHERE + pressure_difference

/mob/living/carbon/human/handle_impaired_vision()
..()

. = ..()
if(!.)
return

//Vision
var/obj/item/organ/vision
var/decl/bodytype/root_bodytype = get_bodytype()
Expand All @@ -162,10 +166,9 @@

/mob/living/carbon/human/handle_disabilities()
..()
if(stat != DEAD)
if ((disabilities & COUGHING) && prob(5) && GET_STATUS(src, STAT_PARA) <= 1)
drop_held_items()
cough()
if(stat != DEAD && (disabilities & COUGHING) && prob(5) && GET_STATUS(src, STAT_PARA) <= 1)
drop_held_items()
cough()

/mob/living/carbon/human/handle_mutations_and_radiation()
if(getFireLoss())
Expand Down
9 changes: 7 additions & 2 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,14 @@
handle_impaired_hearing()

/mob/living/proc/handle_impaired_vision()
if((sdisabilities & BLINDED) || stat) //blindness from disability or unconsciousness doesn't get better on its own
SHOULD_CALL_PARENT(TRUE)
if(stat == DEAD)
SET_STATUS_MAX(src, STAT_BLIND, 0)
if(stat != CONSCIOUS && (sdisabilities & BLINDED)) //blindness from disability or unconsciousness doesn't get better on its own
SET_STATUS_MAX(src, STAT_BLIND, 2)
else
return TRUE
return FALSE

/mob/living/proc/handle_impaired_hearing()
if((sdisabilities & DEAFENED) || stat) //disabled-deaf, doesn't get better on its own
Expand Down Expand Up @@ -350,7 +356,6 @@
lighting_master.set_alpha(target_value)

/mob/living/proc/handle_vision()
blinded = FALSE
update_sight()
if(stat == DEAD)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if(!cond.check_can_set(src))
return FALSE
amount = clamp(amount, 0, 1000)
if(amount == PENDING_STATUS(src, condition))
if(amount == HAS_STATUS(src, condition))
return FALSE
LAZYSET(pending_status_counters, condition, amount)
addtimer(CALLBACK(src, .proc/apply_pending_status_changes), 0, TIMER_UNIQUE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ var/global/list/simplemob_icon_bitflag_cache = list()
handle_bleeding()
if(is_aquatic && !submerged())
walk(src, 0)
if(PENDING_STATUS(src, STAT_PARA))
if(HAS_STATUS(src, STAT_PARA))
SET_STATUS_MAX(src, STAT_PARA, 3)
update_icon()

Expand Down
1 change: 0 additions & 1 deletion mods/mobs/borers/mob/borer/borer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@

/mob/living/simple_animal/borer/handle_vision()
. = ..()
blinded = !!host?.blinded
set_status(STAT_BLIND, host ? GET_STATUS(host, STAT_BLIND) : 0)
set_status(STAT_BLURRY, host ? GET_STATUS(host, STAT_BLURRY) : 0)

Expand Down