From 849340274d51d822dddac1a1dda75f4c1c37da5c Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:38:28 +0100 Subject: [PATCH] sdaf (#18321) --- .vscode/dm_flags.code-snippets | 36 +++++++++++++--- code/__DEFINES/_compile_helpers.dm | 2 - code/__HELPERS/smart_token_bucket.dm | 4 +- code/__HELPERS/unsorted.dm | 32 +++++++------- code/_onclick/click.dm | 2 +- .../hud/screen_object_types/internals.dm | 4 +- code/_onclick/item_attack.dm | 2 +- code/controllers/subsystems/machinery.dm | 2 +- code/game/antagonist/antagonist_equip.dm | 2 +- code/game/atoms.dm | 18 ++++---- code/game/atoms_movable.dm | 2 +- code/game/dna/dna_modifier.dm | 4 +- code/game/dna/genes/disabilities.dm | 4 +- code/game/dna/genes/powers.dm | 4 +- .../changeling/implements/powers/stings.dm | 2 +- .../changeling/implements/powers/suck.dm | 2 +- code/game/gamemodes/cult/structures/altar.dm | 2 +- .../game/gamemodes/technomancer/spell_objs.dm | 2 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/autolathe/autolathe.dm | 6 +-- code/game/machinery/computer/cloning.dm | 2 +- code/game/machinery/cryo.dm | 2 +- code/game/machinery/iv_drip.dm | 2 +- code/game/objects/effects/chem/foam.dm | 2 +- .../items/devices/lighting/flashlight.dm | 4 +- code/game/objects/items/devices/scanners.dm | 4 +- .../objects/items/weapons/dna_injector.dm | 2 +- code/game/objects/items/weapons/weaponry.dm | 2 +- code/game/objects/structures.dm | 2 +- code/game/objects/structures/crystals.dm | 2 +- code/game/objects/structures/girders.dm | 2 +- code/game/objects/structures/gore/wall.dm | 2 +- code/game/objects/structures/grille.dm | 2 +- code/game/objects/structures/window.dm | 2 +- code/game/turfs/simulated/wall_attacks.dm | 2 +- code/modules/assembly/mousetrap.dm | 2 +- .../spacesuits/rig/modules/utility.dm | 2 +- .../subtypes/reagents.dm | 2 +- code/modules/maps/ruins.dm | 6 +-- code/modules/martial_arts/martial.dm | 2 +- .../mob/living/carbon/alien/alien_attacks.dm | 2 +- code/modules/mob/living/carbon/alien/life.dm | 2 +- code/modules/mob/living/carbon/brain/life.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 4 +- .../mob/living/carbon/carbon_defense.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 4 +- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 16 +++---- .../living/carbon/human/human_attackhand.dm | 4 +- .../mob/living/carbon/human/human_damage.dm | 8 ++-- .../mob/living/carbon/human/human_helpers.dm | 4 +- .../mob/living/carbon/human/human_movement.dm | 4 +- code/modules/mob/living/carbon/human/life.dm | 10 ++--- .../mob/living/carbon/human/update_icons.dm | 12 +++--- code/modules/mob/living/carbon/resist.dm | 4 +- code/modules/mob/living/carbon/slime/slime.dm | 2 +- code/modules/mob/living/damage_procs.dm | 2 +- code/modules/mob/living/living.dm | 8 ++-- code/modules/mob/living/living_defense.dm | 2 +- code/modules/mob/living/say.dm | 2 +- .../mob/living/silicon/robot/analyzer.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 2 +- .../simple_animal/hostile/giant_spider.dm | 2 +- .../living/simple_animal/hostile/hostile.dm | 2 +- code/modules/mob/mob.dm | 2 +- code/modules/organs/internal/lungs.dm | 2 +- code/modules/organs/organ_external.dm | 2 +- .../overmap/contacts/contact_sensors.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/guns/energy/magic.dm | 2 +- code/modules/psionics/abilities/assay.dm | 2 +- .../abilities/emotional_suggestion.dm | 2 +- code/modules/psionics/abilities/mend.dm | 6 +-- code/modules/psionics/interface/ui_hub.dm | 12 +++--- .../reagents/reagent_containers/inhaler.dm | 2 +- .../reagent_containers/inhaler_advanced.dm | 2 +- .../reagents/reagent_containers/syringes.dm | 2 +- code/modules/surgery/bones.dm | 2 +- code/modules/surgery/facial_surgery.dm | 4 +- code/unit_tests/smart_token_bucket.dm | 12 +++--- .../fluffyghost-hasflagnoflagaway.yml | 42 +++++++++++++++++++ maps/_common/mapsystem/map.dm | 4 +- 82 files changed, 228 insertions(+), 164 deletions(-) create mode 100644 html/changelogs/fluffyghost-hasflagnoflagaway.yml diff --git a/.vscode/dm_flags.code-snippets b/.vscode/dm_flags.code-snippets index f3c0fa9a30c..299f9ebc38b 100644 --- a/.vscode/dm_flags.code-snippets +++ b/.vscode/dm_flags.code-snippets @@ -18,12 +18,36 @@ // // Refer to https://code.visualstudio.com/docs/editor/userdefinedsnippets - "CHECK_FLAG": { - "prefix": ["CHECK_FLAG", "HAS_FLAG", "NOT_FLAG"], - "body": ["${1|HAS_FLAG,NOT_FLAG|}(${2:variable}, ${3:flag})"] - }, "SET_FLAG": { - "prefix": ["SET_FLAG", "BITFLAG"], - "body": ["${1:variable} = BITFLAG(${2:flag_position})"] + "prefix": ["SET_FLAG"], + "body": ["${1:variable} = BITFLAG(${2:flag_position})"] }, + "HAS_FLAG": { + "prefix": ["HAS_FLAG"], + "description": "Checks that a flag is set", + "body": ["(${1:variable} & ${2:flag})"] + }, + "NOT_FLAG": { + "prefix": ["NOT_FLAG"], + "description": "Checks that a flag is NOT set", + "body": ["!(${1:variable} & ${2:flag})"] + }, + + //Bits-related snippets + "SET_BIT": { + "prefix": ["SET_BIT"], + "description": "Set bit at index BIT", + "body": ["(${1:variable} |= BITFLAG(${2:index}))"] + }, + "CLEAR_BIT": { + "prefix": ["CLEAR_BIT"], + "description": "Unset bit at index BIT", + "body": ["(${1:variable} &= ~BITFLAG(${2:index}))"] + }, + "FLIP_BIT": { + "prefix": ["FLIP_BIT"], + "description": "Flip bit at index BIT", + "body": ["(${1:variable} ^= BITFLAG(${2:index}))"] + }, + } diff --git a/code/__DEFINES/_compile_helpers.dm b/code/__DEFINES/_compile_helpers.dm index 383d56d8446..5d3c06e1b4d 100644 --- a/code/__DEFINES/_compile_helpers.dm +++ b/code/__DEFINES/_compile_helpers.dm @@ -1,3 +1 @@ #define BITFLAG(X) (1<<(X)) -#define HAS_FLAG(flags, flag) (flags & flag) -#define NOT_FLAG(flags, flag) !HAS_FLAG(flags, flag) diff --git a/code/__HELPERS/smart_token_bucket.dm b/code/__HELPERS/smart_token_bucket.dm index 5a82d0e1de1..d396a23bca2 100644 --- a/code/__HELPERS/smart_token_bucket.dm +++ b/code/__HELPERS/smart_token_bucket.dm @@ -33,9 +33,9 @@ src.content = content /// TRUE if the bucket is operating in fixed TTL mode -#define STB_IS_FIXEDTTL_MODE (HAS_FLAG(src.mode, STB_MODE_FIXEDTTL)) +#define STB_IS_FIXEDTTL_MODE ((src.mode & STB_MODE_FIXEDTTL)) /// TRUE if the bucket is a leaky bucket -#define STB_IS_LEAKYBUCKET (HAS_FLAG(src.flags, STB_FLAG_LEAKYBUCKET)) +#define STB_IS_LEAKYBUCKET (src.flags & STB_FLAG_LEAKYBUCKET) /** * # Smart Token Bucket diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 260861ca45e..b697ba8f5ce 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -685,38 +685,38 @@ Turf and target are seperate in case you want to teleport some distance from a t return DO_MISSING_USER var/initial_handle - if (HAS_FLAG(do_flags, DO_USER_UNIQUE_ACT)) + if ((do_flags & DO_USER_UNIQUE_ACT)) initial_handle = sequential_id("/proc/do_after") user.do_unique_user_handle = initial_handle - var/do_feedback = HAS_FLAG(do_flags, DO_FAIL_FEEDBACK) + var/do_feedback = (do_flags & DO_FAIL_FEEDBACK) if(target?.do_unique_target_user) if (do_feedback) USE_FEEDBACK_FAILURE("\The [target.do_unique_target_user] is already interacting with \the [target]!") return DO_TARGET_UNIQUE_ACT - if (HAS_FLAG(do_flags, DO_TARGET_UNIQUE_ACT) && target) + if ((do_flags & DO_TARGET_UNIQUE_ACT) && target) target.do_unique_target_user = user - var/atom/user_loc = HAS_FLAG(do_flags, DO_USER_CAN_MOVE) ? null : user.loc - var/user_dir = HAS_FLAG(do_flags, DO_USER_CAN_TURN) ? null : user.dir - var/user_hand = HAS_FLAG(do_flags, DO_USER_SAME_HAND) ? user.hand : null + var/atom/user_loc = (do_flags & DO_USER_CAN_MOVE) ? null : user.loc + var/user_dir = (do_flags & DO_USER_CAN_TURN) ? null : user.dir + var/user_hand = (do_flags & DO_USER_SAME_HAND) ? user.hand : null - var/atom/target_loc = HAS_FLAG(do_flags, DO_TARGET_CAN_MOVE) ? null : target?.loc - var/target_dir = HAS_FLAG(do_flags, DO_TARGET_CAN_TURN) ? null : target?.dir + var/atom/target_loc = (do_flags & DO_TARGET_CAN_MOVE) ? null : target?.loc + var/target_dir = (do_flags & DO_TARGET_CAN_TURN) ? null : target?.dir var/target_type = target?.type - var/target_zone = HAS_FLAG(do_flags, DO_USER_SAME_ZONE) ? user.zone_sel.selecting : null + var/target_zone = (do_flags & DO_USER_SAME_ZONE) ? user.zone_sel.selecting : null - if (HAS_FLAG(do_flags, DO_MOVE_CHECKS_TURFS)) + if ((do_flags & DO_MOVE_CHECKS_TURFS)) if (user_loc) user_loc = get_turf(user) if (target_loc) target_loc = get_turf(target) var/datum/progressbar/progbar - if (HAS_FLAG(do_flags, DO_SHOW_PROGRESS) && user.client && (user.client.prefs.toggles_secondary & PROGRESS_BARS)) + if ((do_flags & DO_SHOW_PROGRESS) && user.client && (user.client.prefs.toggles_secondary & PROGRESS_BARS)) progbar = new(user, delay, target || user) SEND_SIGNAL(user, COMSIG_DO_AFTER_BEGAN) @@ -739,10 +739,10 @@ Turf and target are seperate in case you want to teleport some distance from a t if (user.incapacitated(incapacitation_flags)) . = DO_INCAPACITATED break - if (user_loc && user_loc != (HAS_FLAG(do_flags, DO_MOVE_CHECKS_TURFS) ? get_turf(user) : user.loc)) + if (user_loc && user_loc != ((do_flags & DO_MOVE_CHECKS_TURFS) ? get_turf(user) : user.loc)) . = DO_USER_CAN_MOVE break - if (target_loc && target_loc != (HAS_FLAG(do_flags, DO_MOVE_CHECKS_TURFS) ? get_turf(target) : target.loc)) + if (target_loc && target_loc != ((do_flags & DO_MOVE_CHECKS_TURFS) ? get_turf(target) : target.loc)) . = DO_TARGET_CAN_MOVE break if (user_dir && user_dir != user.dir) @@ -751,7 +751,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if (target_dir && target_dir != target.dir) . = DO_TARGET_CAN_TURN break - if (HAS_FLAG(do_flags, DO_USER_SAME_HAND) && user_hand != user.hand) + if ((do_flags & DO_USER_SAME_HAND) && user_hand != user.hand) . = DO_USER_SAME_HAND break if (initial_handle && initial_handle != user.do_unique_user_handle) @@ -787,9 +787,9 @@ Turf and target are seperate in case you want to teleport some distance from a t if(!QDELETED(progbar)) progbar.endProgress() - if (HAS_FLAG(do_flags, DO_USER_UNIQUE_ACT) && user.do_unique_user_handle == initial_handle) + if ((do_flags & DO_USER_UNIQUE_ACT) && user.do_unique_user_handle == initial_handle) user.do_unique_user_handle = 0 - if (HAS_FLAG(do_flags, DO_TARGET_UNIQUE_ACT) && target) + if ((do_flags & DO_TARGET_UNIQUE_ACT) && target) target.do_unique_target_user = null SEND_SIGNAL(user, COMSIG_DO_AFTER_ENDED) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 2691e45addc..805fa87b089 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -228,7 +228,7 @@ animals lunging, etc. */ /mob/proc/RangedAttack(var/atom/A, var/params) - if(HAS_FLAG(mutations, LASER_EYES) && a_intent == I_HURT) + if((mutations & LASER_EYES) && a_intent == I_HURT) LaserEyes(A, params) // moved into a proc below return A.attack_ranged(src, params) diff --git a/code/_onclick/hud/screen_object_types/internals.dm b/code/_onclick/hud/screen_object_types/internals.dm index 82166f150b8..2cfd33ab829 100644 --- a/code/_onclick/hud/screen_object_types/internals.dm +++ b/code/_onclick/hud/screen_object_types/internals.dm @@ -149,8 +149,8 @@ user.internal = null /obj/screen/internals/proc/has_internals_mask(var/mob/living/carbon/human/user) - if(user.wear_mask && HAS_FLAG(user.wear_mask.item_flags, ITEM_FLAG_AIRTIGHT)) + if(user.wear_mask && (user.wear_mask.item_flags & ITEM_FLAG_AIRTIGHT)) return TRUE - if(user.head && HAS_FLAG(user.head.item_flags, ITEM_FLAG_AIRTIGHT)) + if(user.head && (user.head.item_flags & ITEM_FLAG_AIRTIGHT)) return TRUE return FALSE diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index c2ebe997ed4..15fc75a123a 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -130,7 +130,7 @@ avoid code duplication. This includes items that may sometimes act as a standard //Called when a weapon is used to make a successful melee attack on a mob. Returns whether damage was dealt. /obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone) var/power = force - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) power *= 2 if(user.is_berserk()) power *= 1.5 diff --git a/code/controllers/subsystems/machinery.dm b/code/controllers/subsystems/machinery.dm index fc9158cb69c..9342f1c53ed 100644 --- a/code/controllers/subsystems/machinery.dm +++ b/code/controllers/subsystems/machinery.dm @@ -204,7 +204,7 @@ SUBSYSTEM_DEF(machinery) processing -= machine continue //process_all was moved here because of calls overhead for no benefits - if(HAS_FLAG(machine.processing_flags, MACHINERY_PROCESS_SELF)) + if((machine.processing_flags & MACHINERY_PROCESS_SELF)) if(machine.process(wait * 0.1) == PROCESS_KILL) STOP_PROCESSING_MACHINE(machine, MACHINERY_PROCESS_SELF) processing -= machine diff --git a/code/game/antagonist/antagonist_equip.dm b/code/game/antagonist/antagonist_equip.dm index bf8eeb88023..c2d733d4e9f 100644 --- a/code/game/antagonist/antagonist_equip.dm +++ b/code/game/antagonist/antagonist_equip.dm @@ -11,7 +11,7 @@ player.species.before_equip(player) - if(HAS_FLAG(flags, ANTAG_CLEAR_EQUIPMENT) && has_idris_account) + if((flags & ANTAG_CLEAR_EQUIPMENT) && has_idris_account) var/datum/money_account/money_account = SSeconomy.create_account("John Doe", rand(idris_account_min, idris_account_max), null, FALSE) if(player.mind) var/remembered_info = "" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f23deacfe00..d8ad1186ced 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -165,40 +165,40 @@ */ /atom/proc/use_check(mob/user, use_flags = 0, show_messages = FALSE) . = USE_SUCCESS - if(NOT_FLAG(use_flags, USE_ALLOW_NONLIVING) && !isliving(user)) // No message for ghosts. + if(!(use_flags & USE_ALLOW_NONLIVING) && !isliving(user)) // No message for ghosts. return USE_FAIL_NONLIVING - if(NOT_FLAG(use_flags, USE_ALLOW_NON_ADJACENT) && !Adjacent(user)) + if(!(use_flags & USE_ALLOW_NON_ADJACENT) && !Adjacent(user)) if (show_messages) to_chat(user, SPAN_NOTICE("You're too far away from [src] to do that.")) return USE_FAIL_NON_ADJACENT - if(NOT_FLAG(use_flags, USE_ALLOW_DEAD) && user.stat == DEAD) + if(!(use_flags & USE_ALLOW_DEAD) && user.stat == DEAD) if (show_messages) to_chat(user, SPAN_NOTICE("How do you expect to do that when you're dead?")) return USE_FAIL_DEAD - if(NOT_FLAG(use_flags, USE_ALLOW_INCAPACITATED) && (user.incapacitated())) + if(!(use_flags & USE_ALLOW_INCAPACITATED) && (user.incapacitated())) if (show_messages) to_chat(user, SPAN_NOTICE("You cannot do that in your current state.")) return USE_FAIL_INCAPACITATED - if(NOT_FLAG(use_flags, USE_ALLOW_NON_ADV_TOOL_USR) && !user.IsAdvancedToolUser()) + if(!(use_flags & USE_ALLOW_NON_ADV_TOOL_USR) && !user.IsAdvancedToolUser()) if (show_messages) to_chat(user, SPAN_NOTICE("You don't know how to operate [src].")) return USE_FAIL_NON_ADV_TOOL_USR - if(HAS_FLAG(use_flags, USE_DISALLOW_SILICONS) && issilicon(user)) + if((use_flags & USE_DISALLOW_SILICONS) && issilicon(user)) if (show_messages) to_chat(user, SPAN_NOTICE("How do you propose doing that without hands?")) return USE_FAIL_IS_SILICON - if(HAS_FLAG(use_flags, USE_DISALLOW_SPECIALS) && is_mob_special(user)) + if((use_flags & USE_DISALLOW_SPECIALS) && is_mob_special(user)) if (show_messages) to_chat(user, SPAN_NOTICE("Your current mob type prevents you from doing this.")) return USE_FAIL_IS_MOB_SPECIAL - if(HAS_FLAG(use_flags, USE_FORCE_SRC_IN_USER) && !(src in user)) + if((use_flags & USE_FORCE_SRC_IN_USER) && !(src in user)) if (show_messages) to_chat(user, SPAN_NOTICE("You need to be holding [src] to do that.")) return USE_FAIL_NOT_IN_USER @@ -434,7 +434,7 @@ add_fibers(M) // They have no prints. - if (HAS_FLAG(M.mutations, mFingerprints)) + if ((M.mutations & mFingerprints)) if(fingerprintslast != M.key) fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]" fingerprintslast = M.key diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 231412acb2d..7793f3ab1b9 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -178,7 +178,7 @@ src.thrower = thrower src.throw_source = get_turf(src) //store the origin turf - if(usr && HAS_FLAG(usr.mutations, HULK)) + if(usr && (usr.mutations & HULK)) src.throwing = 2 // really strong throw! var/dist_travelled = 0 diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 6f959a9375c..963af0795bf 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -373,7 +373,7 @@ occupantData["name"] = connected.occupant.real_name occupantData["stat"] = connected.occupant.stat occupantData["isViableSubject"] = 1 - if (HAS_FLAG(connected.occupant.mutations, NOCLONE) || !src.connected.occupant.dna) + if ((connected.occupant.mutations & NOCLONE) || !src.connected.occupant.dna) occupantData["isViableSubject"] = 0 occupantData["health"] = connected.occupant.health occupantData["maxHealth"] = connected.occupant.maxHealth @@ -710,7 +710,7 @@ return 1 if (bufferOption == "transfer") - if (!src.connected.occupant || HAS_FLAG(src.connected.occupant.mutations, NOCLONE) || !src.connected.occupant.dna) + if (!src.connected.occupant || (src.connected.occupant.mutations & NOCLONE) || !src.connected.occupant.dna) return irradiating = 2 diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index af7a188774c..161faeb8ecf 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -28,7 +28,7 @@ return 1 // Always set! /datum/dna/gene/disability/activate(var/mob/M, var/connected, var/flags) - if(mutation && NOT_FLAG(M.mutations, mutation)) + if(mutation && !(M.mutations & mutation)) M.mutations |= mutation if(disability) M.disabilities|=disability @@ -40,7 +40,7 @@ testing("[name] has no activation message.") /datum/dna/gene/disability/deactivate(var/mob/M, var/connected, var/flags) - if(mutation && HAS_FLAG(M.mutations, mutation)) + if(mutation && (M.mutations & mutation)) M.mutations &= ~mutation if(disability) M.disabilities &= (~disability) diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 8cd5b335e4a..997c3baed3c 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -133,7 +133,7 @@ /datum/dna/gene/basic/midget/can_activate(var/mob/M,var/flags) // Can't be big and small. - if(HAS_FLAG(M.mutations, HULK)) + if((M.mutations & HULK)) return 0 return ..(M,flags) @@ -155,7 +155,7 @@ /datum/dna/gene/basic/hulk/can_activate(var/mob/M,var/flags) // Can't be big and small. - if(HAS_FLAG(M.mutations, mSmallsize)) + if((M.mutations & mSmallsize)) return 0 return ..(M,flags) diff --git a/code/game/gamemodes/changeling/implements/powers/stings.dm b/code/game/gamemodes/changeling/implements/powers/stings.dm index 4576cbbe075..eda5ab18ca8 100644 --- a/code/game/gamemodes/changeling/implements/powers/stings.dm +++ b/code/game/gamemodes/changeling/implements/powers/stings.dm @@ -197,7 +197,7 @@ /datum/changeling_sting/transformation/can_sting(mob/living/target) . = ..() if(.) - if(HAS_FLAG(target.mutations, HUSK) || (!ishuman(target) && !issmall(target))) + if((target.mutations & HUSK) || (!ishuman(target) && !issmall(target))) to_chat(owner, SPAN_WARNING("Our sting appears ineffective against its DNA.")) return FALSE if(islesserform(target)) diff --git a/code/game/gamemodes/changeling/implements/powers/suck.dm b/code/game/gamemodes/changeling/implements/powers/suck.dm index d9ad6171eec..a81c34353a8 100644 --- a/code/game/gamemodes/changeling/implements/powers/suck.dm +++ b/code/game/gamemodes/changeling/implements/powers/suck.dm @@ -23,7 +23,7 @@ if(islesserform(T)) to_chat(src, "This creature's DNA is not compatible with our form!") return - if(HAS_FLAG(T.mutations, HUSK)) + if((T.mutations & HUSK)) to_chat(src, "This creature's DNA is ruined beyond useability!") return if(G.state != GRAB_KILL) diff --git a/code/game/gamemodes/cult/structures/altar.dm b/code/game/gamemodes/cult/structures/altar.dm index eb3f60728c0..3532ef52323 100644 --- a/code/game/gamemodes/cult/structures/altar.dm +++ b/code/game/gamemodes/cult/structures/altar.dm @@ -29,7 +29,7 @@ if(do_after(user, 2 SECONDS, do_flags = DO_USER_UNIQUE_ACT | DO_FAIL_FEEDBACK | DO_SHOW_PROGRESS)) O.status &= ~ORGAN_BROKEN O.update_damages() - if(NOT_FLAG(H.species.flags, NO_BLOOD)) + if(!(H.species.flags & NO_BLOOD)) var/total_blood = REAGENT_VOLUME(H.vessel, /singleton/reagent/blood) var/blood_to_add = H.species.blood_volume * 0.45 if(total_blood < blood_to_add) diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index be6d38e7018..4375b801eaf 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -198,7 +198,7 @@ /// Check if we're still being held. Otherwise... time to qdel. /obj/item/spell/proc/check_owner() - if(!(loc == owner) && NOT_FLAG(cast_methods, CAST_THROW)) + if(!(loc == owner) && !(cast_methods & CAST_THROW)) qdel_self() // Proc: unref_spells() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 9ee5c60d319..3a47eb7b681 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -137,7 +137,7 @@ return /obj/machinery/optable/attack_hand(mob/user) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) visible_message(SPAN_DANGER("\The [user] destroys \the [src]!")) density = FALSE qdel(src) diff --git a/code/game/machinery/autolathe/autolathe.dm b/code/game/machinery/autolathe/autolathe.dm index b7edb605c12..95d12509959 100644 --- a/code/game/machinery/autolathe/autolathe.dm +++ b/code/game/machinery/autolathe/autolathe.dm @@ -143,7 +143,7 @@ return data /obj/machinery/autolathe/attackby(obj/item/O, mob/user) - if(HAS_FLAG(autolathe_flags, AUTOLATHE_BUSY)) + if((autolathe_flags & AUTOLATHE_BUSY)) to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for the completion of previous operation.")) return TRUE @@ -246,9 +246,9 @@ update_use_power(POWER_USE_IDLE) if(currently_printing && use_power == POWER_USE_ACTIVE) - if(!HAS_FLAG(autolathe_flags, AUTOLATHE_STARTED)) + if(!(autolathe_flags & AUTOLATHE_STARTED)) start_processing_queue_item() - else if(HAS_FLAG(autolathe_flags, AUTOLATHE_BUSY)) + else if((autolathe_flags & AUTOLATHE_BUSY)) process_queue_item() /// Used so that we don't try to add_overlay every tick the autolathe processes. diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 9004fb3d77f..c5577c95ee2 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -384,7 +384,7 @@ if ((!subject.ckey) || (!subject.client)) scantemp = "Error: Mental interface failure." return - if (HAS_FLAG(subject.mutations, NOCLONE)) + if ((subject.mutations & NOCLONE)) scantemp = "Error: Mental interface failure." return if (subject.species && subject.species.flags & NO_SCAN) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 0846794407a..0509095110d 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -136,7 +136,7 @@ occupantData["name"] = occupant.name var/displayed_stat = occupant.stat var/blood_oxygenation = occupant.get_blood_oxygenation() - if(HAS_FLAG(occupant.status_flags, FAKEDEATH)) + if((occupant.status_flags & FAKEDEATH)) displayed_stat = DEAD blood_oxygenation = min(blood_oxygenation, BLOOD_VOLUME_SURVIVE) var/pulse_result diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 2c44ff35b41..173af9cbdbb 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -228,7 +228,7 @@ return if(!attached.dna) return - if(HAS_FLAG(attached.mutations, NOCLONE)) + if((attached.mutations & NOCLONE)) return if(attached.species.flags & NO_BLOOD) return diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index db82e89aaa8..f37f9ee1bb3 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -167,7 +167,7 @@ /obj/structure/foamedmetal/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.do_attack_animation(src, FIST_ATTACK_ANIMATION) - if (HAS_FLAG(user.mutations, HULK) || (prob(75 - metal * 25))) + if ((user.mutations & HULK) || (prob(75 - metal * 25))) user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the metal foam wall.")) qdel(src) else diff --git a/code/game/objects/items/devices/lighting/flashlight.dm b/code/game/objects/items/devices/lighting/flashlight.dm index d2550b05e4f..8b9241ec590 100644 --- a/code/game/objects/items/devices/lighting/flashlight.dm +++ b/code/game/objects/items/devices/lighting/flashlight.dm @@ -224,7 +224,7 @@ add_fingerprint(user) if(on && user.zone_sel.selecting == BP_EYES) - if(((user.is_clumsy()) || HAS_FLAG(user.mutations, DUMB)) && prob(50)) //too dumb to use flashlight properly + if(((user.is_clumsy()) || (user.mutations & DUMB)) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head if(brightness_on < 2) @@ -270,7 +270,7 @@ if(H.stat == DEAD || H.blinded || H.status_flags & FAKEDEATH) //mob is dead or fully blind to_chat(user, SPAN_WARNING("\The [H]'s pupils do not react to the light!")) return - if(HAS_FLAG(H.mutations, XRAY)) + if((H.mutations & XRAY)) to_chat(user, SPAN_NOTICE("\The [H]'s pupils give an eerie glow!")) if(vision.damage) to_chat(user, SPAN_WARNING("There's visible damage to [H]'s [vision.name]!")) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index fb8f24ade50..effd3acec8c 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -90,7 +90,7 @@ BREATH ANALYZER /proc/health_scan_mob(var/mob/M, var/mob/living/user, var/show_limb_damage = TRUE, var/just_scan = FALSE, var/sound_scan) if(!just_scan) - if (((user.is_clumsy()) || HAS_FLAG(user.mutations, DUMB)) && prob(50)) + if (((user.is_clumsy()) || (user.mutations & DUMB)) && prob(50)) user.visible_message("[user] runs the scanner over the floor.", "You run the scanner over the floor.", "You hear metal repeatedly clunking against the floor.") to_chat(user, "Scan results for the ERROR:") if(sound_scan) @@ -601,7 +601,7 @@ BREATH ANALYZER to_chat(user,"You can't find a way to use \the [src] on [H]!") return - if ( ((user.is_clumsy()) || HAS_FLAG(user.mutations, DUMB)) && prob(20)) + if ( ((user.is_clumsy()) || (user.mutations & DUMB)) && prob(20)) to_chat(user,"Your hand slips from clumsiness!") if(!H.eyes_protected(src, FALSE)) eyestab(H,user) diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 385a6501e20..43039a601dc 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -70,7 +70,7 @@ var/mob/living/L = M L.apply_damage(rand(5,20), DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED) - if (NOT_FLAG(M.mutations, NOCLONE)) // prevents drained people from having their DNA changed + if (!(M.mutations & NOCLONE)) // prevents drained people from having their DNA changed if (buf.types & DNA2_BUF_UI) if (!block) //isolated block? M.UpdateAppearance(buf.dna.UI.Copy()) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 0ffb2b7e6d4..6b5332862c7 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -96,7 +96,7 @@ health -= rand(10, 20) else health -= rand(1, 3) - else if (HAS_FLAG(user.mutations, HULK)) + else if ((user.mutations & HULK)) health = 0 else health -= rand(5, 8) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index c7fa9210c07..7c9dca7ccf4 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -40,7 +40,7 @@ /obj/structure/attack_hand(mob/user) if(breakable) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) attack_generic(user,1,"smashes") else if(istype(user,/mob/living/carbon/human)) diff --git a/code/game/objects/structures/crystals.dm b/code/game/objects/structures/crystals.dm index 31c1478138c..dde09371dc2 100644 --- a/code/game/objects/structures/crystals.dm +++ b/code/game/objects/structures/crystals.dm @@ -49,7 +49,7 @@ harvest() /obj/structure/reagent_crystal/attack_hand(mob/user) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) user.visible_message(SPAN_WARNING("\The [user] smashes \the [src] apart!"), SPAN_WARNING("You smash \the [src] apart!")) harvest() return diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index ccb56b28b93..bd83eaf810f 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -276,7 +276,7 @@ reinforcing = 0 /obj/structure/girder/attack_hand(mob/user as mob) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) visible_message("[user] smashes [src] apart!") dismantle() return diff --git a/code/game/objects/structures/gore/wall.dm b/code/game/objects/structures/gore/wall.dm index 246f3dc72ab..3c5ac66e7fd 100644 --- a/code/game/objects/structures/gore/wall.dm +++ b/code/game/objects/structures/gore/wall.dm @@ -31,7 +31,7 @@ /obj/structure/gore/resin/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.do_attack_animation(src, FIST_ATTACK_ANIMATION) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) visible_message(SPAN_DANGER("\The [user] destroys \the [src]!")) health = 0 else diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index b095730e069..8cec894e2d8 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -88,7 +88,7 @@ if(shock(user, 70)) return - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) damage_dealt += 5 else damage_dealt += 1 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 0507c0aded4..83518b0894b 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -208,7 +208,7 @@ /obj/structure/window/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!")) user.visible_message(SPAN_DANGER("[user] smashes through [src]!")) user.do_attack_animation(src) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 24bd2dad7fc..7351dc86690 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -65,7 +65,7 @@ add_fingerprint(user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) var/rotting = (locate(/obj/effect/overlay/wallrot) in src) - if (HAS_FLAG(user.mutations, HULK)) + if ((user.mutations & HULK)) if (rotting || !prob(material.hardness)) success_smash(user) else diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 60a0b1665f2..4fb5a490851 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -73,7 +73,7 @@ return ..() /obj/item/device/assembly/mousetrap/proc/clumsy_check(var/mob/living/user) - if((user.is_clumsy() || HAS_FLAG(user.mutations, DUMB)) && prob(50)) + if((user.is_clumsy() || (user.mutations & DUMB)) && prob(50)) var/which_hand = BP_L_HAND if(!user.hand) which_hand = BP_R_HAND diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index da49fe494f6..df5c82fe460 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -690,7 +690,7 @@ if (combatType && ismob(aa)) continue - if (aa.density && NOT_FLAG(aa.atom_flags, ATOM_FLAG_CHECKS_BORDER)) + if (aa.density && !(aa.atom_flags & ATOM_FLAG_CHECKS_BORDER)) to_chat(user, SPAN_WARNING("You cannot leap at a location with solid objects on it!")) return FALSE diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm index 229389c6ed3..7dafd09c74f 100644 --- a/code/modules/integrated_electronics/subtypes/reagents.dm +++ b/code/modules/integrated_electronics/subtypes/reagents.dm @@ -104,7 +104,7 @@ else activate_pin(3) return - if(HAS_FLAG(T.mutations, NOCLONE)) //target done been et, no more blood in him + if((T.mutations & NOCLONE)) //target done been et, no more blood in him if(T.reagents.trans_to_obj(src, tramount)) activate_pin(2) else diff --git a/code/modules/maps/ruins.dm b/code/modules/maps/ruins.dm index c0d4cf5ae71..36f025de5f8 100644 --- a/code/modules/maps/ruins.dm +++ b/code/modules/maps/ruins.dm @@ -27,7 +27,7 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids) handled_ruin_paths += ruin.type continue - if(HAS_FLAG(ruin.template_flags, TEMPLATE_FLAG_SPAWN_GUARANTEED) && (ruin.spawns_in_current_sector())) + if((ruin.template_flags & TEMPLATE_FLAG_SPAWN_GUARANTEED) && (ruin.spawns_in_current_sector())) force_spawn |= ruin for(var/ruin_path in ruin.force_ruins) var/datum/map_template/ruin/force_ruin = new ruin_path @@ -80,7 +80,7 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids) if(ruin.spawn_cost > 0) remaining -= ruin.spawn_cost - if(NOT_FLAG(ruin.template_flags, TEMPLATE_FLAG_ALLOW_DUPLICATES)) + if(!(ruin.template_flags & TEMPLATE_FLAG_ALLOW_DUPLICATES)) GLOB.banned_ruin_ids += ruin.id available -= ruin @@ -97,7 +97,7 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids) load_ruin(choice, ruin) selected += ruin - if(NOT_FLAG(ruin.template_flags, TEMPLATE_FLAG_ALLOW_DUPLICATES)) + if(!(ruin.template_flags & TEMPLATE_FLAG_ALLOW_DUPLICATES)) GLOB.banned_ruin_ids += ruin.id if (remaining) diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index a5b2d2626d6..ab979183610 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -104,7 +104,7 @@ real_damage *= D.damage_multiplier rand_damage *= D.damage_multiplier - if(HAS_FLAG(A.mutations, HULK)) + if((A.mutations & HULK)) real_damage *= 2 // Hulks do twice the damage rand_damage *= 2 if(A.is_berserk()) diff --git a/code/modules/mob/living/carbon/alien/alien_attacks.dm b/code/modules/mob/living/carbon/alien/alien_attacks.dm index 7ee7f90a8a0..f8f9c6b742f 100644 --- a/code/modules/mob/living/carbon/alien/alien_attacks.dm +++ b/code/modules/mob/living/carbon/alien/alien_attacks.dm @@ -33,7 +33,7 @@ else var/damage = rand(1, 9) if (prob(90)) - if (HAS_FLAG(M.mutations, HULK)) + if ((M.mutations & HULK)) damage += 5 spawn(0) Paralyse(1) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 007c6450c64..ba08e1f9850 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -94,7 +94,7 @@ if(!..()) return // Returns if no client. - if(stat == DEAD || HAS_FLAG(mutations, XRAY)) + if(stat == DEAD || (mutations & XRAY)) set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS) set_see_invisible(SEE_INVISIBLE_LEVEL_TWO) else if(stat != DEAD && is_ventcrawling == FALSE) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index afc44a2ec3e..011c4f405a5 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -165,7 +165,7 @@ return 1 /mob/living/carbon/brain/handle_regular_hud_updates() - if(stat == DEAD || HAS_FLAG(mutations, XRAY)) + if(stat == DEAD || (mutations & XRAY)) set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS) set_see_invisible(SEE_INVISIBLE_LEVEL_TWO) else if(stat != DEAD) @@ -192,7 +192,7 @@ else healths.icon_state = "health7" - if(stat == DEAD || HAS_FLAG(mutations, XRAY)) + if(stat == DEAD || (mutations & XRAY)) set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS) set_see_invisible(SEE_INVISIBLE_LEVEL_TWO) else if(stat != DEAD) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 1456fbaa866..391860314bf 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -64,7 +64,7 @@ if(src.hydration) adjustHydrationLoss(hydration_loss*0.1) - if(HAS_FLAG(mutations, FAT) && src.m_intent == M_RUN && src.bodytemperature <= 360) + if((mutations & FAT) && src.m_intent == M_RUN && src.bodytemperature <= 360) src.bodytemperature += 2 // Moving around increases germ_level faster @@ -465,7 +465,7 @@ return FALSE if (is_berserk()) return FALSE - if (HAS_FLAG(mutations, HULK)) + if ((mutations & HULK)) return FALSE if (analgesic > 100) return FALSE diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index af36c133aa6..16dde41ff87 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -79,7 +79,7 @@ return 0 //Hulk modifier - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) effective_force *= 2 //Apply weapon damage diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 8b8a24e926c..fff06205e8f 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -81,7 +81,7 @@ updatehealth() /mob/living/carbon/human/proc/ChangeToHusk() - if(HAS_FLAG(mutations, HUSK)) + if((mutations & HUSK)) return if(f_style) @@ -106,7 +106,7 @@ return /mob/living/carbon/human/proc/ChangeToSkeleton(var/keep_name = FALSE) - if(HAS_FLAG(mutations, SKELETON)) + if((mutations & SKELETON)) return if(f_style) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 699c0a30518..8bf11e64dda 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -219,7 +219,7 @@ if(o.applied_pressure == src) msg += "[get_pronoun("He")] [get_pronoun("is")] applying pressure to [get_pronoun("his")] [o.name]!\n" - if(HAS_FLAG(mutations, mSmallsize)) + if((mutations & mSmallsize)) msg += "[get_pronoun("He")] [get_pronoun("is")] small halfling!\n" //height if(height) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 006b7ade15c..c34e38b9382 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -419,7 +419,7 @@ //Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable /mob/living/carbon/human/proc/get_face_name() var/obj/item/organ/external/head = get_organ(BP_HEAD) - if(!head || head.disfigured || head.is_stump() || !real_name || HAS_FLAG(mutations, HUSK)) //disfigured. use id-name if possible + if(!head || head.disfigured || head.is_stump() || !real_name || (mutations & HUSK)) //disfigured. use id-name if possible return "Unknown" return real_name @@ -1025,7 +1025,7 @@ remoteview_target = null return - if(NOT_FLAG(mutations, mMorph)) + if(!(mutations & mMorph)) remove_verb(src, /mob/living/carbon/human/proc/morph) return @@ -1106,7 +1106,7 @@ remoteview_target = null return - if(NOT_FLAG(mutations, mRemotetalk)) + if(!(mutations & mRemotetalk)) remove_verb(src, /mob/living/carbon/human/proc/remotesay) return var/list/creatures = list() @@ -1120,7 +1120,7 @@ return var/say = sanitize(input("What do you wish to say")) - if(HAS_FLAG(target.mutations, mRemotetalk)) + if((target.mutations & mRemotetalk)) target.show_message(SPAN_NOTICE("You hear [src.real_name]'s voice: [say]")) else target.show_message(SPAN_NOTICE("You hear a voice that seems to echo around the room: [say]")) @@ -1138,7 +1138,7 @@ reset_view(0) return - if(NOT_FLAG(mutations, mRemote)) + if(!(mutations & mRemote)) remoteview_target = null reset_view(0) remove_verb(src, /mob/living/carbon/human/proc/remoteobserve) @@ -1500,7 +1500,7 @@ species.set_default_tail(src) - if(species.psi_deaf || HAS_FLAG(species.flags, IS_MECHANICAL) || HAS_FLAG(species.flags, NO_SCAN)) + if(species.psi_deaf || (species.flags & IS_MECHANICAL) || (species.flags & NO_SCAN)) ADD_TRAIT(src, TRAIT_PSIONICALLY_DEAF, INNATE_TRAIT) else if(HAS_TRAIT(src, TRAIT_PSIONICALLY_DEAF)) REMOVE_TRAIT(src, TRAIT_PSIONICALLY_DEAF, INNATE_TRAIT) @@ -1875,7 +1875,7 @@ return ..() * (species ? species.metabolism_mod : 1) /mob/living/carbon/human/is_clumsy() - if(HAS_FLAG(mutations, CLUMSY)) + if((mutations & CLUMSY)) return TRUE if(CE_CLUMSY in chem_effects) return TRUE @@ -1934,7 +1934,7 @@ victim.forceMove(stomach) /mob/living/carbon/human/need_breathe() - if(NOT_FLAG(mutations, mNobreath) && species.breathing_organ && species.has_organ[species.breathing_organ]) + if(!(mutations & mNobreath) && species.breathing_organ && species.has_organ[species.breathing_organ]) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index f025f6f0458..a6965935e03 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -81,7 +81,7 @@ return 0 var/obj/item/organ/external/affecting = get_organ(ran_zone(H.zone_sel.selecting)) - if(HAS_FLAG(H.mutations, HULK) || H.is_berserk()) + if((H.mutations & HULK) || H.is_berserk()) damage += 5 playsound(loc, /singleton/sound_category/punch_sound, 25, 1, -1) @@ -261,7 +261,7 @@ real_damage *= damage_multiplier rand_damage *= damage_multiplier - if(HAS_FLAG(H.mutations, HULK)) + if((H.mutations & HULK)) real_damage *= 2 // Hulks do twice the damage rand_damage *= 2 if(H.is_berserk()) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 83758a674cf..9f07b44a602 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -12,7 +12,7 @@ if(stat == DEAD) var/genetic_damage = getCloneLoss() - if(genetic_damage > 100 && !(HAS_FLAG(mutations, SKELETON))) //They need flesh to slough off + if(genetic_damage > 100 && !(mutations & SKELETON)) //They need flesh to slough off visible_message(SPAN_WARNING("\The [src]'s flesh sloughs off [get_pronoun("his")] body into a puddle of viscera and goop."), SPAN_WARNING("Your flesh sloughs off your body into a puddle of viscera and goop."), range = 5) ChangeToSkeleton(FALSE) else @@ -106,17 +106,17 @@ BITSET(hud_updateflag, HEALTH_HUD) /mob/living/carbon/human/Stun(amount) - if(HAS_FLAG(mutations, HULK)) + if((mutations & HULK)) return ..() /mob/living/carbon/human/Weaken(amount) - if(HAS_FLAG(mutations, HULK)) + if((mutations & HULK)) return ..() /mob/living/carbon/human/Paralyse(amount) - if(HAS_FLAG(mutations, HULK)) + if((mutations & HULK)) return // Notify our AI if they can now control the suit. if(wearing_rig?.ai_override_enabled && !stat && paralysis < amount) //We are passing out right this second. diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 4d41d653805..b7cfbe66157 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -315,7 +315,7 @@ if ((l_ear?.item_flags & ITEM_FLAG_SOUND_PROTECTION) || (r_ear?.item_flags & ITEM_FLAG_SOUND_PROTECTION) || (head?.item_flags & ITEM_FLAG_SOUND_PROTECTION)) return EAR_PROTECTION_MAJOR - if(istype(head, /obj/item/clothing/head/helmet) || HAS_FLAG(mutations, HULK)) + if(istype(head, /obj/item/clothing/head/helmet) || (mutations & HULK)) . = EAR_PROTECTION_MODERATE return max(EAR_PROTECTION_REDUCED, . - (get_hearing_sensitivity() / 2)) @@ -354,7 +354,7 @@ . = ..() - organs /mob/living/carbon/human/proc/pressure_resistant() - if(HAS_FLAG(mutations, COLD_RESISTANCE)) + if((mutations & COLD_RESISTANCE)) return TRUE if(HAS_TRAIT(src, TRAIT_PRESSURE_IMMUNITY)) return TRUE diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index e34f63f05e4..3a60823cdef 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -41,13 +41,13 @@ tally += 6 if (!(species.flags & NO_COLD_SLOWDOWN)) // Bugs and machines don't move slower when cold. - if(HAS_FLAG(mutations, FAT)) + if((mutations & FAT)) tally += 1.5 if (bodytemperature < 283.222) tally += (283.222 - bodytemperature) / 10 * 1.75 tally += max(2 * stance_damage, 0) //damaged/missing feet or legs is slow - if(HAS_FLAG(mutations, mRun)) + if((mutations & mRun)) tally = 0 tally = max(-2, tally + move_delay_mod) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 34866ebde53..9b40a0fa5e9 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -204,7 +204,7 @@ if(InStasis()) return - if(getFireLoss() && (HAS_FLAG(mutations, COLD_RESISTANCE) || prob(1))) + if(getFireLoss() && ((mutations & COLD_RESISTANCE) || prob(1))) heal_organ_damage(0,1) // DNA2 - Gene processing. @@ -460,7 +460,7 @@ else if(bodytemperature > species.heat_level_1) //360.15 is 310.15 + 50, the temperature where you start to feel effects. if(hydration >= 2) adjustHydrationLoss(2) - if(HAS_FLAG(species.flags, CAN_SWEAT) && fire_stacks == 0) + if((species.flags & CAN_SWEAT) && fire_stacks == 0) fire_stacks = -1 var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers bodytemperature += recovery_amt @@ -548,7 +548,7 @@ return thermal_protection_flags /mob/living/carbon/human/get_cold_protection(temperature) - if(HAS_FLAG(mutations, COLD_RESISTANCE)) + if((mutations & COLD_RESISTANCE)) return 1 //Fully protected from the cold. temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. @@ -745,7 +745,7 @@ silent = 0 return 1 - if(hallucination && (HAS_TRAIT(src, TRAIT_BYPASS_HALLUCINATION_RESTRICTION) || !HAS_FLAG(species.flags, NO_POISON|IS_PLANT))) + if(hallucination && (HAS_TRAIT(src, TRAIT_BYPASS_HALLUCINATION_RESTRICTION) || !(species.flags & NO_POISON|IS_PLANT))) handle_hallucinations() if(get_shock() >= species.total_health) @@ -1436,7 +1436,7 @@ ..() if(stat == DEAD) return - if(HAS_FLAG(mutations, XRAY)) + if((mutations & XRAY)) set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS) /mob/living/carbon/human/proc/handle_stamina() diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6518352369a..96fa1cdca8e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -317,9 +317,9 @@ There are several things that need to be remembered: var/husk_color_mod = rgb(96,88,80) - var/husk = HAS_FLAG(mutations, HUSK) - var/fat = HAS_FLAG(mutations, FAT) - var/skeleton = HAS_FLAG(mutations, SKELETON) + var/husk = (mutations & HUSK) + var/fat = (mutations & FAT) + var/skeleton = (mutations & SKELETON) var/g = (gender == FEMALE ? "f" : "m") pixel_x = species.icon_x_offset @@ -516,7 +516,7 @@ There are several things that need to be remembered: return var/fat - if(HAS_FLAG(mutations, FAT)) + if((mutations & FAT)) fat = "fat" var/image/standing = image("icon" = 'icons/effects/genetics.dmi') @@ -532,7 +532,7 @@ There are several things that need to be remembered: if(underlay) standing.underlays += underlay add_image = 1 - if(HAS_FLAG(mutations, LASER_EYES)) + if((mutations & LASER_EYES)) standing.overlays += "lasereyes_s" add_image = 1 if(add_image) @@ -1300,7 +1300,7 @@ There are several things that need to be remembered: var/tail_layer = GET_TAIL_LAYER - if(species.tail && NOT_FLAG(mutations, HUSK) && NOT_FLAG(mutations, SKELETON) && !(wear_suit && wear_suit.flags_inv & HIDETAIL)) + if(species.tail && !(mutations & HUSK) && !(mutations & SKELETON) && !(wear_suit && wear_suit.flags_inv & HIDETAIL)) var/icon/tail_s = get_tail_icon() overlays_raw[tail_layer] = image(tail_s, icon_state = "[tail_style]_s") animate_tail_reset() diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm index 35c89befa23..985df83ab5d 100644 --- a/code/modules/mob/living/carbon/resist.dm +++ b/code/modules/mob/living/carbon/resist.dm @@ -174,7 +174,7 @@ update_inv_legcuffed() /mob/living/carbon/proc/can_break_cuffs() - if(HAS_FLAG(mutations, HULK)) + if((mutations & HULK)) return TRUE if(stamina < 100) @@ -200,7 +200,7 @@ SPAN_WARNING("You successfully break your [handcuffed.name].") ) - if((isunathi(src)) || HAS_FLAG(mutations, HULK)) + if((isunathi(src)) || (mutations & HULK)) say(pick("RAAAAAAAARGH!", "HNNNNNNNNNGGGGGGH!", "GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", "AAAAAAARRRGH!" )) stamina -= 100 //takes a bunch of stamina diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index 807330cc574..ca67656ad13 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -357,7 +357,7 @@ attacked += 10 if(prob(90)) - if(HAS_FLAG(M.mutations, HULK)) + if((M.mutations & HULK)) damage += 5 if(victim || target) victim = null diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 9803af136be..1e60b39d5b7 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -23,7 +23,7 @@ if(DAMAGE_BRUTE) adjustBruteLoss(damage) if(DAMAGE_BURN) - if(HAS_FLAG(mutations, COLD_RESISTANCE)) + if((mutations & COLD_RESISTANCE)) damage = 0 adjustFireLoss(damage) if(DAMAGE_TOXIN) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1593b13bec0..0073505b0e4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -121,8 +121,8 @@ default behaviour is: now_pushing = FALSE return - if(istype(tmob, /mob/living/carbon/human) && HAS_FLAG(tmob.mutations, FAT)) - if(prob(40) && NOT_FLAG(mutations, FAT)) + if(istype(tmob, /mob/living/carbon/human) && (tmob.mutations & FAT)) + if(prob(40) && !(mutations & FAT)) to_chat(src, "You fail to push [tmob]'s fat ass out of the way.") now_pushing = FALSE return @@ -248,9 +248,9 @@ default behaviour is: return TRUE /mob/living/carbon/human/burn_skin(burn_amount) - if(HAS_FLAG(mutations, mShock)) //shockproof + if((mutations & mShock)) //shockproof return FALSE - if(HAS_FLAG(mutations, COLD_RESISTANCE)) //fireproof + if((mutations & COLD_RESISTANCE)) //fireproof return FALSE . = ..() updatehealth() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 1ba821b69ca..633579b2c0b 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -157,7 +157,7 @@ return FALSE //Hulk modifier - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) effective_force *= 2 //Apply weapon damage diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 358a35abd6c..920deadd4ee 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -100,7 +100,7 @@ var/list/channel_to_radio_key = new if(!message_range) message_range = world.view - if(HAS_FLAG(mutations, HULK)) + if((mutations & HULK)) var/ending = copytext(message, length(message), length(message) + 1) if(ending && GLOB.correct_punctuation[ending]) message = copytext(message, 1, length(message)) diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm index 08aa3e8e6a1..597bab774ed 100644 --- a/code/modules/mob/living/silicon/robot/analyzer.dm +++ b/code/modules/mob/living/silicon/robot/analyzer.dm @@ -22,7 +22,7 @@ /proc/robotic_analyze_mob (var/mob/living/M, var/mob/living/user, var/just_scan = FALSE) if(!just_scan) - if((user.is_clumsy() || HAS_FLAG(user.mutations, DUMB)) && prob(50)) + if((user.is_clumsy() || (user.mutations & DUMB)) && prob(50)) to_chat(user, SPAN_WARNING("You try to analyze the floor's vitals!")) user.visible_message(SPAN_WARNING("\The [user] has analyzed the floor's vitals!")) to_chat(user, SPAN_NOTICE("Analyzing Results for The floor:")) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 4dff3ab58b6..1a191f0a1fa 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -147,7 +147,7 @@ /mob/living/silicon/robot/handle_regular_hud_updates() ..() - if(stat == DEAD || HAS_FLAG(mutations, XRAY) || (sight_mode & BORGXRAY)) + if(stat == DEAD || (mutations & XRAY) || (sight_mode & BORGXRAY)) set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS) set_see_invisible(SEE_INVISIBLE_LEVEL_TWO) else if((sight_mode & BORGMESON) && (sight_mode & BORGTHERM)) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 8514187a122..d5c3c8f7767 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -209,7 +209,7 @@ if(C) to_chat(H, SPAN_WARNING("\The [src] saps some of your energy!")) C.use(C.maxcharge / 15) - if(istype(limb) && HAS_FLAG(limb.status, ORGAN_ROBOT|ORGAN_ADV_ROBOT)) + if(istype(limb) && (limb.status & ORGAN_ROBOT|ORGAN_ADV_ROBOT)) H.visible_message(SPAN_WARNING("\The [src] bites down onto \the [H]'s [limb.name]!"), SPAN_WARNING("\The [src] bites down onto your [limb.name]!")) limb.emp_act(EMP_LIGHT) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index a83ad4e463a..7e5217d2875 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -399,7 +399,7 @@ found_obj = locate(/obj/structure/window) in target_turf if(found_obj) - if(HAS_FLAG(found_obj.atom_flags, ATOM_FLAG_CHECKS_BORDER) && found_obj.dir != GLOB.reverse_dir[card_dir]) + if((found_obj.atom_flags & ATOM_FLAG_CHECKS_BORDER) && found_obj.dir != GLOB.reverse_dir[card_dir]) continue found_obj.attack_generic(src, rand(melee_damage_lower, melee_damage_upper), attacktext, TRUE) hostile_last_attack = world.time diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index bddf7302196..fd513013e21 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1312,7 +1312,7 @@ /mob/proc/is_clumsy() - return HAS_FLAG(mutations, CLUMSY) + return (mutations & CLUMSY) //Helper proc for figuring out if the active hand (or given hand) is usable. /mob/proc/can_use_hand() diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index c783de5fb86..2f0e7e3512b 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -286,7 +286,7 @@ return failed_breath /obj/item/organ/internal/lungs/proc/handle_temperature_effects(datum/gas_mixture/breath) - if((breath.temperature < species.cold_level_1 || breath.temperature > species.heat_level_1) && NOT_FLAG(owner.mutations, COLD_RESISTANCE)) + if((breath.temperature < species.cold_level_1 || breath.temperature > species.heat_level_1) && !(owner.mutations & COLD_RESISTANCE)) if(breath.temperature <= owner.species.cold_level_1) if(prob(20)) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 2dca5f6ebdc..52a8992ad54 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -366,7 +366,7 @@ var/laser = (damage_flags & DAMAGE_FLAG_LASER) var/sharp = (damage_flags & DAMAGE_FLAG_SHARP) var/edge = (damage_flags & DAMAGE_FLAG_EDGE) - var/psionic = HAS_FLAG(damage_flags, DAMAGE_FLAG_PSIONIC) + var/psionic = (damage_flags & DAMAGE_FLAG_PSIONIC) var/blunt = !!(brute && !sharp && !edge) /// Psionics and psionically deaf species take varying amounts of damage from psionic abilities. diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm index 14a724aa0c1..0962ceb53a3 100644 --- a/code/modules/overmap/contacts/contact_sensors.dm +++ b/code/modules/overmap/contacts/contact_sensors.dm @@ -58,7 +58,7 @@ // Update our 'sensor range' (ie. overmap lighting) if(!sensors || !sensors.use_power || (stat & (NOPOWER|BROKEN))) if(length(datalink_contacts)) - var/remove_link = !sensors || HAS_FLAG(stat, BROKEN) + var/remove_link = !sensors || (stat & BROKEN) datalink_remove_all_ships_datalink(remove_link) for(var/key in contact_datums) var/datum/overmap_contact/record = contact_datums[key] diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index e24e8ecb001..27162d0b987 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -249,7 +249,7 @@ var/mob/living/M = user - if(HAS_FLAG(M.mutations, HULK)) + if((M.mutations & HULK)) to_chat(M, SPAN_DANGER("Your fingers are much too large for the trigger guard!")) return FALSE diff --git a/code/modules/projectiles/guns/energy/magic.dm b/code/modules/projectiles/guns/energy/magic.dm index 2800ac60e53..ffb2ec0c527 100644 --- a/code/modules/projectiles/guns/energy/magic.dm +++ b/code/modules/projectiles/guns/energy/magic.dm @@ -27,7 +27,7 @@ playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 1) /obj/item/gun/energy/wand/special_check(var/mob/living/user) - if(HAS_FLAG(user.mutations, HULK)) + if((user.mutations & HULK)) to_chat(user, "In your rage you momentarily forget the operation of this wand!") return 0 return 1 diff --git a/code/modules/psionics/abilities/assay.dm b/code/modules/psionics/abilities/assay.dm index ebfd4783d52..60a9f42f68f 100644 --- a/code/modules/psionics/abilities/assay.dm +++ b/code/modules/psionics/abilities/assay.dm @@ -49,7 +49,7 @@ var/mob/living/carbon/human/target = hit_atom - if(target.stat == DEAD || HAS_FLAG(target.status_flags, FAKEDEATH)) + if(target.stat == DEAD || (target.status_flags & FAKEDEATH)) to_chat(user, SPAN_WARNING("Psionic power does not flow through a dead person.")) return diff --git a/code/modules/psionics/abilities/emotional_suggestion.dm b/code/modules/psionics/abilities/emotional_suggestion.dm index 1d8bb4960f5..379a005093b 100644 --- a/code/modules/psionics/abilities/emotional_suggestion.dm +++ b/code/modules/psionics/abilities/emotional_suggestion.dm @@ -58,7 +58,7 @@ for (var/mob/M in GLOB.player_list) if (istype(M, /mob/abstract/new_player)) continue - else if(M.stat == DEAD && HAS_FLAG(M.client.prefs.toggles, CHAT_GHOSTEARS)) + else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTEARS)) to_chat(M, "[user] psionically suggests an emotion to [target]: [text]") var/mob/living/carbon/human/H = target diff --git a/code/modules/psionics/abilities/mend.dm b/code/modules/psionics/abilities/mend.dm index ff94503045a..859b38db5cc 100644 --- a/code/modules/psionics/abilities/mend.dm +++ b/code/modules/psionics/abilities/mend.dm @@ -39,7 +39,7 @@ if(O.damage > 0) // Fix internal damage to_chat(user, SPAN_NOTICE("You mend their [O]'s bruising.")) O.heal_damage(O.damage) - if(HAS_FLAG(O.status, ORGAN_BROKEN)) + if((O.status & ORGAN_BROKEN)) to_chat(user, SPAN_NOTICE("You restart their [O]'s functionality.")) O.status &= ~ORGAN_BROKEN if(O.damage <= 5 && O.organ_tag == BP_EYES) // Fix eyes @@ -60,10 +60,10 @@ if((affected.damage < affected.min_broken_damage * GLOB.config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN)) to_chat(user, SPAN_NOTICE("You mend their [affected] together.")) affected.status &= ~ORGAN_BROKEN - if(HAS_FLAG(affected.status, ORGAN_ARTERY_CUT)) + if((affected.status & ORGAN_ARTERY_CUT)) to_chat(user, SPAN_NOTICE("You mend a spliced artery in their [affected].")) affected.status &= ~ORGAN_ARTERY_CUT - if(HAS_FLAG(affected.status, ORGAN_DEAD)) + if((affected.status & ORGAN_DEAD)) to_chat(user, SPAN_NOTICE("You mend some necrosis from their [affected].")) affected.status &= ~ORGAN_DEAD user.visible_message(SPAN_NOTICE("[user] raises their palm from [H]."), SPAN_NOTICE("You raise your palm, having finished your work.")) diff --git a/code/modules/psionics/interface/ui_hub.dm b/code/modules/psionics/interface/ui_hub.dm index 4e67bad6ac8..0230c934f1a 100644 --- a/code/modules/psionics/interface/ui_hub.dm +++ b/code/modules/psionics/interface/ui_hub.dm @@ -56,19 +56,19 @@ data["psi_points"] = owner.psi.psi_points data["bought_powers"] = owner.psi.psionic_powers for(var/singleton/psionic_power/P in GET_SINGLETON_SUBTYPE_LIST(/singleton/psionic_power)) - if(HAS_FLAG(P.ability_flags, PSI_FLAG_SPECIAL) && !(P.type in owner.psi.psionic_powers)) + if((P.ability_flags & PSI_FLAG_SPECIAL) && !(P.type in owner.psi.psionic_powers)) continue if(owner_rank < P.minimum_rank) continue /// Apex and Limitless abilities are automatically given, but we want them to have said abilities in the point shop so the users know what they do. - if(owner_rank < PSI_RANK_APEX && HAS_FLAG(P.ability_flags, PSI_FLAG_APEX)) + if(owner_rank < PSI_RANK_APEX && (P.ability_flags & PSI_FLAG_APEX)) continue - if(owner_rank < PSI_RANK_LIMITLESS && HAS_FLAG(P.ability_flags, PSI_FLAG_LIMITLESS)) + if(owner_rank < PSI_RANK_LIMITLESS && (P.ability_flags & PSI_FLAG_LIMITLESS)) continue - if(NOT_FLAG(P.ability_flags, PSI_FLAG_CANON)) - if(owner_rank < PSI_RANK_HARMONIOUS && HAS_FLAG(P.ability_flags, PSI_FLAG_EVENT)) + if(!(P.ability_flags & PSI_FLAG_CANON)) + if(owner_rank < PSI_RANK_HARMONIOUS && (P.ability_flags & PSI_FLAG_EVENT)) continue - if(owner_rank < PSI_RANK_HARMONIOUS && HAS_FLAG(P.ability_flags, PSI_FLAG_ANTAG)) + if(owner_rank < PSI_RANK_HARMONIOUS && (P.ability_flags & PSI_FLAG_ANTAG)) continue data["available_psionics"] += list( list( diff --git a/code/modules/reagents/reagent_containers/inhaler.dm b/code/modules/reagents/reagent_containers/inhaler.dm index 96a843f81a1..5423ac4dd9b 100644 --- a/code/modules/reagents/reagent_containers/inhaler.dm +++ b/code/modules/reagents/reagent_containers/inhaler.dm @@ -43,7 +43,7 @@ to_chat(user,"\The [src] is empty.") return - if ( ((user.is_clumsy()) || HAS_FLAG(user.mutations, DUMB)) && prob(10)) + if ( ((user.is_clumsy()) || (user.mutations & DUMB)) && prob(10)) to_chat(user,"Your hand slips from clumsiness!") if(!H.eyes_protected(src, FALSE)) eyestab(H,user) diff --git a/code/modules/reagents/reagent_containers/inhaler_advanced.dm b/code/modules/reagents/reagent_containers/inhaler_advanced.dm index 05e88c1febc..694bbd89968 100644 --- a/code/modules/reagents/reagent_containers/inhaler_advanced.dm +++ b/code/modules/reagents/reagent_containers/inhaler_advanced.dm @@ -142,7 +142,7 @@ to_chat(user,"\The [src]'s cartridge is empty!") return - if (((user.is_clumsy()) || HAS_FLAG(user.mutations, DUMB)) && prob(10)) + if (((user.is_clumsy()) || (user.mutations & DUMB)) && prob(10)) to_chat(user,"Your hand slips from clumsiness!") if(M.eyes_protected(src, FALSE)) eyestab(M,user) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 83060e6b845..53ccf15ddd3 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -182,7 +182,7 @@ if(!T.dna) to_chat(user, SPAN_WARNING("You are unable to locate any blood. (To be specific, your target seems to be missing their DNA datum).")) return - if(HAS_FLAG(T.mutations, NOCLONE)) //target done been et, no more blood in him + if((T.mutations & NOCLONE)) //target done been et, no more blood in him to_chat(user, SPAN_WARNING("You are unable to locate any blood.")) return diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 349327b3f1a..8e3c636f07b 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -19,7 +19,7 @@ if(!..()) return FALSE var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && !BP_IS_ROBOTIC(affected) && affected.open >= ORGAN_OPEN_RETRACTED && affected.open < ORGAN_ENCASED_RETRACTED && affected.stage == BONE_PRE_OP && HAS_FLAG(affected.status, ORGAN_BROKEN) + return affected && !BP_IS_ROBOTIC(affected) && affected.open >= ORGAN_OPEN_RETRACTED && affected.open < ORGAN_ENCASED_RETRACTED && affected.stage == BONE_PRE_OP && (affected.status & ORGAN_BROKEN) /singleton/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/facial_surgery.dm b/code/modules/surgery/facial_surgery.dm index aecec1aafe0..c33e24e3eb2 100644 --- a/code/modules/surgery/facial_surgery.dm +++ b/code/modules/surgery/facial_surgery.dm @@ -68,7 +68,7 @@ /singleton/surgery_step/generic/alter_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/head/head = target.get_organ(target_zone) - if(head.disfigured || HAS_FLAG(target.mutations, HUSK)) + if(head.disfigured || (target.mutations & HUSK)) head.disfigured = FALSE target.mutations &= ~HUSK target.update_body() @@ -215,7 +215,7 @@ /singleton/surgery_step/robotics/face/alter_synthface/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/head/head = target.get_organ(target_zone) - if(head.disfigured || HAS_FLAG(target.mutations, HUSK)) + if(head.disfigured || (target.mutations & HUSK)) head.disfigured = FALSE target.mutations &= ~HUSK target.update_body() diff --git a/code/unit_tests/smart_token_bucket.dm b/code/unit_tests/smart_token_bucket.dm index 0601e26c046..fe9be4c3c56 100644 --- a/code/unit_tests/smart_token_bucket.dm +++ b/code/unit_tests/smart_token_bucket.dm @@ -39,7 +39,7 @@ for(var/flag in flags) - if(HAS_FLAG(modes[mode], STB_MODE_FIXEDTTL)) + if((modes[mode] & STB_MODE_FIXEDTTL)) src.stb = new(mode = modes[mode], flags = flags[flag], tokens_lifetime = tokens_lifetime) else src.stb = new(mode = modes[mode], flags = flags[flag]) @@ -52,7 +52,7 @@ var/expected_total_expired_amount = 0 src.is_inserting = TRUE for(var/i=0, i