From 03ce2920e12cb004ac21769c2a47f5b88237746e Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Fri, 28 Oct 2022 13:28:23 -0400 Subject: [PATCH] Defining Part 4 - Code cleanup toward defines (... and the rest) (#19388) * I wasn't done * nits --- code/__DEFINES/is_helpers.dm | 60 +++++++++------- code/__HELPERS/_logging.dm | 2 +- code/__HELPERS/game.dm | 2 +- code/__HELPERS/unsorted.dm | 6 +- code/_onclick/cyborg.dm | 2 +- code/controllers/subsystem/shuttles.dm | 2 +- code/controllers/subsystem/ticker.dm | 2 +- code/datums/diseases/magnitis.dm | 6 +- code/datums/spell.dm | 4 +- code/datums/spells/mind_transfer.dm | 2 +- code/datums/uplink_item.dm | 2 +- .../weather/weather_types/solar_flare.dm | 4 +- code/datums/wires/vending.dm | 2 +- code/game/area/areas.dm | 4 +- code/game/data_huds.dm | 2 +- code/game/dna/dna_modifier.dm | 6 +- code/game/dna/mutations/powers.dm | 8 +-- code/game/gamemodes/cult/cult_items.dm | 2 +- .../miniantags/guardian/types/bomb.dm | 2 +- .../miniantags/guardian/types/ranged.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- code/game/gamemodes/steal_items.dm | 2 +- code/game/gamemodes/wizard/spellbook.dm | 2 +- code/game/machinery/Sleeper.dm | 6 +- code/game/machinery/camera/camera.dm | 2 +- code/game/machinery/computer/Operating.dm | 2 +- code/game/machinery/computer/computer.dm | 3 +- code/game/machinery/computer/law.dm | 2 +- code/game/machinery/computer/message.dm | 8 +-- code/game/machinery/computer/robot.dm | 4 +- code/game/machinery/cryopod.dm | 2 +- code/game/machinery/hologram.dm | 2 +- code/game/machinery/magnet.dm | 2 +- code/game/machinery/spaceheater.dm | 2 +- code/game/machinery/teleporter.dm | 8 +-- code/game/machinery/vending.dm | 2 +- .../mecha/equipment/tools/medical_tools.dm | 2 +- code/game/mecha/equipment/tools/work_tools.dm | 4 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/objects/effects/spiders.dm | 4 +- code/game/objects/empulse.dm | 6 +- code/game/objects/items.dm | 4 +- code/game/objects/items/candle.dm | 2 +- .../items/devices/radio/electropack.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 2 +- code/game/objects/items/devices/scanners.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/stacks/nanopaste.dm | 2 +- code/game/objects/items/toys.dm | 4 +- .../objects/items/weapons/flamethrower.dm | 2 +- code/game/objects/items/weapons/lighters.dm | 2 +- .../objects/items/weapons/storage/fancy.dm | 2 +- .../objects/items/weapons/tanks/watertank.dm | 2 +- code/game/objects/objs.dm | 2 +- .../structures/crates_lockers/closets.dm | 4 +- code/modules/admin/admin.dm | 6 +- code/modules/admin/admin_verbs.dm | 2 +- code/modules/admin/player_panel.dm | 4 +- code/modules/admin/topic.dm | 70 +++++++++---------- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 2 +- code/modules/admin/verbs/adminpm.dm | 4 +- code/modules/admin/verbs/debug.dm | 4 +- code/modules/admin/verbs/randomverbs.dm | 6 +- .../environmental/LINDA_system.dm | 4 +- .../components/unary_devices/cryo.dm | 4 +- .../atmospherics/machinery/other/meter.dm | 4 +- code/modules/awaymissions/maploader/reader.dm | 2 +- code/modules/buildmode/submodes/basic.dm | 6 +- code/modules/clothing/clothing.dm | 2 +- code/modules/clothing/head/misc_special.dm | 4 +- code/modules/clothing/suits/miscellaneous.dm | 2 +- code/modules/events/dust.dm | 2 +- code/modules/events/event_procs.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 2 +- .../combos/adminfu/healing_palm.dm | 2 +- .../mining/equipment/lazarus_injector.dm | 4 +- code/modules/mob/dead/observer/observer.dm | 7 +- code/modules/mob/dead/observer/say.dm | 2 +- code/modules/mob/holder.dm | 2 +- code/modules/mob/language.dm | 2 +- .../mob/living/carbon/alien/alien_defense.dm | 2 +- code/modules/mob/living/carbon/brain/brain.dm | 6 +- .../mob/living/carbon/human/human_damage.dm | 2 +- code/modules/mob/living/carbon/human/say.dm | 2 +- .../mob/living/carbon/human/species/diona.dm | 2 +- .../mob/living/silicon/ai/freelook/eye.dm | 2 +- code/modules/mob/living/silicon/ai/say.dm | 2 +- code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../mob/living/silicon/robot/component.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/silicon/robot/robot_modules.dm | 2 +- code/modules/mob/living/silicon/say.dm | 4 +- .../mob/living/simple_animal/bot/ed209bot.dm | 6 +- .../mob/living/simple_animal/bot/floorbot.dm | 4 +- .../mob/living/simple_animal/bot/mulebot.dm | 2 +- .../living/simple_animal/friendly/diona.dm | 2 +- .../living/simple_animal/friendly/lizard.dm | 2 +- .../living/simple_animal/friendly/mouse.dm | 2 +- .../living/simple_animal/friendly/snake.dm | 4 +- .../simple_animal/hostile/giant_spider.dm | 2 +- .../hostile/mining/elites/elite.dm | 2 +- .../simple_animal/hostile/spaceworms.dm | 2 +- .../hostile/terror_spiders/queen.dm | 2 +- .../living/simple_animal/posessed_object.dm | 2 +- code/modules/mob/mob.dm | 2 +- code/modules/mob/mob_helpers.dm | 4 +- code/modules/paperwork/paper.dm | 4 +- code/modules/paperwork/paper_bundle.dm | 2 +- code/modules/paperwork/photocopier.dm | 6 +- code/modules/paperwork/photography.dm | 4 +- code/modules/paperwork/silicon_photography.dm | 4 +- code/modules/pda/PDA.dm | 6 +- code/modules/power/apc.dm | 6 +- code/modules/power/port_gen.dm | 4 +- code/modules/power/power.dm | 2 +- .../particle_accelerator/particle_control.dm | 2 +- code/modules/power/turbine.dm | 2 +- code/modules/projectiles/projectile/beams.dm | 2 +- .../modules/projectiles/projectile/special.dm | 2 +- .../reagents/chemistry/reagents/toxins.dm | 2 +- code/modules/recycling/disposal.dm | 17 ++--- code/modules/recycling/sortingmachinery.dm | 2 +- .../research/xenobiology/xenobiology.dm | 4 +- .../space_management/heap_space_level.dm | 2 +- code/modules/station_goals/bsa.dm | 4 +- code/modules/surgery/organs/organ_external.dm | 2 +- code/modules/surgery/surgery.dm | 2 +- 127 files changed, 268 insertions(+), 257 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 4feff14cb30..8f004477620 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -2,14 +2,39 @@ #define isatom(A) (isloc(A)) // Mobs + +//#define ismob(A, B, C...) BYOND proc, can test multiple arguments and only return TRUE if all are mobs + +#define isliving(A) (istype(A, /mob/living)) + +#define isbrain(A) (istype(A, /mob/living/carbon/brain)) + +// Carbon mobs +#define iscarbon(A) (istype(A, /mob/living/carbon)) + +#define ishuman(A) (istype(A, /mob/living/carbon/human)) + +#define isalien(A) (istype(A, /mob/living/carbon/alien)) + +#define islarva(A) (istype(A, /mob/living/carbon/alien/larva)) + +#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid)) + +#define isalienhunter(A) (istype(A, /mob/living/carbon/alien/humanoid/hunter)) + +#define isaliensentinel(A) (istype(A, /mob/living/carbon/alien/humanoid/sentinel)) + +// Simple animals + #define ismegafauna(A) istype(A, /mob/living/simple_animal/hostile/megafauna) -//Simple animals #define isshade(A) (istype(A, /mob/living/simple_animal/shade)) #define isconstruct(A) (istype(A, /mob/living/simple_animal/hostile/construct)) -//Objects +#define isslime(A) (istype((A), /mob/living/simple_animal/slime)) + +// Objects #define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs #define isitem(A) (istype(A, /obj/item)) @@ -44,7 +69,10 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( #define is_glass_sheet(O) (is_type_in_typecache(O, GLOB.glass_sheet_types)) -//Turfs +// Turfs + +//#define isturf(A, B, C...) BYOND proc, can test multiple arguments and only return TRUE if all are turfs + #define issimulatedturf(A) istype(A, /turf/simulated) #define isspaceturf(A) istype(A, /turf/space) @@ -63,30 +91,10 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( #define ischasm(A) (istype(A, /turf/simulated/floor/chasm)) -//Mobs -#define isliving(A) (istype(A, /mob/living)) +// Areas +//#define isarea(A, B, C...) BYOND proc, can test multiple arguments and only return TRUE if all are areas -#define isbrain(A) (istype(A, /mob/living/carbon/brain)) - -//Carbon mobs -#define iscarbon(A) (istype(A, /mob/living/carbon)) - -#define ishuman(A) (istype(A, /mob/living/carbon/human)) - -//more carbon mobs -#define isalien(A) (istype(A, /mob/living/carbon/alien)) - -#define islarva(A) (istype(A, /mob/living/carbon/alien/larva)) - -#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid)) - -#define isalienhunter(A) (istype(A, /mob/living/carbon/alien/humanoid/hunter)) - -#define isaliensentinel(A) (istype(A, /mob/living/carbon/alien/humanoid/sentinel)) - -#define isslime(A) (istype((A), /mob/living/simple_animal/slime)) - -//Structures +// Structures #define isstructure(A) (istype((A), /obj/structure)) // Misc diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 59db4b675e5..3979b37d9d8 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -182,7 +182,7 @@ GLOBAL_PROTECT(log_end) /proc/datum_info_line(datum/d) if(!istype(d)) return - if(!istype(d, /mob)) + if(!ismob(d)) return "[d] ([d.type])" var/mob/m = d return "[m] ([m.ckey]) ([m.type])" diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index e6a0c134a13..a3081b4a60a 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -229,7 +229,7 @@ var/turf/ear = get_turf(M) if(ear) // Ghostship is magic: Ghosts can hear radio chatter from anywhere - if(speaker_coverage[ear] || (istype(M, /mob/dead/observer) && M.get_preference(PREFTOGGLE_CHAT_GHOSTRADIO))) + if(speaker_coverage[ear] || (isobserver(M) && M.get_preference(PREFTOGGLE_CHAT_GHOSTRADIO))) . |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down. return . diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 5233ee164e6..51d3ac6660c 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -292,7 +292,7 @@ Turf and target are seperate in case you want to teleport some distance from a t var/select = null var/list/borgs = list() for(var/mob/living/silicon/robot/A in GLOB.player_list) - if(A.stat == 2 || A.connected_ai || A.scrambledcodes || istype(A,/mob/living/silicon/robot/drone)) + if(A.stat == 2 || A.connected_ai || A.scrambledcodes || isdrone(A)) continue var/name = "[A.real_name] ([A.modtype] [A.braintype])" borgs[name] = A @@ -376,7 +376,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(M.real_name && M.real_name != M.name) name += " \[[M.real_name]\]" if(M.stat == DEAD) - if(istype(M, /mob/dead/observer/)) + if(isobserver(M)) name += " \[ghost\]" else name += " \[dead\]" @@ -1847,7 +1847,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) if(M.real_name && M.real_name != M.name) name += " \[[M.real_name]\]" if(M.stat == DEAD) - if(istype(M, /mob/dead/observer/)) + if(isobserver(M)) name += " \[ghost\]" else name += " \[dead\]" diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 251f507e349..22f0e609bb0 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -111,7 +111,7 @@ //Middle click points /mob/living/silicon/robot/MiddleClickOn(atom/A) - if(istype(src, /mob/living/silicon/robot/drone)) + if(isdrone(src)) // Drones cannot point. return pointed(A) diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index aa690ef03d0..90b7e6c671e 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -187,7 +187,7 @@ SUBSYSTEM_DEF(shuttle) var/callShuttle = 1 for(var/thing in GLOB.shuttle_caller_list) - if(istype(thing, /mob/living/silicon/ai)) + if(isAI(thing)) var/mob/living/silicon/ai/AI = thing if(AI.stat || !AI.client) continue diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 6ebeabc5327..13fb9d32905 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -521,7 +521,7 @@ SUBSYSTEM_DEF(ticker) for(var/mob/living/silicon/robot/robo in GLOB.mob_list) - if(istype(robo,/mob/living/silicon/robot/drone)) + if(isdrone(robo)) dronecount++ continue diff --git a/code/datums/diseases/magnitis.dm b/code/datums/diseases/magnitis.dm index dd1d062cbf7..a10121fbe36 100644 --- a/code/datums/diseases/magnitis.dm +++ b/code/datums/diseases/magnitis.dm @@ -22,7 +22,7 @@ if(!M.anchored && (M.flags & CONDUCT)) step_towards(M,affected_mob) for(var/mob/living/silicon/S in orange(2,affected_mob)) - if(istype(S, /mob/living/silicon/ai)) continue + if(isAI(S)) continue step_towards(S,affected_mob) if(3) if(prob(2)) @@ -37,7 +37,7 @@ for(i=0,i U.uses) return FALSE diff --git a/code/datums/weather/weather_types/solar_flare.dm b/code/datums/weather/weather_types/solar_flare.dm index 6f1e5187f8b..8d6b4a1bed6 100644 --- a/code/datums/weather/weather_types/solar_flare.dm +++ b/code/datums/weather/weather_types/solar_flare.dm @@ -40,9 +40,9 @@ . = ..() if(.) //If true the mob is already affected, no need to keep processing return TRUE - if(istype(L, /mob/living/simple_animal)) //while this might break immersion, I don't want to spam the server with calling this on simplemobs + if(isanimal(L)) //while this might break immersion, I don't want to spam the server with calling this on simplemobs return FALSE - if(istype(L, /mob/living/silicon/robot/drone)) //same with poor maint drones who just wanna have fun + if(isdrone(L)) //same with poor maint drones who just wanna have fun return FALSE for(var/turf/T in oview(get_turf(L))) if(isspaceturf(T) || istransparentturf(T)) diff --git a/code/datums/wires/vending.dm b/code/datums/wires/vending.dm index 299e18d815a..5ecadda45d6 100644 --- a/code/datums/wires/vending.dm +++ b/code/datums/wires/vending.dm @@ -11,7 +11,7 @@ /datum/wires/vending/interactable(mob/user) var/obj/machinery/vending/V = holder - if(!istype(user, /mob/living/silicon) && V.seconds_electrified && V.shock(user, 100)) + if(!issilicon(user) && V.seconds_electrified && V.shock(user, 100)) return FALSE if(V.panel_open) return TRUE diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 0a7d494a020..147473cfc56 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -492,8 +492,8 @@ var/area/newarea var/area/oldarea - if(istype(A,/mob)) - var/mob/M=A + if(ismob(A)) + var/mob/M = A if(!M.lastarea) M.lastarea = get_area(M) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index bb35e7f6a52..c69fa2f4325 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -27,7 +27,7 @@ return TRUE /datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H) - if(check_sensors(H) || istype(M,/mob/dead/observer) ) + if(check_sensors(H) || isobserver(M) ) ..() /datum/atom_hud/data/human/medical/basic/proc/update_suit_sensors(mob/living/carbon/H) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 217f22b5fc3..9ba8346fdcd 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -185,13 +185,13 @@ return if(!ismob(O)) //humans only return - if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robutts dont fit + if(isanimal(O) || issilicon(O)) //animals and robutts dont fit return if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper return if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return - if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc? + if(!isturf(user.loc) || !isturf(O.loc)) // are you in a container/closet/pod/etc? return if(occupant) to_chat(user, "[src] is already occupied!") @@ -508,7 +508,7 @@ /obj/machinery/computer/scan_consolenew/ui_act(action, params) if(..()) return FALSE // don't update uis - if(!istype(usr.loc, /turf)) + if(!isturf(usr.loc)) return FALSE // don't update uis if(!src || !connected) return FALSE // don't update uis diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index 2f3057b0a71..eac896986d5 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -405,7 +405,7 @@ if(!H.bodyparts_by_name[name]) continue affecting = H.bodyparts_by_name[name] - if(!istype(affecting, /obj/item/organ/external)) + if(!isorgan(affecting)) continue affecting.heal_damage(4, 0, updating_health = FALSE) H.UpdateDamageIcon() @@ -491,11 +491,11 @@ /obj/effect/proc_holder/spell/leap/cast(list/targets, mob/living/user = usr) var/failure = FALSE - if(istype(user.loc,/mob/) || IS_HORIZONTAL(user) || user.IsStunned() || user.buckled || user.stat) + if(ismob(user.loc) || IS_HORIZONTAL(user) || user.IsStunned() || user.buckled || user.stat) to_chat(user, "You can't jump right now!") return - if(istype(user.loc,/turf/)) + if(isturf(user.loc)) if(user.restrained())//Why being pulled while cuffed prevents you from moving for(var/mob/living/M in range(user, 1)) if(M.pulling == user) @@ -747,7 +747,7 @@ if(!ishuman(user)) return - if(istype(user.loc,/mob/)) + if(ismob(user.loc)) to_chat(user, "You can't change your appearance right now!") return var/mob/living/carbon/human/M = user diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 00e04a0a31a..bfda194f2d7 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -549,7 +549,7 @@ /obj/item/shield/mirror/IsReflect() if(prob(reflect_chance)) - if(istype(loc, /mob)) + if(ismob(loc)) var/mob/user = loc if(user.holy_check()) return FALSE diff --git a/code/game/gamemodes/miniantags/guardian/types/bomb.dm b/code/game/gamemodes/miniantags/guardian/types/bomb.dm index 510b72df978..2bc72f4514f 100644 --- a/code/game/gamemodes/miniantags/guardian/types/bomb.dm +++ b/code/game/gamemodes/miniantags/guardian/types/bomb.dm @@ -64,7 +64,7 @@ if(!istype(user)) return to_chat(user, "[src] was boobytrapped!") - if(istype(spawner, /mob/living/simple_animal/hostile/guardian)) + if(isguardian(spawner)) var/mob/living/simple_animal/hostile/guardian/G = spawner if(user == G.summoner) add_attack_logs(user, stored_obj, "booby trap defused") diff --git a/code/game/gamemodes/miniantags/guardian/types/ranged.dm b/code/game/gamemodes/miniantags/guardian/types/ranged.dm index 141965ba3c1..a89930f5d75 100644 --- a/code/game/gamemodes/miniantags/guardian/types/ranged.dm +++ b/code/game/gamemodes/miniantags/guardian/types/ranged.dm @@ -115,7 +115,7 @@ var/turf/snare_loc = get_turf(loc) if(spawner) to_chat(spawner, "[AM] has crossed your surveillance trap at [get_area(snare_loc)].") - if(istype(spawner, /mob/living/simple_animal/hostile/guardian)) + if(isguardian(spawner)) var/mob/living/simple_animal/hostile/guardian/G = spawner if(G.summoner) to_chat(G.summoner, "[AM] has crossed your surveillance trap at [get_area(snare_loc)].") diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index c939fef0ba6..3542ea361a4 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -290,7 +290,7 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) needs_target = FALSE /datum/objective/block/check_completion() - if(!istype(owner.current, /mob/living/silicon)) + if(!issilicon(owner.current)) return FALSE if(SSticker.mode.station_was_nuked) return TRUE diff --git a/code/game/gamemodes/steal_items.dm b/code/game/gamemodes/steal_items.dm index e02efa2b97b..28104db97a2 100644 --- a/code/game/gamemodes/steal_items.dm +++ b/code/game/gamemodes/steal_items.dm @@ -69,7 +69,7 @@ /datum/theft_objective/ai/check_special_completion(obj/item/aicard/C) if(..()) for(var/mob/living/silicon/ai/A in C) - if(istype(A, /mob/living/silicon/ai) && A.stat != 2) //See if any AI's are alive inside that card. + if(isAI(A) && A.stat != 2) //See if any AI's are alive inside that card. return 1 return 0 diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 5040e40de00..74e3e954d25 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -876,7 +876,7 @@ return 1 var/datum/spellbook_entry/E = null - if(loc == H || (in_range(src, H) && istype(loc, /turf))) + if(loc == H || (in_range(src, H) && isturf(loc))) H.set_machine(src) if(href_list["buy"]) E = entries[text2num(href_list["buy"])] diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 90fa6f38fa6..7648b7773d9 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -202,7 +202,7 @@ occupantData["temperatureSuitability"] = 2 else if(occupant.bodytemperature > sp.heat_level_1) occupantData["temperatureSuitability"] = 1 - else if(istype(occupant, /mob/living/simple_animal)) + else if(isanimal(occupant)) var/mob/living/simple_animal/silly = occupant if(silly.bodytemperature < silly.minbodytemp) occupantData["temperatureSuitability"] = -3 @@ -522,13 +522,13 @@ return if(!ismob(O)) //humans only return - if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robots dont fit + if(isanimal(O) || issilicon(O)) //animals and robots dont fit return if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper return if(!user.loc) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return - if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc? + if(!isturf(user.loc) || !isturf(O.loc)) // are you in a container/closet/pod/etc? return if(panel_open) to_chat(user, "Close the maintenance panel first.") diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 24c01a42ac0..37775cf946f 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -174,7 +174,7 @@ to_chat(U, "You hold \the [itemname] up to the camera ...") U.changeNext_move(CLICK_CD_MELEE) for(var/mob/O in GLOB.player_list) - if(istype(O, /mob/living/silicon/ai)) + if(isAI(O)) var/mob/living/silicon/ai/AI = O if(AI.control_disabled || (AI.stat == DEAD)) return diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 1fae66002c4..638356c4df4 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -100,7 +100,7 @@ occupantData["temperatureSuitability"] = 2 else if(occupant.bodytemperature > sp.heat_level_1) occupantData["temperatureSuitability"] = 1 - else if(istype(occupant, /mob/living/simple_animal)) + else if(isanimal(occupant)) var/mob/living/simple_animal/silly = occupant if(silly.bodytemperature < silly.minbodytemp) occupantData["temperatureSuitability"] = -3 diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index ce852969348..fd69493756b 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -165,7 +165,8 @@ /obj/machinery/computer/attack_hand(mob/user) /* Observers can view computers, but not actually use them via Topic*/ - if(istype(user, /mob/dead/observer)) return 0 + if(isobserver(user)) + return FALSE return ..() /obj/machinery/computer/screwdriver_act(mob/user, obj/item/I) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 718405af6b9..d8e06ad16e1 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -16,7 +16,7 @@ set category = "Object" set name = "Access Computer's Internals" set src in oview(1) - if(get_dist(src, usr) > 1 || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.stat || istype(usr, /mob/living/silicon)) + if(get_dist(src, usr) > 1 || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.stat || issilicon(usr)) return opened = !opened diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 2f33ea3fac0..12476e4daec 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -133,7 +133,7 @@ else for(var/n = ++i; n <= optioncount; n++) dat += "
[n]. ---------------
" - if((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.special_role && user.mind.is_original_mob(user))) + if((isAI(user) || isrobot(user)) && (user.mind.special_role && user.mind.is_original_mob(user))) //Malf/Traitor AIs can bruteforce into the system to gain the Key. dat += "
*&@#. Bruteforce Key
" else @@ -163,7 +163,7 @@ dat += "" //Hacking screen. if(2) - if(istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) + if(isAI(user) || isrobot(user)) dat += "Brute-forcing for server key.
It will take 20 seconds for every character that the password has." dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time." else @@ -279,7 +279,7 @@ /obj/machinery/computer/message_monitor/Topic(href, href_list) if(..(href, href_list)) return 1 - if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + if((usr.contents.Find(src) || (in_range(src, usr) && isturf(src.loc))) || (issilicon(usr))) //Authenticate if(href_list["auth"]) if(auth) @@ -353,7 +353,7 @@ //Hack the Console to get the password if(href_list["hack"]) - if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.is_original_mob(usr))) + if((isAI(usr) || isrobot(usr)) && (usr.mind.special_role && usr.mind.is_original_mob(usr))) src.hacking = 1 src.screen = 2 src.icon_screen = hack_icon diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index f7236d54f34..c74a1ab3cf5 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -42,7 +42,7 @@ /obj/machinery/computer/robotics/proc/console_shows(mob/living/silicon/robot/R) if(!istype(R)) return FALSE - if(istype(R, /mob/living/silicon/robot/drone)) + if(isdrone(R)) return FALSE if(R.scrambledcodes) return FALSE @@ -174,7 +174,7 @@ message_admins("[key_name_admin(usr)] detonated all cyborgs!") log_game("\[key_name(usr)] detonated all cyborgs!") for(var/mob/living/silicon/robot/R in GLOB.mob_list) - if(istype(R, /mob/living/silicon/robot/drone)) + if(isdrone(R)) continue // Ignore antagonistic cyborgs if(R.scrambledcodes) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 8501a9c5edf..f86e8b64d9a 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -513,7 +513,7 @@ return if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return - if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc? + if(!isturf(user.loc) || !isturf(O.loc)) // are you in a container/closet/pod/etc? return if(occupant) to_chat(user, "The cryo pod is already occupied!") diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 6dfd88a9710..a0b7bd0e6d8 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -328,7 +328,7 @@ GLOBAL_LIST_EMPTY(holopads) if(QDELETED(user) || user.incapacitated() || !user.client) return FALSE - if(istype(user, /mob/living/silicon/ai)) + if(isAI(user)) var/mob/living/silicon/ai/AI = user if(!AI.current) return FALSE diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 41363f5b0b2..cc63b415651 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -159,7 +159,7 @@ step_towards(M, center) for(var/mob/living/silicon/S in orange(magnetic_field, center)) - if(istype(S, /mob/living/silicon/ai)) continue + if(isAI(S)) continue step_towards(S, center) use_power(electricity_level * 5) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index dca414ef5d6..6ad586fdae2 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -123,7 +123,7 @@ /obj/machinery/space_heater/Topic(href, href_list) if(..()) return 1 - if((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) + if((in_range(src, usr) && isturf(src.loc)) || (issilicon(usr))) usr.set_machine(src) switch(href_list["op"]) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 708e764a615..5aac4bb601e 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -296,9 +296,9 @@ /proc/find_loc(obj/R as obj) if(!R) return null var/turf/T = R.loc - while(!istype(T, /turf)) + while(!isturf(T)) T = T.loc - if(!T || istype(T, /area)) return null + if(!T || isarea(T)) return null return T /obj/machinery/teleport @@ -313,9 +313,9 @@ Prevents AI from using the teleporter, prints out failure messages for clarity */ /obj/machinery/teleport/proc/blockAI(atom/A) - if(istype(A, /mob/living/silicon/ai) || istype(A, /obj/structure/AIcore)) + if(isAI(A) || istype(A, /obj/structure/AIcore)) visible_message("The teleporter rejects the AI unit.") - if(istype(A, /mob/living/silicon/ai)) + if(isAI(A)) var/mob/living/silicon/ai/T = A var/list/TPError = list("Firmware instructions dictate you must remain on your assigned station!", "You cannot interface with this technology and get rejected!", diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index a5d32fc09c3..867c91f3b8e 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -633,7 +633,7 @@ if(!coin) to_chat(usr, "There is no coin in this machine.") return - if(istype(usr, /mob/living/silicon)) + if(issilicon(usr)) to_chat(usr, "You lack hands.") return to_chat(usr, "You remove [coin] from [src].") diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 3e6e88708f2..2f017deb0fc 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -462,7 +462,7 @@ if(get_dist(src,A) >= 4) occupant_message("The object is too far away.") return FALSE - if(!A.reagents || istype(A,/mob)) + if(!A.reagents || ismob(A)) occupant_message("No reagent info gained from [A].") return FALSE occupant_message("Analyzing reagents...") diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index a3b822947da..996bf7fc644 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -221,7 +221,7 @@ if(istype(target, /turf/space/transit))//>implying these are ever made -Sieve return - if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock)) + if(!isturf(target) && !istype(target, /obj/machinery/door/airlock)) target = get_turf(target) if(!action_checks(target) || get_dist(chassis, target)>3) @@ -313,7 +313,7 @@ /obj/item/mecha_parts/mecha_equipment/mimercd/action(atom/target) if(istype(target, /turf/space/transit))//>implying these are ever made -Sieve return - if(!istype(target, /turf)) + if(!isturf(target)) target = get_turf(target) if(!action_checks(target) || get_dist(chassis, target)>3) return diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 6807c5afe4b..afa4e95bd03 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -171,7 +171,7 @@ life -= 10 if(ismob(A)) var/mob/M = A - if(istype(firer, /mob)) + if(ismob(firer)) add_attack_logs(firer, M, "Mecha-shot with [src]") else add_attack_logs(src, M, "Mecha-shot with [src] (no firer)") diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 031b5552ded..d1ed8d58366 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -126,7 +126,7 @@ /obj/structure/spider/spiderling/process() if(travelling_in_vent) - if(istype(loc, /turf)) + if(isturf(loc)) travelling_in_vent = FALSE entry_vent = null else if(entry_vent) @@ -217,7 +217,7 @@ return TRUE /obj/structure/spider/spiderling/decompile_act(obj/item/matter_decompiler/C, mob/user) - if(!istype(user, /mob/living/silicon/robot/drone)) + if(!isdrone(user)) user.visible_message("[user] sucks [src] into its decompiler. There's a horrible crunching noise.", \ "It's a bit of a struggle, but you manage to suck [user] into your decompiler. It makes a series of visceral crunching noises.") C.stored_comms["wood"] += 2 diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 827968ae0e6..0103d787999 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -9,9 +9,9 @@ * cause - The cause of the EMP. Used for the logging */ /proc/empulse(turf/epicenter, heavy_range, light_range, log = FALSE, cause = null) - if(!epicenter) return - - if(!istype(epicenter, /turf)) + if(!epicenter) + return + if(!isturf(epicenter)) epicenter = get_turf(epicenter.loc) if(log) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index d229c35c169..af30c7359d4 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -190,7 +190,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons set category = null set src in oview(1) - if(!istype(src.loc, /turf) || usr.stat || usr.restrained() ) + if(!isturf(src.loc) || usr.stat || usr.restrained() ) return var/turf/T = src.loc @@ -549,7 +549,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons /obj/item/proc/get_loc_turf() var/atom/L = loc - while(L && !istype(L, /turf/)) + while(L && !isturf(L)) L = L.loc return loc diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 478c1502983..7f927bdd04c 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -98,7 +98,7 @@ update_icon(UPDATE_ICON_STATE) if(!wax) new/obj/item/trash/candle(src.loc) - if(istype(src.loc, /mob)) + if(ismob(src.loc)) var/mob/M = src.loc M.unEquip(src, 1) //src is being deleted anyway qdel(src) diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index f8a2dc2671e..17a55b78578 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -75,7 +75,7 @@ if(isliving(loc)) var/mob/living/M = loc var/turf/T = M.loc - if(istype(T, /turf)) + if(isturf(T)) if(!M.moved_recently && M.last_move) M.moved_recently = 1 step(M, M.last_move) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 842f5cbd1b4..f17aee5f595 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -407,7 +407,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( jobname = "Cyborg" // --- Personal AI (pAI) --- - else if(istype(M, /mob/living/silicon/pai)) + else if(ispAI(M)) jobname = "Personal AI" // --- Unidentifiable mob --- diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 0ba69f25e04..bd054faf646 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -343,7 +343,7 @@ REAGENT SCANNER return var/turf/location = user.loc - if(!( istype(location, /turf) )) + if(!isturf(location)) return var/datum/gas_mixture/environment = location.return_air() diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 053b9739fae..62382cba0dd 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -397,7 +397,7 @@ /obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/flash)) - if(istype(user,/mob/living/silicon/robot)) + if(isrobot(user)) to_chat(user, "How do you propose to do that?") return else if(flash1 && flash2) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 234cbb4c73b..20d4ab70f67 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -13,7 +13,7 @@ /obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob) if(!istype(M) || !istype(user)) return 0 - if(istype(M,/mob/living/silicon/robot)) //Repairing cyborgs + if(isrobot(M)) //Repairing cyborgs var/mob/living/silicon/robot/R = M if(R.getBruteLoss() || R.getFireLoss() ) R.heal_overall_damage(15, 15) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index fd5e19ee9c3..e2879d3ffeb 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -424,7 +424,7 @@ ..() playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1) for(var/mob/M in range(10, src)) - if(!M.stat && !istype(M, /mob/living/silicon/ai))\ + if(!M.stat && !isAI(M))\ shake_camera(M, 3, 1) qdel(src) @@ -833,7 +833,7 @@ user.visible_message("[user] presses the big red button.", "You press the button, it plays a loud noise!", "The button clicks loudly.") playsound(src, 'sound/effects/explosionfar.ogg', 50, 0, 0) for(var/mob/M in range(10, src)) // Checks range - if(!M.stat && !istype(M, /mob/living/silicon/ai)) // Checks to make sure whoever's getting shaken is alive/not the AI + if(!M.stat && !isAI(M)) // Checks to make sure whoever's getting shaken is alive/not the AI sleep(8) // Short delay to match up with the explosion sound shake_camera(M, 2, 1) // Shakes player camera 2 squares for 1 second. diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 2d6a3da4c6b..35ee928b8d2 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -40,7 +40,7 @@ STOP_PROCESSING(SSobj, src) return null var/turf/location = loc - if(istype(location, /mob/)) + if(ismob(location)) var/mob/M = location if(M.l_hand == src || M.r_hand == src) location = M.loc diff --git a/code/game/objects/items/weapons/lighters.dm b/code/game/objects/items/weapons/lighters.dm index 7d7a929fa4a..fae9a68e9ae 100644 --- a/code/game/objects/items/weapons/lighters.dm +++ b/code/game/objects/items/weapons/lighters.dm @@ -80,7 +80,7 @@ if(!isliving(M)) return M.IgniteMob() - if(!istype(M, /mob)) + if(!ismob(M)) return if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_selected == "mouth" && lit) diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index a80f17ecdd9..20931c62075 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -186,7 +186,7 @@ icon_state = "[initial(icon_state)][contents.len]" /obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - if(!istype(M, /mob)) + if(!ismob(M)) return if(istype(M) && M == user && user.zone_selected == "mouth" && contents.len > 0 && !user.wear_mask) diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm index 0886a43d546..708fd2a7756 100644 --- a/code/game/objects/items/weapons/tanks/watertank.dm +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -314,7 +314,7 @@ nanofrost_cooldown = 0 return if(nozzle_mode == METAL_FOAM) - if(!Adj|| !istype(target, /turf)) + if(!Adj|| !isturf(target)) return if(metal_synthesis_cooldown < 5) var/obj/effect/particle_effect/foam/F = new /obj/effect/particle_effect/foam(get_turf(target), 1) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index aa01fc3e47b..517c0b8aced 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -138,7 +138,7 @@ if((M.client && M.machine == src)) is_in_use = TRUE src.attack_hand(M) - if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) + if(isAI(usr) || isrobot(usr)) if(!(usr in nearby)) if(usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh. is_in_use = TRUE diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 9942db734cd..0a32404612d 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -131,7 +131,7 @@ for(var/mob/M in loc) if(itemcount >= storage_capacity) break - if(istype(M, /mob/dead/observer)) + if(isobserver(M)) continue if(istype(M, /mob/living/simple_animal/bot/mulebot)) continue @@ -243,7 +243,7 @@ return if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return - if(!istype(user.loc, /turf)) // are you in a container/closet/pod/etc? + if(!isturf(user.loc)) // are you in a container/closet/pod/etc? return if(!opened) return diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 79f97a90c32..c3163438544 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -204,7 +204,7 @@ GLOBAL_VAR_INIT(nologevent, 0) else body += "Animalize | " - if(istype(M, /mob/dead/observer)) + if(isobserver(M)) body += "Re-incarnate | " if(ispAI(M)) @@ -844,7 +844,7 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space /proc/formatJumpTo(location, where="") var/turf/loc - if(istype(location,/turf/)) + if(isturf(location)) loc = location else loc = get_turf(location) @@ -854,7 +854,7 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space /proc/formatLocation(location) var/turf/loc - if(istype(location,/turf/)) + if(isturf(location)) loc = location else loc = get_turf(location) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 028a6e0ac66..2ea98d4d8a2 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -347,7 +347,7 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list( if(!check_rights(R_ADMIN|R_MOD)) return - if(istype(mob,/mob/dead/observer)) + if(isobserver(mob)) //re-enter var/mob/dead/observer/ghost = mob ghost.can_reenter_corpse = 1 //just in-case. diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 6f17661f0ca..4b5e077d9ff 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -375,8 +375,8 @@ for(var/obj/item/disk/nuclear/N in GLOB.poi_list) dat += "[N.name], " var/atom/disk_loc = N.loc - while(!istype(disk_loc, /turf)) - if(istype(disk_loc, /mob)) + while(!isturf(disk_loc)) + if(ismob(disk_loc)) var/mob/M = disk_loc dat += "carried by [M.real_name] " if(isobj(disk_loc)) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4ac41d0124b..5ecbc4cfd4d 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -380,7 +380,7 @@ if(!check_rights(R_SPAWN)) return var/mob/M = locateUID(href_list["mob"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -427,7 +427,7 @@ return var/mob/M = locateUID(href_list["jobban2"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -654,7 +654,7 @@ if(!check_rights(R_BAN)) return var/mob/M = locateUID(href_list["jobban4"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -866,7 +866,7 @@ return var/mob/M = locateUID(href_list["newban"]) - if(!istype(M, /mob)) + if(!ismob(M)) return var/ban_ckey_param = href_list["dbbanaddckey"] @@ -967,7 +967,7 @@ return var/mob/M = locateUID(href_list["mute"]) - if(!istype(M, /mob)) return + if(!ismob(M)) return if(!M.client) return var/mute_type = href_list["mute_type"] @@ -1087,7 +1087,7 @@ if(!check_rights(R_SERVER|R_EVENT)) return var/mob/M = locateUID(href_list["forcespeech"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1105,10 +1105,10 @@ return var/mob/M = locateUID(href_list["sendtoprison"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1178,7 +1178,7 @@ var/mob/M = locateUID(href_list["eraseflavortext"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1209,7 +1209,7 @@ var/mob/M = locateUID(href_list["userandomname"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1244,10 +1244,10 @@ return var/mob/M = locateUID(href_list["tdome1"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1276,10 +1276,10 @@ return var/mob/M = locateUID(href_list["tdome2"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1308,10 +1308,10 @@ return var/mob/M = locateUID(href_list["tdomeadmin"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1332,10 +1332,10 @@ return var/mob/M = locateUID(href_list["tdomeobserve"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1439,10 +1439,10 @@ return var/mob/M = locateUID(href_list["aroomwarp"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return @@ -1584,7 +1584,7 @@ else if(href_list["adminplayeropts"]) var/mob/M = locateUID(href_list["adminplayeropts"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1598,7 +1598,7 @@ C.admin_ghost() var/mob/M = locateUID(href_list["adminplayerobservefollow"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1719,7 +1719,7 @@ else if(href_list["adminmoreinfo"]) var/mob/M = locateUID(href_list["adminmoreinfo"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1792,7 +1792,7 @@ var/mob/M = locateUID(href_list["CentcommReply"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1804,7 +1804,7 @@ var/mob/M = locateUID(href_list["SyndicateReply"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -1816,7 +1816,7 @@ var/mob/M = locateUID(href_list["HeadsetMessage"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return @@ -2499,7 +2499,7 @@ if(!check_rights(R_ADMIN | R_MOD | R_MENTOR)) return var/mob/M = locateUID(href_list["getplaytimewindow"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return cmd_mentor_show_exp_panel(M.client) @@ -2508,7 +2508,7 @@ if(!check_rights(R_ADMIN)) return var/mob/M = locateUID(href_list["jumpto"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return usr.client.jumptomob(M) @@ -2518,7 +2518,7 @@ if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return var/mob/M = locateUID(href_list["getmob"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return usr.client.Getmob(M) @@ -2527,7 +2527,7 @@ if(!check_rights(R_ADMIN)) return var/mob/M = locateUID(href_list["sendmob"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return usr.client.sendmob(M) @@ -2536,7 +2536,7 @@ if(!check_rights(R_ADMIN)) return var/mob/M = locateUID(href_list["narrateto"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return usr.client.cmd_admin_direct_narrate(M) @@ -2546,7 +2546,7 @@ return var/mob/M = locateUID(href_list["subtlemessage"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return usr.client.cmd_admin_subtle_message(M) @@ -2559,7 +2559,7 @@ return var/mob/M = locateUID(href_list["traitor"]) - if(!istype(M, /mob)) + if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob") return show_traitor_panel(M) @@ -2664,7 +2664,7 @@ O.dir = obj_dir if(obj_name) O.name = obj_name - if(istype(O,/mob)) + if(ismob(O)) var/mob/M = O M.real_name = obj_name if(where == "inhand" && isliving(usr) && isitem(O)) @@ -3407,7 +3407,7 @@ var/mob/living/silicon/ai/A = target if(A.client && A.eyeobj) // No point following clientless AI eyes . += "|[ADMIN_FLW(A.eyeobj,"EYE")]" - else if(istype(target, /mob/dead/observer)) + else if(isobserver(target)) var/mob/dead/observer/O = target if(O.mind && O.mind.current) . += "|[ADMIN_FLW(O.mind.current,"BDY")]" diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 2839c309a6e..5e374be26f8 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -129,7 +129,7 @@ var/i = 0 for(var/v in sets) if(++i == sets.len) - if(istype(temp, /turf) && (v == "x" || v == "y" || v == "z")) + if(isturf(temp) && (v == "x" || v == "y" || v == "z")) continue if(!temp.vv_edit_var(v, SDQL_expression(d, set_list[sets]))) to_chat(usr, "[temp] rejected your varedit.") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index b953bf7d9fe..40dc21495ac 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -21,7 +21,7 @@ if(T.mob) if(isnewplayer(T.mob)) targets["(New Player) - [T]"] = T - else if(istype(T.mob, /mob/dead/observer)) + else if(isobserver(T.mob)) targets["[T.mob.name](Ghost) - [T]"] = T else targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T @@ -43,7 +43,7 @@ if(T.mob) if(isnewplayer(T.mob)) targets["[T] - (New Player)"] = T - else if(istype(T.mob, /mob/dead/observer)) + else if(isobserver(T.mob)) targets["[T] - [T.mob.name](Ghost)"] = T else targets["[T] - [T.mob.real_name](as [T.mob.name])"] = T diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index d2feb084b75..e7561c70540 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -257,7 +257,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) return var/turf/T = mob.loc - if(!( istype(T, /turf) )) + if(!isturf(T)) return var/datum/gas_mixture/env = T.return_air() @@ -328,7 +328,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available if(!choice) return 0 - if(!istype(choice, /mob/dead/observer)) + if(!isobserver(choice)) var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank [choice.p_them()] out of [choice.p_their()] body and place [choice.p_them()] in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No") if(confirm != "Yes") return 0 diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 866707361b5..7f1c804a52b 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -24,7 +24,7 @@ return if(ismob(M)) - if(istype(M, /mob/living/silicon/ai)) + if(isAI(M)) alert("The AI can't be sent to prison you jerk!", null, null, null, null, null) return //strip their stuff before they teleport into a cell :downs: @@ -774,7 +774,7 @@ Traitors and the like can also be revived with the previous role mostly intact. log_admin("[key_name(usr)] has gibbed [key_name(M)]") message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]", 1) - if(istype(M, /mob/dead/observer)) + if(isobserver(M)) gibs(M.loc) return @@ -790,7 +790,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") if(confirm == "Yes") - if(istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere + if(isobserver(mob)) // so they don't spam gibs everywhere return else mob.gib() diff --git a/code/modules/atmospherics/environmental/LINDA_system.dm b/code/modules/atmospherics/environmental/LINDA_system.dm index de065abb409..aaca66375cb 100644 --- a/code/modules/atmospherics/environmental/LINDA_system.dm +++ b/code/modules/atmospherics/environmental/LINDA_system.dm @@ -102,7 +102,7 @@ return adjacent_turfs /atom/movable/proc/air_update_turf(command = 0) - if(!istype(loc,/turf) && command) + if(!isturf(loc) && command) return for(var/turf/T in locs) // used by double wide doors and other nonexistant multitile structures T.air_update_turf(command) @@ -114,7 +114,7 @@ SSair.add_to_active(src,command) /atom/movable/proc/move_update_air(turf/T) - if(istype(T,/turf)) + if(isturf(T)) T.air_update_turf(1) air_update_turf(1) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index d58a72e4937..30facfa6774 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -129,13 +129,13 @@ return if(!ismob(O)) //humans only return - if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robutts dont fit + if(isanimal(O) || issilicon(O)) //animals and robutts dont fit return if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper return if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return - if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc? + if(!isturf(user.loc) || !isturf(O.loc)) // are you in a container/closet/pod/etc? return if(occupant) to_chat(user, "The cryo cell is already occupied!") diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index c3ab94a47ef..186752d45c2 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -104,7 +104,7 @@ /obj/machinery/atmospherics/meter/examine(mob/user) var/t = "A gas flow meter. " - if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/dead))) + if(get_dist(user, src) > 3 && !(isAI(user) || istype(user, /mob/dead))) t += "You are too far away to read it." else if(stat & (NOPOWER|BROKEN)) @@ -122,7 +122,7 @@ . = list(t) /obj/machinery/atmospherics/meter/Click() - if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine + if(isAI(usr)) // ghosts can call ..() for examine usr.examinate(src) return 1 diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index de15e7bbc4d..c26a57f5bde 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -288,7 +288,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) var/mlen = members.len - 1 while(index <= mlen) // Last item is an /area var/underlay - if(istype(T, /turf)) // I blame this on the stupid clown who coded the BYOND map editor + if(isturf(T)) // I blame this on the stupid clown who coded the BYOND map editor underlay = T.appearance T = instance_atom(members[index], members_attributes[index], xcrd, ycrd, zcrd) // instance new turf if(ispath(members[index], /turf)) diff --git a/code/modules/buildmode/submodes/basic.dm b/code/modules/buildmode/submodes/basic.dm index d488ed30dc7..84cf4b204e5 100644 --- a/code/modules/buildmode/submodes/basic.dm +++ b/code/modules/buildmode/submodes/basic.dm @@ -19,7 +19,7 @@ var/ctrl_click = pa.Find("ctrl") var/alt_click = pa.Find("alt") - if(istype(object,/turf) && left_click && !alt_click && !ctrl_click) + if(isturf(object) && left_click && !alt_click && !ctrl_click) var/turf/T = object if(isspaceturf(object)) T.ChangeTurf(/turf/simulated/floor/plasteel) @@ -41,10 +41,10 @@ T.ChangeTurf(/turf/simulated/wall) else if(isobj(object)) qdel(object) - else if(istype(object,/turf) && alt_click && left_click) + else if(isturf(object) && alt_click && left_click) log_admin("Build Mode: [key_name(user)] built an airlock at ([object.x],[object.y],[object.z])") new/obj/machinery/door/airlock(get_turf(object)) - else if(istype(object,/turf) && ctrl_click && left_click) + else if(isturf(object) && ctrl_click && left_click) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) WIN.setDir(BM.build_dir) log_admin("Build Mode: [key_name(user)] built a window at ([object.x],[object.y],[object.z])") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 4c0174770d5..d0f90506f14 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -340,7 +340,7 @@ BLIND // can't see anything if(H.w_uniform == src) H.update_suit_sensors() - else if(istype(src.loc, /mob)) + else if(ismob(src.loc)) switch(sensor_mode) if(SUIT_SENSOR_OFF) for(var/mob/V in viewers(user, 1)) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index c8eccc283d1..167305706d0 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -73,12 +73,12 @@ return var/turf/location = loc - if(istype(location, /mob/)) + if(ismob(location)) var/mob/living/carbon/human/M = location if(M.l_hand == src || M.r_hand == src || M.head == src) location = M.loc - if(istype(location, /turf)) + if(isturf(location)) location.hotspot_expose(700, 1) /obj/item/clothing/head/cakehat/attack_self(mob/user) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 23c2ceff96b..20c0056ab46 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -195,7 +195,7 @@ if(!M.anchored && (M.flags & CONDUCT)) step_towards(M,src) for(var/mob/living/silicon/S in orange(2,src)) - if(istype(S, /mob/living/silicon/ai)) continue + if(isAI(S)) continue step_towards(S,src) for(var/mob/living/carbon/human/machine/M in orange(2,src)) step_towards(M,src) diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm index 0a401e1bd26..6eb6446c581 100644 --- a/code/modules/events/dust.dm +++ b/code/modules/events/dust.dm @@ -73,7 +73,7 @@ return if(prob(shake_chance)) for(var/mob/M in range(10, src)) - if(!M.stat && !istype(M, /mob/living/silicon/ai)) + if(!M.stat && !isAI(M)) shake_camera(M, 3, 1) playsound(loc, 'sound/effects/meteorimpact.ogg', 40, 1) diff --git a/code/modules/events/event_procs.dm b/code/modules/events/event_procs.dm index af24915ddb3..9ea59a232ff 100644 --- a/code/modules/events/event_procs.dm +++ b/code/modules/events/event_procs.dm @@ -62,7 +62,7 @@ if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive continue - if(istype(M, /mob/living/silicon/robot)) + if(isrobot(M)) var/mob/living/silicon/robot/R = M if(R.module && (R.module.name == "engineering robot module")) active_with_role["Engineer"]++ diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index a9bb413707c..0497d8f43db 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -1004,7 +1004,7 @@ return ..() /obj/machinery/hydroponics/attack_animal(mob/living/user) - if(istype(user, /mob/living/simple_animal/diona)) + if(isnymph(user)) if(weedlevel > 0) user.adjust_nutrition(weedlevel * 15) adjustWeeds(-10) diff --git a/code/modules/martial_arts/combos/adminfu/healing_palm.dm b/code/modules/martial_arts/combos/adminfu/healing_palm.dm index c5bd34f1886..668e5e290ff 100644 --- a/code/modules/martial_arts/combos/adminfu/healing_palm.dm +++ b/code/modules/martial_arts/combos/adminfu/healing_palm.dm @@ -9,7 +9,7 @@ target.visible_message("[user] smacks [target] in the forehead!") //its the staff of healing code..hush - if(istype(target,/mob)) + if(ismob(target)) var/old_stat = target.stat if(isanimal(target) && target.stat == DEAD) var/mob/living/simple_animal/O = target diff --git a/code/modules/mining/equipment/lazarus_injector.dm b/code/modules/mining/equipment/lazarus_injector.dm index 87901b32f02..8a392486cce 100644 --- a/code/modules/mining/equipment/lazarus_injector.dm +++ b/code/modules/mining/equipment/lazarus_injector.dm @@ -18,7 +18,7 @@ if(!loaded) return if(isliving(target) && proximity_flag) - if(istype(target, /mob/living/simple_animal)) + if(isanimal(target)) var/mob/living/simple_animal/M = target if(M.sentience_type != revive_type) to_chat(user, "[src] does not work on this sort of creature.") @@ -27,7 +27,7 @@ M.faction = list("neutral") M.revive() M.can_collar = TRUE - if(istype(target, /mob/living/simple_animal/hostile)) + if(ishostile(target)) var/mob/living/simple_animal/hostile/H = M if(malfunctioning) H.faction |= list("lazarus", "\ref[user]") diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ba107e4acf0..8f400325254 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -548,10 +548,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Analyze Air" set category = "Ghost" - if(!istype(usr, /mob/dead/observer)) return + if(!isobserver(usr)) + return // Shamelessly copied from the Gas Analyzers - if(!( istype(usr.loc, /turf) )) + if(!isturf(usr.loc)) return var/datum/gas_mixture/environment = usr.loc.return_air() @@ -617,7 +618,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(A.client && A.eyeobj) // No point following clientless AI eyes . += "|eye" return - else if(istype(target, /mob/dead/observer)) + else if(isobserver(target)) var/mob/dead/observer/O = target . = "follow" if(O.mind && O.mind.current) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 850f2585e0f..ac39b557db0 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -11,6 +11,6 @@ /mob/dead/observer/handle_speaker_name(mob/speaker = null, vname, hard_to_hear) var/speaker_name = ..() - if(speaker && (speaker_name != speaker.real_name) && !isAI(speaker) && !istype(speaker, /mob/living/automatedannouncer)) //Announce computer and various stuff that broadcasts doesn't use it's real name but AI's can't pretend to be other mobs. + if(speaker && (speaker_name != speaker.real_name) && !isAI(speaker) && !isAutoAnnouncer(speaker)) //Announce computer and various stuff that broadcasts doesn't use it's real name but AI's can't pretend to be other mobs. speaker_name = "[speaker.real_name] ([speaker_name])" return speaker_name diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 11bc5354e53..cbd2b344506 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -15,7 +15,7 @@ /obj/item/holder/process() - if(istype(loc,/turf) || !(contents.len)) + if(isturf(loc) || !(contents.len)) for(var/mob/M in contents) diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm index 865a860d224..59dceae17a0 100644 --- a/code/modules/mob/language.dm +++ b/code/modules/mob/language.dm @@ -598,7 +598,7 @@ M.show_message("[message_start_dead] [message_body]", 2) for(var/mob/living/S in GLOB.alive_mob_list) - if(drone_only && !istype(S,/mob/living/silicon/robot/drone)) + if(drone_only && !isdrone(S)) continue else if(isAI(S)) message_start = "[name], [speaker.name]" diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 4023edf99e5..761cfe1a8d3 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -6,7 +6,7 @@ As such, they can either help or harm other aliens. Help works like the human he In all, this is a lot like the monkey code. /N */ /mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M) - if(istype(loc, /turf) && istype(loc.loc, /area/start)) + if(isturf(loc) && istype(loc.loc, /area/start)) to_chat(M, "No attacking people at spawn, you jackass.") return diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 170e343a311..cd60bb6c861 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -18,7 +18,7 @@ return ..() /mob/living/carbon/brain/say_understands(other)//Goddamn is this hackish, but this say code is so odd - if(istype(other, /mob/living/silicon/ai)) + if(isAI(other)) if(!(container && istype(container, /obj/item/mmi))) return 0 else @@ -28,12 +28,12 @@ return 0 else return 1 - if(istype(other, /mob/living/silicon/pai)) + if(ispAI(other)) if(!(container && istype(container, /obj/item/mmi))) return 0 else return 1 - if(istype(other, /mob/living/silicon/robot)) + if(isrobot(other)) if(!(container && istype(container, /obj/item/mmi))) return 0 else diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index bfbf2d4d894..5d45ce51925 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -308,7 +308,7 @@ This function restores all organs. /mob/living/carbon/human/proc/HealDamage(zone, brute, burn) var/obj/item/organ/external/E = get_organ(zone) - if(istype(E, /obj/item/organ/external)) + if(isorgan(E)) if(E.heal_damage(brute, burn)) UpdateDamageIcon() else diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 638d61583d2..479ca8954be 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -44,7 +44,7 @@ //These only pertain to common. Languages are handled by mob/say_understands() if(!speaking) - if(istype(other, /mob/living/simple_animal/diona)) + if(isnymph(other)) if(other.languages.len >= 2) //They've sucked down some blood and can speak common now. return 1 if(issilicon(other)) diff --git a/code/modules/mob/living/carbon/human/species/diona.dm b/code/modules/mob/living/carbon/human/species/diona.dm index 192c905acff..cb7a2f5fc8b 100644 --- a/code/modules/mob/living/carbon/human/species/diona.dm +++ b/code/modules/mob/living/carbon/human/species/diona.dm @@ -65,7 +65,7 @@ "is pulling themselves apart!") /datum/species/diona/can_understand(mob/other) - if(istype(other, /mob/living/simple_animal/diona)) + if(isnymph(other)) return 1 return 0 diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index de7324f4b8e..33cecf72df6 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -64,7 +64,7 @@ return ..() /atom/proc/move_camera_by_click() - if(istype(usr, /mob/living/silicon/ai)) + if(isAI(usr)) var/mob/living/silicon/ai/AI = usr if(AI.eyeobj && (AI.client.eye == AI.eyeobj) && (AI.eyeobj.z == z)) AI.cameraFollow = null diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index eb0b8eab6de..0aba6a146c4 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -48,7 +48,7 @@ else track = "[speaker_name] ([jobname])" else - if(istype(follow_target, /mob/living/simple_animal/bot)) + if(isbot(follow_target)) track = "[speaker_name] ([jobname])" else mob_to_track = speaker diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 9285d24105f..5d1ea76cd4c 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -252,7 +252,7 @@ visible_message("[src] folds outwards, expanding into a mobile form.", "You fold outwards, expanding into a mobile form.") /mob/living/silicon/pai/proc/force_fold_out() - if(istype(card.loc, /mob)) + if(ismob(card.loc)) var/mob/holder = card.loc holder.unEquip(card) else if(istype(card.loc, /obj/item/pda)) diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index d78240e71da..4afa6c200dd 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -272,7 +272,7 @@ /proc/robot_healthscan(mob/user, mob/living/M) var/scan_type - if(istype(M, /mob/living/silicon/robot)) + if(isrobot(M)) scan_type = "robot" else if(ishuman(M)) scan_type = "prosthetics" diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 171a50e1c30..238c53a2d52 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -678,7 +678,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( return - if(istype(W, /obj/item/stack/cable_coil) && user.a_intent == INTENT_HELP && (wiresexposed || istype(src, /mob/living/silicon/robot/drone))) + if(istype(W, /obj/item/stack/cable_coil) && user.a_intent == INTENT_HELP && (wiresexposed || isdrone(src))) user.changeNext_move(CLICK_CD_MELEE) if(!getFireLoss()) to_chat(user, "Nothing to fix!") diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 3cae5cd0c51..c7223301b53 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -770,7 +770,7 @@ /// Checks whether this item is a module of the robot it is located in. /obj/item/proc/is_robot_module() - if(!istype(loc, /mob/living/silicon/robot)) + if(!isrobot(loc)) return FALSE var/mob/living/silicon/robot/R = loc diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 7be3aa579bf..edc655368f3 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -61,9 +61,9 @@ if(!speaking) if(iscarbon(other)) return 1 - if(istype(other, /mob/living/silicon)) + if(issilicon(other)) return 1 - if(istype(other, /mob/living/simple_animal/bot)) + if(isbot(other)) return 1 if(isbrain(other)) return 1 diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 8e796baae79..7b32dbf5e98 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -445,15 +445,15 @@ var/atom/U = (istype(target, /atom/movable) ? target.loc : target) if((!( U ) || !( T ))) return - while(!(istype(U, /turf))) + while(!isturf(U)) U = U.loc - if(!(istype(T, /turf))) + if(!isturf(T)) return if(!projectile) return - if(!(istype(U, /turf))) + if(!isturf(U)) return var/obj/item/projectile/A = new projectile(loc) playsound(loc, shoot_sound, 50, 1) diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 904f46c57d0..93e1eb62a3a 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -215,7 +215,7 @@ if(target) if(path.len == 0) - if(!istype(target, /turf/)) + if(!isturf(target)) var/turf/TL = get_turf(target) path = get_path_to(src, TL, /turf/proc/Distance_cardinal, 0, 30, id=access_card,simulated_only = 0) else @@ -236,7 +236,7 @@ start_eattile(target) else if(istype(target, /obj/item/stack/sheet/metal)) start_maketile(target) - else if(istype(target, /turf/) && emagged < 2) + else if(isturf(target) && emagged < 2) repair(target) else if(emagged == 2 && isfloorturf(target)) var/turf/simulated/floor/F = target diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 2c4a8f5cadf..da50db1b2c7 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -687,7 +687,7 @@ if(wires.is_cut(WIRE_MOB_AVOIDANCE)) // usually just bumps, but if avoidance disabled knock over mobs var/mob/living/L = obs if(ismob(L)) - if(istype(L,/mob/living/silicon/robot)) + if(isrobot(L)) visible_message("[src] bumps into [L]!") else if(!paicard) diff --git a/code/modules/mob/living/simple_animal/friendly/diona.dm b/code/modules/mob/living/simple_animal/friendly/diona.dm index d784e1704e6..df3576fab3d 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona.dm @@ -156,7 +156,7 @@ var/hasMobs = FALSE for(var/atom/A in D.contents) - if(istype(A, /mob/) || istype(A, /obj/item/holder)) + if(ismob(A) || istype(A, /obj/item/holder)) hasMobs = TRUE if(!hasMobs) D.status_flags &= ~PASSEMOTES diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index 2b4ff1d065f..ead7016dd62 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -26,7 +26,7 @@ gold_core_spawnable = FRIENDLY_SPAWN /mob/living/simple_animal/lizard/decompile_act(obj/item/matter_decompiler/C, mob/user) - if(!istype(user, /mob/living/silicon/robot/drone)) + if(!isdrone(user)) user.visible_message("[user] sucks [src] into its decompiler. There's a horrible crunching noise.", \ "It's a bit of a struggle, but you manage to suck [src] into your decompiler. It makes a series of visceral crunching noises.") new/obj/effect/decal/cleanable/blood/splatter(get_turf(src)) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 1d644ad4ecd..1dc9c6e1bf0 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -209,7 +209,7 @@ to_chat(src, "[src] tries to pick you up, but you wriggle free of their grasp!") /mob/living/simple_animal/mouse/decompile_act(obj/item/matter_decompiler/C, mob/user) - if(!(istype(user, /mob/living/silicon/robot/drone))) + if(!isdrone(user)) user.visible_message("[user] sucks [src] into its decompiler. There's a horrible crunching noise.", \ "It's a bit of a struggle, but you manage to suck [src] into your decompiler. It makes a series of visceral crunching noises.") new/obj/effect/decal/cleanable/blood/splatter(get_turf(src)) diff --git a/code/modules/mob/living/simple_animal/friendly/snake.dm b/code/modules/mob/living/simple_animal/friendly/snake.dm index fe4fa0db6cd..bd9241721ba 100644 --- a/code/modules/mob/living/simple_animal/friendly/snake.dm +++ b/code/modules/mob/living/simple_animal/friendly/snake.dm @@ -42,7 +42,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 @@ -54,7 +54,7 @@ return mice /mob/living/simple_animal/hostile/retaliate/poison/snake/AttackingTarget() - if(istype(target, /mob/living/simple_animal/mouse)) + if(ismouse(target)) visible_message("[name] consumes [target] in a single gulp!", "You consume [target] in a single gulp!") QDEL_NULL(target) adjustHealth(-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 ca80102116c..2fb4f0271c0 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -202,7 +202,7 @@ walk(src,0) spawn(50) if(busy == SPINNING_COCOON) - if(cocoon_target && istype(cocoon_target.loc, /turf) && get_dist(src,cocoon_target) <= 1) + if(cocoon_target && isturf(cocoon_target.loc) && get_dist(src,cocoon_target) <= 1) var/obj/structure/spider/cocoon/C = new(cocoon_target.loc) var/large_cocoon = 0 C.pixel_x = cocoon_target.pixel_x diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm index f4e18f0b690..959a7ddeb0f 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm @@ -42,7 +42,7 @@ . += "However, this one appears appears less wild in nature, and calmer around people." /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 diff --git a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm index 9c62911d778..73d446edd58 100644 --- a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm +++ b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm @@ -149,7 +149,7 @@ if(noms in totalWormSegments) return //Trying to eat part of self. - if(istype(noms, /turf)) + if(isturf(noms)) if(iswallturf(noms)) W = noms nomDelay *= 2 diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm index 7b120f9df40..bee3dab01b3 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm @@ -143,7 +143,7 @@ // nesting in a hallway would be very stupid - crew would find and kill you almost instantly var/numhostiles = 0 for(var/mob/living/H in oview(10, src)) - if(!istype(H, /mob/living/simple_animal/hostile/poison/terror_spider)) + if(!isterrorspider(H)) if(H.stat != DEAD) numhostiles += 1 // nesting RIGHT NEXT TO SOMEONE is even worse diff --git a/code/modules/mob/living/simple_animal/posessed_object.dm b/code/modules/mob/living/simple_animal/posessed_object.dm index 91ab7d65e20..f4eb68954c7 100644 --- a/code/modules/mob/living/simple_animal/posessed_object.dm +++ b/code/modules/mob/living/simple_animal/posessed_object.dm @@ -121,7 +121,7 @@ client.click_intercept.InterceptClickOn(src, params, A) return - if(!istype(loc, /turf)) // If we're inside a card machine or something similar then you're stuck. + if(!isturf(loc)) // If we're inside a card machine or something similar then you're stuck. return name = spirit_name diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 73dd7c6939a..dd1efb0da36 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -157,7 +157,7 @@ var/omsg = replacetext(message, "[src] ", "") var/list/listening_obj = new for(var/atom/movable/A in view(range, src)) - if(istype(A, /mob)) + if(ismob(A)) var/mob/M = A for(var/obj/O in M.contents) listening_obj |= O diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d121f988c6b..989652a2f7f 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -6,7 +6,7 @@ return 0 /proc/ispet(A) - if(istype(A, /mob/living/simple_animal)) + if(isanimal(A)) var/mob/living/simple_animal/SA = A if(SA.can_collar) return 1 @@ -529,7 +529,7 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM if(M.stat != DEAD && check_rights(R_ADMIN|R_MOD,0,M)) follow = "([admin_jump_link(subject)]) " var/mob/dead/observer/DM - if(istype(subject, /mob/dead/observer)) + if(isobserver(subject)) DM = subject if(check_rights(R_ADMIN|R_MOD, FALSE, M)) // What admins see lname = "[keyname][(DM?.client.prefs.toggles2 & PREFTOGGLE_2_ANON) ? (@"[ANON]") : (DM ? "" : "^")] ([name])" diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index b62d0d088f1..3c9147446e5 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -66,7 +66,7 @@ /obj/item/paper/examine(mob/user) . = ..() if(user.is_literate()) - if(in_range(user, src) || istype(user, /mob/dead/observer)) + if(in_range(user, src) || isobserver(user)) show_content(user) else . += "You have to go closer if you want to read it." @@ -400,7 +400,7 @@ else if(h_user.head == src) h_user.unEquip(src) h_user.put_in_hands(B) - else if(!istype(src.loc, /turf)) + else if(!isturf(src.loc)) src.loc = get_turf(h_user) if(h_user.client) h_user.client.screen -= src h_user.put_in_hands(B) diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 5e5d1dca556..aa996d9aa23 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -193,7 +193,7 @@ update_icon() else to_chat(usr, "You need to hold it in your hands to change pages.") - if(istype(loc, /mob)) + if(ismob(loc)) attack_self(loc) /obj/item/paper_bundle/AltClick(mob/user) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 1e3bc71106d..ab054d1e30a 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -154,9 +154,9 @@ if(ishuman(copymob)) //Suit checks are in check_mob var/mob/living/carbon/human/H = copymob temp_img = icon('icons/obj/butts.dmi', H.dna.species.butt_sprite) - else if(istype(copymob,/mob/living/silicon/robot/drone)) + else if(isdrone(copymob)) temp_img = icon('icons/obj/butts.dmi', "drone") - else if(istype(copymob,/mob/living/simple_animal/diona)) + else if(isnymph(copymob)) temp_img = icon('icons/obj/butts.dmi', "nymph") else if(isalien(copymob) || istype(copymob,/mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro. temp_img = icon('icons/obj/butts.dmi', "xeno") @@ -495,7 +495,7 @@ toner = 0 /obj/machinery/photocopier/MouseDrop_T(mob/target, mob/living/user) - if(!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai) || target.move_resist > user.pull_force) + if(!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || isAI(user) || target.move_resist > user.pull_force) return if(check_mob()) //is target mob or another mob on this photocopier already? return diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 41c47aa9a22..553b479a342 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -252,7 +252,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor // As well as anything that isn't invisible. for(var/atom/A in the_turf) if(A.invisibility) - if(see_ghosts && istype(A,/mob/dead/observer)) + if(see_ghosts && isobserver(A)) var/mob/dead/observer/O = A if(O.orbiting_uid) continue @@ -314,7 +314,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor var/mob_detail for(var/mob/M in the_turf) if(M.invisibility) - if(see_ghosts && istype(M,/mob/dead/observer)) + if(see_ghosts && isobserver(M)) var/mob/dead/observer/O = M if(O.orbiting_uid) continue diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index 7c732ce1b93..e5231da3746 100644 --- a/code/modules/paperwork/silicon_photography.dm +++ b/code/modules/paperwork/silicon_photography.dm @@ -151,10 +151,10 @@ deletepicture(src) /obj/item/camera/siliconcam/proc/getsource() - if(istype(src.loc, /mob/living/silicon/ai)) + if(isAI(loc)) return src - var/mob/living/silicon/robot/C = src.loc + var/mob/living/silicon/robot/C = loc var/obj/item/camera/siliconcam/Cinfo if(C.connected_ai) Cinfo = C.connected_ai.aiCamera diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index 9a2f51bde86..59d2beed0d2 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/mob/M = loc if(M.incapacitated()) return 0 - if((src in M.contents) || ( istype(loc, /turf) && in_range(src, M) )) + if((src in M.contents) || ( isturf(loc) && in_range(src, M) )) return 1 else return 0 @@ -218,7 +218,7 @@ GLOBAL_LIST_EMPTY(PDAs) if(O) to_chat(user, "You remove [O] from [src].") playsound(src, 'sound/machines/pda_button2.ogg', 50, TRUE) - if(istype(loc, /mob)) + if(ismob(loc)) var/mob/M = loc if(M.get_active_hand() == null) M.put_in_hands(O) @@ -280,7 +280,7 @@ GLOBAL_LIST_EMPTY(PDAs) playsound(src, 'sound/machines/terminal_success.ogg', 50, TRUE) else //Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand. - if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) ) + if(((src in user.contents) && (C in user.contents)) || (isturf(loc) && in_range(src, user) && (C in user.contents)) ) if( can_use(user) )//If they can still act. id_check(user, 2) to_chat(user, "You put the ID into \the [src]'s slot.
You can remove it with ALT click.
") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 5d6fb251067..91a7eefb816 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -850,7 +850,7 @@ data["chargingStatus"] = charging data["totalLoad"] = round(lastused_equip + lastused_light + lastused_environ) data["coverLocked"] = coverlocked - data["siliconUser"] = istype(user, /mob/living/silicon) + data["siliconUser"] = issilicon(user) data["siliconLock"] = locked data["malfStatus"] = get_malf_status(user) data["nightshiftLights"] = nightshift_lights @@ -929,7 +929,7 @@ return 1 autoflag = 5 - if(istype(user, /mob/living/silicon)) + if(issilicon(user)) var/mob/living/silicon/ai/AI = user var/mob/living/silicon/robot/robot = user if( \ @@ -944,7 +944,7 @@ to_chat(user, "\The [src] has AI control disabled!") return FALSE else - if((!in_range(src, user) || !istype(loc, /turf))) + if((!in_range(src, user) || !isturf(loc))) return FALSE var/mob/living/carbon/human/H = user diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index d528a98fdb3..094ab323405 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -336,9 +336,9 @@ var/list/data = list() data["active"] = active - if(istype(user, /mob/living/silicon/ai)) + if(isAI(user)) data["is_ai"] = TRUE - else if(istype(user, /mob/living/silicon/robot) && !Adjacent(user)) + else if(isrobot(user) && !Adjacent(user)) data["is_ai"] = TRUE else data["is_ai"] = FALSE diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 99248b99a50..34e1e74febe 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -308,7 +308,7 @@ return FALSE //to avoid spamming with insulated glvoes on var/area/source_area - if(istype(power_source, /area)) + if(isarea(power_source)) source_area = power_source power_source = source_area.get_apc() if(istype(power_source, /obj/structure/cable)) diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index badc288f2c7..cdc130d8988 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -250,7 +250,7 @@ /obj/machinery/particle_accelerator/control_box/interact(mob/user) if(((get_dist(src, user) > 1) && !isobserver(user)) || (stat & (BROKEN|NOPOWER))) - if(!istype(user, /mob/living/silicon)) + if(!issilicon(user)) user.unset_machine() user << browse(null, "window=pacontrol") return diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 086dbf24350..fc919819c0b 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -317,7 +317,7 @@ /obj/machinery/power/turbine/interact(mob/user) - if( !Adjacent(user) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon)) ) + if( !Adjacent(user) || (stat & (NOPOWER|BROKEN)) && (!issilicon(user)) ) user.unset_machine(src) user << browse(null, "window=turbine") return diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index f56dd922f70..0366951f59a 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -63,7 +63,7 @@ light_color = LIGHT_COLOR_DARKBLUE /obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = 0) - if(istype(target,/turf/) || isstructure(target)) + if(isturf(target) || isstructure(target)) target.ex_act(2) ..() diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 31ad2c28c0f..411d1dad400 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -275,7 +275,7 @@ /obj/item/projectile/ornament/on_hit(atom/target) //knockback ..() - if(istype(target, /turf)) + if(isturf(target)) return 0 var/obj/T = target var/throwdir = get_dir(firer,target) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 8ab01650abd..c39d7912c05 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -1059,7 +1059,7 @@ var/mob/living/carbon/C = M if(!C.wear_mask) // If not wearing a mask C.adjustToxLoss(lethality) - if(istype(M, /mob/living/simple_animal/diona)) //nymphs take EVEN MORE damage + if(isnymph(M)) //nymphs take EVEN MORE damage var/mob/living/simple_animal/diona/D = M D.adjustHealth(100) ..() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index dd3ae8208e3..09d687fcaf9 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -169,9 +169,10 @@ // mouse drop another mob or self // /obj/machinery/disposal/MouseDrop_T(mob/living/target, mob/living/user) - if(!istype(target) || target.buckled || target.has_buckled_mobs() || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai)) + if(!istype(target) || target.buckled || target.has_buckled_mobs() || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || isAI(user)) return - if(isanimal(user) && target != user) return //animals cannot put mobs other than themselves into disposal + if(isanimal(user) && target != user) + return //animals cannot put mobs other than themselves into disposal src.add_fingerprint(user) var/target_loc = target.loc var/msg @@ -286,7 +287,7 @@ if(src.flushing) return - if(istype(src.loc, /turf)) + if(isturf(src.loc)) if(action == "pumpOn") mode = 1 update() @@ -472,7 +473,7 @@ AM.forceMove(loc) AM.pipe_eject(0) - if(!istype(AM, /mob/living/silicon/robot/drone) && !istype(AM, /mob/living/silicon/robot/syndicate/saboteur)) //Poor drones kept smashing windows and taking system damage being fired out of disposals. ~Z + if(!isdrone(AM) && !istype(AM, /mob/living/silicon/robot/syndicate/saboteur)) //Poor drones kept smashing windows and taking system damage being fired out of disposals. ~Z spawn(1) if(AM) AM.throw_at(target, 5, 1) @@ -539,7 +540,7 @@ //Check for any living mobs trigger hasmob. //hasmob effects whether the package goes to cargo or its tagged destination. for(var/mob/living/M in D) - if(M && M.stat != 2 && !istype(M, /mob/living/silicon/robot/drone) && !istype(M, /mob/living/silicon/robot/syndicate/saboteur)) + if(M && M.stat != 2 && !isdrone(M) && !istype(M, /mob/living/silicon/robot/syndicate/saboteur)) hasmob = 1 //Checks 1 contents level deep. This means that players can be sent through disposals... @@ -547,7 +548,7 @@ for(var/obj/O in D) if(O.contents) for(var/mob/living/M in O.contents) - if(M && M.stat != 2 && !istype(M,/mob/living/silicon/robot/drone) && !istype(M, /mob/living/silicon/robot/syndicate/saboteur)) + if(M && M.stat != 2 && !isdrone(M) && !istype(M, /mob/living/silicon/robot/syndicate/saboteur)) hasmob = 1 // now everything inside the disposal gets put into the holder @@ -566,7 +567,7 @@ var/obj/item/smallDelivery/T = AM destinationTag = T.sortTag //Drones can mail themselves through maint. - if(istype(AM, /mob/living/silicon/robot/drone)) + if(isdrone(AM)) var/mob/living/silicon/robot/drone/drone = AM destinationTag = drone.mail_destination if(istype(AM, /mob/living/silicon/robot/syndicate/saboteur)) @@ -1319,7 +1320,7 @@ for(var/atom/movable/AM in contents) AM.forceMove(loc) AM.pipe_eject(dir) - if(istype(AM,/mob/living/silicon/robot/drone) || istype(AM, /mob/living/silicon/robot/syndicate/saboteur)) //Drones keep smashing windows from being fired out of chutes. Bad for the station. ~Z + if(isdrone(AM) || istype(AM, /mob/living/silicon/robot/syndicate/saboteur)) //Drones keep smashing windows from being fired out of chutes. Bad for the station. ~Z return spawn(5) if(QDELETED(AM)) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 4353372ed84..f91f8c4bcf7 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -313,7 +313,7 @@ if(isobj(AM)) var/obj/O = AM O.loc = src - else if(istype(AM, /mob)) + else if(ismob(AM)) var/mob/M = AM M.loc = src flush() diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 72e63a19808..822e55fbdd3 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -481,7 +481,7 @@ continue M.notransform = TRUE M.anchored = TRUE - if(istype(M, /mob/living/simple_animal/hostile)) + if(ishostile(M)) var/mob/living/simple_animal/hostile/H = M H.AIStatus = AI_OFF H.LoseTarget() @@ -509,7 +509,7 @@ /obj/effect/timestop/proc/unfreeze_mob(mob/living/M) M.notransform = FALSE M.anchored = FALSE - if(istype(M, /mob/living/simple_animal/hostile)) + if(ishostile(M)) var/mob/living/simple_animal/hostile/H = M H.AIStatus = initial(H.AIStatus) diff --git a/code/modules/space_management/heap_space_level.dm b/code/modules/space_management/heap_space_level.dm index d8156291fc0..c2d58b499f6 100644 --- a/code/modules/space_management/heap_space_level.dm +++ b/code/modules/space_management/heap_space_level.dm @@ -47,7 +47,7 @@ C.set_occupied(FALSE) for(var/turf/T in block(locate(C.x, C.y, C.zpos), locate(C.x+C.width-1, C.y+C.height-1, C.zpos))) for(var/atom/movable/M in T) - if(istype(M, /mob/dead/observer)) + if(isobserver(M)) continue M.loc = null qdel(M, TRUE) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 768815bb283..6bc8db830f8 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -360,7 +360,7 @@ target = options[V] /obj/machinery/computer/bsa_control/proc/get_target_name() - if(istype(target,/area)) + if(isarea(target)) var/area/A = target return A.name else if(istype(target,/obj/item/gps)) @@ -368,7 +368,7 @@ return G.gpstag /obj/machinery/computer/bsa_control/proc/get_impact_turf() - if(istype(target,/area)) + if(isarea(target)) return pick(get_area_turfs(target)) else if(istype(target,/obj/item/gps)) return get_turf(target) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 24a08e5edd2..3de1aa1c1f2 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -547,7 +547,7 @@ Note that amputating the affected organ does in fact remove the infection from t src.transform = M if(!clean) // Throw limb around. - if(src && istype(loc,/turf)) + if(src && isturf(loc)) dropped_part.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),30) dir = 2 brute_dam = 0 diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 5425220e033..a456939c448 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -468,7 +468,7 @@ * * tool - The tool performing the operation. */ /proc/spread_germs_by_incision(obj/item/organ/external/E, obj/item/tool) - if(!istype(E, /obj/item/organ/external)) + if(!isorgan(E)) return var/germs = 0