From 5409570e01ca3e55147792adff7974a8fe128f08 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:40:19 +0200 Subject: [PATCH] Upgrades GODMODE from a flag to a trait. (#86596) ## About The Pull Request GODMODE has a lot of sources that toggle it. From admin-stuff to status effects, components, actions and mobs which are supposed to be invincible. It's better off as a trait than a flag, so we can manage these sources. ## Why It's Good For The Game See above. ## Changelog :cl: admin: godmode is now a datum trait instead of a bitflag. This means the process for toggling it is a little different now. /:cl: --- code/__DEFINES/combat.dm | 3 -- code/__DEFINES/traits/declarations.dm | 2 + code/_globalvars/traits/_traits.dm | 1 + code/_globalvars/traits/admin_tooling.dm | 1 + code/datums/actions/mobs/lava_swoop.dm | 6 +-- .../basic_targeting_strategy.dm | 3 +- code/datums/components/area_based_godmode.dm | 8 ++-- code/datums/components/singularity.dm | 2 +- code/datums/components/soulstoned.dm | 6 +-- code/datums/components/supermatter_crystal.dm | 20 +++++----- code/datums/elements/embed.dm | 2 +- code/datums/shuttles/emergency.dm | 2 +- .../weather/weather_types/radiation_storm.dm | 18 ++++----- code/datums/wounds/_wound_static_data.dm | 2 +- .../anomalies/anomalies_bioscrambler.dm | 2 +- code/game/objects/items/spear.dm | 6 +-- code/game/objects/items/theft_tools.dm | 6 +-- .../objects/structures/petrified_statue.dm | 37 +++++++++---------- code/modules/admin/verbs/admingame.dm | 18 +++++---- .../heretic/status_effects/buffs.dm | 4 +- code/modules/mafia/controller.dm | 17 ++++++--- code/modules/mining/lavaland/tendril_loot.dm | 6 +-- code/modules/mob/camera/camera.dm | 2 +- .../modules/mob/living/basic/basic_defense.dm | 2 +- .../mob/living/basic/drone/interaction.dm | 2 +- .../mob/living/basic/health_adjustment.dm | 4 +- .../lavaland/bileworm/bileworm_actions.dm | 8 ++-- .../mob/living/basic/pets/parrot/poly.dm | 3 +- .../basic/ruin_defender/living_floor.dm | 3 +- .../living/basic/space_fauna/bear/_bear.dm | 3 +- .../space_fauna/wumborian_fugu/inflation.dm | 6 +-- code/modules/mob/living/blood.dm | 2 +- code/modules/mob/living/brain/life.dm | 2 +- .../mob/living/carbon/alien/larva/life.dm | 2 +- code/modules/mob/living/carbon/alien/life.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 4 +- .../modules/mob/living/carbon/damage_procs.dm | 16 ++++---- code/modules/mob/living/carbon/human/dummy.dm | 5 ++- code/modules/mob/living/carbon/life.dm | 2 +- code/modules/mob/living/damage_procs.dm | 20 +++++----- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/living_defense.dm | 2 +- code/modules/mob/living/silicon/ai/life.dm | 4 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/simple_animal/damage_procs.dm | 4 +- .../living/simple_animal/hostile/hostile.dm | 4 +- .../hostile/megafauna/colossus.dm | 6 +-- .../mob/living/simple_animal/simple_animal.dm | 6 +-- code/modules/mob/living/status_procs.dm | 10 ++--- code/modules/pai/pai.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 4 +- .../crossbreeding/_status_effects.dm | 10 ++--- code/modules/shuttle/special.dm | 7 ++-- .../spells/spell_types/self/rod_form.dm | 6 +-- code/modules/surgery/bodyparts/_bodyparts.dm | 2 +- .../surgery/bodyparts/dismemberment.dm | 4 +- code/modules/surgery/bodyparts/wounds.dm | 4 +- .../organs/internal/_internal_organ.dm | 2 +- .../surgery/organs/internal/ears/_ears.dm | 4 +- .../surgery/organs/internal/lungs/_lungs.dm | 2 +- code/modules/unit_tests/mob_damage.dm | 8 ++-- code/modules/unit_tests/strange_reagent.dm | 2 +- 62 files changed, 171 insertions(+), 188 deletions(-) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 60cd3a7b018..439d803fb94 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -76,15 +76,12 @@ #define CANUNCONSCIOUS (1<<2) /// If set, this mob can be grabbed or pushed when bumped into #define CANPUSH (1<<3) -/// Mob godmode. Prevents most statuses and damage from being taken, but is more often than not a crapshoot. Use with caution. -#define GODMODE (1<<4) DEFINE_BITFIELD(status_flags, list( "CAN STUN" = CANSTUN, "CAN KNOCKDOWN" = CANKNOCKDOWN, "CAN UNCONSCIOUS" = CANUNCONSCIOUS, "CAN PUSH" = CANPUSH, - "GOD MODE" = GODMODE, )) //Health Defines diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index bfd46d89418..af90aefcd0f 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -26,6 +26,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_RESTRAINED "restrained" /// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sources of undesity will still apply. Always define a unique source when adding a new instance of this! #define TRAIT_UNDENSE "undense" +/// Makes the mob immune to damage and several other ailments. +#define TRAIT_GODMODE "godmode" /// Expands our FOV by 30 degrees if restricted #define TRAIT_EXPANDED_FOV "expanded_fov" /// Doesn't miss attacks diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 0484682f913..b853a281fde 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -258,6 +258,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_GARLIC_BREATH" = TRAIT_GARLIC_BREATH, "TRAIT_GENELESS" = TRAIT_GENELESS, "TRAIT_GIANT" = TRAIT_GIANT, + "TRAIT_GODMODE" = TRAIT_GODMODE, "TRAIT_GONE_FISHING" = TRAIT_GONE_FISHING, "TRAIT_GOOD_HEARING" = TRAIT_GOOD_HEARING, "TRAIT_GRABWEAKNESS" = TRAIT_GRABWEAKNESS, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index ecd8bb3d860..52848bdfde4 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -118,6 +118,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_GARLIC_BREATH" = TRAIT_GARLIC_BREATH, "TRAIT_GENELESS" = TRAIT_GENELESS, "TRAIT_GIANT" = TRAIT_GIANT, + "TRAIT_GODMODE" = TRAIT_GODMODE, "TRAIT_GOOD_HEARING" = TRAIT_GOOD_HEARING, "TRAIT_GRABWEAKNESS" = TRAIT_GRABWEAKNESS, "TRAIT_GREENTEXT_CURSED" = TRAIT_GREENTEXT_CURSED, diff --git a/code/datums/actions/mobs/lava_swoop.dm b/code/datums/actions/mobs/lava_swoop.dm index aa512b2d28e..2b07734b4a8 100644 --- a/code/datums/actions/mobs/lava_swoop.dm +++ b/code/datums/actions/mobs/lava_swoop.dm @@ -39,7 +39,7 @@ return // stop swooped target movement swooping = TRUE - ADD_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) + owner.add_traits(list(TRAIT_GODMODE, TRAIT_UNDENSE), SWOOPING_TRAIT) owner.visible_message(span_boldwarning("[owner] swoops up high!")) var/negative @@ -66,7 +66,6 @@ animate(owner, alpha = 255, transform = oldtransform, time = 0, flags = ANIMATION_END_NOW) //reset immediately return animate(owner, alpha = 100, transform = matrix()*0.7, time = 7) - owner.status_flags |= GODMODE SEND_SIGNAL(owner, COMSIG_SWOOP_INVULNERABILITY_STARTED) owner.mouse_opacity = MOUSE_OPACITY_TRANSPARENT @@ -112,12 +111,11 @@ for(var/mob/observer in range(7, owner)) shake_camera(observer, 15, 1) - REMOVE_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) + owner.remove_traits(list(TRAIT_GODMODE, TRAIT_UNDENSE), SWOOPING_TRAIT) SLEEP_CHECK_DEATH(1, owner) swooping = FALSE if(!lava_success) SEND_SIGNAL(owner, COMSIG_LAVA_ARENA_FAILED) - owner.status_flags &= ~GODMODE /datum/action/cooldown/mob_cooldown/lava_swoop/proc/lava_pools(atom/target, amount = 30, delay = 0.8) if(!target) diff --git a/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm b/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm index 709acb8d5e8..d552b69c142 100644 --- a/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm +++ b/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm @@ -25,8 +25,7 @@ if(ismob(the_target)) //Target is in godmode, ignore it. if(living_mob.loc == the_target) return FALSE // We've either been eaten or are shapeshifted, let's assume the latter because we're still alive - var/mob/M = the_target - if(M.status_flags & GODMODE) + if(HAS_TRAIT(the_target, TRAIT_GODMODE)) return FALSE if (vision_range && get_dist(living_mob, the_target) > vision_range) diff --git a/code/datums/components/area_based_godmode.dm b/code/datums/components/area_based_godmode.dm index 4f03ae57794..b9447efbafb 100644 --- a/code/datums/components/area_based_godmode.dm +++ b/code/datums/components/area_based_godmode.dm @@ -34,8 +34,6 @@ var/mob/mob_target = parent if(!istype(mob_target)) return COMPONENT_INCOMPATIBLE - if(initial(mob_target.status_flags) & GODMODE) - return COMPONENT_INCOMPATIBLE sources_to_area_type = list() src.gain_message = gain_message @@ -102,11 +100,11 @@ /datum/component/area_based_godmode/proc/check_area(mob/source) SIGNAL_HANDLER - var/has_godmode = source.status_flags & GODMODE + var/has_godmode = HAS_TRAIT(source, TRAIT_GODMODE) if(!check_in_valid_area(source)) if(has_godmode) to_chat(source, lose_message) - source.status_flags ^= GODMODE + REMOVE_TRAIT(source, TRAIT_GODMODE, REF(src)) check_area_cached_state = FALSE return @@ -115,7 +113,7 @@ return to_chat(source, gain_message) - source.status_flags ^= GODMODE + ADD_TRAIT(source, TRAIT_GODMODE, REF(src)) #undef MAP_AREA_TYPE #undef MAP_ALLOW_AREA_SUBTYPES diff --git a/code/datums/components/singularity.dm b/code/datums/components/singularity.dm index 14aaedff717..0cd64d829a2 100644 --- a/code/datums/components/singularity.dm +++ b/code/datums/components/singularity.dm @@ -373,7 +373,7 @@ for(var/mob/living/target as anything in GLOB.mob_living_list) if(target.z != atom_parent.z) continue - if(target.status_effects & GODMODE) + if(HAS_TRAIT(target, TRAIT_GODMODE)) continue var/distance_from_target = get_dist(target, atom_parent) if(distance_from_target < closest_distance) diff --git a/code/datums/components/soulstoned.dm b/code/datums/components/soulstoned.dm index bb22030c210..d4e9e0eaf02 100644 --- a/code/datums/components/soulstoned.dm +++ b/code/datums/components/soulstoned.dm @@ -11,8 +11,7 @@ stoned.forceMove(container) stoned.fully_heal() - stoned.add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT) - stoned.status_flags |= GODMODE + stoned.add_traits(list(TRAIT_GODMODE, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT) RegisterSignal(stoned, COMSIG_MOVABLE_MOVED, PROC_REF(free_prisoner)) @@ -25,5 +24,4 @@ /datum/component/soulstoned/UnregisterFromParent() var/mob/living/stoned = parent - stoned.status_flags &= ~GODMODE - stoned.remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT) + stoned.remove_traits(list(TRAIT_GODMODE, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT) diff --git a/code/datums/components/supermatter_crystal.dm b/code/datums/components/supermatter_crystal.dm index 81a29b56c6d..53a0797c2e1 100644 --- a/code/datums/components/supermatter_crystal.dm +++ b/code/datums/components/supermatter_crystal.dm @@ -71,7 +71,7 @@ SIGNAL_HANDLER if(isliving(user)) var/mob/living/living_mob = user - if(living_mob.incorporeal_move || living_mob.status_flags & GODMODE) + if(living_mob.incorporeal_move || HAS_TRAIT(living_mob, TRAIT_GODMODE)) return if(isalien(user)) dust_mob(source, user, cause = "alien attack") @@ -80,7 +80,7 @@ /datum/component/supermatter_crystal/proc/animal_hit(datum/source, mob/living/simple_animal/user, list/modifiers) SIGNAL_HANDLER - if(user.incorporeal_move || user.status_flags & GODMODE) + if(user.incorporeal_move || HAS_TRAIT(user, TRAIT_GODMODE)) return var/atom/atom_source = source var/murder @@ -101,7 +101,7 @@ SIGNAL_HANDLER if(isliving(user)) var/mob/living/living_mob = user - if(living_mob.incorporeal_move || living_mob.status_flags & GODMODE) + if(living_mob.incorporeal_move || HAS_TRAIT(living_mob, TRAIT_GODMODE)) return var/atom/atom_source = source if(iscyborg(user) && atom_source.Adjacent(user)) @@ -115,7 +115,7 @@ /datum/component/supermatter_crystal/proc/hand_hit(datum/source, mob/living/user, list/modifiers) SIGNAL_HANDLER - if(user.incorporeal_move || user.status_flags & GODMODE) + if(user.incorporeal_move || HAS_TRAIT(user, TRAIT_GODMODE)) return if(user.zone_selected != BODY_ZONE_PRECISE_MOUTH) dust_mob(source, user, cause = "hand") @@ -202,7 +202,7 @@ return if(atom_source.Adjacent(user)) //if the item is stuck to the person, kill the person too instead of eating just the item. - if(user.incorporeal_move || user.status_flags & GODMODE) + if(user.incorporeal_move || HAS_TRAIT(user, TRAIT_GODMODE)) return var/vis_msg = span_danger("[user] reaches out and touches [atom_source] with [item], inducing a resonance... [item] starts to glow briefly before the light continues up to [user]'s body. [user.p_They()] burst[user.p_s()] into flames before flashing into dust!") var/mob_msg = span_userdanger("You reach out and touch [atom_source] with [item]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"") @@ -219,7 +219,7 @@ SIGNAL_HANDLER if(isliving(hit_object)) var/mob/living/hit_mob = hit_object - if(hit_mob.incorporeal_move || hit_mob.status_flags & GODMODE) + if(hit_mob.incorporeal_move || HAS_TRAIT(hit_mob, TRAIT_GODMODE)) return var/atom/atom_source = source var/obj/machinery/power/supermatter_crystal/our_supermatter = parent // Why is this a component? @@ -272,7 +272,7 @@ span_hear("You hear a loud crack as you are washed with a wave of heat.")) /datum/component/supermatter_crystal/proc/dust_mob(datum/source, mob/living/nom, vis_msg, mob_msg, cause) - if(nom.incorporeal_move || nom.status_flags & GODMODE) //try to keep supermatter sliver's + hemostat's dust conditions in sync with this too + if(nom.incorporeal_move || HAS_TRAIT(nom, TRAIT_GODMODE)) //try to keep supermatter sliver's + hemostat's dust conditions in sync with this too return var/atom/atom_source = source if(!vis_msg) @@ -290,10 +290,8 @@ /datum/component/supermatter_crystal/proc/consume(atom/source, atom/movable/consumed_object) if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1) return - if(isliving(consumed_object)) - var/mob/living/consumed_mob = consumed_object - if(consumed_mob.status_flags & GODMODE) - return + if(HAS_TRAIT(consumed_object, TRAIT_GODMODE)) + return var/atom/atom_source = source SEND_SIGNAL(consumed_object, COMSIG_SUPERMATTER_CONSUMED, atom_source) diff --git a/code/datums/elements/embed.dm b/code/datums/elements/embed.dm index 4a8bda37c3a..5217738dff6 100644 --- a/code/datums/elements/embed.dm +++ b/code/datums/elements/embed.dm @@ -46,7 +46,7 @@ if(blocked || !istype(victim) || HAS_TRAIT(victim, TRAIT_PIERCEIMMUNE)) return FALSE - if(victim.status_flags & GODMODE) + if(HAS_TRAIT(victim, TRAIT_GODMODE)) return FALSE var/flying_speed = throwingdatum?.speed || weapon.throw_speed diff --git a/code/datums/shuttles/emergency.dm b/code/datums/shuttles/emergency.dm index f7299ed2e93..2af1a238a72 100644 --- a/code/datums/shuttles/emergency.dm +++ b/code/datums/shuttles/emergency.dm @@ -90,7 +90,7 @@ suffix = "bar" name = "The Emergency Escape Bar" description = "Features include sentient bar staff (a Bardrone and a Barmaid), bathroom, a quality lounge for the heads, and a large gathering table." - admin_notes = "Bardrone and Barmaid are GODMODE, will be automatically sentienced by the fun balloon at 60 seconds before arrival. \ + admin_notes = "Bardrone and Barmaid have TRAIT_GODMODE (basically invincibility), will be automatically sentienced by the fun balloon at 60 seconds before arrival. \ Has medical facilities." credit_cost = CARGO_CRATE_VALUE * 10 occupancy_limit = "30" diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index 8a1cfff7657..9bf17c7a9dc 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -34,28 +34,28 @@ status_alarm(TRUE) -/datum/weather/rad_storm/weather_act(mob/living/L) +/datum/weather/rad_storm/weather_act(mob/living/living) if(!prob(mutate_chance)) return - if(!ishuman(L)) + if(!ishuman(living) || HAS_TRAIT(living, TRAIT_GODMODE)) return - var/mob/living/carbon/human/H = L - if(!H.can_mutate() || H.status_flags & GODMODE) + var/mob/living/carbon/human/human = living + if(!human.can_mutate()) return - if(HAS_TRAIT(H, TRAIT_RADIMMUNE)) + if(HAS_TRAIT(human, TRAIT_RADIMMUNE)) return - if (SSradiation.wearing_rad_protected_clothing(H)) + if (SSradiation.wearing_rad_protected_clothing(human)) return - H.random_mutate_unique_identity() - H.random_mutate_unique_features() + human.random_mutate_unique_identity() + human.random_mutate_unique_features() if(prob(50)) - do_mutate(L) + do_mutate(human) /datum/weather/rad_storm/end() if(..()) diff --git a/code/datums/wounds/_wound_static_data.dm b/code/datums/wounds/_wound_static_data.dm index f8b03d1856b..adc0923ee4f 100644 --- a/code/datums/wounds/_wound_static_data.dm +++ b/code/datums/wounds/_wound_static_data.dm @@ -95,7 +95,7 @@ if (random_roll && !can_be_randomly_generated) return FALSE - if (HAS_TRAIT(limb.owner, TRAIT_NEVER_WOUNDED) || (limb.owner.status_flags & GODMODE)) + if (HAS_TRAIT(limb.owner, TRAIT_NEVER_WOUNDED) || HAS_TRAIT(limb.owner, TRAIT_GODMODE)) return FALSE if (!wounding_types_valid(suggested_wounding_types)) diff --git a/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm b/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm index efa197de84b..d9796616023 100644 --- a/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm +++ b/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm @@ -62,7 +62,7 @@ for(var/mob/living/carbon/target in GLOB.player_list) if (target.z != z) continue - if (target.status_flags & GODMODE) + if (HAS_TRAIT(target, TRAIT_GODMODE)) continue if (target.stat >= UNCONSCIOUS) continue // Don't just haunt a corpse diff --git a/code/game/objects/items/spear.dm b/code/game/objects/items/spear.dm index 53e307e31d6..f0548fa66f4 100644 --- a/code/game/objects/items/spear.dm +++ b/code/game/objects/items/spear.dm @@ -177,10 +177,8 @@ return if(target.resistance_flags & INDESTRUCTIBLE) //due to the lich incident of 2021, embedding grenades inside of indestructible structures is forbidden return - if(ismob(target)) - var/mob/mob_target = target - if(mob_target.status_flags & GODMODE) //no embedding grenade phylacteries inside of ghost poly either - return + if(HAS_TRAIT(target, TRAIT_GODMODE)) + return if(iseffect(target)) //and no accidentally wasting your moment of glory on graffiti return user.say("[war_cry]", forced="spear warcry") diff --git a/code/game/objects/items/theft_tools.dm b/code/game/objects/items/theft_tools.dm index e13251fe8e5..d51130a4d21 100644 --- a/code/game/objects/items/theft_tools.dm +++ b/code/game/objects/items/theft_tools.dm @@ -187,7 +187,7 @@ if(!isliving(hit_atom)) return ..() var/mob/living/victim = hit_atom - if(victim.incorporeal_move || victim.status_flags & GODMODE) //try to keep this in sync with supermatter's consume fail conditions + if(victim.incorporeal_move || HAS_TRAIT(victim, TRAIT_GODMODE)) //try to keep this in sync with supermatter's consume fail conditions return ..() var/mob/thrower = throwingdatum?.get_thrower() if(thrower) @@ -208,7 +208,7 @@ /obj/item/nuke_core/supermatter_sliver/pickup(mob/living/user) ..() - if(!isliving(user) || user.status_flags & GODMODE) //try to keep this in sync with supermatter's consume fail conditions + if(!isliving(user) || HAS_TRAIT(user, TRAIT_GODMODE)) //try to keep this in sync with supermatter's consume fail conditions return FALSE user.visible_message(span_danger("[user] reaches out and tries to pick up [src]. [user.p_their()] body starts to glow and bursts into flames before flashing into dust!"),\ span_userdanger("You reach for [src] with your hands. That was dumb."),\ @@ -311,7 +311,7 @@ if(!isliving(AM)) return var/mob/living/victim = AM - if(victim.incorporeal_move || victim.status_flags & GODMODE) //try to keep this in sync with supermatter's consume fail conditions + if(victim.incorporeal_move || HAS_TRAIT(victim, TRAIT_GODMODE)) //try to keep this in sync with supermatter's consume fail conditions return victim.investigate_log("has been dusted by [src].", INVESTIGATE_DEATHS) victim.dust() diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index 5383436d4db..d7fdfab74e2 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -13,24 +13,24 @@ /obj/structure/statue/petrified/relaymove() return -/obj/structure/statue/petrified/Initialize(mapload, mob/living/L, statue_timer, save_brain) +/obj/structure/statue/petrified/Initialize(mapload, mob/living/living, statue_timer, save_brain) . = ..() if(statue_timer) timer = statue_timer if(save_brain) brain = save_brain - if(L) - petrified_mob = L - if(L.buckled) - L.buckled.unbuckle_mob(L,force=1) - L.visible_message(span_warning("[L]'s skin rapidly turns to marble!"), span_userdanger("Your body freezes up! Can't... move... can't... think...")) - L.forceMove(src) - ADD_TRAIT(L, TRAIT_MUTE, STATUE_MUTE) - L.faction |= FACTION_MIMIC //Stops mimics from instaqdeling people in statues - L.status_flags |= GODMODE - atom_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues - max_integrity = atom_integrity - START_PROCESSING(SSobj, src) + if(!living) + return + petrified_mob = living + if(living.buckled) + living.buckled.unbuckle_mob(living, force = TRUE) + living.visible_message(span_warning("[living]'s skin rapidly turns to marble!"), span_userdanger("Your body freezes up! Can't... move... can't... think...")) + living.forceMove(src) + living.add_traits(list(TRAIT_GODMODE, TRAIT_MUTE, TRAIT_NOBLOOD), STATUE_MUTE) + living.faction |= FACTION_MIMIC //Stops mimics from instaqdeling people in statues + atom_integrity = living.health + 100 //stoning damaged mobs will result in easier to shatter statues + max_integrity = atom_integrity + START_PROCESSING(SSobj, src) /obj/structure/statue/petrified/process(seconds_per_tick) if(!petrified_mob) @@ -47,6 +47,9 @@ /obj/structure/statue/petrified/Exited(atom/movable/gone, direction) . = ..() if(gone == petrified_mob) + petrified_mob.remove_traits(list(TRAIT_GODMODE, TRAIT_MUTE, TRAIT_NOBLOOD), STATUE_MUTE) + petrified_mob.take_overall_damage((petrified_mob.health - atom_integrity + 100)) //any new damage the statue incurred is transferred to the mob + petrified_mob.faction -= FACTION_MIMIC petrified_mob = null /obj/structure/statue/petrified/Destroy() @@ -64,13 +67,7 @@ for(var/obj/O in src) O.forceMove(loc) - if(petrified_mob) - petrified_mob.status_flags &= ~GODMODE - REMOVE_TRAIT(petrified_mob, TRAIT_MUTE, STATUE_MUTE) - REMOVE_TRAIT(petrified_mob, TRAIT_NOBLOOD, MAGIC_TRAIT) - petrified_mob.take_overall_damage((petrified_mob.health - atom_integrity + 100)) //any new damage the statue incurred is transferred to the mob - petrified_mob.faction -= FACTION_MIMIC - petrified_mob.forceMove(loc) + petrified_mob?.forceMove(loc) return ..() /obj/structure/statue/petrified/atom_deconstruct(disassembled = TRUE) diff --git a/code/modules/admin/verbs/admingame.dm b/code/modules/admin/verbs/admingame.dm index aef16dc7d7d..f9a081445b8 100644 --- a/code/modules/admin/verbs/admingame.dm +++ b/code/modules/admin/verbs/admingame.dm @@ -150,20 +150,24 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_ADMIN, "Show Player Panel", mo user << browse(body, "window=adminplayeropts-[REF(player)];size=550x515") BLACKBOX_LOG_ADMIN_VERB("Player Panel") -/client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list) +/client/proc/cmd_admin_godmode(mob/mob in GLOB.mob_list) set category = "Admin.Game" set name = "Godmode" if(!check_rights(R_ADMIN)) return - M.status_flags ^= GODMODE - to_chat(usr, span_adminnotice("Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]"), confidential = TRUE) + var/had_trait = HAS_TRAIT_FROM(mob, TRAIT_GODMODE, ADMIN_TRAIT) + if(had_trait) + REMOVE_TRAIT(mob, TRAIT_GODMODE, ADMIN_TRAIT) + else + ADD_TRAIT(mob, TRAIT_GODMODE, ADMIN_TRAIT) + to_chat(usr, span_adminnotice("Toggled [had_trait ? "OFF" : "ON"]"), confidential = TRUE) - log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]") - var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]" + log_admin("[key_name(usr)] has toggled [key_name(mob)]'s nodamage to [had_trait ? "Off" : "On"]") + var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(mob)]'s nodamage to [had_trait ? "Off" : "On"]" message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Godmode", "[M.status_flags & GODMODE ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! + admin_ticket_log(mob, msg) + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Godmode", "[had_trait ? "Disabled" : "Enabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! /* If a guy was gibbed and you want to revive him, this is a good way to do so. diff --git a/code/modules/antagonists/heretic/status_effects/buffs.dm b/code/modules/antagonists/heretic/status_effects/buffs.dm index 1668ea5a11e..e4f5990040b 100644 --- a/code/modules/antagonists/heretic/status_effects/buffs.dm +++ b/code/modules/antagonists/heretic/status_effects/buffs.dm @@ -251,11 +251,10 @@ status_type = STATUS_EFFECT_REFRESH duration = -1 alert_type = null - var/static/list/caretaking_traits = list(TRAIT_HANDS_BLOCKED, TRAIT_IGNORESLOWDOWN, TRAIT_SECLUDED_LOCATION) + var/static/list/caretaking_traits = list(TRAIT_GODMODE, TRAIT_HANDS_BLOCKED, TRAIT_IGNORESLOWDOWN, TRAIT_SECLUDED_LOCATION) /datum/status_effect/caretaker_refuge/on_apply() owner.add_traits(caretaking_traits, TRAIT_STATUS_EFFECT(id)) - owner.status_flags |= GODMODE animate(owner, alpha = 45,time = 0.5 SECONDS) owner.density = FALSE RegisterSignal(owner, SIGNAL_REMOVETRAIT(TRAIT_ALLOW_HERETIC_CASTING), PROC_REF(on_focus_lost)) @@ -266,7 +265,6 @@ /datum/status_effect/caretaker_refuge/on_remove() owner.remove_traits(caretaking_traits, TRAIT_STATUS_EFFECT(id)) - owner.status_flags &= ~GODMODE owner.alpha = initial(owner.alpha) owner.density = initial(owner.density) UnregisterSignal(owner, SIGNAL_REMOVETRAIT(TRAIT_ALLOW_HERETIC_CASTING)) diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index f6b46c3430d..d4edbb37f41 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -602,13 +602,18 @@ GLOBAL_LIST_INIT(mafia_role_by_alignment, setup_mafia_role_by_alignment()) outfit_to_distribute = player_outfit for(var/datum/mafia_role/role as anything in all_roles) - var/mob/living/carbon/human/H = new(get_turf(role.assigned_landmark)) - H.add_traits(list(TRAIT_NOFIRE, TRAIT_NOBREATH, TRAIT_CANNOT_CRYSTALIZE, TRAIT_PERMANENTLY_MORTAL), MAFIA_TRAIT) - H.equipOutfit(outfit_to_distribute) - H.status_flags |= GODMODE - RegisterSignal(H, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(display_votes)) + var/mob/living/carbon/human/human = new(get_turf(role.assigned_landmark)) + human.add_traits(list( + TRAIT_NOFIRE, + TRAIT_NOBREATH, + TRAIT_CANNOT_CRYSTALIZE, + TRAIT_PERMANENTLY_MORTAL, + TRAIT_GODMODE, + ), MAFIA_TRAIT) + human.equipOutfit(outfit_to_distribute) + RegisterSignal(human, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(display_votes)) var/obj/item/modular_computer/modpc = role.player_pda - role.register_body(H) + role.register_body(human) if(modpc) player_role_lookup[modpc] = role else diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index 0403e17ad79..2ded64c17aa 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -425,8 +425,7 @@ if(!user) return - user.status_flags &= ~GODMODE - REMOVE_TRAIT(user, TRAIT_NO_TRANSFORM, REF(src)) + user.remove_traits(list(TRAIT_GODMODE, TRAIT_NO_TRANSFORM), REF(src)) user.forceMove(get_turf(src)) user.visible_message(span_danger("[user] pops back into reality!")) @@ -437,8 +436,7 @@ setDir(user.dir) user.forceMove(src) - ADD_TRAIT(user, TRAIT_NO_TRANSFORM, REF(src)) - user.status_flags |= GODMODE + user.add_traits(list(TRAIT_GODMODE, TRAIT_NO_TRANSFORM), REF(src)) user_ref = WEAKREF(user) diff --git a/code/modules/mob/camera/camera.dm b/code/modules/mob/camera/camera.dm index b4ddc8cd9c8..2dc5db8fc02 100644 --- a/code/modules/mob/camera/camera.dm +++ b/code/modules/mob/camera/camera.dm @@ -4,7 +4,6 @@ density = FALSE move_force = INFINITY move_resist = INFINITY - status_flags = GODMODE // You can't damage it. mouse_opacity = MOUSE_OPACITY_TRANSPARENT invisibility = INVISIBILITY_ABSTRACT // No one can see us sight = SEE_SELF @@ -15,6 +14,7 @@ /mob/camera/Initialize(mapload) . = ..() + ADD_TRAIT(src, TRAIT_GODMODE, INNATE_TRAIT) SSpoints_of_interest.make_point_of_interest(src) if(!move_on_shuttle) ADD_TRAIT(src, TRAIT_BLOCK_SHUTTLE_MOVEMENT, INNATE_TRAIT) diff --git a/code/modules/mob/living/basic/basic_defense.dm b/code/modules/mob/living/basic/basic_defense.dm index 646cabe339d..9a7ddef3ce0 100644 --- a/code/modules/mob/living/basic/basic_defense.dm +++ b/code/modules/mob/living/basic/basic_defense.dm @@ -159,7 +159,7 @@ ..() /mob/living/basic/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= 0) diff --git a/code/modules/mob/living/basic/drone/interaction.dm b/code/modules/mob/living/basic/drone/interaction.dm index 0b0247c1c45..58b7cd88ef2 100644 --- a/code/modules/mob/living/basic/drone/interaction.dm +++ b/code/modules/mob/living/basic/drone/interaction.dm @@ -32,7 +32,7 @@ return ..() /mob/living/basic/drone/mob_try_pickup(mob/living/user, instant=FALSE) - if(stat == DEAD || status_flags & GODMODE) + if(stat == DEAD || HAS_TRAIT(src, TRAIT_GODMODE)) return return ..() diff --git a/code/modules/mob/living/basic/health_adjustment.dm b/code/modules/mob/living/basic/health_adjustment.dm index bae9d7b9e57..ca98f98eb8e 100644 --- a/code/modules/mob/living/basic/health_adjustment.dm +++ b/code/modules/mob/living/basic/health_adjustment.dm @@ -4,12 +4,12 @@ * Arguments: * * amount The amount that will be used to adjust the mob's health * * updating_health If the mob's health should be immediately updated to the new value - * * forced If we should force update the adjustment of the mob's health no matter the restrictions, like GODMODE + * * forced If we should force update the adjustment of the mob's health no matter the restrictions, like TRAIT_GODMODE * returns the net change in bruteloss after applying the damage amount */ /mob/living/basic/proc/adjust_health(amount, updating_health = TRUE, forced = FALSE) . = FALSE - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return 0 . = bruteloss // bruteloss value before applying damage bruteloss = round(clamp(bruteloss + amount, 0, maxHealth * 2), DAMAGE_PRECISION) diff --git a/code/modules/mob/living/basic/lavaland/bileworm/bileworm_actions.dm b/code/modules/mob/living/basic/lavaland/bileworm/bileworm_actions.dm index f023215d7dd..ca07c1a043e 100644 --- a/code/modules/mob/living/basic/lavaland/bileworm/bileworm_actions.dm +++ b/code/modules/mob/living/basic/lavaland/bileworm/bileworm_actions.dm @@ -19,14 +19,14 @@ return playsound(burrower, 'sound/effects/break_stone.ogg', 50, TRUE) new /obj/effect/temp_visual/mook_dust(get_turf(burrower)) - burrower.status_flags |= GODMODE + ADD_TRAIT(burrower, TRAIT_GODMODE, REF(src)) burrower.SetInvisibility(INVISIBILITY_MAXIMUM, id=type) burrower.forceMove(unburrow_turf) //not that it's gonna die with godmode but still SLEEP_CHECK_DEATH(rand(0.7 SECONDS, 1.2 SECONDS), burrower) playsound(burrower, 'sound/effects/break_stone.ogg', 50, TRUE) new /obj/effect/temp_visual/mook_dust(unburrow_turf) - burrower.status_flags &= ~GODMODE + REMOVE_TRAIT(burrower, TRAIT_GODMODE, REF(src)) burrower.RemoveInvisibility(type) /datum/action/cooldown/mob_cooldown/resurface/proc/get_unburrow_turf(mob/living/burrower, atom/target) @@ -108,14 +108,14 @@ return //this will give up on devouring the target which is fine by me playsound(devourer, 'sound/effects/break_stone.ogg', 50, TRUE) new /obj/effect/temp_visual/mook_dust(get_turf(devourer)) - devourer.status_flags |= GODMODE + ADD_TRAIT(devourer, TRAIT_GODMODE, REF(src)) devourer.SetInvisibility(INVISIBILITY_MAXIMUM, id=type) devourer.forceMove(devour_turf) //not that it's gonna die with godmode but still SLEEP_CHECK_DEATH(rand(0.7 SECONDS, 1.2 SECONDS), devourer) playsound(devourer, 'sound/effects/break_stone.ogg', 50, TRUE) new /obj/effect/temp_visual/mook_dust(devour_turf) - devourer.status_flags &= ~GODMODE + REMOVE_TRAIT(devourer, TRAIT_GODMODE, REF(src)) devourer.RemoveInvisibility(type) if(!(target in devour_turf)) to_chat(devourer, span_warning("Someone stole your dinner!")) diff --git a/code/modules/mob/living/basic/pets/parrot/poly.dm b/code/modules/mob/living/basic/pets/parrot/poly.dm index cba3dd6e588..737ea2079b0 100644 --- a/code/modules/mob/living/basic/pets/parrot/poly.dm +++ b/code/modules/mob/living/basic/pets/parrot/poly.dm @@ -191,7 +191,6 @@ name = "The Ghost of Poly" desc = "Doomed to squawk the Earth." color = "#FFFFFF77" - status_flags = GODMODE sentience_type = SENTIENCE_BOSS //This is so players can't mindswap into ghost poly to become a literal god incorporeal_move = INCORPOREAL_MOVE_BASIC butcher_results = list(/obj/item/ectoplasm = 1) @@ -202,7 +201,7 @@ /mob/living/basic/parrot/poly/ghost/Initialize(mapload) // block anything and everything that could possibly happen with writing memory for ghosts memory_saved = TRUE - ADD_TRAIT(src, TRAIT_DONT_WRITE_MEMORY, INNATE_TRAIT) + add_traits(list(TRAIT_GODMODE, TRAIT_DONT_WRITE_MEMORY), INNATE_TRAIT) RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved)) return ..() diff --git a/code/modules/mob/living/basic/ruin_defender/living_floor.dm b/code/modules/mob/living/basic/ruin_defender/living_floor.dm index 105838f0c55..c84e602659b 100644 --- a/code/modules/mob/living/basic/ruin_defender/living_floor.dm +++ b/code/modules/mob/living/basic/ruin_defender/living_floor.dm @@ -26,7 +26,6 @@ icon_living = "floor" mob_size = MOB_SIZE_HUGE mob_biotypes = MOB_SPECIAL - status_flags = GODMODE //nothing but crowbars may kill us death_message = "" unsuitable_atmos_damage = 0 minimum_survivable_temperature = 0 @@ -52,7 +51,7 @@ /mob/living/basic/living_floor/Initialize(mapload) . = ..() - ADD_TRAIT(src, TRAIT_IMMOBILIZED, INNATE_TRAIT) + add_traits(list(TRAIT_GODMODE, TRAIT_IMMOBILIZED), INNATE_TRAIT) //nothing but crowbars may kill us var/static/list/connections = list(COMSIG_ATOM_ENTERED = PROC_REF(look_aggro), COMSIG_ATOM_EXITED = PROC_REF(look_deaggro)) AddComponent(/datum/component/connect_range, tracked = src, connections = connections, range = 1, works_in_containers = FALSE) diff --git a/code/modules/mob/living/basic/space_fauna/bear/_bear.dm b/code/modules/mob/living/basic/space_fauna/bear/_bear.dm index f4a1267e9db..9080e040f51 100644 --- a/code/modules/mob/living/basic/space_fauna/bear/_bear.dm +++ b/code/modules/mob/living/basic/space_fauna/bear/_bear.dm @@ -94,12 +94,11 @@ /mob/living/basic/bear/snow/ancient name = "ancient polar bear" desc = "A grizzled old polar bear, its hide thick enough to make it impervious to almost all weapons." - status_flags = CANPUSH | GODMODE gold_core_spawnable = NO_SPAWN /mob/living/basic/bear/snow/Initialize(mapload) . = ..() - ADD_TRAIT(src, TRAIT_SNOWSTORM_IMMUNE, INNATE_TRAIT) + add_traits(list(TRAIT_GODMODE, TRAIT_SNOWSTORM_IMMUNE), INNATE_TRAIT) /mob/living/basic/bear/russian name = "combat bear" diff --git a/code/modules/mob/living/basic/space_fauna/wumborian_fugu/inflation.dm b/code/modules/mob/living/basic/space_fauna/wumborian_fugu/inflation.dm index bba6e0eb460..a25b3c52ad8 100644 --- a/code/modules/mob/living/basic/space_fauna/wumborian_fugu/inflation.dm +++ b/code/modules/mob/living/basic/space_fauna/wumborian_fugu/inflation.dm @@ -58,13 +58,12 @@ return FALSE RegisterSignal(fugu, COMSIG_MOB_STATCHANGE, PROC_REF(check_death)) fugu.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/inflated) - ADD_TRAIT(fugu, TRAIT_FUGU_GLANDED, TRAIT_STATUS_EFFECT(id)) + fugu.add_traits(list(TRAIT_FUGU_GLANDED, TRAIT_GODMODE), TRAIT_STATUS_EFFECT(id)) fugu.AddElement(/datum/element/wall_tearer, allow_reinforced = FALSE) fugu.mob_size = MOB_SIZE_LARGE fugu.icon_state = "Fugu1" fugu.melee_damage_lower = 15 fugu.melee_damage_upper = 20 - fugu.status_flags |= GODMODE fugu.obj_damage = 60 fugu.ai_controller.set_blackboard_key(BB_BASIC_MOB_STOP_FLEEING, TRUE) fugu.ai_controller.CancelActions() @@ -76,12 +75,11 @@ return // Check again in case you changed mob after application but somehow kept the status effect UnregisterSignal(fugu, COMSIG_MOB_STATCHANGE) fugu.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/inflated) - REMOVE_TRAIT(fugu, TRAIT_FUGU_GLANDED, TRAIT_STATUS_EFFECT(id)) + fugu.remove_traits(list(TRAIT_FUGU_GLANDED, TRAIT_GODMODE), TRAIT_STATUS_EFFECT(id)) fugu.RemoveElement(/datum/element/wall_tearer, allow_reinforced = FALSE) fugu.mob_size = MOB_SIZE_SMALL fugu.melee_damage_lower = 0 fugu.melee_damage_upper = 0 - fugu.status_flags &= ~GODMODE if (fugu.stat != DEAD) fugu.icon_state = "Fugu0" fugu.obj_damage = 0 diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 7d5d6bec936..5d4cf831f90 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -122,7 +122,7 @@ //Makes a blood drop, leaking amt units of blood from the mob /mob/living/carbon/proc/bleed(amt) - if(!blood_volume || (status_flags & GODMODE)) + if(!blood_volume || HAS_TRAIT(src, TRAIT_GODMODE)) return blood_volume = max(blood_volume - amt, 0) diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 9bebeac70ec..7ffe49951ec 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -14,7 +14,7 @@ handle_emp_damage(seconds_per_tick, times_fired) /mob/living/brain/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(health > HEALTH_THRESHOLD_DEAD) return diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 147079ae720..52f7b8dfc47 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -11,7 +11,7 @@ /mob/living/carbon/alien/larva/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= -maxHealth || !get_organ_by_type(/obj/item/organ/internal/brain)) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index f7ecd307517..7bd7d7aec49 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -3,7 +3,7 @@ return..() /mob/living/carbon/alien/check_breath(datum/gas_mixture/breath) - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(!breath || (breath.total_moles() == 0)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index a4becbcd0eb..b56351f9063 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -550,7 +550,7 @@ //Updates the mob's health from bodyparts and mob damage variables /mob/living/carbon/updatehealth() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/total_burn = 0 var/total_brute = 0 @@ -835,7 +835,7 @@ /mob/living/carbon/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= HEALTH_THRESHOLD_DEAD && !HAS_TRAIT(src, TRAIT_NODEATH)) diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index b781b296bc8..2b50c215f89 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -103,7 +103,7 @@ . = heal_overall_damage(brute = abs(amount), required_bodytype = required_bodytype, updating_health = updating_health, forced = forced) /mob/living/carbon/setBruteLoss(amount, updating_health = TRUE, forced = FALSE, required_bodytype) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE var/current = getBruteLoss() var/diff = amount - current @@ -120,7 +120,7 @@ . = heal_overall_damage(burn = abs(amount), required_bodytype = required_bodytype, updating_health = updating_health, forced = forced) /mob/living/carbon/setFireLoss(amount, updating_health = TRUE, forced = FALSE, required_bodytype) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE var/current = getFireLoss() var/diff = amount - current @@ -150,7 +150,7 @@ apply_status_effect(/datum/status_effect/incapacitating/stamcrit) /** - * If an organ exists in the slot requested, and we are capable of taking damage (we don't have [GODMODE] on), call the damage proc on that organ. + * If an organ exists in the slot requested, and we are capable of taking damage (we don't have TRAIT_GODMODE), call the damage proc on that organ. * * Arguments: * * slot - organ slot, like [ORGAN_SLOT_HEART] @@ -162,14 +162,14 @@ */ /mob/living/carbon/adjustOrganLoss(slot, amount, maximum, required_organ_flag = NONE) var/obj/item/organ/affected_organ = get_organ_slot(slot) - if(!affected_organ || (status_flags & GODMODE)) + if(!affected_organ || HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if(required_organ_flag && !(affected_organ.organ_flags & required_organ_flag)) return FALSE return affected_organ.apply_organ_damage(amount, maximum) /** - * If an organ exists in the slot requested, and we are capable of taking damage (we don't have [GODMODE] on), call the set damage proc on that organ, which can + * If an organ exists in the slot requested, and we are capable of taking damage (we don't have TRAIT_GODMODE), call the set damage proc on that organ, which can * set or clear the failing variable on that organ, making it either cease or start functions again, unlike adjustOrganLoss. * * Arguments: @@ -181,7 +181,7 @@ */ /mob/living/carbon/setOrganLoss(slot, amount, required_organ_flag = NONE) var/obj/item/organ/affected_organ = get_organ_slot(slot) - if(!affected_organ || (status_flags & GODMODE)) + if(!affected_organ || HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if(required_organ_flag && !(affected_organ.organ_flags & required_organ_flag)) return FALSE @@ -267,7 +267,7 @@ */ /mob/living/carbon/take_bodypart_damage(brute = 0, burn = 0, updating_health = TRUE, required_bodytype, check_armor = FALSE, wound_bonus = 0, bare_wound_bonus = 0, sharpness = NONE) . = FALSE - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/list/obj/item/bodypart/parts = get_damageable_bodyparts(required_bodytype) if(!parts.len) @@ -314,7 +314,7 @@ /mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, forced = FALSE, required_bodytype) . = FALSE - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return // treat negative args as positive brute = abs(brute) diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index f13e90719c1..23b1ad51266 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -1,13 +1,16 @@ /mob/living/carbon/human/dummy real_name = "Test Dummy" - status_flags = GODMODE|CANPUSH mouse_drag_pointer = MOUSE_INACTIVE_POINTER visual_only_organs = TRUE var/in_use = FALSE INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) +/mob/living/carbon/human/dummy/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_GODMODE, INNATE_TRAIT) + /mob/living/carbon/human/dummy/Destroy() in_use = FALSE return ..() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index af693717e36..db6ad1a80e3 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -147,7 +147,7 @@ /mob/living/carbon/proc/check_breath(datum/gas_mixture/breath) . = TRUE - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) failed_last_breath = FALSE clear_alert(ALERT_NOT_ENOUGH_OXYGEN) return diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 1ae6d3357e5..4c8aee27d02 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -266,7 +266,7 @@ return bruteloss /mob/living/proc/can_adjust_brute_loss(amount, forced, required_bodytype) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if(SEND_SIGNAL(src, COMSIG_LIVING_ADJUST_BRUTE_DAMAGE, BRUTE, amount, forced) & COMPONENT_IGNORE_CHANGE) return FALSE @@ -285,7 +285,7 @@ /mob/living/proc/setBruteLoss(amount, updating_health = TRUE, forced = FALSE, required_bodytype = ALL) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE . = bruteloss bruteloss = amount @@ -301,7 +301,7 @@ /mob/living/proc/can_adjust_oxy_loss(amount, forced, required_biotype, required_respiration_type) if(!forced) - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if (required_respiration_type) var/obj/item/organ/internal/lungs/affected_lungs = get_organ_slot(ORGAN_SLOT_LUNGS) @@ -328,7 +328,7 @@ /mob/living/proc/setOxyLoss(amount, updating_health = TRUE, forced = FALSE, required_biotype = ALL, required_respiration_type = ALL) if(!forced) - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE var/obj/item/organ/internal/lungs/affected_lungs = get_organ_slot(ORGAN_SLOT_LUNGS) @@ -350,7 +350,7 @@ return toxloss /mob/living/proc/can_adjust_tox_loss(amount, forced, required_biotype = ALL) - if(!forced && ((status_flags & GODMODE) || !(mob_biotypes & required_biotype))) + if(!forced && (HAS_TRAIT(src, TRAIT_GODMODE) || !(mob_biotypes & required_biotype))) return FALSE if(SEND_SIGNAL(src, COMSIG_LIVING_ADJUST_TOX_DAMAGE, TOX, amount, forced) & COMPONENT_IGNORE_CHANGE) return FALSE @@ -385,7 +385,7 @@ /mob/living/proc/setToxLoss(amount, updating_health = TRUE, forced = FALSE, required_biotype = ALL) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if(!forced && !(mob_biotypes & required_biotype)) return FALSE @@ -401,7 +401,7 @@ return fireloss /mob/living/proc/can_adjust_fire_loss(amount, forced, required_bodytype) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return FALSE if(SEND_SIGNAL(src, COMSIG_LIVING_ADJUST_BURN_DAMAGE, BURN, amount, forced) & COMPONENT_IGNORE_CHANGE) return FALSE @@ -419,7 +419,7 @@ updatehealth() /mob/living/proc/setFireLoss(amount, updating_health = TRUE, forced = FALSE, required_bodytype = ALL) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return 0 . = fireloss fireloss = amount @@ -442,7 +442,7 @@ return staminaloss /mob/living/proc/can_adjust_stamina_loss(amount, forced, required_biotype = ALL) - if(!forced && (!(mob_biotypes & required_biotype) || status_flags & GODMODE)) + if(!forced && (!(mob_biotypes & required_biotype) || HAS_TRAIT(src, TRAIT_GODMODE))) return FALSE if(SEND_SIGNAL(src, COMSIG_LIVING_ADJUST_STAMINA_DAMAGE, STAMINA, amount, forced) & COMPONENT_IGNORE_CHANGE) return FALSE @@ -464,7 +464,7 @@ return delta /mob/living/proc/setStaminaLoss(amount, updating_stamina = TRUE, forced = FALSE, required_biotype = ALL) - if(!forced && (status_flags & GODMODE)) + if(!forced && HAS_TRAIT(src, TRAIT_GODMODE)) return 0 if(!forced && !(mob_biotypes & required_biotype)) return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 005eff4d542..2ba8dc82192 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -798,7 +798,7 @@ /mob/living/proc/updatehealth() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return set_health(maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()) update_stat() @@ -1438,7 +1438,7 @@ * Returns a mob (what our mob turned into) or null (if we failed). */ /mob/living/proc/wabbajack(what_to_randomize, change_flags = WABBAJACK) - if(stat == DEAD || (GODMODE & status_flags) || HAS_TRAIT(src, TRAIT_NO_TRANSFORM)) + if(stat == DEAD || HAS_TRAIT(src, TRAIT_GODMODE) || HAS_TRAIT(src, TRAIT_NO_TRANSFORM)) return if(SEND_SIGNAL(src, COMSIG_LIVING_PRE_WABBAJACKED, what_to_randomize) & STOP_WABBAJACK) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 2b61f5ac68d..789a5c2ccd2 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -538,7 +538,7 @@ return 20 /mob/living/narsie_act() - if(status_flags & GODMODE || QDELETED(src)) + if(HAS_TRAIT(src, TRAIT_GODMODE) || QDELETED(src)) return if(GLOB.cult_narsie && GLOB.cult_narsie.souls_needed[src]) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index b11f125d38c..34aa7a0714a 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -47,7 +47,7 @@ return !T || !A || ((!A.power_equip || isspaceturf(T)) && !is_type_in_list(loc, list(/obj/item, /obj/vehicle/sealed/mecha))) /mob/living/silicon/ai/updatehealth() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/old_health = health @@ -63,7 +63,7 @@ SEND_SIGNAL(src, COMSIG_LIVING_HEALTH_UPDATE) /mob/living/silicon/ai/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= HEALTH_THRESHOLD_DEAD) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 04de7c928e1..1d3562d9dfb 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -666,7 +666,7 @@ return ..() /mob/living/silicon/robot/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= -maxHealth) //die only once diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm index 7a8a2fcb63b..075b40afeeb 100644 --- a/code/modules/mob/living/simple_animal/damage_procs.dm +++ b/code/modules/mob/living/simple_animal/damage_procs.dm @@ -4,11 +4,11 @@ * Arguments: * * amount The amount that will be used to adjust the mob's health * * updating_health If the mob's health should be immediately updated to the new value - * * forced If we should force update the adjustment of the mob's health no matter the restrictions, like GODMODE + * * forced If we should force update the adjustment of the mob's health no matter the restrictions, like TRAIT_GODMODE */ /mob/living/simple_animal/proc/adjustHealth(amount, updating_health = TRUE, forced = FALSE) . = FALSE - if(forced || !(status_flags & GODMODE)) + if(forced || !HAS_TRAIT(src, TRAIT_GODMODE)) bruteloss = round(clamp(bruteloss + amount, 0, maxHealth * 2), DAMAGE_PRECISION) if(updating_health) updatehealth() diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 0803d96a706..5b0cfdcc51e 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -254,8 +254,8 @@ return FALSE if(ismob(the_target)) //Target is in godmode, ignore it. - var/mob/M = the_target - if(M.status_flags & GODMODE) + var/mob/mob = the_target + if(HAS_TRAIT(mob, TRAIT_GODMODE)) return FALSE if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index d09de265dda..3cfc4e7dd35 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -527,8 +527,7 @@ . = ..() if(isliving(arrived) && holder_animal) var/mob/living/possessor = arrived - possessor.add_traits(list(TRAIT_UNDENSE, TRAIT_NO_TRANSFORM), STASIS_MUTE) - possessor.status_flags |= GODMODE + possessor.add_traits(list(TRAIT_UNDENSE, TRAIT_NO_TRANSFORM, TRAIT_GODMODE), STASIS_MUTE) possessor.mind.transfer_to(holder_animal) var/datum/action/exit_possession/escape = new(holder_animal) escape.Grant(holder_animal) @@ -536,8 +535,7 @@ /obj/structure/closet/stasis/dump_contents(kill = TRUE) for(var/mob/living/possessor in src) - possessor.remove_traits(list(TRAIT_UNDENSE, TRAIT_NO_TRANSFORM), STASIS_MUTE) - possessor.status_flags &= ~GODMODE + possessor.remove_traits(list(TRAIT_UNDENSE, TRAIT_NO_TRANSFORM, TRAIT_GODMODE), STASIS_MUTE) if(kill || !isanimal_or_basicmob(loc)) possessor.investigate_log("has died from [src].", INVESTIGATE_DEATHS) possessor.death(FALSE) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9d5041fe870..179b50710c1 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -234,7 +234,7 @@ . += "There appears to be [icon2html(access_card, user)] \a [access_card] pinned to [p_them()]." /mob/living/simple_animal/update_stat() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return if(stat != DEAD) if(health <= 0) @@ -389,8 +389,8 @@ if(see_invisible < the_target.invisibility) return FALSE if(ismob(the_target)) - var/mob/M = the_target - if(M.status_flags & GODMODE) + var/mob/mob = the_target + if(HAS_TRAIT(mob, TRAIT_GODMODE)) return FALSE if (isliving(the_target)) var/mob/living/L = the_target diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index c0e2058f23e..7bf067c7a12 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -10,7 +10,7 @@ /mob/living/proc/check_stun_immunity(check_flags = CANSTUN, force_stun = FALSE) SHOULD_CALL_PARENT(TRUE) - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return TRUE if(force_stun) // Does not take priority over god mode? I guess @@ -385,7 +385,7 @@ /mob/living/proc/Sleeping(amount) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) @@ -397,7 +397,7 @@ /mob/living/proc/SetSleeping(amount) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(amount <= 0) @@ -412,7 +412,7 @@ /mob/living/proc/AdjustSleeping(amount) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) @@ -425,7 +425,7 @@ /mob/living/proc/PermaSleeping() if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, -1) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index 5792fef8e6a..43e45881903 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -259,7 +259,7 @@ return radio.screwdriver_act(user, tool) /mob/living/silicon/pai/updatehealth() - if(status_flags & GODMODE) + if(HAS_TRAIT(src, TRAIT_GODMODE)) return set_health(maxHealth - getBruteLoss() - getFireLoss()) update_stat() diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 0e7957b65fb..bbc1030f0d6 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -187,8 +187,8 @@ /obj/energy_ball/proc/dust_mobs(atom/A) if(isliving(A)) - var/mob/living/L = A - if(L.incorporeal_move || L.status_flags & GODMODE) + var/mob/living/living = A + if(living.incorporeal_move || HAS_TRAIT(living, TRAIT_GODMODE)) return if(!iscarbon(A)) return diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 832d266723d..227f1be5165 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -11,8 +11,7 @@ var/originalcolor /datum/status_effect/rainbow_protection/on_apply() - owner.status_flags |= GODMODE - ADD_TRAIT(owner, TRAIT_PACIFISM, /datum/status_effect/rainbow_protection) + owner.add_traits(list(TRAIT_GODMODE, TRAIT_PACIFISM), TRAIT_STATUS_EFFECT(id)) owner.visible_message(span_warning("[owner] shines with a brilliant rainbow light."), span_notice("You feel protected by an unknown force!")) originalcolor = owner.color @@ -23,9 +22,8 @@ return ..() /datum/status_effect/rainbow_protection/on_remove() - owner.status_flags &= ~GODMODE owner.color = originalcolor - REMOVE_TRAIT(owner, TRAIT_PACIFISM, /datum/status_effect/rainbow_protection) + owner.remove_traits(list(TRAIT_GODMODE, TRAIT_PACIFISM), TRAIT_STATUS_EFFECT(id)) owner.visible_message(span_notice("[owner] stops glowing, the rainbow light fading away."), span_warning("You no longer feel protected...")) @@ -106,7 +104,7 @@ RegisterSignal(owner, COMSIG_LIVING_RESIST, PROC_REF(breakCube)) cube = new /obj/structure/ice_stasis(get_turf(owner)) owner.forceMove(cube) - owner.status_flags |= GODMODE + ADD_TRAIT(owner, TRAIT_GODMODE, TRAIT_STATUS_EFFECT(id)) return ..() /datum/status_effect/frozenstasis/tick(seconds_between_ticks) @@ -121,7 +119,7 @@ /datum/status_effect/frozenstasis/on_remove() if(cube) qdel(cube) - owner.status_flags &= ~GODMODE + REMOVE_TRAIT(owner, TRAIT_GODMODE, TRAIT_STATUS_EFFECT(id)) UnregisterSignal(owner, COMSIG_LIVING_RESIST) /datum/status_effect/slime_clone diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 484fa32ac87..3cbe494c8d0 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -153,9 +153,10 @@ /obj/structure/table/abductor/wabbajack/right desc = "It wakes so you may sleep." -// Bar staff, GODMODE mobs(as long as they stay in the shuttle) that just want to make sure people have drinks -// and a good time. - +/** + * Bar staff, mobs with the TRAIT_GODMODE trait (as long as they stay in the shuttle) + * that just want to make sure people have drinks and a good shuttle time. + */ /mob/living/basic/drone/snowflake/bardrone name = "Bardrone" desc = "A barkeeping drone, a robot built to tend bars." diff --git a/code/modules/spells/spell_types/self/rod_form.dm b/code/modules/spells/spell_types/self/rod_form.dm index 9989c4420c0..6f26ab16719 100644 --- a/code/modules/spells/spell_types/self/rod_form.dm +++ b/code/modules/spells/spell_types/self/rod_form.dm @@ -138,8 +138,7 @@ our_wizard = WEAKREF(wizard) wizard.forceMove(src) - wizard.status_flags |= GODMODE - wizard.add_traits(list(TRAIT_MAGICALLY_PHASED, TRAIT_NO_TRANSFORM), REF(src)) + wizard.add_traits(list(TRAIT_GODMODE, TRAIT_MAGICALLY_PHASED, TRAIT_NO_TRANSFORM), REF(src)) /** * Eject our current wizard, removing them from the rod @@ -150,8 +149,7 @@ if(QDELETED(wizard)) return - wizard.status_flags &= ~GODMODE - wizard.remove_traits(list(TRAIT_MAGICALLY_PHASED, TRAIT_NO_TRANSFORM), REF(src)) + wizard.remove_traits(list(TRAIT_GODMODE, TRAIT_MAGICALLY_PHASED, TRAIT_NO_TRANSFORM), REF(src)) wizard.forceMove(get_turf(src)) our_wizard = null diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 296f818e587..a264a7d1cc3 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -469,7 +469,7 @@ return FALSE if (!forced) if(!isnull(owner)) - if (owner.status_flags & GODMODE) + if (HAS_TRAIT(owner, TRAIT_GODMODE)) return FALSE if (SEND_SIGNAL(owner, COMSIG_CARBON_LIMB_DAMAGED, src, brute, burn) & COMPONENT_PREVENT_LIMB_DAMAGE) return FALSE diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 5579cb64d83..c53443503fd 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -9,9 +9,7 @@ if(!owner || (bodypart_flags & BODYPART_UNREMOVABLE)) return FALSE var/mob/living/carbon/limb_owner = owner - if(limb_owner.status_flags & GODMODE) - return FALSE - if(HAS_TRAIT(limb_owner, TRAIT_NODISMEMBER)) + if(HAS_TRAIT(limb_owner, TRAIT_GODMODE) || HAS_TRAIT(limb_owner, TRAIT_NODISMEMBER)) return FALSE var/obj/item/bodypart/affecting = limb_owner.get_bodypart(BODY_ZONE_CHEST) diff --git a/code/modules/surgery/bodyparts/wounds.dm b/code/modules/surgery/bodyparts/wounds.dm index 93d61b091d9..fa1f9a9c5d2 100644 --- a/code/modules/surgery/bodyparts/wounds.dm +++ b/code/modules/surgery/bodyparts/wounds.dm @@ -2,7 +2,7 @@ /obj/item/bodypart/proc/painless_wound_roll(wounding_type, wounding_dmg, wound_bonus, bare_wound_bonus, sharpness=NONE) SHOULD_CALL_PARENT(TRUE) - if(!owner || wounding_dmg <= WOUND_MINIMUM_DAMAGE || wound_bonus == CANT_WOUND || (owner.status_flags & GODMODE)) + if(!owner || wounding_dmg <= WOUND_MINIMUM_DAMAGE || wound_bonus == CANT_WOUND || HAS_TRAIT(owner, TRAIT_GODMODE)) return var/mangled_state = get_mangled_state() @@ -52,7 +52,7 @@ SHOULD_CALL_PARENT(TRUE) RETURN_TYPE(/datum/wound) - if(HAS_TRAIT(owner, TRAIT_NEVER_WOUNDED) || (owner.status_flags & GODMODE)) + if(HAS_TRAIT(owner, TRAIT_NEVER_WOUNDED) || HAS_TRAIT(owner, TRAIT_GODMODE)) return // note that these are fed into an exponent, so these are magnified diff --git a/code/modules/surgery/organs/internal/_internal_organ.dm b/code/modules/surgery/organs/internal/_internal_organ.dm index 9f67fb3d899..8b7bd354931 100644 --- a/code/modules/surgery/organs/internal/_internal_organ.dm +++ b/code/modules/surgery/organs/internal/_internal_organ.dm @@ -17,7 +17,7 @@ /obj/item/organ/internal/on_mob_remove(mob/living/carbon/organ_owner, special = FALSE) . = ..() - if((organ_flags & ORGAN_VITAL) && !special && !(organ_owner.status_flags & GODMODE)) + if((organ_flags & ORGAN_VITAL) && !special && !HAS_TRAIT(organ_owner, TRAIT_GODMODE)) if(organ_owner.stat != DEAD) organ_owner.investigate_log("has been killed by losing a vital organ ([src]).", INVESTIGATE_DEATHS) organ_owner.death() diff --git a/code/modules/surgery/organs/internal/ears/_ears.dm b/code/modules/surgery/organs/internal/ears/_ears.dm index 53b95b54d9b..9fd0d89adfd 100644 --- a/code/modules/surgery/organs/internal/ears/_ears.dm +++ b/code/modules/surgery/organs/internal/ears/_ears.dm @@ -64,7 +64,7 @@ * * ddeaf: Handles temporary deafness, 1 ddeaf = 2 seconds of deafness, by default (with no multiplier) */ /obj/item/organ/internal/ears/proc/adjustEarDamage(ddmg = 0, ddeaf = 0) - if(owner.status_flags & GODMODE) + if(HAS_TRAIT(owner, TRAIT_GODMODE)) update_temp_deafness() return @@ -85,7 +85,7 @@ if(isnull(owner)) return - if(owner.status_flags & GODMODE) + if(HAS_TRAIT(owner, TRAIT_GODMODE)) deaf = 0 if(deaf > 0) diff --git a/code/modules/surgery/organs/internal/lungs/_lungs.dm b/code/modules/surgery/organs/internal/lungs/_lungs.dm index 9b38803dd77..5f435fff98e 100644 --- a/code/modules/surgery/organs/internal/lungs/_lungs.dm +++ b/code/modules/surgery/organs/internal/lungs/_lungs.dm @@ -592,7 +592,7 @@ * * breather: A carbon mob that is using the lungs to breathe. */ /obj/item/organ/internal/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/breather) - if(breather.status_flags & GODMODE) + if(HAS_TRAIT(breather, TRAIT_GODMODE)) breather.failed_last_breath = FALSE breather.clear_alert(ALERT_NOT_ENOUGH_OXYGEN) return FALSE diff --git a/code/modules/unit_tests/mob_damage.dm b/code/modules/unit_tests/mob_damage.dm index 64b12b8f477..7496eb64434 100644 --- a/code/modules/unit_tests/mob_damage.dm +++ b/code/modules/unit_tests/mob_damage.dm @@ -289,8 +289,8 @@ /datum/unit_test/mob_damage/proc/test_godmode(mob/living/carbon/human/consistent/dummy) // Heal up, so that errors from the previous tests we won't cause this one to fail dummy.fully_heal(HEAL_DAMAGE) - // flip godmode bit to 1 - dummy.status_flags ^= GODMODE + // add godmode + ADD_TRAIT(dummy, TRAIT_GODMODE, TRAIT_GENERIC) // Apply 9 damage and then heal it if(!test_apply_damage(dummy, amount = 9, expected = 0)) @@ -306,8 +306,8 @@ if(!test_apply_damage(dummy, amount = -11, forced = TRUE)) TEST_FAIL("ABOVE FAILURE: failed test_godmode! godmode did not respect forced = TRUE") - // flip godmode bit back to 0 - dummy.status_flags ^= GODMODE + // remove godmode + REMOVE_TRAIT(dummy, TRAIT_GODMODE, TRAIT_GENERIC) /// Testing biotypes /datum/unit_test/mob_damage/proc/test_biotypes(mob/living/carbon/human/consistent/dummy) diff --git a/code/modules/unit_tests/strange_reagent.dm b/code/modules/unit_tests/strange_reagent.dm index e5e385b86fd..bcdf89f0a9c 100644 --- a/code/modules/unit_tests/strange_reagent.dm +++ b/code/modules/unit_tests/strange_reagent.dm @@ -24,7 +24,7 @@ var/is_basic = istype(target, /mob/living/basic) var/is_simple = istype(target, /mob/living/simple_animal) // check some basic stuff - if(target.status_flags & GODMODE) + if(HAS_TRAIT(target, TRAIT_GODMODE)) continue if(!(target.mob_biotypes & MOB_ORGANIC)) continue