diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 6b9fc0d6ba..f371ccccfb 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -260,6 +260,7 @@ #define COMPONENT_EXAMINATE_BLIND 3 //outputs the "something is there but you can't see it" message. #define COMSIG_MOB_DEATH "mob_death" //from base of mob/death(): (gibbed) #define COMPONENT_BLOCK_DEATH_BROADCAST 1 //stops the death from being broadcasted in deadchat. +#define COMSIG_MOB_STATCHANGE "mob_statchange" //!from base of mob/set_stat(): (new_stat, old_stat) #define COMSIG_MOB_CLICKON "mob_clickon" //from base of mob/clickon(): (atom/A, params) #define COMSIG_MOB_CANCEL_CLICKON 1 #define COMSIG_MOB_GHOSTIZE "mob_ghostize" //from base of mob/Ghostize(): (can_reenter_corpse, special, penalize) diff --git a/code/datums/action.dm b/code/datums/action.dm index f27c1fcabb..4c9099fc72 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -49,6 +49,10 @@ Remove(owner) owner = M RegisterSignal(owner, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE) + // Register some signals based on our check_flags + // so that our button icon updates when relevant + if(check_flags & AB_CHECK_CONSCIOUS) + RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(update_status_on_signal)) GiveAction(M) @@ -68,7 +72,10 @@ viewers = list() if(owner) - UnregisterSignal(owner, COMSIG_PARENT_QDELETING) + UnregisterSignal(owner, list( + COMSIG_PARENT_QDELETING, + COMSIG_MOB_STATCHANGE + )) if(target == owner) RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref)) owner = null @@ -218,6 +225,11 @@ our_button.id = bitflag return +/// A general use signal proc that reacts to an event and updates JUST our button's status +/datum/action/proc/update_status_on_signal(datum/source, new_stat, old_stat) + SIGNAL_HANDLER + UpdateButton(status_only = TRUE) + //Presets for item actions /datum/action/item_action check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index 3b1a8d804d..aaf3b37864 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -369,7 +369,7 @@ C.set_species(selected) C.set_resting(TRUE, TRUE) // Don't want to cause it to deathgasp.. - C.stat = DEAD + C.set_stat(DEAD) C.adjustOxyLoss(200) // Limb replacement causes toxloss, which can cause too much suffering for the doctor that I don't want C.adjustCloneLoss(45) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index a713ddfbf4..bc5b37655b 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -10,6 +10,7 @@ var/icon_door = null var/icon_door_override = FALSE //override to have open overlay use icon different to its base's + var/has_door_icon = TRUE // Set to false to skip trying to draw a door icon. var/secure = FALSE //secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights var/opened = FALSE var/welded = FALSE @@ -76,7 +77,7 @@ . += "[icon_door_override ? icon_door : icon_state]_open" return - if(icon_door) + if(has_door_icon) . += "[icon_door || icon_state]_door" if(welded) . += icon_welded diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index fc0b7c96c8..f6e1e6fe9e 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -3,7 +3,7 @@ name = "large cardboard box" desc = "Just a box..." icon_state = "cardboard" - icon_door = null + has_door_icon = FALSE mob_storage_capacity = 1 resistance_flags = FLAMMABLE max_integrity = 70 diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm index a3b7fd4c0f..023bbbe1e3 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm @@ -241,7 +241,7 @@ owner.current.Unconscious(20, 1) /datum/antagonist/bloodsucker/proc/Torpor_Begin(amInCoffin = FALSE) - owner.current.stat = UNCONSCIOUS + owner.current.set_stat(UNCONSCIOUS) owner.current.apply_status_effect(STATUS_EFFECT_UNCONSCIOUS) ADD_TRAIT(owner.current, TRAIT_FAKEDEATH, "bloodsucker") // Come after UNCONSCIOUS or else it fails ADD_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker") // Without this, you'll just keep dying while you recover. @@ -260,7 +260,7 @@ to_chat(owner.current, "Your body keeps you going, even as you try to end yourself.") /datum/antagonist/bloodsucker/proc/Torpor_End() - owner.current.stat = SOFT_CRIT + owner.current.set_stat(SOFT_CRIT) owner.current.remove_status_effect(STATUS_EFFECT_UNCONSCIOUS) REMOVE_TRAIT(owner.current, TRAIT_FAKEDEATH, "bloodsucker") REMOVE_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker") diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm index 019bbe6fbd..dc16ecef1e 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm @@ -50,6 +50,7 @@ // click.dm <--- Where we can take over mouse clicks // spells.dm /add_ranged_ability() <--- How we take over the mouse click to use a power on a target. +// TODO: Refactor this to use /Activate(). /datum/action/cooldown/bloodsucker/Trigger() // Active? DEACTIVATE AND END! if(active && CheckCanDeactivate(TRUE)) @@ -130,7 +131,7 @@ /datum/action/cooldown/bloodsucker/proc/CheckCanDeactivate(display_error) return TRUE -/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, force = FALSE) +/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE) background_icon_state = active? background_icon_state_on : background_icon_state_off ..()//UpdateButton() @@ -179,6 +180,7 @@ bs_proc_holder = new () bs_proc_holder.linked_power = src +// TODO: Refactor this to use /Activate() and click_to_activate = TRUE. // Click power: Begin Aim /datum/action/cooldown/bloodsucker/targeted/Trigger() if(active && CheckCanDeactivate(TRUE)) diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index f013e56737..14c1ad9421 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -56,7 +56,7 @@ mind.announce_objectives() /mob/living/carbon/true_devil/death(gibbed) - stat = DEAD + set_stat(DEAD) ..(gibbed) drop_all_held_items() INVOKE_ASYNC(mind.has_antag_datum(/datum/antagonist/devil), TYPE_PROC_REF(/datum/antagonist/devil, beginResurrectionCheck), src) diff --git a/code/modules/antagonists/disease/disease_abilities.dm b/code/modules/antagonists/disease/disease_abilities.dm index fc53575bd8..0b5258dd50 100644 --- a/code/modules/antagonists/disease/disease_abilities.dm +++ b/code/modules/antagonists/disease/disease_abilities.dm @@ -169,9 +169,7 @@ new /datum/disease_ability/symptom/powerful/youth desc = "Force the host you are following to cough with extra force, spreading your infection to those within two meters of your host even if your transmissibility is low.
Cooldown: 10 seconds" cooldown_time = 100 -/datum/action/cooldown/disease_cough/Trigger() - if(!..()) - return FALSE +/datum/action/cooldown/disease_cough/Activate() var/mob/camera/disease/D = owner var/mob/living/L = D.following_host if(!L) @@ -201,9 +199,7 @@ new /datum/disease_ability/symptom/powerful/youth desc = "Force the host you are following to sneeze with extra force, spreading your infection to any victims in a 4 meter cone in front of your host even if your transmissibility is low.
Cooldown: 20 seconds" cooldown_time = 200 -/datum/action/cooldown/disease_sneeze/Trigger() - if(!..()) - return FALSE +/datum/action/cooldown/disease_sneeze/Activate() var/mob/camera/disease/D = owner var/mob/living/L = D.following_host if(!L) @@ -237,9 +233,7 @@ new /datum/disease_ability/symptom/powerful/youth desc = "Cause the host you are following to excrete an infective substance from their pores, causing all objects touching their skin to transmit your infection to anyone who touches them for the next 30 seconds.
Cooldown: 40 seconds" cooldown_time = 400 -/datum/action/cooldown/disease_infect/Trigger() - if(!..()) - return FALSE +/datum/action/cooldown/disease_infect/Activate() var/mob/camera/disease/D = owner var/mob/living/carbon/human/H = D.following_host if(!H) diff --git a/code/modules/antagonists/gang/gang.dm b/code/modules/antagonists/gang/gang.dm index dd90d4b57b..e41c7b1228 100644 --- a/code/modules/antagonists/gang/gang.dm +++ b/code/modules/antagonists/gang/gang.dm @@ -226,19 +226,11 @@ /// The family antagonist datum of the "owner" of this action. var/datum/antagonist/gang/my_gang_datum -/datum/action/cooldown/spawn_induction_package/Trigger() - if(!..()) - return FALSE - if(!IsAvailable()) - return FALSE +/datum/action/cooldown/spawn_induction_package/Activate() if(!my_gang_datum) return FALSE - if(!istype(owner, /mob/living/carbon/human)) + if(!ishuman(owner)) return FALSE - var/mob/living/carbon/human/H = owner - if(H.stat) - return FALSE - var/obj/item/slapper/secret_handshake/secret_handshake_item = new(owner) if(owner.put_in_hands(secret_handshake_item)) to_chat(owner, span_notice("You ready your secret handshake.")) @@ -248,14 +240,15 @@ return FALSE owner.visible_message(span_notice("[owner] is offering to induct people into the Family."), span_notice("You offer to induct people into the Family."), null, 2) - if(H.has_status_effect(STATUS_EFFECT_HANDSHAKE)) + var/mob/living/living_owner = owner + if(living_owner.has_status_effect(STATUS_EFFECT_HANDSHAKE)) return FALSE if(!(locate(/mob/living/carbon) in orange(1, owner))) owner.visible_message(span_danger("[owner] offers to induct people into the Family, but nobody was around."), \ span_warning("You offer to induct people into the Family, but nobody is around."), null, 2) return FALSE - H.apply_status_effect(STATUS_EFFECT_HANDSHAKE, secret_handshake_item) + living_owner.apply_status_effect(STATUS_EFFECT_HANDSHAKE, secret_handshake_item) StartCooldown() return TRUE diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index 1dba6f8b88..802d9eb5ea 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -87,10 +87,7 @@ button_icon_state = "slam" cooldown_time = 45 SECONDS -/datum/action/cooldown/slam/Trigger() - . = ..() - if(!.) - return +/datum/action/cooldown/slam/Activate() var/mob/living/simple_animal/slaughter/user = owner user.slam_mode = !user.slam_mode to_chat(user, user.slam_mode ? "Ready to slam!" : "Maybe not now.") diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 847d3370c1..f1e586f090 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -75,7 +75,7 @@ brainmob.forceMove(src) brainmob.container = src if(!(newbrain.organ_flags & ORGAN_FAILING)) // the brain organ hasn't been beaten to death. - brainmob.stat = CONSCIOUS //we manually revive the brain mob + brainmob.set_stat(CONSCIOUS) //we manually revive the brain mob brainmob.remove_from_dead_mob_list() brainmob.add_to_alive_mob_list() @@ -112,7 +112,7 @@ if(brain.brainmob) brainmob.container = null //Reset brainmob mmi var. brainmob.forceMove(brain) //Throw mob into brain. - brainmob.stat = DEAD + brainmob.set_stat(DEAD) brainmob.emp_damage = 0 brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision brain.brainmob = brainmob //Set the brain to use the brainmob diff --git a/code/modules/mob/living/brain/death.dm b/code/modules/mob/living/brain/death.dm index 4ee8d6756b..8a0e71de5f 100644 --- a/code/modules/mob/living/brain/death.dm +++ b/code/modules/mob/living/brain/death.dm @@ -1,7 +1,7 @@ /mob/living/brain/death(gibbed) if(stat == DEAD) return - stat = DEAD + set_stat(DEAD) if(!gibbed && container)//If not gibbed but in a container. var/obj/item/mmi = container diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index 0695f32cea..b9db274b65 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -135,7 +135,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) brainmob.stored_dna = new /datum/dna/stored(brainmob) C.dna.copy_dna(brainmob.stored_dna) brainmob.timeofhostdeath = C.timeofdeath - brainmob.stat = CONSCIOUS + brainmob.set_stat(CONSCIOUS) if(brainmob.mind) brainmob.mind.assigned_role = new_role if(C.mind) @@ -158,7 +158,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) name = "[initial(name)] ([brainmob.name])" to_chat(brainmob, welcome_message) brainmob.mind.assigned_role = new_role - brainmob.stat = CONSCIOUS + brainmob.set_stat(CONSCIOUS) brainmob.remove_from_dead_mob_list() brainmob.add_to_alive_mob_list() diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index b22ff68531..48713e0728 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -16,12 +16,12 @@ return if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || health <= crit_threshold) if(stat == CONSCIOUS) - stat = UNCONSCIOUS + set_stat(UNCONSCIOUS) if(!eye_blind) blind_eyes(1) update_mobility() else if(stat == UNCONSCIOUS) - stat = CONSCIOUS + set_stat(CONSCIOUS) if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)) set_resting(FALSE, TRUE) if(eye_blind <= 1) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index efa178de33..86dc221654 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -807,16 +807,16 @@ death() return if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || (health <= HEALTH_THRESHOLD_FULLCRIT && !HAS_TRAIT(src, TRAIT_NOHARDCRIT))) - stat = UNCONSCIOUS + set_stat(UNCONSCIOUS) SEND_SIGNAL(src, COMSIG_DISABLE_COMBAT_MODE) if(!eye_blind) blind_eyes(1) else if(health <= crit_threshold && !HAS_TRAIT(src, TRAIT_NOSOFTCRIT)) - stat = SOFT_CRIT + set_stat(SOFT_CRIT) SEND_SIGNAL(src, COMSIG_DISABLE_COMBAT_MODE) else - stat = CONSCIOUS + set_stat(CONSCIOUS) if(eye_blind <= 1) adjust_blindness(-1) update_mobility() diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 134e7d9cdc..aaf9bf0a7a 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -57,7 +57,7 @@ /mob/living/death(gibbed) SEND_SIGNAL(src, COMSIG_LIVING_PREDEATH, gibbed) - stat = DEAD + set_stat(DEAD) unset_machine() timeofdeath = world.time tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1615b80193..cd69b5ee52 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -626,7 +626,7 @@ remove_from_dead_mob_list() add_to_alive_mob_list() suiciding = 0 - stat = UNCONSCIOUS //the mob starts unconscious, + set_stat(UNCONSCIOUS) //the mob starts unconscious, if(!eye_blind) blind_eyes(1) updatehealth() //then we check if the mob should wake up. diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 6f0306350a..efe94a3261 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -413,7 +413,7 @@ else the_mmi.forceMove(get_turf(src)) if(the_mmi.brainmob.stat == DEAD && !suiciding) - the_mmi.brainmob.stat = CONSCIOUS + the_mmi.brainmob.set_stat(CONSCIOUS) if(mind) mind.transfer_to(the_mmi.brainmob) the_mmi.update_appearance() diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 1506442158..c87c1da0b8 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -79,7 +79,7 @@ death() return else if(stat == UNCONSCIOUS) - stat = CONSCIOUS + set_stat(CONSCIOUS) adjust_blindness(-1) diag_hud_set_status() diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 07cb671706..16f86e8827 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -1,7 +1,7 @@ /mob/living/silicon/pai/death(gibbed) if(stat == DEAD) return - stat = DEAD + set_stat(DEAD) update_mobility() update_sight() wipe_fullscreens() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 2def55c3ee..44e8a41474 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -106,7 +106,7 @@ mmi.forceMove(T) if(mmi.brainmob) if(mmi.brainmob.stat == DEAD) - mmi.brainmob.stat = CONSCIOUS + mmi.brainmob.set_stat(CONSCIOUS) mmi.brainmob.remove_from_dead_mob_list() mmi.brainmob.add_to_alive_mob_list() mind.transfer_to(mmi.brainmob) @@ -922,9 +922,9 @@ toggle_headlamp(1) return if(IsUnconscious() || IsStun() || IsKnockdown() || IsParalyzed() || getOxyLoss() > maxHealth * 0.5) - stat = UNCONSCIOUS + set_stat(UNCONSCIOUS) else - stat = CONSCIOUS + set_stat(CONSCIOUS) update_mobility() diag_hud_set_status() diag_hud_set_health() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index bb3c8f1d32..8111dbb366 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -112,7 +112,7 @@ Difficulty: Normal if(health > 0 || stat == DEAD) return else - stat = DEAD + set_stat(DEAD) blinking = TRUE //we do a fancy animation, release a huge burst(), and leave our staff. burst_range = 10 visible_message("\"Mrmxmexmrk wipj-hiwxvygx wiuyirgi...\"") diff --git a/code/modules/mob/living/simple_animal/hostile/plaguerat.dm b/code/modules/mob/living/simple_animal/hostile/plaguerat.dm index d67064a447..88118d179b 100644 --- a/code/modules/mob/living/simple_animal/hostile/plaguerat.dm +++ b/code/modules/mob/living/simple_animal/hostile/plaguerat.dm @@ -167,10 +167,7 @@ GLOBAL_LIST_EMPTY(plague_rats) button_icon_state = "coffer" cooldown_time = 50 -/datum/action/cooldown/scavenge/Trigger() - . = ..() - if(!.) - return +/datum/action/cooldown/scavenge/Activate() var/turf/T = get_turf(owner) var/loot = rand(1,100) switch(loot) diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 8419271d57..87c7d0519b 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -87,11 +87,9 @@ background_icon_state = "bg_clock" button_icon_state = "coffer" cooldown_time = 50 + check_flags = AB_CHECK_CONSCIOUS -/datum/action/cooldown/coffer/Trigger() - . = ..() - if(!. || owner.stat != CONSCIOUS) - return +/datum/action/cooldown/coffer/Activate() var/turf/T = get_turf(owner) var/loot = rand(1,100) switch(loot) @@ -131,12 +129,10 @@ button_icon_state = "riot" background_icon_state = "bg_clock" cooldown_time = 80 + check_flags = AB_CHECK_CONSCIOUS ///Checks to see if there are any nearby mice. Does not count Rats. -/datum/action/cooldown/riot/Trigger() - . = ..() - if(!. || owner.stat != CONSCIOUS) - return +/datum/action/cooldown/riot/Activate() var/cap = CONFIG_GET(number/ratcap) var/something_from_nothing = FALSE for(var/mob/living/simple_animal/mouse/M in oview(owner, 5)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 3eb2f8bb0f..c7e753744c 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -197,7 +197,7 @@ if(health <= 0) death() else - stat = CONSCIOUS + set_stat(CONSCIOUS) med_hud_set_status() /mob/living/simple_animal/proc/handle_automated_action() diff --git a/code/modules/mob/living/simple_animal/slime/death.dm b/code/modules/mob/living/simple_animal/slime/death.dm index 5cac0c630c..9553fe52b1 100644 --- a/code/modules/mob/living/simple_animal/slime/death.dm +++ b/code/modules/mob/living/simple_animal/slime/death.dm @@ -21,7 +21,7 @@ if(buckled) Feedstop(silent = TRUE) //releases ourselves from the mob we fed on. - stat = DEAD + set_stat(DEAD) cut_overlays() update_mobility() diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 98767a3189..8e66ae14e3 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -134,14 +134,14 @@ if(stat == CONSCIOUS && stasis) to_chat(src, "Nerve gas in the air has put you in stasis!") - stat = UNCONSCIOUS + set_stat(UNCONSCIOUS) powerlevel = 0 rabid = 0 update_mobility() regenerate_icons() else if(stat == UNCONSCIOUS && !stasis) to_chat(src, "You wake up from the stasis.") - stat = CONSCIOUS + set_stat(CONSCIOUS) update_mobility() regenerate_icons() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 72d2f327eb..e9bb92516c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1009,3 +1009,15 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) */ /mob/proc/on_item_dropped(obj/item/I) return + +/** + * Used to wrap stat setting to trigger on-stat-change functionality. + * Must be used instead of directly setting a mob's stat var, + * so that the signal is sent properly. + */ +/mob/proc/set_stat(new_stat) + if(new_stat == stat) + return + . = stat + stat = new_stat + SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .) diff --git a/code/modules/modular_computers/hardware/battery_module.dm b/code/modules/modular_computers/hardware/battery_module.dm index 27d3546ca2..1f2f884bf4 100644 --- a/code/modules/modular_computers/hardware/battery_module.dm +++ b/code/modules/modular_computers/hardware/battery_module.dm @@ -69,6 +69,7 @@ icon_state = "cell_mini" w_class = WEIGHT_CLASS_TINY maxcharge = 750 + has_charge_overlay = FALSE /obj/item/stock_parts/cell/computer/advanced name = "advanced battery" diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index bf8899e5d5..f3587c01b3 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -22,6 +22,8 @@ var/ratingdesc = TRUE ///If it's a grown that acts as a battery, add a wire overlay to it. var/grown_battery = FALSE + /// If true, add the o1 and o2 overlays based on charge level. + var/has_charge_overlay = TRUE rad_flags = RAD_NO_CONTAMINATE // Prevent the same cheese as with the stock parts /obj/item/stock_parts/cell/get_cell() @@ -64,7 +66,7 @@ if(grown_battery) . += image('icons/obj/power.dmi', "grown_wires") return - if(charge < 0.01) + if(!has_charge_overlay || charge < 0.01) return else if(charge/maxcharge >=0.995) . += "cell-o2" diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 03dfc46713..7bebfff07e 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -20,7 +20,9 @@ var/obj/item/stock_parts/cell/cell //What type of power cell this uses var/cell_type = /obj/item/stock_parts/cell - var/modifystate = 0 + var/modifystate = FALSE + /// If TRUE, when modifystate is TRUE this energy gun gets an overlay based on its selected shot type, like "[icon_state]_disable". + var/shot_type_overlay = TRUE /// = TRUE/FALSE decides if the user can switch to it of their own accord var/list/ammo_type = list(/obj/item/ammo_casing/energy = TRUE) /// The index of the ammo_types/firemodes which we're using right now @@ -259,7 +261,11 @@ var/ratio = get_charge_ratio() if (modifystate) var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index] - . += "[icon_state]_[shot.select_name]" + // Some guns, like the mini egun, don't have non-charge mode states. Remove or rework this check when that's fixed. + // Currently, it's entirely too hyperspecific; there's no way to have the non-charge overlay without the charge overlay, for example. + // Oh, well. + if (shot_type_overlay) + . += "[icon_state]_[shot.select_name]" overlay_icon_state += "_[shot.select_name]" if(ratio == 0) . += "[icon_state]_empty" diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index 4fd0220ee3..04563ebc1e 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -21,6 +21,7 @@ charge_sections = 3 gunlight_state = "mini-light" can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update + shot_type_overlay = FALSE /obj/item/gun/energy/e_gun/mini/Initialize(mapload) gun_light = new /obj/item/flashlight/seclite(src) diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index f73ac9cfb8..880542fe31 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -83,6 +83,7 @@ item_state = "laser" desc = "An industrial-grade heavy-duty laser rifle with a modified laser lens to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theoretically infinite use." ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser) + shaded_charge = FALSE /obj/item/gun/energy/laser/cyborg can_charge = FALSE diff --git a/code/modules/projectiles/guns/energy/mounted.dm b/code/modules/projectiles/guns/energy/mounted.dm index 25a94895f8..1cad8f74fe 100644 --- a/code/modules/projectiles/guns/energy/mounted.dm +++ b/code/modules/projectiles/guns/energy/mounted.dm @@ -13,7 +13,7 @@ name = "mounted laser" desc = "An arm mounted cannon that fires lethal lasers." icon = 'icons/obj/items_cyborg.dmi' - icon_state = "laser" + icon_state = "laser_cyborg" item_state = "armcannonlase" force = 5 selfcharge = EGUN_SELFCHARGE diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 67e7b58bd3..260a8c911a 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -334,6 +334,7 @@ desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit." ammo_type = list(/obj/item/ammo_casing/energy/instakill) force = 60 + automatic_charge_overlays = FALSE // This has no charge overlays. /obj/item/gun/energy/laser/instakill/red desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a red design." diff --git a/code/modules/research/nanites/nanite_cloud_controller.dm b/code/modules/research/nanites/nanite_cloud_controller.dm index eda9224bfb..15e452b474 100644 --- a/code/modules/research/nanites/nanite_cloud_controller.dm +++ b/code/modules/research/nanites/nanite_cloud_controller.dm @@ -5,6 +5,7 @@ icon_state = "nanite_cloud_controller" circuit = /obj/item/circuitboard/computer/nanite_cloud_controller icon_screen = "nanite_cloud_controller_screen" + icon_keyboard = null var/obj/item/disk/nanite_program/disk var/list/datum/nanite_cloud_backup/cloud_backups = list() diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index a6298f502c..052e3e354e 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -271,7 +271,7 @@ Charged extracts: if(M.maxHealth <= 0) to_chat(user, "The slime is too unstable to return!") M.revive(full_heal = 1) - M.stat = CONSCIOUS + M.set_stat(CONSCIOUS) M.visible_message("[M] is filled with renewed vigor and blinks awake!") M.maxHealth -= 10 //Revival isn't healthy. M.health -= 10 diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 2f0cba0056..1bd719e9c8 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -235,6 +235,7 @@ circuit = /obj/item/circuitboard/computer/bsa_control icon = 'icons/obj/machines/particle_accelerator.dmi' icon_state = "control_boxp" + icon_keyboard = null var/obj/machinery/bsa/full/cannon var/notice diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 96b9290239..bec8641d82 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -217,7 +217,7 @@ LB.brainmob = brainmob brainmob = null LB.brainmob.forceMove(LB) - LB.brainmob.stat = DEAD + LB.brainmob.set_stat(DEAD) /obj/item/organ/eyes/transfer_to_limb(obj/item/bodypart/head/LB, mob/living/carbon/human/C) LB.eyes = src diff --git a/icons/obj/items_cyborg.dmi b/icons/obj/items_cyborg.dmi index 5d87bee320..ec3cd50af1 100644 Binary files a/icons/obj/items_cyborg.dmi and b/icons/obj/items_cyborg.dmi differ diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index bc598e81e3..eb98bdb97f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -451,7 +451,7 @@ if(H.InCritical()) perma = TRUE volume = 5 - H.stat = DEAD + H.set_stat(DEAD) catto.origin = H /datum/reagent/fermi/secretcatchem/on_mob_life(mob/living/carbon/H) @@ -488,7 +488,7 @@ var/mob/living/simple_animal/pet/cat/custom_cat/catto = L if(catto.origin) var/mob/living/carbon/human/H = catto.origin - H.stat = CONSCIOUS + H.set_stat(CONSCIOUS) log_reagent("FERMICHEM: [catto] ckey: [catto.key] has returned to normal.") to_chat(catto, "Your body shifts back to normal!") H.forceMove(catto.loc)