diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index c97d36730c1..7d115428b96 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -119,6 +119,8 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( // basic mobs #define isbasicmob(A) (istype(A, /mob/living/basic)) +#define iscow(A) (istype(A, /mob/living/basic/cow)) + /// returns whether or not the atom is either a basic mob OR simple animal #define isanimal_or_basicmob(A) (istype(A, /mob/living/simple_animal) || istype(A, /mob/living/basic)) @@ -133,8 +135,6 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( #define ismouse(A) (istype(A, /mob/living/simple_animal/mouse)) -#define iscow(A) (istype(A, /mob/living/basic/cow)) - #define isslime(A) (istype(A, /mob/living/simple_animal/slime)) #define isdrone(A) (istype(A, /mob/living/simple_animal/drone)) diff --git a/code/__HELPERS/ai.dm b/code/__HELPERS/ai.dm index b5b64237f3f..5db23ed1ffc 100644 --- a/code/__HELPERS/ai.dm +++ b/code/__HELPERS/ai.dm @@ -11,7 +11,7 @@ continue if(HAS_TRAIT(item, TRAIT_NEEDS_TWO_HANDS) || controller.blackboard[BB_MONKEY_BLACKLISTITEMS][item]) continue - if(gun_neurons_activated && istype(item, /obj/item/gun)) + if(gun_neurons_activated && isgun(item)) // We have a gun, why bother looking for something inferior // Also yes it is intentional that pawns dont know how to pick the best gun return item @@ -24,7 +24,7 @@ continue if(HAS_TRAIT(item, TRAIT_NEEDS_TWO_HANDS) || controller.blackboard[BB_MONKEY_BLACKLISTITEMS][item]) continue - if(gun_neurons_activated && istype(item, /obj/item/gun)) + if(gun_neurons_activated && isgun(item)) return item if(item.force <= top_force) continue diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 80632e8a31a..78dc1303508 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -35,11 +35,11 @@ var/atom/object_to_check = processing_list[index] - if(istype(object_to_check, /obj/item/organ)) + if(isorgan(object_to_check)) found_organ = object_to_check found_organ.organ_flags ^= ORGAN_FROZEN - else if(istype(object_to_check, /mob/living/carbon)) + else if(iscarbon(object_to_check)) var/mob/living/carbon/mob_to_check = object_to_check for(var/organ in mob_to_check.internal_organs) found_organ = organ diff --git a/code/__HELPERS/jatum.dm b/code/__HELPERS/jatum.dm index fa80955513d..d00e6a68642 100644 --- a/code/__HELPERS/jatum.dm +++ b/code/__HELPERS/jatum.dm @@ -101,7 +101,7 @@ "contents" = list_contents) // JATUM is really only meant for PoD types - if(!istype(value, /datum)\ + if(!isdatum(value)\ || istype(value, /image)\ || istype(value, /icon)\ || istype(value, /sound)\ diff --git a/code/__HELPERS/logging/_logging.dm b/code/__HELPERS/logging/_logging.dm index 3d6704aeb35..96c8889a561 100644 --- a/code/__HELPERS/logging/_logging.dm +++ b/code/__HELPERS/logging/_logging.dm @@ -191,7 +191,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global")) if(istype(whom, /atom)) var/atom/A = whom swhom = "[A.name]" - else if(istype(whom, /datum)) + else if(isdatum(whom)) swhom = "[whom]" if(!swhom) diff --git a/code/__HELPERS/ref.dm b/code/__HELPERS/ref.dm index 4e787c88e1d..de1ba392b43 100644 --- a/code/__HELPERS/ref.dm +++ b/code/__HELPERS/ref.dm @@ -1,10 +1,10 @@ /** * \ref behaviour got changed in 512 so this is necesary to replicate old behaviour. * If it ever becomes necesary to get a more performant REF(), this lies here in wait - * #define REF(thing) (thing && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]") + * #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]") **/ /proc/REF(input) - if(istype(input, /datum)) + if(isdatum(input)) var/datum/thing = input if(thing.datum_flags & DF_USE_TAG) if(!thing.tag) diff --git a/code/__HELPERS/weakref.dm b/code/__HELPERS/weakref.dm index 56b3782c5b9..8c31b5ec37e 100644 --- a/code/__HELPERS/weakref.dm +++ b/code/__HELPERS/weakref.dm @@ -1,5 +1,5 @@ /// Checks if potential_weakref is a weakref of thing. -#define IS_WEAKREF_OF(thing, potential_weakref) (istype(thing, /datum) && !isnull(potential_weakref) && thing.weak_reference == potential_weakref) +#define IS_WEAKREF_OF(thing, potential_weakref) (isdatum(thing) && !isnull(potential_weakref) && thing.weak_reference == potential_weakref) //For these two procs refs MUST be ref = TRUE format like typecaches! /proc/weakref_filter_list(list/things, list/refs) diff --git a/code/controllers/admin.dm b/code/controllers/admin.dm index 2e6b1f3a598..7a7e1f40ff6 100644 --- a/code/controllers/admin.dm +++ b/code/controllers/admin.dm @@ -10,7 +10,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) . = ..() name = text src.target = target - if(istype(target, /datum)) //Harddel man bad + if(isdatum(target)) //Harddel man bad RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/cleanup) /obj/effect/statclick/Destroy() @@ -36,7 +36,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) class = "subsystem" else if(istype(target, /datum/controller)) class = "controller" - else if(istype(target, /datum)) + else if(isdatum(target)) class = "datum" else class = "unknown" @@ -70,22 +70,22 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) if(!holder) return - + var/list/controllers = list() var/list/controller_choices = list() - + for (var/datum/controller/controller in world) if (istype(controller, /datum/controller/subsystem)) continue controllers["[controller] (controller.type)"] = controller //we use an associated list to ensure clients can't hold references to controllers controller_choices += "[controller] (controller.type)" - + var/datum/controller/controller_string = input("Select controller to debug", "Debug Controller") as null|anything in controller_choices var/datum/controller/controller = controllers[controller_string] - + if (!istype(controller)) return debug_variables(controller) - + SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller") message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.") diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 085e67d725d..660dd0f51cd 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -167,7 +167,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new continue else var/varval = Master.vars[varname] - if (istype(varval, /datum)) // Check if it has a type var. + if (isdatum(varval)) // Check if it has a type var. var/datum/D = varval msg += "\t [varname] = [D]([D.type])\n" else diff --git a/code/controllers/subsystem/movement/movement_types.dm b/code/controllers/subsystem/movement/movement_types.dm index 5f6b05ceb88..8b2ced243f2 100644 --- a/code/controllers/subsystem/movement/movement_types.dm +++ b/code/controllers/subsystem/movement/movement_types.dm @@ -368,7 +368,7 @@ src.simulated_only = simulated_only src.avoid = avoid src.skip_first = skip_first - if(istype(id, /obj/item/card/id)) + if(isidcard(id)) RegisterSignal(id, COMSIG_PARENT_QDELETING, .proc/handle_no_id) //I prefer erroring to harddels. If this breaks anything consider making id info into a datum or something /datum/move_loop/has_target/jps/compare_loops(datum/move_loop/loop_type, priority, flags, extra_info, delay, timeout, atom/chasing, repath_delay, max_path_length, minimum_distance, obj/item/card/id/id, simulated_only, turf/avoid, skip_first) diff --git a/code/controllers/subsystem/points_of_interest.dm b/code/controllers/subsystem/points_of_interest.dm index e588386bad9..505c9163d1c 100644 --- a/code/controllers/subsystem/points_of_interest.dm +++ b/code/controllers/subsystem/points_of_interest.dm @@ -223,28 +223,28 @@ SUBSYSTEM_DEF(points_of_interest) /// Priority list broadly stolen from /proc/sortmobs. Lower numbers are higher priorities when sorted and appear closer to the top or start of lists. /datum/point_of_interest/mob_poi/proc/get_type_sort_priority() - if(istype(target, /mob/living/silicon/ai)) + if(isAI(target)) return 0 - if(istype(target, /mob/camera)) + if(iscameramob(target)) return 1 - if(istype(target, /mob/living/silicon/pai)) + if(ispAI(target)) return 2 - if(istype(target, /mob/living/silicon/robot)) + if(iscyborg(target)) return 3 - if(istype(target, /mob/living/carbon/human)) + if(ishuman(target)) return 4 - if(istype(target, /mob/living/brain)) + if(isbrain(target)) return 5 - if(istype(target, /mob/living/carbon/alien)) + if(isalien(target)) return 6 - if(istype(target, /mob/dead/observer)) + if(isobserver(target)) return 7 - if(istype(target, /mob/dead/new_player)) + if(isnewplayer(target)) return 8 - if(istype(target, /mob/living/simple_animal/slime)) + if(isslime(target)) return 9 - if(istype(target, /mob/living/simple_animal)) + if(isanimal(target)) return 10 - if(istype(target, /mob/living/basic)) + if(isbasicmob(target)) return 11 return 12 diff --git a/code/datums/actions/mobs/lava_swoop.dm b/code/datums/actions/mobs/lava_swoop.dm index 07ce1f85343..92adeba3372 100644 --- a/code/datums/actions/mobs/lava_swoop.dm +++ b/code/datums/actions/mobs/lava_swoop.dm @@ -149,9 +149,9 @@ drakewalls += new /obj/effect/temp_visual/drakewall(T) // no people with lava immunity can just run away from the attack for free var/list/indestructible_turfs = list() for(var/turf/T in RANGE_TURFS(2, center)) - if(istype(T, /turf/open/indestructible)) + if(isindestructiblefloor(T)) continue - if(!istype(T, /turf/closed/indestructible)) + if(!isindestructiblewall(T)) T.ChangeTurf(/turf/open/misc/asteroid/basalt/lava_land_surface, flags = CHANGETURF_INHERIT_AIR) else indestructible_turfs += T @@ -182,7 +182,7 @@ for(var/turf/T in turfs) if(!(T in empty)) new /obj/effect/temp_visual/lava_warning(T) - else if(!istype(T, /turf/closed/indestructible)) + else if(!isindestructiblewall(T)) new /obj/effect/temp_visual/lava_safe(T) amount-- SLEEP_CHECK_DEATH(2.4 SECONDS, owner) diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm index de28f96492a..aad1bf87497 100644 --- a/code/datums/ai/monkey/monkey_controller.dm +++ b/code/datums/ai/monkey/monkey_controller.dm @@ -189,7 +189,7 @@ have ways of interacting with a specific mob and control it. /datum/ai_controller/monkey/proc/on_hitby(datum/source, atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) SIGNAL_HANDLER - if(istype(AM, /obj/item)) + if(isitem(AM)) var/mob/living/living_pawn = pawn var/obj/item/I = AM var/mob/thrown_by = I.thrownby?.resolve() diff --git a/code/datums/ai_laws/ai_laws.dm b/code/datums/ai_laws/ai_laws.dm index 8dd40dddaf6..cce1888bd6d 100644 --- a/code/datums/ai_laws/ai_laws.dm +++ b/code/datums/ai_laws/ai_laws.dm @@ -323,7 +323,7 @@ return TRUE if(owner?.mind?.special_role) return FALSE - if (istype(owner, /mob/living/silicon/ai)) + if (isAI(owner)) var/mob/living/silicon/ai/A=owner if(A?.deployed_shell?.mind?.special_role) return FALSE diff --git a/code/datums/alarm.dm b/code/datums/alarm.dm index c19ff6c0c0b..1290eb9cfa8 100644 --- a/code/datums/alarm.dm +++ b/code/datums/alarm.dm @@ -22,7 +22,7 @@ if(istype(source_atom)) src.source_atom = source_atom else - var/source_type = (istype(source_atom, /datum)) ? source_atom.type : "" + var/source_type = (isdatum(source_atom)) ? source_atom.type : "" stack_trace("a non atom was passed into alarm_handler! [source_atom] [source_type]") return ..() diff --git a/code/datums/components/construction.dm b/code/datums/components/construction.dm index 062371a4e1d..04fbd2d8652 100644 --- a/code/datums/components/construction.dm +++ b/code/datums/components/construction.dm @@ -92,7 +92,7 @@ // Using stacks else - if(istype(I, /obj/item/stack)) + if(isstack(I)) . = I.use_tool(parent, user, 0, volume=50, amount=current_step["amount"]) diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 39cb6dd1cdd..047157578b7 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -332,7 +332,7 @@ . += RG Deletion -= RG continue - else if(istype(part, /obj/item/stack)) + else if(isstack(part)) var/obj/item/stack/ST = locate(part) in Deletion if(ST.amount > partlist[part]) ST.amount = partlist[part] @@ -350,7 +350,7 @@ Deletion.Cut(Deletion.len) // Snowflake handling of reagent containers and storage atoms. // If we consumed them in our crafting, we should dump their contents out before qdeling them. - if(istype(DL, /obj/item/reagent_containers)) + if(is_reagent_container(DL)) var/obj/item/reagent_containers/container = DL container.reagents.expose(container.loc, TOUCH) else if(istype(DL, /obj/item/storage)) diff --git a/code/datums/components/gas_leaker.dm b/code/datums/components/gas_leaker.dm index 71565bb29f4..902873b4044 100644 --- a/code/datums/components/gas_leaker.dm +++ b/code/datums/components/gas_leaker.dm @@ -20,7 +20,7 @@ . = ..() if(istype(parent, /obj/machinery/atmospherics/components)) process_type = PROCESS_COMPONENT - else if(istype(parent, /obj/machinery)) + else if(ismachinery(parent)) process_type = PROCESS_MACHINE else if(isobj(parent)) process_type = PROCESS_OBJ diff --git a/code/datums/components/grillable.dm b/code/datums/components/grillable.dm index f6c5b007bb9..3ba4e0bb4b9 100644 --- a/code/datums/components/grillable.dm +++ b/code/datums/components/grillable.dm @@ -78,7 +78,7 @@ var/atom/original_object = parent - if(istype(parent, /obj/item/stack)) //Check if its a sheet, for grilling multiple things in a stack + if(isstack(parent)) //Check if its a sheet, for grilling multiple things in a stack var/obj/item/stack/itemstack = original_object var/atom/grilled_result = new cook_result(original_object.loc, itemstack.amount) SEND_SIGNAL(parent, COMSIG_GRILL_COMPLETED, grilled_result) diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index 6631a744637..675c4c18fea 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -129,7 +129,7 @@ to_chat(user, span_warning("[I] does not contain sufficient materials to be accepted by [parent].")) return if(!has_space(material_amount)) - if(istype(I, /obj/item/stack)) + if(isstack(I)) //figure out how much space is left var/space_left = max_amount - total_amount //figure out the amount of sheets that can fit that space @@ -151,7 +151,7 @@ set waitfor = FALSE var/requested_amount var/active_held = user.get_active_held_item() // differs from I when using TK - if(istype(held_item, /obj/item/stack) && precise_insertion) + if(isstack(held_item) && precise_insertion) var/atom/current_parent = parent var/obj/item/stack/item_stack = held_item requested_amount = tgui_input_number(user, "How much do you want to insert?", "Inserting [item_stack.singular_name]s", item_stack.amount, item_stack.amount) diff --git a/code/datums/components/payment.dm b/code/datums/components/payment.dm index e3209c99497..9c9ff93f02d 100644 --- a/code/datums/components/payment.dm +++ b/code/datums/components/payment.dm @@ -95,7 +95,7 @@ if(physical_cash_total < total_cost) var/armless //Suggestions for those with no arms/simple animals. - if(!ishuman(user) && !istype(user, /mob/living/simple_animal/slime)) + if(!ishuman(user) && !isslime(user)) armless = TRUE else var/mob/living/carbon/human/harmless_armless = user @@ -119,7 +119,7 @@ var/obj/item/holochip/holochange = new /obj/item/holochip(user.loc) //Change is made in holocredits exclusively. holochange.credits = physical_cash_total holochange.name = "[holochange.credits] credit holochip" - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/paying_customer = user if(!INVOKE_ASYNC(paying_customer, /mob.proc/put_in_hands, holochange)) user.pulling = holochange diff --git a/code/datums/components/reagent_refiller.dm b/code/datums/components/reagent_refiller.dm index d8a48f778c9..6d8bc8c04f8 100644 --- a/code/datums/components/reagent_refiller.dm +++ b/code/datums/components/reagent_refiller.dm @@ -18,7 +18,7 @@ power_to_draw = 30, whitelisted_reagents = list(/datum/reagent/consumable) ) - if(!istype(parent, /obj/item/reagent_containers)) + if(!is_reagent_container(parent)) return COMPONENT_INCOMPATIBLE src.time_to_refill = time_to_refill diff --git a/code/datums/components/remote_materials.dm b/code/datums/components/remote_materials.dm index 2ae9bd96775..530563537ad 100644 --- a/code/datums/components/remote_materials.dm +++ b/code/datums/components/remote_materials.dm @@ -92,7 +92,7 @@ handles linking back and forth. /datum/component/remote_materials/proc/OnAttackBy(datum/source, obj/item/I, mob/user) SIGNAL_HANDLER - if (silo && istype(I, /obj/item/stack)) + if (silo && isstack(I)) if (silo.remote_attackby(parent, user, I, mat_container_flags)) return COMPONENT_NO_AFTERATTACK diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm index 3dffe19288e..185ac42d634 100644 --- a/code/datums/components/riding/riding_mob.dm +++ b/code/datums/components/riding/riding_mob.dm @@ -155,7 +155,7 @@ /// If the ridden creature has abilities, and some var yet to be made is set to TRUE, the rider will be able to control those abilities /datum/component/riding/creature/proc/setup_abilities(mob/living/rider) - if(!istype(parent, /mob/living)) + if(!isliving(parent)) return var/mob/living/ridden_creature = parent @@ -165,7 +165,7 @@ /// Takes away the riding parent's abilities from the rider /datum/component/riding/creature/proc/remove_abilities(mob/living/rider) - if(!istype(parent, /mob/living)) + if(!isliving(parent)) return var/mob/living/ridden_creature = parent diff --git a/code/datums/components/shell.dm b/code/datums/components/shell.dm index e976450a262..c4b794f6788 100644 --- a/code/datums/components/shell.dm +++ b/code/datums/components/shell.dm @@ -179,7 +179,7 @@ source.balloon_alert(attacker, "[locked ? "locked" : "unlocked"] [source]") return COMPONENT_NO_AFTERATTACK - if(!attached_circuit.owner_id && istype(item, /obj/item/card/id)) + if(!attached_circuit.owner_id && isidcard(item)) source.balloon_alert(attacker, "owner id set for [item]") attached_circuit.owner_id = WEAKREF(item) return COMPONENT_NO_AFTERATTACK diff --git a/code/datums/components/simple_access.dm b/code/datums/components/simple_access.dm index fd82d723327..04da72fac2e 100644 --- a/code/datums/components/simple_access.dm +++ b/code/datums/components/simple_access.dm @@ -12,7 +12,7 @@ RegisterSignal(parent, COMSIG_MOB_TRIED_ACCESS, .proc/on_tried_access) if(!donor_atom) return - if(istype(donor_atom, /obj/item/organ)) + if(isorgan(donor_atom)) RegisterSignal(donor_atom, COMSIG_ORGAN_REMOVED, .proc/on_donor_removed) else if(istype(donor_atom, /obj/item/implant)) RegisterSignal(donor_atom, COMSIG_IMPLANT_REMOVED, .proc/on_donor_removed) diff --git a/code/datums/components/wet_floor.dm b/code/datums/components/wet_floor.dm index ea7203c893c..7638beadb28 100644 --- a/code/datums/components/wet_floor.dm +++ b/code/datums/components/wet_floor.dm @@ -51,7 +51,7 @@ /datum/component/wet_floor/proc/update_overlay() var/intended - if(!istype(parent, /turf/open/floor)) + if(!isfloorturf(parent)) intended = generic_turf_overlay else switch(highest_strength) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index e8391a7116e..8dfeb56a523 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -230,7 +230,7 @@ var/typeofdatum = jsonlist["DATUM_TYPE"] //BYOND won't directly read if this is just put in the line below, and will instead runtime because it thinks you're trying to make a new list? var/datum/D = new typeofdatum var/datum/returned = D.deserialize_list(jsonlist, options) - if(!istype(returned, /datum)) + if(!isdatum(returned)) qdel(D) else return returned diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 82d75879498..e6e125b5cb9 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -53,7 +53,7 @@ /datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob) - if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD) + if(iscarbon(affected_mob) && affected_mob.stat != DEAD) if(length(stage5)) to_chat(affected_mob, pick(stage5)) if(QDELETED(affected_mob)) diff --git a/code/datums/elements/atmos_sensitive.dm b/code/datums/elements/atmos_sensitive.dm index c7dd4cf2f7a..5d9020eb4b2 100644 --- a/code/datums/elements/atmos_sensitive.dm +++ b/code/datums/elements/atmos_sensitive.dm @@ -50,7 +50,7 @@ /atom/proc/process_exposure() var/turf/open/spot = loc - if(!istype(loc, /turf/open)) + if(!isopenturf(loc)) //If you end up in a locker or a wall reconsider your life decisions atmos_end() SSair.atom_process -= src diff --git a/code/datums/elements/dryable.dm b/code/datums/elements/dryable.dm index 225e854fb6f..54198848e9c 100644 --- a/code/datums/elements/dryable.dm +++ b/code/datums/elements/dryable.dm @@ -30,7 +30,7 @@ resulting_atom.forceMove(source.drop_location()) return - else if(istype(source, /obj/item/stack)) //Check if its a sheet + else if(isstack(source)) //Check if its a sheet var/obj/item/stack/itemstack = dried_atom for(var/i in 1 to itemstack.amount) var/atom/movable/resulting_atom = new dry_result(source.drop_location()) diff --git a/code/datums/elements/update_icon_updates_onmob.dm b/code/datums/elements/update_icon_updates_onmob.dm index 0f76e4cf942..728bce2c86e 100644 --- a/code/datums/elements/update_icon_updates_onmob.dm +++ b/code/datums/elements/update_icon_updates_onmob.dm @@ -10,7 +10,7 @@ /datum/element/update_icon_updates_onmob/Attach(datum/target, flags, body = FALSE) . = ..() - if(!istype(target, /obj/item)) + if(!isitem(target)) return ELEMENT_INCOMPATIBLE RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, .proc/update_onmob) update_flags = flags diff --git a/code/datums/materials/_material.dm b/code/datums/materials/_material.dm index 8f84ea199e3..0d13fd761f9 100644 --- a/code/datums/materials/_material.dm +++ b/code/datums/materials/_material.dm @@ -86,7 +86,7 @@ Simple datum which is instanced once per type and is used for every object of sa if(beauty_modifier) source.AddElement(/datum/element/beauty, beauty_modifier * amount) - if(istype(source, /obj)) //objs + if(isobj(source)) //objs on_applied_obj(source, amount, material_flags) else if(istype(source, /turf)) //turfs @@ -180,7 +180,7 @@ Simple datum which is instanced once per type and is used for every object of sa if(beauty_modifier) source.RemoveElement(/datum/element/beauty, beauty_modifier * amount) - if(istype(source, /obj)) //objs + if(isobj(source)) //objs on_removed_obj(source, amount, material_flags) if(istype(source, /turf)) //turfs diff --git a/code/datums/materials/basemats.dm b/code/datums/materials/basemats.dm index 8e9b7e32a7a..d58078589fe 100644 --- a/code/datums/materials/basemats.dm +++ b/code/datums/materials/basemats.dm @@ -319,12 +319,12 @@ Unless you know what you're doing, only use the first three numbers. They're in /datum/material/mythril/on_applied_obj(atom/source, amount, material_flags) . = ..() - if(istype(source, /obj/item)) + if(isitem(source)) source.AddComponent(/datum/component/fantasy) /datum/material/mythril/on_removed_obj(atom/source, amount, material_flags) . = ..() - if(istype(source, /obj/item)) + if(isitem(source)) qdel(source.GetComponent(/datum/component/fantasy)) /datum/material/mythril/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) diff --git a/code/datums/mutations/holy_mutation/honorbound.dm b/code/datums/mutations/holy_mutation/honorbound.dm index eeecbf9d6c1..f5dadddbef9 100644 --- a/code/datums/mutations/holy_mutation/honorbound.dm +++ b/code/datums/mutations/holy_mutation/honorbound.dm @@ -159,7 +159,7 @@ /datum/mutation/human/honorbound/proc/thrown_guilt(datum/source, atom/movable/thrown_movable, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) SIGNAL_HANDLER - if(istype(thrown_movable, /obj/item)) + if(isitem(thrown_movable)) var/mob/living/honorbound = source var/obj/item/thrown_item = thrown_movable var/mob/thrown_by = thrown_item.thrownby?.resolve() diff --git a/code/datums/proximity_monitor/fields/projectile_dampener.dm b/code/datums/proximity_monitor/fields/projectile_dampener.dm index c66c74b7795..37e9a2430d0 100644 --- a/code/datums/proximity_monitor/fields/projectile_dampener.dm +++ b/code/datums/proximity_monitor/fields/projectile_dampener.dm @@ -92,12 +92,12 @@ qdel(src) /datum/proximity_monitor/advanced/projectile_dampener/field_edge_uncrossed(atom/movable/movable, turf/location) - if(istype(movable, /obj/projectile) && get_dist(movable, host) > current_range) + if(isprojectile(movable) && get_dist(movable, host) > current_range) if(movable in tracked) release_projectile(movable) /datum/proximity_monitor/advanced/projectile_dampener/field_edge_crossed(atom/movable/movable, turf/location) - if(istype(movable, /obj/projectile) && !(movable in tracked)) + if(isprojectile(movable) && !(movable in tracked)) capture_projectile(movable) /datum/proximity_monitor/advanced/projectile_dampener/peaceborg/process(delta_time) diff --git a/code/datums/proximity_monitor/fields/timestop.dm b/code/datums/proximity_monitor/fields/timestop.dm index bde85c6f4d9..324dc5653ad 100644 --- a/code/datums/proximity_monitor/fields/timestop.dm +++ b/code/datums/proximity_monitor/fields/timestop.dm @@ -103,9 +103,9 @@ var/frozen = TRUE if(isliving(A)) freeze_mob(A) - else if(istype(A, /obj/projectile)) + else if(isprojectile(A)) freeze_projectile(A) - else if(istype(A, /obj/vehicle/sealed/mecha)) + else if(ismecha(A)) freeze_mecha(A) else if((ismachinery(A) && !istype(A, /obj/machinery/light)) || isstructure(A)) //Special exception for light fixtures since recoloring causes them to change light freeze_structure(A) @@ -139,9 +139,9 @@ unfreeze_throwing(A) if(isliving(A)) unfreeze_mob(A) - else if(istype(A, /obj/projectile)) + else if(isprojectile(A)) unfreeze_projectile(A) - else if(istype(A, /obj/vehicle/sealed/mecha)) + else if(ismecha(A)) unfreeze_mecha(A) UnregisterSignal(A, COMSIG_MOVABLE_PRE_MOVE) diff --git a/code/datums/shuttles.dm b/code/datums/shuttles.dm index 6b1b3ee1851..ced67e19cc9 100644 --- a/code/datums/shuttles.dm +++ b/code/datums/shuttles.dm @@ -52,7 +52,7 @@ locate(.[MAP_MAXX], .[MAP_MAXY], .[MAP_MAXZ])) for(var/i in 1 to turfs.len) var/turf/place = turfs[i] - if(istype(place, /turf/open/space)) // This assumes all shuttles are loaded in a single spot then moved to their real destination. + if(isspaceturf(place)) // This assumes all shuttles are loaded in a single spot then moved to their real destination. continue if(length(place.baseturfs) < 2) // Some snowflake shuttle shit continue diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 71581c502f0..2bba14b11a5 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -341,7 +341,7 @@ owner.adjustFireLoss(-25) owner.remove_CC() owner.bodytemperature = owner.get_body_temp_normal() - if(istype(owner, /mob/living/carbon/human)) + if(ishuman(owner)) var/mob/living/carbon/human/humi = owner humi.set_coretemperature(humi.get_body_temp_normal()) return TRUE diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm index 9b8b758ada7..9f7317828d6 100644 --- a/code/datums/storage/storage.dm +++ b/code/datums/storage/storage.dm @@ -832,7 +832,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches) for(var/obj/item/thing in resolve_location.contents) var/total_amnt = 1 - if(istype(thing, /obj/item/stack)) + if(isstack(thing)) var/obj/item/stack/things = thing total_amnt = things.amount diff --git a/code/datums/storage/subtypes/pockets.dm b/code/datums/storage/subtypes/pockets.dm index d168005c634..3947b713618 100644 --- a/code/datums/storage/subtypes/pockets.dm +++ b/code/datums/storage/subtypes/pockets.dm @@ -55,7 +55,7 @@ /datum/storage/pockets/chefhat/can_insert(obj/item/to_insert, mob/user, messages, force) . = ..() - if(istype(to_insert, /obj/item/clothing/head/mob_holder)) + if(ispickedupmob(to_insert)) var/obj/item/clothing/head/mob_holder/mausholder = to_insert if(locate(/mob/living/simple_animal/mouse) in mausholder.contents) return diff --git a/code/datums/weakrefs.dm b/code/datums/weakrefs.dm index 302aa29b53c..9fb7f3b7cdd 100644 --- a/code/datums/weakrefs.dm +++ b/code/datums/weakrefs.dm @@ -2,7 +2,7 @@ /// See /datum/weakref's documentation for more information. /proc/WEAKREF(datum/input) if(istype(input) && !QDELETED(input)) - if(istype(input, /datum/weakref)) + if(isweakref(input)) return input if(!input.weak_reference) diff --git a/code/datums/wires/_wires.dm b/code/datums/wires/_wires.dm index 7565f67f44a..745e719112c 100644 --- a/code/datums/wires/_wires.dm +++ b/code/datums/wires/_wires.dm @@ -6,7 +6,7 @@ if(I.tool_behaviour == TOOL_WIRECUTTER || I.tool_behaviour == TOOL_MULTITOOL) return TRUE - if(istype(I, /obj/item/assembly)) + if(isassembly(I)) var/obj/item/assembly/A = I if(A.attachable) return TRUE @@ -334,7 +334,7 @@ . = TRUE else I = L.get_active_held_item() - if(istype(I, /obj/item/assembly)) + if(isassembly(I)) var/obj/item/assembly/A = I if(A.attachable) if(!L.temporarilyRemoveItemFromInventory(A)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 4474718702f..cc4d5f2b0b8 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -520,7 +520,7 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION /datum/objective/survive/malf/check_completion() var/list/datum/mind/owners = get_owners() for(var/datum/mind/mindobj in owners) - if(!istype(mindobj, /mob/living/silicon/robot) && !considered_alive(mindobj, FALSE)) //Shells (and normal borgs for that matter) are considered alive for Malf + if(!iscyborg(mindobj) && !considered_alive(mindobj, FALSE)) //Shells (and normal borgs for that matter) are considered alive for Malf return FALSE return TRUE @@ -695,7 +695,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) continue captured_amount+=1 for(var/mob/living/carbon/alien/humanoid/M in A)//Aliens are worth twice as much as humans. - if(istype(M, /mob/living/carbon/alien/humanoid/royal/queen))//Queens are worth three times as much as humans. + if(isalienqueen(M))//Queens are worth three times as much as humans. if(M.stat == DEAD) captured_amount+=1.5 else diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index cf172a26965..9c780b5b32c 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -134,7 +134,7 @@ insert_pda(O, user) return - if(istype(O, /obj/item/card/id)) + if(isidcard(O)) if(stored_id_card) to_chat(user, span_warning("There is already an ID card inside!")) return @@ -305,7 +305,7 @@ return TRUE var/obj/item/held_item = usr.get_active_held_item() - if(istype(held_item, /obj/item/card/id)) + if(isidcard(held_item)) // If we successfully inserted, we've ejected the old item. Return early. if(insert_id_card(held_item, usr)) return TRUE diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 52d6b389d97..7fc393dcdf6 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -837,7 +837,7 @@ return TRUE /obj/proc/can_be_unfasten_wrench(mob/user, silent) //if we can unwrench this object; returns SUCCESSFUL_UNFASTEN and FAILED_UNFASTEN, which are both TRUE, or CANT_UNFASTEN, which isn't. - if(!(isfloorturf(loc) || istype(loc, /turf/open/indestructible)) && !anchored) + if(!(isfloorturf(loc) || isindestructiblefloor(loc)) && !anchored) to_chat(user, span_warning("[src] needs to be on the floor to be secured!")) return FAILED_UNFASTEN return SUCCESSFUL_UNFASTEN diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index fded1a87b0e..9aa5e1c5d5f 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -71,7 +71,7 @@ /obj/machinery/button/attackby(obj/item/W, mob/living/user, params) if(panel_open) - if(!device && istype(W, /obj/item/assembly)) + if(!device && isassembly(W)) if(!user.transferItemToLoc(W, src)) to_chat(user, span_warning("\The [W] is stuck to you!")) return diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 4da1fa30dd1..5aecf16f01f 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -318,7 +318,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0) to_chat(user, span_warning("[src] already has that upgrade!")) return - else if(istype(attacking_item, /obj/item/assembly/prox_sensor)) + else if(isprox(attacking_item)) if(!isMotion()) if(!user.temporarilyRemoveItemFromInventory(attacking_item)) return diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 7bac396b7f4..2023777baa1 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -176,7 +176,7 @@ update_appearance() return - else if(istype(W, /obj/item/assembly/prox_sensor)) //motion sensing upgrade + else if(isprox(W)) //motion sensing upgrade if(proxy_module) to_chat(user, span_warning("[src] already contains a [proxy_module]!")) return diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 1dfe547c2c3..2c9a7de97e7 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -123,7 +123,7 @@ GLOBAL_VAR_INIT(cops_arrived, FALSE) return ACCESS_CAPTAIN in authorize_access //Skyrat Edit End /obj/machinery/computer/communications/attackby(obj/I, mob/user, params) - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) attack_hand(user) else return ..() diff --git a/code/game/machinery/computer/prisoner/management.dm b/code/game/machinery/computer/prisoner/management.dm index 9b1c0e27a57..e1a444d5906 100644 --- a/code/game/machinery/computer/prisoner/management.dm +++ b/code/game/machinery/computer/prisoner/management.dm @@ -69,7 +69,7 @@ return /obj/machinery/computer/prisoner/management/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) if(screen) id_insert(user) else diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 6fa7295d49e..aa4027dea35 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -277,7 +277,7 @@ if(isitem(P) && get_req_components_amt()) for(var/I in req_components) if(istype(P, I) && (req_components[I] > 0)) - if(istype(P, /obj/item/stack)) + if(isstack(P)) var/obj/item/stack/S = P var/used_amt = min(round(S.get_amount()), req_components[I]) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 73e10c26882..469031bee0e 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -41,7 +41,7 @@ . = ..() if(locate(/obj/structure/barricade) in get_turf(mover)) return TRUE - else if(istype(mover, /obj/projectile)) + else if(isprojectile(mover)) if(!anchored) return TRUE var/obj/projectile/proj = mover diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index b37120a2290..950396dc1a7 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -518,7 +518,7 @@ /obj/machinery/door/airlock/cult/allowed(mob/living/L) if(!density) return TRUE - if(friendly || IS_CULTIST(L) || istype(L, /mob/living/simple_animal/shade) || isconstruct(L)) + if(friendly || IS_CULTIST(L) || isshade(L) || isconstruct(L)) if(!stealthy) new openingoverlaytype(loc) return TRUE diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index ad8503c9685..994aba11b0a 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -168,7 +168,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/flasher, 26) if (last_flash && world.time < last_flash + 150) return - if(istype(AM, /mob/living/carbon)) + if(iscarbon(AM)) var/mob/living/carbon/M = AM if (M.m_intent != MOVE_INTENT_WALK && anchored) flash() diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index c56295feed4..b38f0c81d74 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -115,7 +115,7 @@ var/turf/T = get_step(src,adir) if(!T) continue - if(istype(T, /turf/closed)) + if(isclosedturf(T)) continue target = T break diff --git a/code/game/machinery/medipen_refiller.dm b/code/game/machinery/medipen_refiller.dm index 1650434c301..f4ceab57c37 100644 --- a/code/game/machinery/medipen_refiller.dm +++ b/code/game/machinery/medipen_refiller.dm @@ -38,7 +38,7 @@ if(busy) to_chat(user, span_danger("The machine is busy.")) return - if(istype(I, /obj/item/reagent_containers) && I.is_open_container()) + if(is_reagent_container(I) && I.is_open_container()) var/obj/item/reagent_containers/RC = I var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user) if(units) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index e128ae5669b..0d1b3a64c39 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -96,7 +96,7 @@ if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE) return // prevent intraction when T-scanner revealed - else if (istype(I, /obj/item/card/id) || istype(I, /obj/item/modular_computer/tablet)) + else if (isidcard(I) || istype(I, /obj/item/modular_computer/tablet)) if(open) if (src.allowed(user)) src.locked = !src.locked diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 0fd5e8ddb7c..2596e19df00 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -129,7 +129,7 @@ for(var/i in to_eat) var/atom/movable/AM = i - if(istype(AM, /obj/item)) + if(isitem(AM)) var/obj/item/bodypart/head/as_head = AM var/obj/item/mmi/as_mmi = AM if(istype(AM, /obj/item/organ/internal/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /obj/item/dullahan_relay)) diff --git a/code/game/machinery/roulette_machine.dm b/code/game/machinery/roulette_machine.dm index 60eb4eeb6d9..7c6482b90ef 100644 --- a/code/game/machinery/roulette_machine.dm +++ b/code/game/machinery/roulette_machine.dm @@ -115,7 +115,7 @@ return ..() var/obj/item/card/id/player_card = W.GetID() if(player_card) - if(istype(W, /obj/item/card/id)) + if(isidcard(W)) playsound(src, 'sound/machines/card_slide.ogg', 50, TRUE) else playsound(src, 'sound/machines/terminal_success.ogg', 50, TRUE) diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index 80a9d0e62b7..cf11171fdef 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -216,7 +216,7 @@ beep = TRUE if(SCANGATE_GUNS) for(var/I in M.get_contents()) - if(istype(I, /obj/item/gun)) + if(isgun(I)) beep = TRUE break if(SCANGATE_NUTRITION) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 498a5e4c677..70f03090867 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -519,5 +519,5 @@ if(istype(mover) && (mover.pass_flags & PASSGLASS)) return prob(20) else - if(istype(mover, /obj/projectile)) + if(isprojectile(mover)) return prob(10) diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 1caa38d5da8..992ed0d142d 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -112,7 +112,7 @@ var/turf/real_target = get_link_target_turf() if(!istype(real_target)) return FALSE - if(!force && (!ismecha(M) && !istype(M, /obj/projectile) && M.anchored && !allow_anchored)) + if(!force && (!ismecha(M) && !isprojectile(M) && M.anchored && !allow_anchored)) return var/no_effect = FALSE if(last_effect == world.time) @@ -120,7 +120,7 @@ else last_effect = world.time if(do_teleport(M, real_target, innate_accuracy_penalty, no_effects = no_effect, channel = teleport_channel, forced = force_teleport)) - if(istype(M, /obj/projectile)) + if(isprojectile(M)) var/obj/projectile/P = M P.ignore_source_check = TRUE return TRUE diff --git a/code/game/objects/effects/spiderwebs.dm b/code/game/objects/effects/spiderwebs.dm index 8ec5ec113c5..a99fe21fde7 100644 --- a/code/game/objects/effects/spiderwebs.dm +++ b/code/game/objects/effects/spiderwebs.dm @@ -61,7 +61,7 @@ return if(sealed) return FALSE - if(istype(mover, /mob/living/simple_animal/hostile/giant_spider)) + if(isspider(mover)) return TRUE else if(isliving(mover)) if(istype(mover.pulledby, /mob/living/simple_animal/hostile/giant_spider)) @@ -69,7 +69,7 @@ if(prob(50)) to_chat(mover, span_danger("You get stuck in \the [src] for a moment.")) return FALSE - else if(istype(mover, /obj/projectile)) + else if(isprojectile(mover)) return prob(30) /obj/structure/spider/stickyweb/sealed @@ -97,7 +97,7 @@ if(prob(50)) to_chat(mover, span_danger("You get stuck in \the [src] for a moment.")) return FALSE - else if(istype(mover, /obj/projectile)) + else if(isprojectile(mover)) return prob(30) /obj/structure/spider/spiderling diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a84201fa8ad..da921a4845f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -801,7 +801,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons var/itempush = 1 if(w_class < 4) itempush = 0 //too light to push anything - if(istype(hit_atom, /mob/living)) //Living mobs handle hit sounds differently. + if(isliving(hit_atom)) //Living mobs handle hit sounds differently. var/volume = get_volume_by_throwforce_and_or_w_class() if (throwforce > 0) if (mob_throw_hit_sound) diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 68a81ee6701..a91a490b769 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -107,7 +107,7 @@ RLD matter += load playsound(loc, 'sound/machines/click.ogg', 50, TRUE) loaded = TRUE - else if(istype(O, /obj/item/stack)) + else if(isstack(O)) loaded = loadwithsheets(O, user) if(loaded) to_chat(user, span_notice("[src] now holds [matter]/[max_matter] matter-units.")) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index ed664cf1c76..4a347a71724 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -1355,7 +1355,7 @@ if(!proximity) return - if(istype(target, /obj/item/card/id)) + if(isidcard(target)) theft_target = WEAKREF(target) ui_interact(user) return @@ -1366,7 +1366,7 @@ // If we're attacking a human, we want it to be covert. We're not ATTACKING them, we're trying // to sneakily steal their accesses by swiping our agent ID card near them. As a result, we // return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN to cancel any part of the following the attack chain. - if(istype(target, /mob/living/carbon/human)) + if(ishuman(target)) to_chat(user, "You covertly start to scan [target] with \the [src], hoping to pick up a wireless ID card signal...") if(!do_mob(user, target, 2 SECONDS)) @@ -1387,7 +1387,7 @@ ui_interact(user) return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN - if(istype(target, /obj/item)) + if(isitem(target)) var/obj/item/target_item = target to_chat(user, "You covertly start to scan [target] with your [src], hoping to pick up a wireless ID card signal...") diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 219e27c4f24..f6286b82a40 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -74,7 +74,7 @@ var/post_noise = FALSE /obj/item/toy/crayon/proc/isValidSurface(surface) - return istype(surface, /turf/open/floor) + return isfloorturf(surface) /obj/item/toy/crayon/suicide_act(mob/user) user.visible_message(span_suicide("[user] is jamming [src] up [user.p_their()] nose and into [user.p_their()] brain. It looks like [user.p_theyre()] trying to commit suicide!")) @@ -626,7 +626,7 @@ post_noise = FALSE /obj/item/toy/crayon/spraycan/isValidSurface(surface) - return (istype(surface, /turf/open/floor) || istype(surface, /turf/closed/wall)) + return (isfloorturf(surface) || iswallturf(surface)) /obj/item/toy/crayon/spraycan/suicide_act(mob/user) @@ -748,7 +748,7 @@ if(check_empty(user)) return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN - if(istype(target, /obj/item/bodypart) && actually_paints) + if(isbodypart(target) && actually_paints) var/obj/item/bodypart/limb = target if(!IS_ORGANIC_LIMB(limb)) var/list/skins = list() @@ -835,7 +835,7 @@ volume_multiplier = 5 /obj/item/toy/crayon/spraycan/lubecan/isValidSurface(surface) - return istype(surface, /turf/open/floor) + return isfloorturf(surface) /obj/item/toy/crayon/spraycan/mimecan name = "silent spraycan" diff --git a/code/game/objects/items/devices/portable_chem_mixer.dm b/code/game/objects/items/devices/portable_chem_mixer.dm index 82178e25035..519dd4c8f9e 100644 --- a/code/game/objects/items/devices/portable_chem_mixer.dm +++ b/code/game/objects/items/devices/portable_chem_mixer.dm @@ -38,7 +38,7 @@ return ..() /obj/item/storage/portable_chem_mixer/attackby(obj/item/I, mob/user, params) - if (istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container() && atom_storage.locked) + if (is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container() && atom_storage.locked) var/obj/item/reagent_containers/B = I . = TRUE //no afterattack if(!user.transferItemToLoc(B, src)) diff --git a/code/game/objects/items/devices/pressureplates.dm b/code/game/objects/items/devices/pressureplates.dm index 146dedb0d15..707e07a0d5a 100644 --- a/code/game/objects/items/devices/pressureplates.dm +++ b/code/game/objects/items/devices/pressureplates.dm @@ -59,7 +59,7 @@ sigdev.signal() /obj/item/pressure_plate/attackby(obj/item/I, mob/living/L) - if(istype(I, /obj/item/assembly/signaler) && !istype(sigdev) && removable_signaller && L.transferItemToLoc(I, src)) + if(issignaler(I) && !istype(sigdev) && removable_signaller && L.transferItemToLoc(I, src)) sigdev = I to_chat(L, span_notice("You attach [I] to [src]!")) return ..() diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 464d8df9ff4..edb7c6364c9 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -175,7 +175,7 @@ var/attachment var/attachment_signal_log if(attached_device) - if(istype(attached_device, /obj/item/assembly/signaler)) + if(issignaler(attached_device)) var/obj/item/assembly/signaler/attached_signaller = attached_device attachment = "[attached_signaller]" attachment_signal_log = attached_signaller.last_receive_signal_log ? "The following log entry is the last one associated with the attached signaller
[attached_signaller.last_receive_signal_log]" : "There is no signal log entry." diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 1d71b76a96e..04f8e575d77 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -49,7 +49,7 @@ STOP_PROCESSING(SSobj, src) return null var/turf/location = loc - if(istype(location, /mob/)) + if(ismob(location)) var/mob/M = location if(M.is_holding(src)) location = M.loc diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index e8e94950225..f315d172c04 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -157,7 +157,7 @@ to_chat(user, span_notice("You remove the activation mechanism from the [initial(name)] assembly.")) /obj/item/grenade/chem_grenade/attackby(obj/item/item, mob/user, params) - if(istype(item, /obj/item/assembly) && stage == GRENADE_WIRED) + if(isassembly(item) && stage == GRENADE_WIRED) wires.interact(user) else if(stage == GRENADE_WIRED && is_type_in_list(item, allowed_containers)) . = TRUE //no afterattack diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 1e24bb948f0..0ad29d38817 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -105,14 +105,14 @@ moveToNullspace() //Yep - if(istype(bomb_target, /obj/item)) //your crappy throwing star can't fly so good with a giant brick of c4 on it. + if(isitem(bomb_target)) //your crappy throwing star can't fly so good with a giant brick of c4 on it. var/obj/item/thrown_weapon = bomb_target thrown_weapon.throw_speed = max(1, (thrown_weapon.throw_speed - 3)) thrown_weapon.throw_range = max(1, (thrown_weapon.throw_range - 3)) if(thrown_weapon.embedding) thrown_weapon.embedding["embed_chance"] = 0 thrown_weapon.updateEmbedding() - else if(istype(bomb_target, /mob/living)) + else if(isliving(bomb_target)) plastic_overlay.layer = FLOAT_LAYER target.add_overlay(plastic_overlay) diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 5b8f72456ed..e28ae7705ce 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -93,7 +93,7 @@ if(P.implant(M)) visible_message(span_warning("[M] is implanted by [src].")) return TRUE - else if(istype(I, /obj/item/organ)) + else if(isorgan(I)) var/obj/item/organ/P = I P.Insert(M, FALSE, FALSE) visible_message(span_warning("[M] is implanted by [src].")) diff --git a/code/game/objects/items/inducer.dm b/code/game/objects/items/inducer.dm index ca16a4d25b2..fb8d7d20045 100644 --- a/code/game/objects/items/inducer.dm +++ b/code/game/objects/items/inducer.dm @@ -111,7 +111,7 @@ if(istype(A, /obj/item/clothing/suit/space)) to_chat(user, span_alert("Error unable to interface with device.")) return FALSE - if(istype(A, /obj)) + if(isobj(A)) O = A if(C) var/done_any = FALSE diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index 938f7c81f64..ff6265203c6 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -144,7 +144,7 @@ user.put_in_hands(grenade) grenade = null return - if(istype(I, /obj/item/grenade)) + if(isgrenade(I)) if(stuffed) to_chat(user, span_warning("You need to remove some stuffing first!")) return diff --git a/code/game/objects/items/singularityhammer.dm b/code/game/objects/items/singularityhammer.dm index bff80cc9020..aea06434866 100644 --- a/code/game/objects/items/singularityhammer.dm +++ b/code/game/objects/items/singularityhammer.dm @@ -57,7 +57,7 @@ if(HAS_TRAIT(src, TRAIT_WIELDED)) if(charged) charged = FALSE - if(istype(A, /mob/living/)) + if(isliving(A)) var/mob/living/Z = A Z.take_bodypart_damage(20,0) playsound(user, 'sound/weapons/marauder.ogg', 50, TRUE) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 7a4a8ffdd73..92445015c6b 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -228,7 +228,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ return TOOL_ACT_TOOLTYPE_SUCCESS /obj/item/stack/sheet/iron/afterattack_secondary(atom/target, mob/user, proximity_flag, click_parameters) - if(istype(target, /turf/open)) + if(isopenturf(target)) var/turf/open/build_on = target if(!user.Adjacent(build_on)) return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN diff --git a/code/game/objects/items/stacks/tape.dm b/code/game/objects/items/stacks/tape.dm index ff505d2903f..0fb31ed770c 100644 --- a/code/game/objects/items/stacks/tape.dm +++ b/code/game/objects/items/stacks/tape.dm @@ -89,7 +89,7 @@ to_chat(user, span_notice("You finish wrapping [target] with [src].")) target.name = "[prefix] [target.name]" - if(istype(target, /obj/item/grenade)) + if(isgrenade(target)) var/obj/item/grenade/sticky_bomb = target sticky_bomb.sticky = TRUE diff --git a/code/game/objects/items/storage/lockbox.dm b/code/game/objects/items/storage/lockbox.dm index 9cda286decb..5dc74dbe54c 100644 --- a/code/game/objects/items/storage/lockbox.dm +++ b/code/game/objects/items/storage/lockbox.dm @@ -230,7 +230,7 @@ //SKYRAT EDIT END /obj/item/storage/lockbox/order/attackby(obj/item/W, mob/user, params) - if(!istype(W, /obj/item/card/id)) + if(!isidcard(W)) return ..() var/obj/item/card/id/id_card = W diff --git a/code/game/objects/items/storage/medkit.dm b/code/game/objects/items/storage/medkit.dm index bb7bc9b3010..f96e9d74473 100644 --- a/code/game/objects/items/storage/medkit.dm +++ b/code/game/objects/items/storage/medkit.dm @@ -580,7 +580,7 @@ var/obj/item/organ/internal/int_organ = I int_organ.organ_flags |= ORGAN_FROZEN return - if(istype(I, /obj/item/bodypart)) + if(isbodypart(I)) var/obj/item/bodypart/B = I for(var/obj/item/organ/internal/int_organ in B.contents) int_organ.organ_flags |= ORGAN_FROZEN @@ -592,13 +592,13 @@ var/obj/item/organ/internal/int_organ = I int_organ.organ_flags &= ~ORGAN_FROZEN return - if(istype(I, /obj/item/bodypart)) + if(isbodypart(I)) var/obj/item/bodypart/B = I for(var/obj/item/organ/internal/int_organ in B.contents) int_organ.organ_flags &= ~ORGAN_FROZEN /obj/item/storage/organbox/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/reagent_containers) && I.is_open_container()) + if(is_reagent_container(I) && I.is_open_container()) var/obj/item/reagent_containers/RC = I var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user) if(units) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 7eac2e12e8b..9ff803ff6dc 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -44,7 +44,7 @@ /obj/item/storage/wallet/Exited(atom/movable/gone, direction) . = ..() - if(istype(gone, /obj/item/card/id)) + if(isidcard(gone)) refreshID() /** @@ -89,7 +89,7 @@ /obj/item/storage/wallet/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs) . = ..() - if(istype(arrived, /obj/item/card/id)) + if(isidcard(arrived)) refreshID() /obj/item/storage/wallet/update_overlays() diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index d2d02e0048b..b9ce200a0c6 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -122,7 +122,7 @@ return loc /obj/item/tank/jetpack/suicide_act(mob/user) - if (!istype(user, /mob/living/carbon/human)) + if (!ishuman(user)) return ..() var/mob/living/carbon/human/suffocater = user suffocater.say("WHAT THE FUCK IS CARBON DIOXIDE?") diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 173195462ac..b1eeac1e66e 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -321,7 +321,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 user.balloon_alert(user, "crafted spear") return - if(istype(attacking_item, /obj/item/assembly/igniter) && !(HAS_TRAIT(attacking_item, TRAIT_NODROP))) + if(isigniter(attacking_item) && !(HAS_TRAIT(attacking_item, TRAIT_NODROP))) var/datum/crafting_recipe/recipe_to_use = /datum/crafting_recipe/stunprod user.balloon_alert(user, "crafting cattleprod...") if(do_after(user, initial(recipe_to_use.time), src)) diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index a16abad5709..17499ed8980 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -122,7 +122,7 @@ return FALSE if(!SSmapping.level_trait(T.z,ZTRAIT_STATION)) return FALSE - if(!istype(T, /turf/open/floor)) + if(!isfloorturf(T)) return FALSE return TRUE diff --git a/code/game/objects/structures/cannons/cannon.dm b/code/game/objects/structures/cannons/cannon.dm index e5569d7b88a..d087423c96c 100644 --- a/code/game/objects/structures/cannons/cannon.dm +++ b/code/game/objects/structures/cannons/cannon.dm @@ -81,7 +81,7 @@ charge_ignited = TRUE return - else if(istype(used_item, /obj/item/reagent_containers)) + else if(is_reagent_container(used_item)) var/obj/item/reagent_containers/powder_keg = used_item if(!(powder_keg.reagent_flags & OPENCONTAINER)) return ..() diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index f7b330523e6..008d171fd7d 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -100,7 +100,7 @@ /obj/structure/closet/update_icon() . = ..() - if(istype(src, /obj/structure/closet/supplypod)) + if(issupplypod(src)) return layer = opened ? BELOW_OBJ_LAYER : OBJ_LAYER diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm index af175889f85..e2c083a7197 100644 --- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm +++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm @@ -99,7 +99,7 @@ to_chat(the_folder, span_warning("You wrestle with [src], but it won't fold while unzipped.")) return for(var/content_thing in contents) - if(istype(content_thing, /mob) || istype(content_thing, /obj)) + if(istype(content_thing, /mob) || isobj(content_thing)) to_chat(the_folder, span_warning("There are too many things inside of [src] to fold it up!")) return // toto we made it! diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 1d408f9d971..212087047ac 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -55,7 +55,7 @@ qdel(src) return - else if(istype(W, /obj/item/stack)) + else if(isstack(W)) if(iswallturf(loc) || (locate(/obj/structure/falsewall) in src.loc.contents)) balloon_alert(user, "wall already present!") return @@ -357,7 +357,7 @@ /obj/structure/girder/CanAllowThrough(atom/movable/mover, border_dir) . = ..() - if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/projectile)) + if((mover.pass_flags & PASSGRILLE) || isprojectile(mover)) return prob(girderpasschance) /obj/structure/girder/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 00d1081cb97..5553f1d055c 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -163,7 +163,7 @@ /obj/structure/grille/CanAllowThrough(atom/movable/mover, border_dir) . = ..() - if(!. && istype(mover, /obj/projectile)) + if(!. && isprojectile(mover)) return prob(30) /obj/structure/grille/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index 749cbfcc6ba..86596d6b9ef 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -203,7 +203,7 @@ to_chat(usr, span_warning("[src] needs to be wrenched to the floor!")) return FALSE - if (!istype(M, /mob/living/carbon/human)) + if (!ishuman(M)) to_chat(usr, span_warning("It doesn't look like [M.p_they()] can fit into this properly!")) return FALSE // Can't decapitate non-humans @@ -214,7 +214,7 @@ return ..(M, user, check_loc = FALSE) //check_loc = FALSE to allow moving people in from adjacent turfs /obj/structure/guillotine/post_buckle_mob(mob/living/M) - if (!istype(M, /mob/living/carbon/human)) + if (!ishuman(M)) return M.add_mood_event("dying", /datum/mood_event/deaths_door) diff --git a/code/game/objects/structures/maintenance.dm b/code/game/objects/structures/maintenance.dm index eecad4a91ba..210b3d1d291 100644 --- a/code/game/objects/structures/maintenance.dm +++ b/code/game/objects/structures/maintenance.dm @@ -93,7 +93,7 @@ at the cost of risking a vicious bite.**/ if(iscyborg(user) || isalien(user) || !CanReachInside(user)) return ..() add_fingerprint(user) - if(istype(I, /obj/item/reagent_containers)) + if(is_reagent_container(I)) if(istype(I, /obj/item/food/monkeycube)) var/obj/item/food/monkeycube/cube = I cube.Expand() diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index 15751316d31..93b07c44e89 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -96,7 +96,7 @@ resistance_flags = FLAMMABLE /obj/structure/table_frame/wood/attackby(obj/item/I, mob/user, params) - if (istype(I, /obj/item/stack)) + if (isstack(I)) var/obj/item/stack/material = I var/toConstruct // stores the table variant var/carpet_type // stores the carpet type used for construction in case of poker tables diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index c1db722795e..d025e6d0ae2 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -741,7 +741,7 @@ if(potential_patient.body_position == LYING_DOWN && potential_patient.loc == loc) patient = potential_patient return - + // Find another lying mob as a replacement. for (var/mob/living/carbon/replacement_patient in loc.contents) if(replacement_patient.body_position == LYING_DOWN) @@ -776,7 +776,7 @@ /obj/structure/rack/MouseDrop_T(obj/O, mob/user) . = ..() - if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O)) + if ((!( isitem(O) ) || user.get_active_held_item() != O)) return if(!user.dropItemToGround(O)) return diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index e28e68cb231..ac07cedd8bb 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -121,7 +121,7 @@ w_items += I.w_class to_chat(user, span_notice("You carefully place [I] into the cistern.")) - else if(istype(I, /obj/item/reagent_containers) && !user.combat_mode) + else if(is_reagent_container(I) && !user.combat_mode) if (!open) return if(istype(I, /obj/item/food/monkeycube)) @@ -360,7 +360,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink, (-14)) to_chat(user, span_warning("Someone's already washing here!")) return - if(istype(O, /obj/item/reagent_containers)) + if(is_reagent_container(O)) var/obj/item/reagent_containers/RG = O if(reagents.total_volume <= 0) to_chat(user, span_notice("\The [src] is dry.")) @@ -604,7 +604,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink/kitchen, (-16)) to_chat(user, span_warning("Someone's already washing here!")) return - if(istype(O, /obj/item/reagent_containers)) + if(is_reagent_container(O)) var/obj/item/reagent_containers/container = O if(container.is_refillable()) if(!container.reagents.holder_full()) diff --git a/code/game/say.dm b/code/game/say.dm index f457c05b0cc..f680afda500 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -225,7 +225,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/virtualspeaker) else if(iscyborg(M)) // Cyborg var/mob/living/silicon/robot/B = M job = "[B.designation] Cyborg" - else if(istype(M, /mob/living/silicon/pai)) // Personal AI (pAI) + else if(ispAI(M)) // Personal AI (pAI) job = JOB_PERSONAL_AI else if(isobj(M)) // Cold, emotionless machines job = "Machine" diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 99d09d5eb05..53680b369d2 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -279,7 +279,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( if(!length(baseturfs)) baseturfs = list(baseturfs) var/list/old_baseturfs = baseturfs.Copy() - if(!istype(src, /turf/closed)) + if(!isclosedturf(src)) old_baseturfs += type newT = ChangeTurf(fake_turf_type, null, flags) newT.assemble_baseturfs(initial(fake_turf_type.baseturfs)) // The baseturfs list is created like roundstart @@ -290,13 +290,13 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( return newT if(!length(baseturfs)) baseturfs = list(baseturfs) - if(!istype(src, /turf/closed)) + if(!isclosedturf(src)) new_baseturfs = list(type) + new_baseturfs baseturfs = baseturfs_string_list(baseturfs + new_baseturfs, src) return ChangeTurf(fake_turf_type, null, flags) if(!length(baseturfs)) baseturfs = list(baseturfs) - if(!istype(src, /turf/closed)) + if(!isclosedturf(src)) baseturfs = baseturfs_string_list(baseturfs + type, src) var/turf/change_type if(length(new_baseturfs)) @@ -337,10 +337,10 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( levelupdate() if(flags & CHANGETURF_RECALC_ADJACENT) immediate_calculate_adjacent_turfs() - if(ispath(oldType, /turf/closed) && istype(src, /turf/open)) + if(ispath(oldType, /turf/closed) && isopenturf(src)) SSair.add_to_active(src) else //In effect, I want closed turfs to make their tile active when sheered, but we need to queue it since they have no adjacent turfs - CALCULATE_ADJACENT_TURFS(src, (!(ispath(oldType, /turf/closed) && istype(src, /turf/open)) ? NORMAL_TURF : MAKE_ACTIVE)) + CALCULATE_ADJACENT_TURFS(src, (!(ispath(oldType, /turf/closed) && isopenturf(src)) ? NORMAL_TURF : MAKE_ACTIVE)) //update firedoor adjacency var/list/turfs_to_check = get_adjacent_open_turfs(src) | src for(var/I in turfs_to_check) diff --git a/code/game/turfs/open/river.dm b/code/game/turfs/open/river.dm index 483db1b4648..fc2681aec53 100644 --- a/code/game/turfs/open/river.dm +++ b/code/game/turfs/open/river.dm @@ -75,7 +75,7 @@ for(var/F in RANGE_TURFS(1, src) - src) var/turf/T = F var/area/new_area = get_area(T) - if(!T || (T.density && !ismineralturf(T)) || istype(T, /turf/open/indestructible) || (whitelisted_area && !istype(new_area, whitelisted_area)) || (T.turf_flags & NO_LAVA_GEN) ) + if(!T || (T.density && !ismineralturf(T)) || isindestructiblefloor(T) || (whitelisted_area && !istype(new_area, whitelisted_area)) || (T.turf_flags & NO_LAVA_GEN) ) continue if(!logged_turf_type && ismineralturf(T)) diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 257e51fdbb2..8a9bd9a3f16 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -6,9 +6,9 @@ if(!check_rights(R_ADMIN)) return - if (!istype(borgo, /mob/living/silicon/robot)) + if (!iscyborg(borgo)) borgo = input("Select a borg", "Select a borg", null, null) as null|anything in sort_names(GLOB.silicon_mobs) - if (!istype(borgo, /mob/living/silicon/robot)) + if (!iscyborg(borgo)) to_chat(usr, span_warning("Borg is required for borgpanel"), confidential = TRUE) var/datum/borgpanel/borgpanel = new(usr, borgo) diff --git a/code/modules/admin/view_variables/debug_variables.dm b/code/modules/admin/view_variables/debug_variables.dm index fe03c768573..f92d5de5365 100644 --- a/code/modules/admin/view_variables/debug_variables.dm +++ b/code/modules/admin/view_variables/debug_variables.dm @@ -55,7 +55,7 @@ [M.c][M.f]1  "} //TODO link to modify_transform wrapper for all matrices - else if (istype(value, /datum)) + else if (isdatum(value)) var/datum/DV = value if ("[DV]" != "[DV.type]") //if the thing as a name var, lets use it. item = "[name_part] = [DV] [DV.type] [REF(value)]" diff --git a/code/modules/admin/view_variables/get_variables.dm b/code/modules/admin/view_variables/get_variables.dm index 8120a710c70..434d5594619 100644 --- a/code/modules/admin/view_variables/get_variables.dm +++ b/code/modules/admin/view_variables/get_variables.dm @@ -28,10 +28,10 @@ else if(istype(var_value, /client)) . = VV_CLIENT - else if(istype(var_value, /datum/weakref)) + else if(isweakref(var_value)) . = VV_WEAKREF - else if(istype(var_value, /datum)) + else if(isdatum(var_value)) . = VV_DATUM_REFERENCE else if(ispath(var_value)) diff --git a/code/modules/admin/view_variables/reference_tracking.dm b/code/modules/admin/view_variables/reference_tracking.dm index c9d87718af4..2339f06b81d 100644 --- a/code/modules/admin/view_variables/reference_tracking.dm +++ b/code/modules/admin/view_variables/reference_tracking.dm @@ -82,7 +82,7 @@ CHECK_TICK #endif - if(istype(potential_container, /datum)) + if(isdatum(potential_container)) var/datum/datum_container = potential_container if(datum_container.last_find_references == search_time) return diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index cc6a552bafd..d6934144a8c 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -5,7 +5,7 @@ return var/target = GET_VV_TARGET vv_do_basic(target, href_list, href) - if(istype(target, /datum)) + if(isdatum(target)) var/datum/D = target D.vv_do_topic(href_list) else if(islist(target)) @@ -117,6 +117,6 @@ //Finally, refresh if something modified the list. if(href_list["datumrefresh"]) var/datum/DAT = locate(href_list["datumrefresh"]) - if(istype(DAT, /datum) || istype(DAT, /client) || islist(DAT)) + if(isdatum(DAT) || istype(DAT, /client) || islist(DAT)) debug_variables(DAT) diff --git a/code/modules/antagonists/blob/blob_mobs.dm b/code/modules/antagonists/blob/blob_mobs.dm index ab573071441..5f19f24279e 100644 --- a/code/modules/antagonists/blob/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob_mobs.dm @@ -91,7 +91,7 @@ var/spanned_message = say_quote(message) var/rendered = "\[Blob Telepathy\] [real_name] [spanned_message]" for(var/M in GLOB.mob_list) - if(isovermind(M) || istype(M, /mob/living/simple_animal/hostile/blob)) + if(isovermind(M) || isblobmonster(M)) to_chat(M, rendered) if(isobserver(M)) var/link = FOLLOW_LINK(M, src) diff --git a/code/modules/antagonists/blob/blobstrains/_reagent.dm b/code/modules/antagonists/blob/blobstrains/_reagent.dm index 424fb6ba3f3..aefd6c02f3c 100644 --- a/code/modules/antagonists/blob/blobstrains/_reagent.dm +++ b/code/modules/antagonists/blob/blobstrains/_reagent.dm @@ -29,7 +29,7 @@ /// Used by blob reagents to calculate the reaction volume they should use when exposing mobs. /datum/reagent/blob/proc/return_mob_expose_reac_volume(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind) - if(exposed_mob.stat == DEAD || istype(exposed_mob, /mob/living/simple_animal/hostile/blob)) + if(exposed_mob.stat == DEAD || isblobmonster(exposed_mob)) return 0 //the dead, and blob mobs, don't cause reactions return round(reac_volume * min(1.5 - touch_protection, 1), 0.1) //full touch protection means 50% volume, any prot below 0.5 means 100% volume. diff --git a/code/modules/antagonists/blob/blobstrains/reactive_spines.dm b/code/modules/antagonists/blob/blobstrains/reactive_spines.dm index 7631499b8f6..e56f9377ca2 100644 --- a/code/modules/antagonists/blob/blobstrains/reactive_spines.dm +++ b/code/modules/antagonists/blob/blobstrains/reactive_spines.dm @@ -33,7 +33,7 @@ color = "#9ACD32" /datum/reagent/blob/reactive_spines/return_mob_expose_reac_volume(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind) - if(exposed_mob.stat == DEAD || istype(exposed_mob, /mob/living/simple_animal/hostile/blob)) + if(exposed_mob.stat == DEAD || isblobmonster(exposed_mob)) return 0 //the dead, and blob mobs, don't cause reactions return reac_volume diff --git a/code/modules/antagonists/blob/overmind.dm b/code/modules/antagonists/blob/overmind.dm index 4bb83647d9d..e2b05f5a64b 100644 --- a/code/modules/antagonists/blob/overmind.dm +++ b/code/modules/antagonists/blob/overmind.dm @@ -281,7 +281,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) var/rendered = span_big("\[Blob Telepathy\] [name]([blobstrain.name]) [message_a]") for(var/mob/M in GLOB.mob_list) - if(isovermind(M) || istype(M, /mob/living/simple_animal/hostile/blob)) + if(isovermind(M) || isblobmonster(M)) to_chat(M, rendered) if(isobserver(M)) var/link = FOLLOW_LINK(M, src) diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index 960fcc3b31d..31f4f1ccc44 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -294,7 +294,7 @@ COOLDOWN_DECLARE(cult_mark_cooldown) /datum/action/innate/cult/ghostmark/IsAvailable() - return ..() && istype(owner, /mob/dead/observer) + return ..() && isobserver(owner) /datum/action/innate/cult/ghostmark/Activate() var/datum/antagonist/cult/cultist = owner.mind?.has_antag_datum(/datum/antagonist/cult, TRUE) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 0ff58434a4b..1196e34f9e1 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -678,7 +678,7 @@ Striking a noncultist, however, will tear their flesh."} to_chat(user, "That doesn't seem to do anything useful.") return - if(!istype(A, /obj/item)) + if(!isitem(A)) ..() to_chat(user, span_warning("\The [src] can only transport items!")) return @@ -1017,7 +1017,7 @@ Striking a noncultist, however, will tear their flesh."} /obj/item/shield/mirror/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(IS_CULTIST(owner)) - if(istype(hitby, /obj/projectile)) + if(isprojectile(hitby)) var/obj/projectile/P = hitby if(P.damage_type == BRUTE || P.damage_type == BURN) if(P.damage >= 30) diff --git a/code/modules/antagonists/cult/cult_structure_pylon.dm b/code/modules/antagonists/cult/cult_structure_pylon.dm index 187337bdbd3..280df3ee09d 100644 --- a/code/modules/antagonists/cult/cult_structure_pylon.dm +++ b/code/modules/antagonists/cult/cult_structure_pylon.dm @@ -59,7 +59,7 @@ if(length(validturfs)) var/turf/converted_turf = pick(validturfs) - if(istype(converted_turf, /turf/open/floor/plating)) + if(isplatingturf(converted_turf)) converted_turf.PlaceOnTop(/turf/open/floor/engine/cult, flags = CHANGETURF_INHERIT_AIR) else converted_turf.ChangeTurf(/turf/open/floor/engine/cult, flags = CHANGETURF_INHERIT_AIR) diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index a94cfd21030..a6f5da20888 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -104,7 +104,7 @@ Runes can either be invoked by one's self or with many different cultists. Each fail_invoke() /obj/effect/rune/attack_animal(mob/living/simple_animal/user, list/modifiers) - if(istype(user, /mob/living/simple_animal/shade) || istype(user, /mob/living/simple_animal/hostile/construct)) + if(isshade(user) || isconstruct(user)) if(istype(user, /mob/living/simple_animal/hostile/construct/wraith/angelic) || istype(user, /mob/living/simple_animal/hostile/construct/juggernaut/angelic) || istype(user, /mob/living/simple_animal/hostile/construct/artificer/angelic)) to_chat(user, span_warning("You purge the rune!")) qdel(src) diff --git a/code/modules/antagonists/heretic/magic/ash_ascension.dm b/code/modules/antagonists/heretic/magic/ash_ascension.dm index 29285bc4c26..d4465b06c54 100644 --- a/code/modules/antagonists/heretic/magic/ash_ascension.dm +++ b/code/modules/antagonists/heretic/magic/ash_ascension.dm @@ -138,7 +138,7 @@ /datum/action/cooldown/spell/pointed/ash_beams/proc/fire_line(atom/source, list/turfs) var/list/hit_list = list() for(var/turf/T in turfs) - if(istype(T, /turf/closed)) + if(isclosedturf(T)) break for(var/mob/living/L in T.contents) diff --git a/code/modules/antagonists/heretic/structures/mawed_crucible.dm b/code/modules/antagonists/heretic/structures/mawed_crucible.dm index a3f198b0ace..e50da967a55 100644 --- a/code/modules/antagonists/heretic/structures/mawed_crucible.dm +++ b/code/modules/antagonists/heretic/structures/mawed_crucible.dm @@ -72,7 +72,7 @@ balloon_alert(user, "[anchored ? "":"un"]anchored") return TRUE - if(istype(weapon, /obj/item/bodypart)) + if(isbodypart(weapon)) var/obj/item/bodypart/consumed = weapon if(!IS_ORGANIC_LIMB(consumed)) @@ -82,7 +82,7 @@ consume_fuel(user, consumed) return TRUE - if(istype(weapon, /obj/item/organ)) + if(isorgan(weapon)) var/obj/item/organ/consumed = weapon if(consumed.status != ORGAN_ORGANIC || (consumed.organ_flags & ORGAN_SYNTHETIC)) balloon_alert(user, "not organic!") diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index f3638e42e13..4909138a595 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -154,7 +154,7 @@ /datum/action/cooldown/spell/aoe/revenant/New(Target) . = ..() - if(!istype(target, /mob/living/simple_animal/revenant)) + if(!isrevenant(target)) stack_trace("[type] was given to a non-revenant mob, please don't.") qdel(src) return @@ -168,7 +168,7 @@ . = ..() if(!.) return FALSE - if(!istype(owner, /mob/living/simple_animal/revenant)) + if(!isrevenant(owner)) stack_trace("[type] was owned by a non-revenant mob, please don't.") return FALSE diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm index c87001c2c30..70ee19ff61c 100644 --- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm +++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm @@ -401,7 +401,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) if(caller.incapacitated()) unset_ranged_ability(caller) return FALSE - if(!istype(clicked_on, /obj/machinery)) + if(!ismachinery(clicked_on)) to_chat(caller, span_warning("You can only animate machines!")) return FALSE var/obj/machinery/clicked_machine = clicked_on @@ -489,7 +489,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) if(caller.incapacitated()) unset_ranged_ability(caller) return FALSE - if(!istype(clicked_on, /obj/machinery)) + if(!ismachinery(clicked_on)) to_chat(caller, span_warning("You can only overload machines!")) return FALSE var/obj/machinery/clicked_machine = clicked_on diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index b148f51b408..6e84d709dd4 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -226,7 +226,7 @@ return /obj/item/assembly/signaler/internal/can_interact(mob/user) - if(istype(user, /mob/living/silicon/pai)) + if(ispAI(user)) return TRUE . = ..() diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 058e1cc8a26..e879cbc76ed 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -488,7 +488,7 @@ return ..() /obj/machinery/atmospherics/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs) - if(istype(arrived, /mob/living)) + if(isliving(arrived)) var/mob/living/L = arrived L.ventcrawl_layer = piping_layer return ..() diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index 803453d6e06..ad94e7a199e 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -474,7 +474,7 @@ icon_state = "plated_frame" /obj/structure/tank_frame/attackby(obj/item/item, mob/living/user, params) - if(construction_state == TANK_FRAME && istype(item, /obj/item/stack) && add_plating(user, item)) + if(construction_state == TANK_FRAME && isstack(item) && add_plating(user, item)) return return ..() diff --git a/code/modules/buildmode/submodes/advanced.dm b/code/modules/buildmode/submodes/advanced.dm index 2209ecd33c7..d6939f347a7 100644 --- a/code/modules/buildmode/submodes/advanced.dm +++ b/code/modules/buildmode/submodes/advanced.dm @@ -36,7 +36,7 @@ var/alt_click = LAZYACCESS(modifiers, ALT_CLICK) if(left_click && alt_click) - if (istype(object, /turf) || istype(object, /obj) || istype(object, /mob)) + if (istype(object, /turf) || isobj(object) || istype(object, /mob)) objholder = object.type to_chat(c, span_notice("[initial(object.name)] ([object.type]) selected.")) else diff --git a/code/modules/cargo/bounties/mech.dm b/code/modules/cargo/bounties/mech.dm index 9cacba95ff3..c55daae7b51 100644 --- a/code/modules/cargo/bounties/mech.dm +++ b/code/modules/cargo/bounties/mech.dm @@ -5,7 +5,7 @@ /datum/bounty/item/mech/ship(obj/O) if(!applies_to(O)) return - if(istype(O, /obj/vehicle/sealed/mecha)) + if(ismecha(O)) var/obj/vehicle/sealed/mecha/M = O M.wreckage = null // So the mech doesn't explode. ..() diff --git a/code/modules/cargo/bounties/reagent.dm b/code/modules/cargo/bounties/reagent.dm index 1d3b02262a0..1ae252c096e 100644 --- a/code/modules/cargo/bounties/reagent.dm +++ b/code/modules/cargo/bounties/reagent.dm @@ -7,7 +7,7 @@ return ..() && shipped_volume >= required_volume /datum/bounty/reagent/applies_to(obj/O) - if(!istype(O, /obj/item/reagent_containers)) + if(!is_reagent_container(O)) return FALSE if(!O.reagents || !O.reagents.has_reagent(wanted_reagent.type)) return FALSE diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index 71aec6e7fee..96414866575 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -381,7 +381,7 @@ else if(isobj(to_insert)) var/obj/obj_to_insert = to_insert - if(istype(obj_to_insert, /obj/structure/closet/supplypod)) + if(issupplypod(obj_to_insert)) return FALSE if(istype(obj_to_insert, /obj/effect/supplypod_smoke)) return FALSE diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 6a9a867a080..11b2b2131ac 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -19,8 +19,8 @@ * By default in byond if you define a proc on datums, that proc will exist on nearly every single type * from icons to images to atoms to mobs to objs to turfs to areas, it won't however, appear on client * - * instead by default they act like their own independent type so while you can do istype(icon, /datum) - * and have it return true, you can't do istype(client, /datum), it will always return false. + * instead by default they act like their own independent type so while you can do isdatum(icon) + * and have it return true, you can't do isdatum(client), it will always return false. * * This makes writing oo code hard, when you have to consider this extra special case * diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index d292cc82b50..c7af1aae3b3 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -41,7 +41,7 @@ var/mob/living/simple_animal/drone/D - if(istype(owner, /mob/living/simple_animal/drone)) + if(isdrone(owner)) D = owner else return @@ -234,7 +234,7 @@ item_target.righthand_file = SSgreyscale.GetColoredIconByType(initial(picked_item.greyscale_config_inhand_right), initial(picked_item.greyscale_colors)) item_target.worn_icon_state = initial(picked_item.worn_icon_state) item_target.inhand_icon_state = initial(picked_item.inhand_icon_state) - if(istype(item_target, /obj/item/clothing) && ispath(picked_item, /obj/item/clothing)) + if(isclothing(item_target) && ispath(picked_item, /obj/item/clothing)) var/obj/item/clothing/clothing_target = item_target var/obj/item/clothing/picked_clothing = picked_item clothing_target.flags_cover = initial(picked_clothing.flags_cover) diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index 25073a20410..31b7e0814a5 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -36,7 +36,7 @@ return(FIRELOSS) /obj/item/clothing/head/chefhat/relaymove(mob/living/user, direction) - if(!istype(user, /mob/living/simple_animal/mouse) || !isliving(loc) || !prob(mouse_control_probability)) + if(!ismouse(user) || !isliving(loc) || !prob(mouse_control_probability)) return var/mob/living/L = loc if(L.incapacitated(IGNORE_RESTRAINTS)) //just in case diff --git a/code/modules/clothing/shoes/cowboy.dm b/code/modules/clothing/shoes/cowboy.dm index 607902fd5c1..9ab85d9828e 100644 --- a/code/modules/clothing/shoes/cowboy.dm +++ b/code/modules/clothing/shoes/cowboy.dm @@ -53,7 +53,7 @@ if(contents.len >= max_occupants) to_chat(user, span_warning("[src] are full!")) return - if(istype(target, /mob/living/simple_animal/hostile/retaliate/snake) || istype(target, /mob/living/simple_animal/hostile/headcrab) || istype(target, /mob/living/carbon/alien/larva)) + if(istype(target, /mob/living/simple_animal/hostile/retaliate/snake) || istype(target, /mob/living/simple_animal/hostile/headcrab) || islarva(target)) target.forceMove(src) to_chat(user, span_notice("[target] slithers into [src].")) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 38202b26ad8..55622c10a53 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -233,7 +233,7 @@ set category = "Object" set src in usr var/mob/M = usr - if (istype(M, /mob/dead/)) + if (isdead(M)) return if (!can_use(M)) return diff --git a/code/modules/economy/account.dm b/code/modules/economy/account.dm index 6c4f74c513c..5cde975c0e2 100644 --- a/code/modules/economy/account.dm +++ b/code/modules/economy/account.dm @@ -151,7 +151,7 @@ return for(var/obj/A in bank_cards) var/icon_source = A - if(istype(A, /obj/item/card/id)) + if(isidcard(A)) var/obj/item/card/id/id_card = A icon_source = id_card.get_cached_flat_icon() var/mob/card_holder = recursive_loc_check(A, /mob) diff --git a/code/modules/economy/holopay.dm b/code/modules/economy/holopay.dm index 7e8314da85a..5e46a5ae02f 100644 --- a/code/modules/economy/holopay.dm +++ b/code/modules/economy/holopay.dm @@ -29,7 +29,7 @@ /obj/structure/holopay/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() - if(istype(held_item, /obj/item/card/id)) + if(isidcard(held_item)) context[SCREENTIP_CONTEXT_LMB] = "Pay" var/obj/item/card/id/held_id = held_item if(held_id.my_store && held_id.my_store == src) @@ -72,7 +72,7 @@ if(!isliving(user)) return ..() /// Users can pay with an ID to skip the UI - if(istype(held_item, /obj/item/card/id)) + if(isidcard(held_item)) if(force_fee && tgui_alert(item_holder, "This holopay has a [force_fee] cr fee. Confirm?", "Holopay Fee", list("Pay", "Cancel")) != "Pay") return TRUE process_payment(user) @@ -110,7 +110,7 @@ /obj/structure/holopay/attackby_secondary(obj/item/weapon, mob/user, params) /// Can kill it by right-clicking with ID because it seems useful and intuitive, to me, at least - if(!istype(weapon, /obj/item/card/id)) + if(!isidcard(weapon)) return ..() var/obj/item/card/id/attacking_id = weapon if(!attacking_id.my_store || attacking_id.my_store != src) diff --git a/code/modules/experisci/experiment/physical_experiments.dm b/code/modules/experisci/experiment/physical_experiments.dm index 659008ffeb4..b8d55d5e388 100644 --- a/code/modules/experisci/experiment/physical_experiments.dm +++ b/code/modules/experisci/experiment/physical_experiments.dm @@ -3,7 +3,7 @@ description = "There has been interest in using our engineering equipment to see what kind of new cooking appliances we can create" /datum/experiment/physical/meat_wall_explosion/register_events() - if(!istype(currently_scanned_atom, /turf/closed/wall)) + if(!iswallturf(currently_scanned_atom)) linked_experiment_handler.announce_message("Incorrect object for experiment.") return FALSE diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index b82eebc676a..90d84a28467 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -142,7 +142,7 @@ /// Checks what can be hooked /obj/item/fishing_rod/proc/can_be_hooked(atom/movable/target) // Could be made dependent on actual hook, ie magnet to hook metallic items - return istype(target, /obj/item) + return isitem(target) /obj/item/fishing_rod/proc/clear_hooked_item() SIGNAL_HANDLER diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index 7fa003394f4..437fd9b974c 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -80,7 +80,7 @@ popup.open() /obj/machinery/icecream_vat/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/reagent_containers) && !(O.item_flags & ABSTRACT) && O.is_open_container()) + if(is_reagent_container(O) && !(O.item_flags & ABSTRACT) && O.is_open_container()) . = TRUE //no afterattack var/obj/item/reagent_containers/B = O if(!user.transferItemToLoc(B, src)) diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 92da655ed50..b92c7a2bb78 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -70,7 +70,7 @@ . += span_notice("\The [src] contains:") var/list/items_counts = new for(var/i in ingredients) - if(istype(i, /obj/item/stack)) + if(isstack(i)) var/obj/item/stack/S = i items_counts[S.name] += S.amount else diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index cfd6dfcb401..a8283f9d746 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -207,7 +207,7 @@ for(var/mob/living/simple_animal/slime/slime in range(1,src)) if(slime.loc == src) continue - if(istype(slime, /mob/living/simple_animal/slime)) + if(isslime(slime)) if(slime.stat) picked_slime = slime break diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 4894c37f8b7..aaec2b31b9c 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -378,7 +378,7 @@ base_build_path = /obj/machinery/smartfridge/drinks /obj/machinery/smartfridge/drinks/accept_check(obj/item/O) - if(!istype(O, /obj/item/reagent_containers) || (O.item_flags & ABSTRACT) || !O.reagents || !O.reagents.reagent_list.len) + if(!is_reagent_container(O) || (O.item_flags & ABSTRACT) || !O.reagents || !O.reagents.reagent_list.len) return FALSE if(istype(O, /obj/item/reagent_containers/cup) || istype(O, /obj/item/reagent_containers/cup/glass) || istype(O, /obj/item/reagent_containers/condiment)) return TRUE @@ -494,7 +494,7 @@ return FALSE return TRUE return FALSE - if(!istype(O, /obj/item/reagent_containers) || (O.item_flags & ABSTRACT)) + if(!is_reagent_container(O) || (O.item_flags & ABSTRACT)) return FALSE if(istype(O, /obj/item/reagent_containers/pill)) // empty pill prank ok return TRUE diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 1d6b3b8305d..1f3c43f17b5 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -18,7 +18,7 @@ /mob/living/carbon/human/bee_friendly() if(dna && dna.species && dna.species.id == SPECIES_PODPERSON) //bees pollinate plants, duh. return 1 - if (wear_suit && head && istype(wear_suit, /obj/item/clothing) && istype(head, /obj/item/clothing)) + if (wear_suit && head && isclothing(wear_suit) && isclothing(head)) var/obj/item/clothing/CS = wear_suit var/obj/item/clothing/CH = head if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 1a3010e70c9..ae5555b7cf3 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -796,7 +796,7 @@ /obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) //Called when mob user "attacks" it with object O - if(IS_EDIBLE(O) || istype(O, /obj/item/reagent_containers)) // Syringe stuff (and other reagent containers now too) + if(IS_EDIBLE(O) || is_reagent_container(O)) // Syringe stuff (and other reagent containers now too) var/obj/item/reagent_containers/reagent_source = O if(!reagent_source.reagents.total_volume) diff --git a/code/modules/industrial_lift/industrial_lift.dm b/code/modules/industrial_lift/industrial_lift.dm index 456aad74f21..b9222d46997 100644 --- a/code/modules/industrial_lift/industrial_lift.dm +++ b/code/modules/industrial_lift/industrial_lift.dm @@ -335,7 +335,7 @@ GLOBAL_LIST_EMPTY(lifts) ///handles any special interactions objects could have with the lift/tram, handled on the item itself SEND_SIGNAL(dest_turf, COMSIG_TURF_INDUSTRIAL_LIFT_ENTER, things_to_move) - if(istype(dest_turf, /turf/closed/wall)) + if(iswallturf(dest_turf)) var/turf/closed/wall/collided_wall = dest_turf do_sparks(2, FALSE, collided_wall) collided_wall.dismantle_wall(devastated = TRUE) diff --git a/code/modules/mapfluff/ruins/lavaland_ruin_code.dm b/code/modules/mapfluff/ruins/lavaland_ruin_code.dm index ecc1c8edeef..596fb38f48b 100644 --- a/code/modules/mapfluff/ruins/lavaland_ruin_code.dm +++ b/code/modules/mapfluff/ruins/lavaland_ruin_code.dm @@ -75,7 +75,7 @@ /obj/item/stack/sheet/mineral/metal_hydrogen= /datum/species/golem/mhydrogen, ) - if(!istype(I, /obj/item/stack)) + if(!isstack(I)) return var/obj/item/stack/stuff_stack = I var/species = golem_shell_species_types[stuff_stack.merge_type] diff --git a/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm b/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm index 30915dd47b0..27a561e17bb 100644 --- a/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm +++ b/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm @@ -92,7 +92,7 @@ O.play_tool_sound(src) deconstruct() return 1 - if(istype(O, /obj/item/reagent_containers)) //Refilling bottles with oil + if(is_reagent_container(O)) //Refilling bottles with oil var/obj/item/reagent_containers/RG = O if(RG.is_refillable()) if(!RG.reagents.holder_full()) diff --git a/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm index 5d4aeaec40a..f49f98648f9 100644 --- a/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm @@ -266,7 +266,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate) if(!islava(T) && !ischasm(T)) //nothing to sink or fall into return var/obj/item/I - if(istype(AM, /obj/item)) + if(isitem(AM)) I = AM var/mob/living/L if(isliving(AM)) diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 75117f8f404..54cb61fda9d 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -314,7 +314,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32) /obj/docking_port/mobile/auxiliary_base/takeoff(list/old_turfs, list/new_turfs, list/moved_atoms, rotation, movement_direction, old_dock, area/underlying_old_area) for(var/i in new_turfs) var/turf/place = i - if(istype(place, /turf/closed/mineral)) + if(ismineralturf(place)) place.ScrapeAway() return ..() diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm index bf09b971734..846354a66ff 100644 --- a/code/modules/mining/lavaland/megafauna_loot.dm +++ b/code/modules/mining/lavaland/megafauna_loot.dm @@ -761,7 +761,7 @@ var/turf/open/T = get_turf(target) if(!istype(T)) return - if(!istype(T, /turf/open/lava)) + if(!islava(T)) var/obj/effect/temp_visual/lavastaff/L = new /obj/effect/temp_visual/lavastaff(T) L.alpha = 0 animate(L, alpha = 255, time = create_delay) diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index 45dc4f9dfe5..8cac79c890f 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -585,7 +585,7 @@ /obj/item/clothing/gloves/gauntlets/proc/rocksmash(mob/living/carbon/human/H, atom/A, proximity) SIGNAL_HANDLER - if(!istype(A, /turf/closed/mineral)) + if(!ismineralturf(A)) return A.attackby(src, H) return COMPONENT_CANCEL_ATTACK_CHAIN diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index e4313ea35fc..0cca6f51865 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -79,7 +79,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs) if(!powered()) return ..() - if (istype(W, /obj/item/stack)) + if (isstack(W)) return remote_attackby(src, user, W) return ..() diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index c52cbce7f3e..6a2e972ac4b 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -268,7 +268,7 @@ var/points = 500 /obj/item/card/mining_point_card/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) if(points) var/obj/item/card/id/C = I C.mining_points += points diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index cb3ed415315..73da09b418a 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -255,7 +255,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ return ..() /obj/item/gibtonite/attackby(obj/item/I, mob/user, params) - if(!wires && istype(I, /obj/item/assembly/igniter)) + if(!wires && isigniter(I)) user.visible_message(span_notice("[user] attaches [I] to [src]."), span_notice("You attach [I] to [src].")) wires = new /datum/wires/explosive/gibtonite(src) attacher = key_name(user) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index b9ecd685387..8318554ba18 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -209,7 +209,7 @@ return FALSE // If the item is a stack and we're already holding a stack then merge - if (istype(I, /obj/item/stack)) + if (isstack(I)) var/obj/item/stack/item_stack = I var/obj/item/stack/active_stack = get_active_held_item() diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index f8f7524d532..853146686ed 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -61,7 +61,7 @@ return TRUE /mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(!skipcatch && can_catch_item() && istype(AM, /obj/item) && !HAS_TRAIT(AM, TRAIT_UNCATCHABLE) && isturf(AM.loc)) + if(!skipcatch && can_catch_item() && isitem(AM) && !HAS_TRAIT(AM, TRAIT_UNCATCHABLE) && isturf(AM.loc)) var/obj/item/I = AM I.attack_hand(src) if(get_active_held_item() == I) //if our attack_hand() picks up the item... @@ -795,7 +795,7 @@ /obj/item/hand_item/self_grasp/proc/grasp_limb(obj/item/bodypart/grasping_part) user = grasping_part.owner if(!istype(user)) - stack_trace("[src] attempted to try_grasp() with [istype(user, /datum) ? user.type : isnull(user) ? "null" : user] user") + stack_trace("[src] attempted to try_grasp() with [isdatum(user) ? user.type : isnull(user) ? "null" : user] user") qdel(src) return diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index b5920f5024d..4dc96ccfd8b 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -117,7 +117,7 @@ var/block_chance_modifier = round(damage / -3) for(var/obj/item/I in held_items) - if(!istype(I, /obj/item/clothing)) + if(!isclothing(I)) var/final_block_chance = I.block_chance - (clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE @@ -154,7 +154,7 @@ return spec_return var/obj/item/I var/throwpower = 30 - if(istype(AM, /obj/item)) + if(isitem(AM)) I = AM throwpower = I.throwforce if(I.thrownby == WEAKREF(src)) //No throwing stuff at yourself to trigger hit reactions diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 34e2a4c9b3d..3b8c1cd1e02 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -15,12 +15,12 @@ if (!(lube & GALOSHES_DONT_HELP)) if(HAS_TRAIT(src, TRAIT_NOSLIPWATER)) return FALSE - if(shoes && istype(shoes, /obj/item/clothing)) + if(shoes && isclothing(shoes)) var/obj/item/clothing/CS = shoes if (CS.clothing_flags & NOSLIP) return FALSE if (lube & SLIDE_ICE) - if(shoes && istype(shoes, /obj/item/clothing)) + if(shoes && isclothing(shoes)) var/obj/item/clothing/CS = shoes if (CS.clothing_flags & NOSLIP_ICE) return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 8643f88bc53..abb8d8e4554 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -515,7 +515,7 @@ /datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) ..() var/obj/item/I - if(istype(AM, /obj/item)) + if(isitem(AM)) I = AM if(I.thrownby == WEAKREF(H)) //No throwing stuff at yourself to trigger the teleport return 0 @@ -673,7 +673,7 @@ /datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) ..() var/obj/item/I - if(istype(AM, /obj/item)) + if(isitem(AM)) I = AM if(I.thrownby == WEAKREF(H)) //No throwing stuff at yourself to make bananas return 0 diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 3a86631fc13..30b8511944c 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -562,7 +562,7 @@ /datum/action/innate/integrate_extract/Activate() var/mob/living/carbon/human/H = owner var/datum/species/jelly/luminescent/species = target - if(!is_species(H, /datum/species/jelly/luminescent) || !species) + if(!isluminescent(H) || !species) return CHECK_DNA_AND_SPECIES(H) @@ -623,7 +623,7 @@ /datum/action/innate/use_extract/Activate() var/mob/living/carbon/human/H = owner var/datum/species/jelly/luminescent/species = H.dna.species - if(!is_species(H, /datum/species/jelly/luminescent) || !species) + if(!isluminescent(H) || !species) return CHECK_DNA_AND_SPECIES(H) diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 7e9cf93f194..18f96625020 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -179,7 +179,7 @@ //handle stuff to update when a mob equips/unequips a headgear. /mob/living/carbon/proc/head_update(obj/item/I, forced) - if(istype(I, /obj/item/clothing)) + if(isclothing(I)) var/obj/item/clothing/C = I if(C.tint || initial(C.tint)) update_tint() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index d68808283a1..3b9f99d1b84 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -71,7 +71,7 @@ else clear_mood_event("suffocation") else - if(istype(loc, /obj/)) + if(isobj(loc)) var/obj/location_as_object = loc location_as_object.handle_internal_lifeform(src,0) @@ -101,7 +101,7 @@ losebreath-- if(prob(10)) emote("gasp") - if(istype(loc, /obj/)) + if(isobj(loc)) var/obj/loc_as_obj = loc loc_as_obj.handle_internal_lifeform(src,0) else @@ -150,7 +150,7 @@ breath = loc.remove_air(breath_moles) else //Breathe from loc as obj again - if(istype(loc, /obj/)) + if(isobj(loc)) var/obj/loc_as_obj = loc loc_as_obj.handle_internal_lifeform(src,0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9a6909bef1a..4b9a05b55e5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -210,7 +210,7 @@ return TRUE //anti-riot equipment is also anti-push for(var/obj/item/I in M.held_items) - if(!istype(M, /obj/item/clothing)) + if(!isclothing(M)) if(prob(I.block_chance*2)) return @@ -2288,10 +2288,10 @@ GLOBAL_LIST_EMPTY(fire_appearances) * extra damage, so jokers can't use half a stack of iron rods to make getting hit by the tram immediately lethal. */ /mob/living/proc/tram_slam_land() - if(!istype(loc, /turf/open/openspace) && !istype(loc, /turf/open/floor/plating)) + if(!istype(loc, /turf/open/openspace) && !isplatingturf(loc)) return - if(istype(loc, /turf/open/floor/plating)) + if(isplatingturf(loc)) var/turf/open/floor/smashed_plating = loc visible_message(span_danger("[src] is thrown violently into [smashed_plating], smashing through it and punching straight through!"), span_userdanger("You're thrown violently into [smashed_plating], smashing through it and punching straight through!")) diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index 4433b3e4255..14e3894560b 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -40,13 +40,13 @@ return FALSE /mob/living/silicon/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE) //immune to oxygen damage - if(istype(src, /mob/living/silicon/ai)) //ais are snowflakes and use oxyloss for being in AI cards and having no battery + if(isAI(src)) //ais are snowflakes and use oxyloss for being in AI cards and having no battery return ..() return FALSE /mob/living/silicon/setOxyLoss(amount, updating_health = TRUE, forced = FALSE) - if(istype(src, /mob/living/silicon/ai)) //ditto + if(isAI(src)) //ditto return ..() return FALSE diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 0050080032f..0a93a4cd591 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -342,7 +342,7 @@ if(!L.len) //no requirements return TRUE - if(!istype(I, /obj/item/card/id) && isitem(I)) + if(!isidcard(I) && isitem(I)) I = I.GetID() if(!I || !I.access) //not ID or no access diff --git a/code/modules/mob/living/silicon/robot/robot_model.dm b/code/modules/mob/living/silicon/robot/robot_model.dm index ebcd0838505..673750ee75a 100644 --- a/code/modules/mob/living/silicon/robot/robot_model.dm +++ b/code/modules/mob/living/silicon/robot/robot_model.dm @@ -84,7 +84,7 @@ . += module /obj/item/robot_model/proc/add_module(obj/item/added_module, nonstandard, requires_rebuild) - if(istype(added_module, /obj/item/stack)) + if(isstack(added_module)) var/obj/item/stack/sheet_module = added_module if(ispath(sheet_module.source, /datum/robot_energy_storage)) sheet_module.source = get_or_create_estorage(sheet_module.source) @@ -431,7 +431,7 @@ wash_audio = new(owner) /datum/action/toggle_buffer/IsAvailable() - if(!istype(owner, /mob/living/silicon/robot)) + if(!iscyborg(owner)) return FALSE return ..() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 7eecbdb30ba..43e92675367 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -83,13 +83,13 @@ modularInterface.layer = ABOVE_HUD_PLANE modularInterface.plane = ABOVE_HUD_PLANE modularInterface.saved_identification = real_name || name - if(istype(src, /mob/living/silicon/robot)) + if(iscyborg(src)) modularInterface.saved_job = "Cyborg" modularInterface.install_component(new /obj/item/computer_hardware/hard_drive/small/robot) - if(istype(src, /mob/living/silicon/ai)) + if(isAI(src)) modularInterface.saved_job = "AI" modularInterface.install_component(new /obj/item/computer_hardware/hard_drive/small/ai) - if(istype(src, /mob/living/silicon/pai)) + if(ispAI(src)) modularInterface.saved_job = "pAI Messenger" modularInterface.install_component(new /obj/item/computer_hardware/hard_drive/small/ai) diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index 9f33d3d0098..da5c157f331 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -361,12 +361,12 @@ target = null mode = BOT_IDLE - else if(istype(A, /obj/item) || istype(A, /obj/effect/decal/remains)) + else if(isitem(A) || istype(A, /obj/effect/decal/remains)) visible_message(span_danger("[src] sprays hydrofluoric acid at [A]!")) playsound(src, 'sound/effects/spray2.ogg', 50, TRUE, -6) A.acid_act(75, 10) target = null - else if(istype(A, /mob/living/basic/cockroach) || istype(A, /mob/living/simple_animal/mouse)) + else if(istype(A, /mob/living/basic/cockroach) || ismouse(A)) var/mob/living/living_target = A if(!living_target.stat) visible_message(span_danger("[src] smashes [living_target] with its mop!")) @@ -374,7 +374,7 @@ target = null else if(bot_cover_flags & BOT_COVER_EMAGGED) //Emag functions - if(istype(A, /mob/living/carbon)) + if(iscarbon(A)) var/mob/living/carbon/victim = A if(victim.stat == DEAD)//cleanbots always finish the job return diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index b5d1b765820..4961f1bd1c7 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -271,7 +271,7 @@ start_handcuffing(attack_target) /mob/living/simple_animal/bot/secbot/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(hitting_atom, /obj/item)) + if(isitem(hitting_atom)) var/obj/item/item_hitby = hitting_atom var/mob/thrown_by = item_hitby.thrownby?.resolve() if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index a4fe631ddff..a6e33337ebf 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -322,7 +322,7 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list( if (!.) return FALSE - if (!istype(equipping, /obj/item/card/id)) + if (!isidcard(equipping)) to_chat(user, span_warning("You can't pin [equipping] to [source]!")) return FALSE diff --git a/code/modules/mob/living/simple_animal/friendly/snake.dm b/code/modules/mob/living/simple_animal/friendly/snake.dm index 30a9f2d02ad..b52b513cd32 100644 --- a/code/modules/mob/living/simple_animal/friendly/snake.dm +++ b/code/modules/mob/living/simple_animal/friendly/snake.dm @@ -47,7 +47,7 @@ var/list/mice = list() for (var/HM in .) //Yum a tasty mouse - if(istype(HM, /mob/living/simple_animal/mouse)) + if(ismouse(HM)) mice += HM if(isliving(HM)) living_mobs += HM @@ -68,7 +68,7 @@ return living_mobs & actual_enemies /mob/living/simple_animal/hostile/retaliate/snake/AttackingTarget() - if(istype(target, /mob/living/simple_animal/mouse)) + if(ismouse(target)) visible_message(span_notice("[name] consumes [target] in a single gulp!"), span_notice("You consume [target] in a single gulp!")) QDEL_NULL(target) adjustBruteLoss(-2) 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 a01f46de805..c7be5fcaf23 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -145,7 +145,7 @@ /mob/living/simple_animal/hostile/giant_spider/nurse/AttackingTarget() if(DOING_INTERACTION(src, INTERACTION_SPIDER_KEY)) return - if(!istype(target, /mob/living/simple_animal/hostile/giant_spider)) + if(!isspider(target)) return ..() var/mob/living/simple_animal/hostile/giant_spider/hurt_spider = target if(hurt_spider == src) @@ -520,7 +520,7 @@ button_icon_state = "directive" /datum/action/innate/spider/set_directive/IsAvailable() - return ..() && istype(owner, /mob/living/simple_animal/hostile/giant_spider) + return ..() && isspider(owner) /datum/action/innate/spider/set_directive/Activate() var/mob/living/simple_animal/hostile/giant_spider/midwife/spider = owner diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index d6f02a361c9..a6ae4396fb4 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -114,7 +114,7 @@ foam.Grant(src) /mob/living/simple_animal/hostile/hivebot/mechanic/AttackingTarget() - if(istype(target, /obj/machinery)) + if(ismachinery(target)) var/obj/machinery/fixable = target if(fixable.get_integrity() >= fixable.max_integrity) to_chat(src, span_warning("Diagnostics indicate that this machine is at peak integrity.")) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm index a5a0fa9f544..35d59a291ee 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm @@ -297,7 +297,7 @@ Difficulty: Extremely Hard SIGNAL_HANDLER var/turf/T = get_turf(loc) - if(!on || istype(T, /turf/closed) || istype(T, change_turf)) + if(!on || isclosedturf(T) || istype(T, change_turf)) return var/reset_turf = T.type T.ChangeTurf(change_turf, flags = CHANGETURF_INHERIT_AIR) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index 24bb3fc8c01..7ac2652b95c 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -181,7 +181,7 @@ /proc/dragon_fire_line(atom/source, list/turfs, frozen = FALSE) var/list/hit_list = list() for(var/turf/T in turfs) - if(istype(T, /turf/closed)) + if(isclosedturf(T)) break var/obj/effect/hotspot/drake_fire_hotspot = new /obj/effect/hotspot(T) if(frozen) @@ -271,7 +271,7 @@ M.take_damage(45, BRUTE, MELEE, 1) // changes turf to lava temporarily - if(!istype(T, /turf/closed) && !istype(T, /turf/open/lava)) + if(!isclosedturf(T) && !islava(T)) var/lava_turf = /turf/open/lava/smooth var/reset_turf = T.type T.ChangeTurf(lava_turf, flags = CHANGETURF_INHERIT_AIR) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 3c5248e140c..d8a87f3a620 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -555,7 +555,7 @@ Difficulty: Hard return FALSE if(mover == caster.pulledby) return - if(istype(mover, /obj/projectile)) + if(isprojectile(mover)) var/obj/projectile/P = mover if(P.firer == caster) return diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm index 4c7c1a583b9..16cf6406916 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm @@ -80,7 +80,7 @@ /mob/living/simple_animal/hostile/asteroid/basilisk/AttackingTarget() . = ..() - if(lava_drinker && !warmed_up && istype(target, /turf/open/lava)) + if(lava_drinker && !warmed_up && islava(target)) visible_message(span_warning("[src] begins to drink from [target]...")) if(do_after(src, 70, target = target)) visible_message(span_warning("[src] begins to fire up!")) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm index 1dea25d1ec0..76105c1cfc2 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm @@ -101,7 +101,7 @@ . = ..() if(mover == set_target) return FALSE - if(istype(mover, /obj/projectile)) + if(isprojectile(mover)) var/obj/projectile/P = mover if(P.firer == set_target) return FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index 857ed8fdd31..98644a69260 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -35,7 +35,7 @@ //Prevents elites from attacking members of their faction (can't hurt themselves either) and lets them mine rock with an attack despite not being able to smash walls. /mob/living/simple_animal/hostile/asteroid/elite/AttackingTarget() - if(istype(target, /mob/living/simple_animal/hostile)) + if(ishostile(target)) var/mob/living/simple_animal/hostile/M = target if(faction_check_mob(M)) return FALSE @@ -54,7 +54,7 @@ if(ismineralturf(target)) var/turf/closed/mineral/M = target M.gets_drilled() - if(istype(target, /obj/vehicle/sealed/mecha)) + if(ismecha(target)) var/obj/vehicle/sealed/mecha/M = target M.take_damage(50, BRUTE, MELEE, 1) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index 1c2bdf52d70..4b6bca12a2c 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -51,7 +51,7 @@ ..() /mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //No floor tiling them to death, wiseguy - if(istype(AM, /obj/item)) + if(isitem(AM)) var/obj/item/T = AM if(!stat) Aggro() diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 95d5bb141a2..f171d556c8d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -180,7 +180,7 @@ /mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() - if(istype(AM, /obj/item)) + if(isitem(AM)) var/obj/item/T = AM if(T.throwforce) Bruise() diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 58732c92059..ad24346c0d9 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -94,9 +94,9 @@ /mob/living/simple_animal/hostile/regalrat/CanAttack(atom/the_target) if(istype(the_target,/mob/living/simple_animal)) var/mob/living/A = the_target - if(istype(the_target, /mob/living/simple_animal/hostile/regalrat) && A.stat == CONSCIOUS) + if(isregalrat(the_target) && A.stat == CONSCIOUS) return TRUE - if(istype(the_target, /mob/living/simple_animal/hostile/rat) && A.stat == CONSCIOUS) + if(israt(the_target) && A.stat == CONSCIOUS) var/mob/living/simple_animal/hostile/rat/R = the_target if(R.faction_check_mob(src, TRUE)) return FALSE @@ -347,13 +347,13 @@ /mob/living/simple_animal/hostile/rat/CanAttack(atom/the_target) if(istype(the_target,/mob/living/simple_animal)) var/mob/living/A = the_target - if(istype(the_target, /mob/living/simple_animal/hostile/regalrat) && A.stat == CONSCIOUS) + if(isregalrat(the_target) && A.stat == CONSCIOUS) var/mob/living/simple_animal/hostile/regalrat/ratking = the_target if(ratking.faction_check_mob(src, TRUE)) return FALSE else return TRUE - if(istype(the_target, /mob/living/simple_animal/hostile/rat) && A.stat == CONSCIOUS) + if(israt(the_target) && A.stat == CONSCIOUS) var/mob/living/simple_animal/hostile/rat/R = the_target if(R.faction_check_mob(src, TRUE)) return FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index 5aad97b195d..cefc59bd283 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -121,7 +121,7 @@ if(target == src) to_chat(src, span_warning("You almost bite yourself, but then decide against it.")) return - if(istype(target, /turf/closed/wall)) + if(iswallturf(target)) if(tearing_wall) return tearing_wall = TRUE @@ -132,7 +132,7 @@ if(istype(target, /turf/closed/wall/r_wall)) timetotear = 120 if(do_after(src, timetotear, target = thewall)) - if(istype(thewall, /turf/open)) + if(isopenturf(thewall)) return thewall.dismantle_wall(1) playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE) @@ -147,7 +147,7 @@ adjustHealth(-L.maxHealth * 0.25) return . = ..() - if(istype(target, /obj/vehicle/sealed/mecha)) + if(ismecha(target)) var/obj/vehicle/sealed/mecha/M = target M.take_damage(50, BRUTE, MELEE, 1) @@ -281,7 +281,7 @@ turfs = line_target(0, range, at) var/delayFire = -1.0 for(var/turf/T in turfs) - if(istype(T, /turf/closed)) + if(isclosedturf(T)) return for(var/obj/structure/window/W in T.contents) return diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 421a80b0a83..0416ca299fa 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -482,7 +482,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do. var/atom/movable/AM = search_for_perch_and_item() //This handles checking through lists so we know it's either a perch or stealable item if(AM) - if(istype(AM, /obj/item) || isliving(AM)) //If stealable item + if(isitem(AM) || isliving(AM)) //If stealable item parrot_interest = AM manual_emote("turns and flies towards [parrot_interest].") parrot_state = PARROT_SWOOP | PARROT_STEAL @@ -645,7 +645,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( //Skip items we already stole or are wearing or are too big if(parrot_perch && AM.loc == parrot_perch.loc || AM.loc == src) continue - if(istype(AM, /obj/item)) + if(isitem(AM)) var/obj/item/I = AM if(I.w_class < WEIGHT_CLASS_SMALL) item = I @@ -679,7 +679,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(parrot_perch && AM.loc == parrot_perch.loc || AM.loc == src) continue - if(istype(AM, /obj/item)) + if(isitem(AM)) var/obj/item/I = AM if(I.w_class <= WEIGHT_CLASS_SMALL) return I @@ -789,7 +789,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(!drop_gently) - if(istype(held_item, /obj/item/grenade)) + if(isgrenade(held_item)) var/obj/item/grenade/G = held_item G.forceMove(drop_location()) G.detonate() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5fe239dfeab..c386b0fb7b1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1086,7 +1086,7 @@ var/search_pda = 1 for(var/A in searching) - if( search_id && istype(A, /obj/item/card/id) ) + if( search_id && isidcard(A) ) var/obj/item/card/id/ID = A if(ID.registered_name == oldname) ID.registered_name = newname diff --git a/code/modules/mod/modules/modules_medical.dm b/code/modules/mod/modules/modules_medical.dm index 0894caa103c..82194baad76 100644 --- a/code/modules/mod/modules/modules_medical.dm +++ b/code/modules/mod/modules/modules_medical.dm @@ -138,7 +138,7 @@ if(!.) return var/mob/living/carbon/human/wearer_human = mod.wearer - if(istype(target, /obj/item/organ)) + if(isorgan(target)) if(!wearer_human.Adjacent(target)) return var/atom/movable/organ = target diff --git a/code/modules/mod/modules/modules_service.dm b/code/modules/mod/modules/modules_service.dm index 8e3c81787ea..c2747afa698 100644 --- a/code/modules/mod/modules/modules_service.dm +++ b/code/modules/mod/modules/modules_service.dm @@ -36,7 +36,7 @@ . = ..() if(!.) return - if(!istype(target, /obj/item)) + if(!isitem(target)) return if(!isturf(target.loc)) balloon_alert(mod.wearer, "must be on the floor!") diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index 39a2aeccfc6..ca0d9c158b7 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -142,7 +142,7 @@ return if(!mod.wearer.Adjacent(target)) return - if(istype(target, /turf/closed/mineral)) + if(ismineralturf(target)) var/turf/closed/mineral/mineral_turf = target mineral_turf.gets_drilled(mod.wearer) drain_power(use_power_cost) @@ -155,7 +155,7 @@ /obj/item/mod/module/drill/proc/bump_mine(mob/living/carbon/human/bumper, atom/bumped_into, proximity) SIGNAL_HANDLER - if(!istype(bumped_into, /turf/closed/mineral) || !drain_power(use_power_cost)) + if(!ismineralturf(bumped_into) || !drain_power(use_power_cost)) return var/turf/closed/mineral/mineral_turf = bumped_into mineral_turf.gets_drilled(mod.wearer) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index bc958a42e01..9afc5eddce3 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -657,7 +657,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar /obj/item/modular_computer/attackby(obj/item/attacking_item, mob/user, params) // Check for ID first - if(istype(attacking_item, /obj/item/card/id) && InsertID(attacking_item)) + if(isidcard(attacking_item) && InsertID(attacking_item)) return // Insert a PAI. diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index 10f75bbce7d..d22091240dd 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -228,7 +228,7 @@ /obj/item/modular_computer/tablet/integrated/ui_data(mob/user) . = ..() .["has_light"] = TRUE - if(istype(borgo, /mob/living/silicon/robot)) + if(iscyborg(borgo)) var/mob/living/silicon/robot/robo = borgo .["light_on"] = robo.lamp_enabled .["comp_light_color"] = robo.lamp_color @@ -237,7 +237,7 @@ /obj/item/modular_computer/tablet/integrated/toggle_flashlight() if(!borgo || QDELETED(borgo)) return FALSE - if(istype(borgo, /mob/living/silicon/robot)) + if(iscyborg(borgo)) var/mob/living/silicon/robot/robo = borgo robo.toggle_headlamp() return TRUE @@ -246,7 +246,7 @@ /obj/item/modular_computer/tablet/integrated/set_flashlight_color(color) if(!borgo || QDELETED(borgo) || !color) return FALSE - if(istype(borgo, /mob/living/silicon/robot)) + if(iscyborg(borgo)) var/mob/living/silicon/robot/robo = borgo robo.lamp_color = color robo.toggle_headlamp(FALSE, TRUE) @@ -270,7 +270,7 @@ /obj/item/modular_computer/tablet/integrated/syndicate/Initialize(mapload) . = ..() - if(istype(borgo, /mob/living/silicon/robot)) + if(iscyborg(borgo)) var/mob/living/silicon/robot/robo = borgo robo.lamp_color = COLOR_RED //Syndicate likes it red diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 6fb42ae9bbc..ecc144d08e6 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -141,7 +141,7 @@ return card_slot.try_eject(user) else var/obj/item/I = user.get_active_held_item() - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) return card_slot.try_insert(I, user) // Eject the ID being modified. if("PRG_ejectmodid") @@ -152,7 +152,7 @@ return card_slot2.try_eject(user) else var/obj/item/I = user.get_active_held_item() - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) return card_slot2.try_insert(I, user) return TRUE // Used to fire someone. Wipes all access from their card and modifies their assignment. diff --git a/code/modules/modular_computers/file_system/programs/ntmessenger.dm b/code/modules/modular_computers/file_system/programs/ntmessenger.dm index c46bc0d917e..89047ab22e0 100644 --- a/code/modules/modular_computers/file_system/programs/ntmessenger.dm +++ b/code/modules/modular_computers/file_system/programs/ntmessenger.dm @@ -95,7 +95,7 @@ photo_path = deter_path /datum/computer_file/program/messenger/ui_state(mob/user) - if(istype(user, /mob/living/silicon)) + if(issilicon(user)) return GLOB.reverse_contained_state return GLOB.default_state diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index 6c4ab0155b0..9e2ce5e3c96 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -59,7 +59,7 @@ if(!holder) return FALSE - if(!istype(I, /obj/item/card/id)) + if(!isidcard(I)) return FALSE if(stored_card) diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index b831aeef8b6..be6df199a27 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -235,7 +235,7 @@ visible_message(span_info("[user] inserts a [HC.credits] cr holocredit chip into [src].")) qdel(HC) return - else if(istype(I, /obj/item/card/id)) + else if(isidcard(I)) if(state != 2) return var/obj/item/card/id/ID = I diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index 17f16ae9014..dd4feeb4944 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -288,7 +288,7 @@ var/mob/living/carbon/holder if(!holoform && iscarbon(card.loc)) holder = card.loc - if(holoform && istype(loc, /obj/item/clothing/head/mob_holder) && iscarbon(loc.loc)) + if(holoform && ispickedupmob(loc) && iscarbon(loc.loc)) holder = loc.loc if(!holder || !iscarbon(holder)) return FALSE diff --git a/code/modules/pai/shell.dm b/code/modules/pai/shell.dm index 44016c65bcf..2aada5132a4 100644 --- a/code/modules/pai/shell.dm +++ b/code/modules/pai/shell.dm @@ -84,7 +84,7 @@ return FALSE visible_message(span_notice("[src] deactivates its holochassis emitter and folds back into a compact card!")) stop_pulling() - if(istype(loc, /obj/item/clothing/head/mob_holder)) + if(ispickedupmob(loc)) var/obj/item/clothing/head/mob_holder/mob_head = loc mob_head.release(display_messages = FALSE) if(client) diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm index ce47f352609..00bda723289 100644 --- a/code/modules/paperwork/handlabeler.dm +++ b/code/modules/paperwork/handlabeler.dm @@ -16,7 +16,7 @@ user.real_name += " (suicide)" // no conflicts with their identification card for(var/atom/A in user.get_all_contents()) - if(istype(A, /obj/item/card/id)) + if(isidcard(A)) var/obj/item/card/id/their_card = A // only renames their card, as opposed to tagging everyone's diff --git a/code/modules/plumbing/plumbers/bottler.dm b/code/modules/plumbing/plumbers/bottler.dm index 7aa6466990c..98434ee060d 100644 --- a/code/modules/plumbing/plumbers/bottler.dm +++ b/code/modules/plumbing/plumbers/bottler.dm @@ -80,7 +80,7 @@ if(reagents.total_volume >= wanted_amount && anchored && length(inputspot.contents)) use_power(active_power_usage * delta_time) var/obj/AM = pick(inputspot.contents)///pick a reagent_container that could be used - if((istype(AM, /obj/item/reagent_containers) && !istype(AM, /obj/item/reagent_containers/hypospray/medipen)) || istype(AM, /obj/item/ammo_casing/shotgun/dart)) + if((is_reagent_container(AM) && !istype(AM, /obj/item/reagent_containers/hypospray/medipen)) || istype(AM, /obj/item/ammo_casing/shotgun/dart)) var/obj/item/reagent_containers/B = AM ///see if it would overflow else inject if((B.reagents.total_volume + wanted_amount) <= B.reagents.maximum_volume) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index cf861a1d531..d958c2fc6bf 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -565,7 +565,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(target_type > LIVING) continue - if(istype(test, /mob/living/)) + if(isliving(test)) var/mob/living/alive = test if(!(HAS_TRAIT(alive, TRAIT_TESLA_SHOCKIMMUNE)) && !(alive.flags_1 & SHOCKED_1) && alive.stat != DEAD && prob(20))//let's not hit all the engineers with every beam and/or segment of the arc if(target_type != LIVING) @@ -576,7 +576,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(target_type > MACHINERY) continue - if(istype(test, /obj/machinery/)) + if(ismachinery(test)) var/obj/machinery/machine = test if(!(machine.obj_flags & BEING_SHOCKED) && prob(40)) if(target_type != MACHINERY) @@ -587,7 +587,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(target_type > OBJECT) continue - if(istype(test, /obj/)) + if(isobj(test)) var/obj/object = test if(!(object.obj_flags & BEING_SHOCKED)) if(target_type != OBJECT) diff --git a/code/modules/projectiles/ammunition/caseless/_caseless.dm b/code/modules/projectiles/ammunition/caseless/_caseless.dm index ef813060b13..45a5e028303 100644 --- a/code/modules/projectiles/ammunition/caseless/_caseless.dm +++ b/code/modules/projectiles/ammunition/caseless/_caseless.dm @@ -6,7 +6,7 @@ /obj/item/ammo_casing/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from) if (!..()) //failed firing return FALSE - if(istype(fired_from, /obj/item/gun)) + if(isgun(fired_from)) var/obj/item/gun/shot_from = fired_from if(shot_from.chambered == src) shot_from.chambered = null //Nuke it. Nuke it now. diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm index 097a8e23128..740d56e6600 100644 --- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm +++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm @@ -134,7 +134,7 @@ break if(num_loaded) AM.update_ammo_count() - if(istype(A, /obj/item/ammo_casing)) + if(isammocasing(A)) var/obj/item/ammo_casing/AC = A if(give_round(AC, replace_spent)) user.transferItemToLoc(AC, src, TRUE) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index b0d9a9acec1..faad1435cf7 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -346,7 +346,7 @@ else to_chat(user, span_notice("There's already a [magazine_wording] in [src].")) return - if (istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box)) + if (isammocasing(A) || istype(A, /obj/item/ammo_box)) if (bolt_type == BOLT_TYPE_NO_BOLT || internal_magazine) if (chambered && !chambered.loaded_projectile) chambered.forceMove(drop_location()) diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index 3efdda0a995..6b093fd6cf7 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -179,7 +179,7 @@ return SECONDARY_ATTACK_CONTINUE_CHAIN /obj/item/gun/ballistic/automatic/m90/attackby(obj/item/A, mob/user, params) - if(istype(A, /obj/item/ammo_casing)) + if(isammocasing(A)) if(istype(A, underbarrel.magazine.ammo_type)) underbarrel.attack_self(user) underbarrel.attackby(A, user, params) diff --git a/code/modules/projectiles/guns/ballistic/launchers.dm b/code/modules/projectiles/guns/ballistic/launchers.dm index 6a3996e1de4..541ad542c60 100644 --- a/code/modules/projectiles/guns/ballistic/launchers.dm +++ b/code/modules/projectiles/guns/ballistic/launchers.dm @@ -18,7 +18,7 @@ /obj/item/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params) ..() - if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing)) + if(istype(A, /obj/item/ammo_box) || isammocasing(A)) chamber_round() /obj/item/gun/ballistic/revolver/grenadelauncher/cyborg diff --git a/code/modules/projectiles/guns/special/grenade_launcher.dm b/code/modules/projectiles/guns/special/grenade_launcher.dm index 3ae950b269d..a570c842f2d 100644 --- a/code/modules/projectiles/guns/special/grenade_launcher.dm +++ b/code/modules/projectiles/guns/special/grenade_launcher.dm @@ -20,7 +20,7 @@ if(istype(I, /obj/item/grenade/c4)) return - if((istype(I, /obj/item/grenade))) + if((isgrenade(I))) if(grenades.len < max_grenades) if(!user.transferItemToLoc(I, src)) return diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 2af5f3aa56e..990073c255a 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -17,13 +17,13 @@ /obj/item/firing_pin/New(newloc) ..() - if(istype(newloc, /obj/item/gun)) + if(isgun(newloc)) gun = newloc /obj/item/firing_pin/afterattack(atom/target, mob/user, proximity_flag) . = ..() if(proximity_flag) - if(istype(target, /obj/item/gun)) + if(isgun(target)) var/obj/item/gun/G = target var/obj/item/firing_pin/old_pin = G.pin if(old_pin && (force_replace || old_pin.pin_removeable)) @@ -247,7 +247,7 @@ ..() /obj/item/firing_pin/paywall/attackby(obj/item/M, mob/user, params) - if(istype(M, /obj/item/card/id)) + if(isidcard(M)) var/obj/item/card/id/id = M if(!id.registered_account) to_chat(user, span_warning("ERROR: Identification card lacks registered bank account!")) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 578710174ca..6ed793176b0 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -111,7 +111,7 @@ /obj/projectile/beam/pulse/on_hit(atom/target, blocked = FALSE) . = ..() - if (!QDELETED(target) && (isturf(target) || istype(target, /obj/structure/))) + if (!QDELETED(target) && (isturf(target) || isstructure(target))) if(isobj(target)) SSexplosions.med_mov_atom += target else @@ -214,6 +214,6 @@ /obj/projectile/beam/shrink/on_hit(atom/target, blocked = FALSE) . = ..() - if(isopenturf(target) || istype(target, /turf/closed/indestructible))//shrunk floors wouldnt do anything except look weird, i-walls shouldn't be bypassable + if(isopenturf(target) || isindestructiblewall(target))//shrunk floors wouldnt do anything except look weird, i-walls shouldn't be bypassable return target.AddComponent(/datum/component/shrink, shrink_time) diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 968498fd136..e0f71ed378f 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -178,7 +178,7 @@ return else var/obj/O = src - if(istype(O, /obj/item/gun)) + if(isgun(O)) new /mob/living/simple_animal/hostile/mimic/copy/ranged(drop_location(), src, owner) else new /mob/living/simple_animal/hostile/mimic/copy(drop_location(), src, owner) diff --git a/code/modules/projectiles/projectile/special/rocket.dm b/code/modules/projectiles/projectile/special/rocket.dm index 838fcb396ed..cbd425dbe13 100644 --- a/code/modules/projectiles/projectile/special/rocket.dm +++ b/code/modules/projectiles/projectile/special/rocket.dm @@ -101,5 +101,5 @@ if(istype(target, i)) explosion(target, heavy_impact_range = 1, light_impact_range = 1, flash_range = 2, explosion_cause = src) return BULLET_ACT_HIT - //if(istype(target, /turf/closed) || ismecha(target)) + //if(isclosedturf(target) || ismecha(target)) new /obj/item/broken_missile(get_turf(src), 1) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 0cac48120a9..de56c8f75d5 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -417,7 +417,7 @@ return if(default_deconstruction_crowbar(I)) return - if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container()) + if(is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container()) var/obj/item/reagent_containers/B = I //SKYRAT EDIT BEGIN - CHEMISTRY QOL if(customTransferAmount) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 149a5aaebc3..ad27de53245 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -163,7 +163,7 @@ if(default_deconstruction_crowbar(I)) return - if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container()) + if(is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container()) . = TRUE //no afterattack var/obj/item/reagent_containers/B = I if(!user.transferItemToLoc(B, src)) diff --git a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm index 2c61c068621..7656eec5b21 100644 --- a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm +++ b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm @@ -88,7 +88,7 @@ This will not clean any inverted reagents. Inverted reagents will still be corre update_appearance() return - if(istype(item, /obj/item/reagent_containers) && !(item.item_flags & ABSTRACT) && item.is_open_container()) + if(is_reagent_container(item) && !(item.item_flags & ABSTRACT) && item.is_open_container()) var/obj/item/reagent_containers/beaker = item . = TRUE //no afterattack if(!user.transferItemToLoc(beaker, src)) @@ -110,7 +110,7 @@ This will not clean any inverted reagents. Inverted reagents will still be corre if(default_deconstruction_crowbar(item)) return - if(istype(item, /obj/item/reagent_containers) && !(item.item_flags & ABSTRACT) && item.is_open_container()) + if(is_reagent_container(item) && !(item.item_flags & ABSTRACT) && item.is_open_container()) var/obj/item/reagent_containers/beaker = item if(!user.transferItemToLoc(beaker, src)) return diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 951fe3c45fe..d5d4f8c6345 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -136,7 +136,7 @@ else if(default_deconstruction_crowbar(I)) return - if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container()) + if(is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container()) . = TRUE // no afterattack if(panel_open) to_chat(user, span_warning("You can't use the [src.name] while its panel is opened!")) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index b7cb4f93849..6b373962650 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -58,7 +58,7 @@ return ..() /obj/machinery/computer/pandemic/attackby(obj/item/held_item, mob/user, params) - if(!istype(held_item, /obj/item/reagent_containers) || held_item.item_flags & ABSTRACT || !held_item.is_open_container()) + if(!is_reagent_container(held_item) || held_item.item_flags & ABSTRACT || !held_item.is_open_container()) return ..() . = TRUE //no afterattack if(machine_stat & (NOPOWER|BROKEN)) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 8a593bebb0d..09e2f13c557 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -157,7 +157,7 @@ if(panel_open) //Can't insert objects when its screwed open return TRUE - if (istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container()) + if (is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container()) var/obj/item/reagent_containers/B = I . = TRUE //no afterattack if(!user.transferItemToLoc(B, src)) diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm index cfc8e9783e8..ac757721b0b 100644 --- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm +++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm @@ -101,7 +101,7 @@ /obj/machinery/smoke_machine/attackby(obj/item/I, mob/user, params) add_fingerprint(user) - if(istype(I, /obj/item/reagent_containers) && I.is_open_container()) + if(is_reagent_container(I) && I.is_open_container()) var/obj/item/reagent_containers/RC = I var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user) if(units) diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index d81ae96395c..eecbbb91092 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -486,7 +486,7 @@ */ /datum/chemical_reaction/proc/freeze_radius(datum/reagents/holder, datum/equilibrium/equilibrium, temp, radius = 2, freeze_duration = 50 SECONDS, snowball_chance = 0) for(var/any_turf in circle_range_turfs(center = get_turf(holder.my_atom), radius = radius)) - if(!istype(any_turf, /turf/open)) + if(!isopenturf(any_turf)) continue var/turf/open/open_turf = any_turf open_turf.MakeSlippery(TURF_WET_PERMAFROST, freeze_duration, freeze_duration, freeze_duration) diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index b41fd52af74..b0ff59d0372 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -579,7 +579,7 @@ /datum/chemical_reaction/monkey/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) var/mob/living/carbon/M = holder.my_atom var/location = get_turf(M) - if(istype(M, /mob/living/carbon)) + if(iscarbon(M)) if(ismonkey(M)) M.gib() else diff --git a/code/modules/reagents/reagent_containers/cups/glassbottle.dm b/code/modules/reagents/reagent_containers/cups/glassbottle.dm index 8f44a6ece84..0004d814514 100644 --- a/code/modules/reagents/reagent_containers/cups/glassbottle.dm +++ b/code/modules/reagents/reagent_containers/cups/glassbottle.dm @@ -650,7 +650,7 @@ /obj/item/reagent_containers/cup/glass/bottle/pruno/proc/check_fermentation() SIGNAL_HANDLER - if (!(istype(loc, /obj/machinery) || istype(loc, /obj/structure))) + if (!(ismachinery(loc) || isstructure(loc))) if(fermentation_timer) fermentation_time_remaining = timeleft(fermentation_timer) deltimer(fermentation_timer) diff --git a/code/modules/reagents/reagent_containers/cups/soda.dm b/code/modules/reagents/reagent_containers/cups/soda.dm index fcef087cb92..c6fa11782a7 100644 --- a/code/modules/reagents/reagent_containers/cups/soda.dm +++ b/code/modules/reagents/reagent_containers/cups/soda.dm @@ -58,7 +58,7 @@ return TOXLOSS /obj/item/reagent_containers/cup/soda_cans/attack(mob/M, mob/living/user) - if(istype(M, /mob/living/carbon) && !reagents.total_volume && user.combat_mode && user.zone_selected == BODY_ZONE_HEAD) + if(iscarbon(M) && !reagents.total_volume && user.combat_mode && user.zone_selected == BODY_ZONE_HEAD) if(M == user) user.visible_message(span_warning("[user] crushes the can of [src] on [user.p_their()] forehead!"), span_notice("You crush the can of [src] on your forehead.")) else diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 8ae2da45eb7..6443163e671 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -336,7 +336,7 @@ /obj/item/sales_tagger/attackby(obj/item/item, mob/living/user, params) . = ..() - if(istype(item, /obj/item/card/id)) + if(isidcard(item)) var/obj/item/card/id/potential_acc = item if(potential_acc.registered_account) if(payments_acc == potential_acc.registered_account) diff --git a/code/modules/religion/sparring/sparring_datum.dm b/code/modules/religion/sparring/sparring_datum.dm index c5b01451af4..453f09e6181 100644 --- a/code/modules/religion/sparring/sparring_datum.dm +++ b/code/modules/religion/sparring/sparring_datum.dm @@ -119,7 +119,7 @@ /datum/sparring_match/proc/thrown_interference(datum/source, atom/movable/thrown_movable, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) SIGNAL_HANDLER - if(istype(thrown_movable, /obj/item)) + if(isitem(thrown_movable)) var/mob/living/honorbound = source var/obj/item/thrown_item = thrown_movable var/mob/thrown_by = thrown_item.thrownby?.resolve() diff --git a/code/modules/research/bepis.dm b/code/modules/research/bepis.dm index 542f8740f93..3eafcdfd883 100644 --- a/code/modules/research/bepis.dm +++ b/code/modules/research/bepis.dm @@ -69,7 +69,7 @@ say("Deposited [deposit_value] credits into storage.") update_appearance() return - if(istype(O, /obj/item/card/id)) + if(isidcard(O)) var/obj/item/card/id/Card = O if(Card.registered_account) account = Card.registered_account diff --git a/code/modules/research/stock_parts.dm b/code/modules/research/stock_parts.dm index 30712de4b4b..8e938f644f4 100644 --- a/code/modules/research/stock_parts.dm +++ b/code/modules/research/stock_parts.dm @@ -19,13 +19,13 @@ If you create T5+ please take a pass at mech_fabricator.dm. The parts being good create_storage(type = /datum/storage/rped) /obj/item/storage/part_replacer/pre_attack(obj/attacked_object, mob/living/user, params) - if(!istype(attacked_object, /obj/machinery) && !istype(attacked_object, /obj/structure/frame/machine)) + if(!ismachinery(attacked_object) && !istype(attacked_object, /obj/structure/frame/machine)) return ..() if(!user.Adjacent(attacked_object)) // no TK upgrading. return ..() - if(istype(attacked_object, /obj/machinery)) + if(ismachinery(attacked_object)) var/obj/machinery/attacked_machinery = attacked_object if(!attacked_machinery.component_parts) @@ -47,13 +47,13 @@ If you create T5+ please take a pass at mech_fabricator.dm. The parts being good return TRUE /obj/item/storage/part_replacer/afterattack(obj/attacked_object, mob/living/user, adjacent, params) - if(!istype(attacked_object, /obj/machinery) && !istype(attacked_object, /obj/structure/frame/machine)) + if(!ismachinery(attacked_object) && !istype(attacked_object, /obj/structure/frame/machine)) return ..() if(adjacent) return ..() - if(istype(attacked_object, /obj/machinery)) + if(ismachinery(attacked_object)) var/obj/machinery/attacked_machinery = attacked_object if(!attacked_machinery.component_parts) diff --git a/code/modules/research/xenobiology/crossbreeding/_misc.dm b/code/modules/research/xenobiology/crossbreeding/_misc.dm index 90316d00e4a..17947fc073b 100644 --- a/code/modules/research/xenobiology/crossbreeding/_misc.dm +++ b/code/modules/research/xenobiology/crossbreeding/_misc.dm @@ -193,7 +193,7 @@ Slimecrossing Items to_chat(user, span_warning("[M] refused to enter the device.")) return else - if(istype(M, /mob/living/simple_animal/hostile) && !("neutral" in M.faction)) + if(ishostile(M) && !("neutral" in M.faction)) to_chat(user, span_warning("This creature is too aggressive to capture.")) return to_chat(user, span_notice("You store [M] in the capture device.")) diff --git a/code/modules/research/xenobiology/crossbreeding/_potions.dm b/code/modules/research/xenobiology/crossbreeding/_potions.dm index 5a8b0b19316..78be472d626 100644 --- a/code/modules/research/xenobiology/crossbreeding/_potions.dm +++ b/code/modules/research/xenobiology/crossbreeding/_potions.dm @@ -14,7 +14,7 @@ Slimecrossing Potions /obj/item/slimepotion/extract_cloner/afterattack(obj/item/target, mob/user , proximity) if(!proximity) return - if(istype(target, /obj/item/reagent_containers)) + if(is_reagent_container(target)) return ..(target, user, proximity) if(istype(target, /obj/item/slimecross)) to_chat(user, span_warning("[target] is too complex for the potion to clone!")) @@ -43,7 +43,7 @@ Slimecrossing Potions if(!isliving(peace_target) || peace_target.stat == DEAD) to_chat(user, span_warning("[src] only works on the living.")) return ..() - if(istype(peace_target, /mob/living/simple_animal/hostile/megafauna)) + if(ismegafauna(peace_target)) to_chat(user, span_warning("[src] does not work on beings of pure evil!")) return ..() if(peace_target != user) @@ -77,7 +77,7 @@ Slimecrossing Potions if(!isliving(love_target) || love_target.stat == DEAD) to_chat(user, span_warning("The love potion only works on living things, sicko!")) return ..() - if(istype(love_target, /mob/living/simple_animal/hostile/megafauna)) + if(ismegafauna(love_target)) to_chat(user, span_warning("The love potion does not work on beings of pure evil!")) return ..() if(user == love_target) @@ -164,7 +164,7 @@ Slimecrossing Potions C.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) C.add_atom_colour("#800000", FIXED_COLOUR_PRIORITY) C.resistance_flags |= LAVA_PROOF - if (istype(C, /obj/item/clothing)) + if (isclothing(C)) var/obj/item/clothing/CL = C CL.clothing_flags |= LAVAPROTECT uses-- diff --git a/code/modules/research/xenobiology/crossbreeding/_weapons.dm b/code/modules/research/xenobiology/crossbreeding/_weapons.dm index 88914b34248..cbfa32b19c5 100644 --- a/code/modules/research/xenobiology/crossbreeding/_weapons.dm +++ b/code/modules/research/xenobiology/crossbreeding/_weapons.dm @@ -28,7 +28,7 @@ Slimecrossing Weapons damtype = BRUTE /obj/item/knife/rainbowknife/afterattack(atom/O, mob/user, proximity) - if(proximity && istype(O, /mob/living)) + if(proximity && isliving(O)) damtype = pick(BRUTE, BURN, TOX, OXY, CLONE) switch(damtype) if(BRUTE) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 1cd9f0c97e9..e7bcb259810 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -39,7 +39,7 @@ . += span_warning("It is probably best to fortify your position as to be uninterrupted during the attempt, given the automatic announcements..") /obj/machinery/computer/emergency_shuttle/attackby(obj/item/I, mob/user,params) - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) say("Please equip your ID card into your ID slot to authenticate.") . = ..() diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 40e4ac662da..980a4084a38 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -370,7 +370,7 @@ if(payees[AM] < threshold) //Suggestions for those with no arms/simple animals. var/armless - if(!ishuman(AM) && !istype(AM, /mob/living/simple_animal/slime)) + if(!ishuman(AM) && !isslime(AM)) armless = TRUE else var/mob/living/carbon/human/H = AM @@ -394,7 +394,7 @@ var/obj/item/holochip/HC = new /obj/item/holochip(AM.loc) //Change is made in holocredits exclusively. HC.credits = payees[AM] HC.name = "[HC.credits] credit holochip" - if(istype(AM, /mob/living/carbon/human)) + if(ishuman(AM)) var/mob/living/carbon/human/H = AM if(!H.put_in_hands(HC)) AM.pulling = HC diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 3043c3cfcad..a932f8d6c17 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -155,7 +155,7 @@ if(istype(head_item, /obj/item/reagent_containers/pill)) for(var/datum/action/item_action/hands_free/activate_pill/pill_action in head_item.actions) qdel(pill_action) - else if(istype(head_item, /obj/item/organ)) + else if(isorgan(head_item)) var/obj/item/organ/organ = head_item if(organ.organ_flags & ORGAN_UNREMOVABLE) continue diff --git a/code/modules/surgery/bone_mending.dm b/code/modules/surgery/bone_mending.dm index f07574c8a69..ac4ac93cd21 100644 --- a/code/modules/surgery/bone_mending.dm +++ b/code/modules/surgery/bone_mending.dm @@ -67,7 +67,7 @@ /datum/surgery_step/repair_bone_hairline/success(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) if(surgery.operated_wound) - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) display_results(user, target, span_notice("You successfully repair the fracture in [target]'s [parse_zone(target_zone)]."), @@ -81,7 +81,7 @@ /datum/surgery_step/repair_bone_hairline/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob = 0) ..() - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) @@ -108,7 +108,7 @@ /datum/surgery_step/reset_compound_fracture/success(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) if(surgery.operated_wound) - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) display_results(user, target, span_notice("You successfully reset the bone in [target]'s [parse_zone(target_zone)]."), @@ -121,7 +121,7 @@ /datum/surgery_step/reset_compound_fracture/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob = 0) ..() - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) @@ -147,7 +147,7 @@ /datum/surgery_step/repair_bone_compound/success(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) if(surgery.operated_wound) - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) display_results(user, target, span_notice("You successfully repair the fracture in [target]'s [parse_zone(target_zone)]."), @@ -161,6 +161,6 @@ /datum/surgery_step/repair_bone_compound/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob = 0) ..() - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) diff --git a/code/modules/surgery/burn_dressing.dm b/code/modules/surgery/burn_dressing.dm index 9294b8c1504..3f9c2d2d741 100644 --- a/code/modules/surgery/burn_dressing.dm +++ b/code/modules/surgery/burn_dressing.dm @@ -146,6 +146,6 @@ /datum/surgery_step/dress/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob = 0) ..() - if(istype(tool, /obj/item/stack)) + if(isstack(tool)) var/obj/item/stack/used_stack = tool used_stack.use(1) diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index 0749e012f9a..7c925f8406c 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -43,7 +43,7 @@ /datum/surgery_step/handle_cavity/success(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery = FALSE) var/obj/item/bodypart/chest/target_chest = target.get_bodypart(BODY_ZONE_CHEST) if(tool) - if(item_for_cavity || tool.w_class > WEIGHT_CLASS_NORMAL || HAS_TRAIT(tool, TRAIT_NODROP) || istype(tool, /obj/item/organ)) + if(item_for_cavity || tool.w_class > WEIGHT_CLASS_NORMAL || HAS_TRAIT(tool, TRAIT_NODROP) || isorgan(tool)) to_chat(user, span_warning("You can't seem to fit [tool] in [target]'s [target_zone]!")) return FALSE else diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 0852e525041..f25b7a75dc4 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -205,7 +205,7 @@ ///only operate on internal organs /datum/surgery_step/manipulate_organs/internal/can_use_organ(mob/user, obj/item/organ/organ) - return istype(organ, /obj/item/organ/internal) + return isinternalorgan(organ) ///Surgery step for external organs/features, like tails, frills, wings etc /datum/surgery_step/manipulate_organs/external @@ -214,4 +214,4 @@ ///Only operate on external organs /datum/surgery_step/manipulate_organs/external/can_use_organ(mob/user, obj/item/organ/organ) - return istype(organ, /obj/item/organ/external) + return isexternalorgan(organ) diff --git a/code/modules/surgery/organs/_organ.dm b/code/modules/surgery/organs/_organ.dm index f615373301a..0fc16955d34 100644 --- a/code/modules/surgery/organs/_organ.dm +++ b/code/modules/surgery/organs/_organ.dm @@ -60,7 +60,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) /obj/item/organ/forceMove(atom/destination, check_dest = TRUE) if(check_dest && destination) //Nullspace is always a valid location for organs. Because reasons. if(organ_flags & ORGAN_UNREMOVABLE) //If this organ is unremovable, it should delete itself if it tries to be moved to anything besides a bodypart. - if(!istype(destination, /obj/item/bodypart) && !iscarbon(destination)) + if(!isbodypart(destination) && !iscarbon(destination)) qdel(src) return //Don't move it out of nullspace if it's deleted. return ..() diff --git a/code/modules/surgery/organs/autosurgeon.dm b/code/modules/surgery/organs/autosurgeon.dm index 4b44eee07de..145776cddbb 100644 --- a/code/modules/surgery/organs/autosurgeon.dm +++ b/code/modules/surgery/organs/autosurgeon.dm @@ -105,7 +105,7 @@ use_autosurgeon(target, user, 8 SECONDS) /obj/item/autosurgeon/attackby(obj/item/attacking_item, mob/user, params) - if(istype(attacking_item, /obj/item/organ)) + if(isorgan(attacking_item)) load_organ(attacking_item, user) else return ..() diff --git a/code/modules/surgery/organs/stomach/_stomach.dm b/code/modules/surgery/organs/stomach/_stomach.dm index 650cf87f42f..9832b805324 100644 --- a/code/modules/surgery/organs/stomach/_stomach.dm +++ b/code/modules/surgery/organs/stomach/_stomach.dm @@ -44,7 +44,7 @@ . = ..() //Manage species digestion - if(istype(owner, /mob/living/carbon/human)) + if(ishuman(owner)) var/mob/living/carbon/human/humi = owner if(!(organ_flags & ORGAN_FAILING)) handle_hunger(humi, delta_time, times_fired) diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index 71147e3cb43..83099d25c8b 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -40,7 +40,7 @@ to_chat(user, span_warning("[organ_storage_contents] cannot be attached!")) return SURGERY_STEP_FAIL tool = organ_storage_contents - if(istype(tool, /obj/item/bodypart)) + if(isbodypart(tool)) var/obj/item/bodypart/bodypart_to_attach = tool if(IS_ORGANIC_LIMB(bodypart_to_attach)) organ_rejection_dam = 10 @@ -75,7 +75,7 @@ tool.desc = initial(tool.desc) tool.cut_overlays() tool = tool.contents[1] - if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool)) + if(isbodypart(tool) && user.temporarilyRemoveItemFromInventory(tool)) var/obj/item/bodypart/limb_to_attach = tool if(!limb_to_attach.attach_limb(target)) display_results(user, target, span_warning("You fail in replacing [target]'s [parse_zone(target_zone)]! Their body has rejected [limb_to_attach]!"), diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 0d295307b15..12c0134e37a 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -89,7 +89,7 @@ A = new spawn_path(get_turf(user)) else A = spawn_path - if(ishuman(user) && istype(A, /obj/item)) + if(ishuman(user) && isitem(A)) var/mob/living/carbon/human/H = user if(H.put_in_hands(A)) to_chat(H, span_boldnotice("[A] materializes into your hands!")) diff --git a/code/modules/vehicles/cars/clowncar.dm b/code/modules/vehicles/cars/clowncar.dm index 12e7e895c9b..4650676769a 100644 --- a/code/modules/vehicles/cars/clowncar.dm +++ b/code/modules/vehicles/cars/clowncar.dm @@ -107,7 +107,7 @@ playsound(src, pick('sound/vehicles/clowncar_ram1.ogg', 'sound/vehicles/clowncar_ram2.ogg', 'sound/vehicles/clowncar_ram3.ogg'), 75) log_combat(src, hittarget_living, "sucked up") return - if(!istype(bumped, /turf/closed)) + if(!isclosedturf(bumped)) return visible_message(span_warning("[src] rams into [bumped] and crashes!")) playsound(src, pick('sound/vehicles/clowncar_crash1.ogg', 'sound/vehicles/clowncar_crash2.ogg'), 75) diff --git a/code/modules/vehicles/mecha/mecha_wreckage.dm b/code/modules/vehicles/mecha/mecha_wreckage.dm index 5f1f8087720..3f3b72ae0ba 100644 --- a/code/modules/vehicles/mecha/mecha_wreckage.dm +++ b/code/modules/vehicles/mecha/mecha_wreckage.dm @@ -64,7 +64,7 @@ var/type = pick(welder_salvage) var/N = new type(get_turf(user)) user.visible_message(span_notice("[user] cuts [N] from [src]."), span_notice("You cut [N] from [src].")) - if(!istype(N, /obj/item/stack)) + if(!isstack(N)) welder_salvage -= type salvage_num-- diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm index 737f4563c38..6e8ea62cb50 100644 --- a/code/modules/vehicles/motorized_wheelchair.dm +++ b/code/modules/vehicles/motorized_wheelchair.dm @@ -137,7 +137,7 @@ /obj/vehicle/ridden/wheelchair/motorized/Bump(atom/A) . = ..() // Here is the shitty emag functionality. - if(obj_flags & EMAGGED && (istype(A, /turf/closed) || isliving(A))) + if(obj_flags & EMAGGED && (isclosedturf(A) || isliving(A))) explosion(src, devastation_range = -1, heavy_impact_range = 1, light_impact_range = 3, flash_range = 2, adminlog = FALSE) visible_message(span_boldwarning("[src] explodes!!")) return diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index b5e3961c17c..dc52a1bdbb6 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1285,7 +1285,7 @@ GLOBAL_LIST_EMPTY(vending_products) if(loaded_items >= max_loaded_items) say("There are too many items in stock.") return - if(istype(I, /obj/item/stack)) + if(isstack(I)) say("Loose items may cause problems, try to use it inside wrapping paper.") return if(I.custom_price) diff --git a/code/modules/vending/security.dm b/code/modules/vending/security.dm index f7eb0a3d150..6a7edd8e854 100644 --- a/code/modules/vending/security.dm +++ b/code/modules/vending/security.dm @@ -36,7 +36,7 @@ payment_department = ACCOUNT_SEC /obj/machinery/vending/security/pre_throw(obj/item/I) - if(istype(I, /obj/item/grenade)) + if(isgrenade(I)) var/obj/item/grenade/G = I G.arm_grenade() else if(istype(I, /obj/item/flashlight)) diff --git a/code/modules/wiremod/components/action/pathfind.dm b/code/modules/wiremod/components/action/pathfind.dm index 540e228ee10..9a0774a8c48 100644 --- a/code/modules/wiremod/components/action/pathfind.dm +++ b/code/modules/wiremod/components/action/pathfind.dm @@ -57,7 +57,7 @@ return var/atom/path_id = id_card.value - if(path_id && !istype(path_id, /obj/item/card/id)) + if(path_id && !isidcard(path_id)) path_id = null failed.set_output(COMPONENT_SIGNAL) reason_failed.set_output("Object marked is not an ID! Using no ID instead.") diff --git a/code/modules/wiremod/core/integrated_circuit.dm b/code/modules/wiremod/core/integrated_circuit.dm index 6672dd7cc69..2f69de6313e 100644 --- a/code/modules/wiremod/core/integrated_circuit.dm +++ b/code/modules/wiremod/core/integrated_circuit.dm @@ -155,7 +155,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit) user.visible_message(span_notice("[user] inserts a power cell into [src]."), span_notice("You insert the power cell into [src].")) return - if(istype(I, /obj/item/card/id)) + if(isidcard(I)) balloon_alert(user, "owner id set for [I]") owner_id = WEAKREF(I) return diff --git a/code/modules/wiremod/shell/assembly.dm b/code/modules/wiremod/shell/assembly.dm index 88ab3e97579..5bb25f73a17 100644 --- a/code/modules/wiremod/shell/assembly.dm +++ b/code/modules/wiremod/shell/assembly.dm @@ -56,7 +56,7 @@ /obj/item/circuit_component/assembly_output/register_shell(atom/movable/shell) . = ..() - if(istype(shell, /obj/item/assembly)) + if(isassembly(shell)) attached_assembly = shell /obj/item/circuit_component/assembly_output/unregister_shell(atom/movable/shell)