From 9e90c81282eaa67587a95d6a533ba19c8d96de1f Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:50:29 -0400 Subject: [PATCH] Defining Part 1 - Code cleanup toward defines (#19262) * This is only the beginning * Update stack.dm --- code/__HELPERS/unsorted.dm | 6 +++--- code/_onclick/click.dm | 2 +- code/_onclick/click_override.dm | 2 +- code/_onclick/hud/alert.dm | 4 ++-- code/_onclick/hud/screen_objects.dm | 4 ++-- code/_onclick/telekinesis.dm | 4 ++-- code/controllers/subsystem/ticker.dm | 2 +- code/datums/components/radioactive.dm | 2 +- code/datums/diseases/transformation.dm | 2 +- code/datums/helper_datums/teleport.dm | 6 +++--- code/datums/spells/charge.dm | 2 +- code/game/area/areas.dm | 4 ++-- code/game/atoms.dm | 2 +- code/game/gamemodes/blob/blob.dm | 2 +- code/game/gamemodes/blob/blob_report.dm | 6 +++--- code/game/gamemodes/blob/theblob.dm | 2 +- code/game/gamemodes/cult/cult_structures.dm | 4 ++-- .../gamemodes/miniantags/guardian/guardian.dm | 2 +- .../miniantags/guardian/types/healer.dm | 2 +- .../miniantags/guardian/types/protector.dm | 2 +- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- code/game/gamemodes/wizard/raginmages.dm | 4 ++-- code/game/machinery/computer/HolodeckControl.dm | 4 ++-- code/game/machinery/computer/arcade.dm | 2 +- code/game/machinery/computer/prisoner.dm | 2 +- code/game/machinery/constructable_frame.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/doors/airlock_control.dm | 2 +- code/game/machinery/flasher.dm | 2 +- code/game/machinery/mass_driver.dm | 2 +- code/game/machinery/portable_turret.dm | 4 ++-- code/game/machinery/recycler.dm | 4 ++-- code/game/machinery/shieldgen.dm | 2 +- code/game/machinery/transformer.dm | 8 ++++---- code/game/machinery/washing_machine.dm | 2 +- code/game/mecha/equipment/tools/work_tools.dm | 16 ++++++++-------- code/game/mecha/mech_fabricator.dm | 2 +- code/game/mecha/mecha.dm | 2 +- code/game/mecha/mecha_control_console.dm | 2 +- .../effects/effect_system/effects_foam.dm | 2 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/effects/spiders.dm | 2 +- code/game/objects/explosion.dm | 4 ++-- code/game/objects/items.dm | 10 +++++----- code/game/objects/items/blueprints.dm | 8 ++++---- code/game/objects/items/bodybag.dm | 2 +- code/game/objects/items/devices/autopsy.dm | 2 +- code/game/objects/items/devices/chameleonproj.dm | 2 +- code/game/objects/items/devices/lightreplacer.dm | 2 +- code/game/objects/items/devices/paicard.dm | 2 +- code/game/objects/items/devices/taperecorder.dm | 2 +- .../game/objects/items/devices/traitordevices.dm | 2 +- .../objects/items/stacks/sheets/sheet_types.dm | 2 +- code/game/objects/items/stacks/stack.dm | 8 ++++---- code/game/objects/items/weapons/RCD.dm | 2 +- code/game/objects/items/weapons/RSF.dm | 2 +- code/game/objects/items/weapons/cards_ids.dm | 2 +- code/game/objects/items/weapons/caution.dm | 2 +- code/game/objects/items/weapons/explosives.dm | 2 +- .../items/weapons/implants/implantcase.dm | 2 +- .../objects/items/weapons/implants/implanter.dm | 2 +- code/game/objects/items/weapons/legcuffs.dm | 2 +- .../objects/items/weapons/pneumaticCannon.dm | 4 ++-- code/game/objects/items/weapons/shards.dm | 2 +- code/game/objects/items/weapons/signs.dm | 2 +- code/game/objects/items/weapons/soap.dm | 2 +- code/game/objects/items/weapons/storage/boxes.dm | 2 +- .../objects/items/weapons/storage/firstaid.dm | 2 +- .../objects/items/weapons/storage/storage.dm | 12 ++++++------ code/game/objects/items/weapons/twohanded.dm | 4 ++-- code/game/objects/structures/aliens.dm | 6 +++--- .../crates_lockers/closets/cardboardbox.dm | 2 +- .../structures/crates_lockers/closets/fireaxe.dm | 2 +- code/game/objects/structures/door_assembly.dm | 2 +- code/game/objects/structures/false_walls.dm | 2 +- code/game/objects/structures/grille.dm | 2 +- code/game/objects/structures/inflatable.dm | 2 +- code/game/objects/structures/mineral_doors.dm | 2 +- code/game/objects/structures/morgue.dm | 4 ++-- code/game/objects/structures/noticeboard.dm | 4 ++-- .../stool_bed_chair_nest/wheelchair.dm | 2 +- code/game/objects/structures/tables_racks.dm | 4 ++-- code/game/objects/structures/windoor_assembly.dm | 2 +- code/game/turfs/simulated/floor.dm | 2 +- code/game/turfs/simulated/floor/asteroid.dm | 2 +- code/game/turfs/turf.dm | 4 ++-- code/modules/admin/admin.dm | 2 +- code/modules/admin/admin_verbs.dm | 4 ++-- code/modules/admin/topic.dm | 4 ++-- code/modules/admin/verbs/diagnostics.dm | 2 +- .../antagonists/changeling/powers/mutations.dm | 4 ++-- code/modules/antagonists/vampire/vamp_datum.dm | 2 +- code/modules/assembly/infrared.dm | 2 +- code/modules/assembly/proximity.dm | 2 +- .../atmospherics/environmental/LINDA_fire.dm | 2 +- .../atmospherics/environmental/LINDA_system.dm | 2 +- .../environmental/LINDA_turf_tile.dm | 6 +++--- .../machinery/components/binary_devices/pump.dm | 2 +- .../components/binary_devices/volume_pump.dm | 2 +- .../components/trinary_devices/filter.dm | 2 +- .../components/trinary_devices/mixer.dm | 2 +- .../components/unary_devices/thermal_plate.dm | 2 +- .../atmospherics/machinery/datum_pipeline.dm | 2 +- code/modules/atmospherics/machinery/pipes/cap.dm | 2 +- .../atmospherics/machinery/pipes/manifold.dm | 2 +- .../atmospherics/machinery/pipes/manifold4w.dm | 2 +- .../modules/atmospherics/machinery/pipes/pipe.dm | 2 +- 107 files changed, 161 insertions(+), 161 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 56ad62cd5f0..21d5a3859ed 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -765,7 +765,7 @@ Returns 1 if the chain up to the area contains the given typepath X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi // Give the new turf our air, if simulated - if(istype(X, /turf/simulated) && istype(T, /turf/simulated)) + if(issimulatedturf(X) && issimulatedturf(T)) var/turf/simulated/sim = X sim.copy_air_with_tile(T) @@ -785,7 +785,7 @@ Returns 1 if the chain up to the area contains the given typepath // Find a new turf to take on the property of var/turf/nextturf = get_step(corner, direction) - if(!nextturf || !istype(nextturf, /turf/space)) + if(!nextturf || !isspaceturf(nextturf)) nextturf = get_step(corner, turn(direction, 180)) @@ -928,7 +928,7 @@ Returns 1 if the chain up to the area contains the given typepath var/old_icon1 = T.icon if(platingRequired) - if(istype(B, /turf/space)) + if(isspaceturf(B)) continue moving var/turf/X = new T.type(B) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 3ef96ef6087..9199e2ce690 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -441,7 +441,7 @@ /obj/screen/click_catcher/Click(location, control, params) var/list/modifiers = params2list(params) - if(modifiers["middle"] && istype(usr, /mob/living/carbon)) + if(modifiers["middle"] && iscarbon(usr)) var/mob/living/carbon/C = usr C.swap_hand() else diff --git a/code/_onclick/click_override.dm b/code/_onclick/click_override.dm index 3789a110116..d5feafb450f 100644 --- a/code/_onclick/click_override.dm +++ b/code/_onclick/click_override.dm @@ -82,7 +82,7 @@ break var/list/next_shocked = list() for(var/atom/movable/AM in orange(3, target_atom)) - if(AM == user || istype(AM, /obj/effect) || isobserver(AM)) + if(AM == user || iseffect(AM) || isobserver(AM)) continue next_shocked.Add(AM) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 216875d1759..20937716aa4 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -462,7 +462,7 @@ so as to remain in compliance with the most up-to-date laws." /obj/screen/alert/mech_port_available/Click() if(!usr || !usr.client) return - if(!istype(usr.loc, /obj/mecha) || !target) + if(!ismecha(usr.loc) || !target) return var/obj/mecha/M = usr.loc if(M.connect(target)) @@ -478,7 +478,7 @@ so as to remain in compliance with the most up-to-date laws." /obj/screen/alert/mech_port_disconnect/Click() if(!usr || !usr.client) return - if(!istype(usr.loc, /obj/mecha)) + if(!ismecha(usr.loc)) return var/obj/mecha/M = usr.loc if(M.disconnect()) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 83424370862..ab783f7c060 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -43,7 +43,7 @@ /obj/screen/close/Click() if(master) - if(istype(master, /obj/item/storage)) + if(isstorage(master)) var/obj/item/storage/S = master S.close(usr) return 1 @@ -181,7 +181,7 @@ return FALSE /obj/screen/storage/MouseDrop_T(obj/item/I, mob/user) - if(!user || !istype(I) || user.incapacitated(ignore_restraints = TRUE) || istype(user.loc, /obj/mecha) || !master) + if(!user || !istype(I) || user.incapacitated(ignore_restraints = TRUE) || ismecha(user.loc) || !master) return var/obj/item/storage/S = master diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 71258f40080..66bcab2691f 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -168,7 +168,7 @@ update_icon(UPDATE_OVERLAYS) apply_focus_overlay() // Make it behave like other equipment - if(istype(target, /obj/item)) + if(isitem(target)) if(target in user.tkgrabbed_objects) // Release the old grab first user.unEquip(user.tkgrabbed_objects[target]) @@ -177,7 +177,7 @@ /obj/item/tk_grab/proc/release_object() if(!focus) return - if(istype(focus, /obj/item)) + if(isitem(focus)) // Delete the key/value pair of item to TK grab host.tkgrabbed_objects -= focus focus = null diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 670c4460bd8..6ebeabc5327 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -449,7 +449,7 @@ SUBSYSTEM_DEF(ticker) if(desc_override) I.desc = desc_override - if(istype(H.back, /obj/item/storage)) // Try to place it in something on the mob's back + if(isstorage(H.back)) // Try to place it in something on the mob's back var/obj/item/storage/S = H.back if(length(S.contents) < S.storage_slots) I.forceMove(H.back) diff --git a/code/datums/components/radioactive.dm b/code/datums/components/radioactive.dm index ab0b8f440cb..ea7bd40985c 100644 --- a/code/datums/components/radioactive.dm +++ b/code/datums/components/radioactive.dm @@ -19,7 +19,7 @@ can_contaminate = _can_contaminate if(istype(parent, /atom)) RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/rad_examine) - if(istype(parent, /obj/item)) + if(isitem(parent)) RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/rad_attack) RegisterSignal(parent, COMSIG_ITEM_ATTACK_OBJ, .proc/rad_attack) else diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index adb889f3abd..fcb38272091 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -38,7 +38,7 @@ do_disease_transformation(affected_mob) /datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob) - if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD) + if(iscarbon(affected_mob) && affected_mob.stat != DEAD) if(stage5) to_chat(affected_mob, pick(stage5)) if(jobban_isbanned(affected_mob, job_role)) diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index ba7db4c6547..c91ec0f039c 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -52,7 +52,7 @@ //must succeed in most cases /datum/teleport/proc/setTeleatom(atom/movable/ateleatom) - if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon)) + if(iseffect(ateleatom) && !istype(ateleatom, /obj/effect/dummy/chameleon)) qdel(ateleatom) return 0 if(istype(ateleatom)) @@ -107,7 +107,7 @@ center = destination if(safe_turf_first) for(var/turf/T in range(precision, center)) - if(istype(T, /turf/space)) + if(isspaceturf(T)) continue if(T.density) continue @@ -191,7 +191,7 @@ else precision = max(rand(1, 100) * length(bagholding), 100) - if(istype(teleatom, /mob/living)) + if(isliving(teleatom)) var/mob/living/MM = teleatom to_chat(MM, "The bluespace interface on your bag of holding interferes with the teleport!") return 1 diff --git a/code/datums/spells/charge.dm b/code/datums/spells/charge.dm index 6a5aa0a13c7..d5362e35b5c 100644 --- a/code/datums/spells/charge.dm +++ b/code/datums/spells/charge.dm @@ -18,7 +18,7 @@ var/charged_item = null var/burnt_out = FALSE - if(L.pulling && (istype(L.pulling, /mob/living))) + if(L.pulling && (isliving(L.pulling))) var/mob/living/M = L.pulling if(M.mob_spell_list.len != 0 || (M.mind && M.mind.spell_list.len != 0)) for(var/obj/effect/proc_holder/spell/S in M.mob_spell_list) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 94e81f2d785..9f0aaad07e3 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -536,7 +536,7 @@ if(M.buckled) //Cam't fall down if you are buckled return - if(istype(get_turf(M), /turf/space)) // Can't fall onto nothing. + if(isspaceturf(get_turf(M))) // Can't fall onto nothing. return if((istype(M,/mob/living/carbon/human/)) && (M.m_intent == MOVE_INTENT_RUN)) @@ -552,7 +552,7 @@ if(!T) T = get_turf(AT) var/area/A = get_area(T) - if(istype(T, /turf/space)) // Turf never has gravity + if(isspaceturf(T)) // Turf never has gravity return 0 else if(A && A.has_gravity) // Areas which always has gravity return 1 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 643d4d3923b..dd3b62b28c4 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -241,7 +241,7 @@ reagents.conditional_update() else if(istype(A, /atom/movable)) var/atom/movable/M = A - if(istype(M.loc, /mob/living)) + if(isliving(M.loc)) var/mob/living/L = M.loc L.unEquip(M) M.forceMove(src) diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index f89cf5c2a7f..1bfbf2c32c2 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -122,7 +122,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) if(GLOB.directory[ckey(blob.key)]) blob_client = GLOB.directory[ckey(blob.key)] location = get_turf(C) - if(!is_station_level(location.z) || istype(location, /turf/space)) + if(!is_station_level(location.z) || isspaceturf(location)) if(!warned) to_chat(C, "You feel ready to burst, but this isn't an appropriate place! You must return to the station!") message_admins("[key_name_admin(C)] was in space when the blobs burst, and will die if [C.p_they()] [C.p_do()] not return to the station.") diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 76607e1eedd..de538be6ccd 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -50,14 +50,14 @@ else src.floor += 1 - if(istype(T, /turf/simulated/wall)) + if(iswallturf(T)) var/turf/simulated/wall/W = T if(W.intact) src.wall += 2 else src.wall += 1 - if(istype(T, /turf/simulated/wall/r_wall)) + if(isreinforcedwallturf(T)) var/turf/simulated/wall/r_wall/R = T if(R.intact) src.r_wall += 2 @@ -74,7 +74,7 @@ grille += 1 else if(istype(O, /obj/machinery/door)) src.door += 1 - else if(istype(O, /obj/machinery)) + else if(ismachinery(O)) src.mach += 1 /datum/station_state/proc/score(datum/station_state/result) diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 787d459a94b..735c29f5b36 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -135,7 +135,7 @@ /obj/structure/blob/proc/expand(turf/T = null, prob = 1, a_color, _overmind = null) if(prob && !prob(obj_integrity)) return - if(istype(T, /turf/space) && prob(75)) return + if(isspaceturf(T) && prob(75)) return if(!T) var/list/dirs = list(1,2,4,8) for(var/i = 1 to 4) diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index eb07f7845fb..3a7ab920643 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -294,9 +294,9 @@ GLOBAL_LIST_INIT(blacklisted_pylon_turfs, typecacheof(list( var/turf/T = safepick(validturfs) if(T) - if(istype(T, /turf/simulated/floor)) + if(isfloorturf(T)) T.ChangeTurf(/turf/simulated/floor/engine/cult) - if(istype(T, /turf/simulated/wall)) + if(iswallturf(T)) T.ChangeTurf(/turf/simulated/wall/cult/artificer) else var/turf/simulated/floor/engine/cult/F = safepick(cultturfs) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index b93a07a2043..109c679210c 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -89,7 +89,7 @@ else to_chat(src, "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]!") visible_message("\The [src] jumps back to its user.") - if(istype(summoner.loc, /obj/effect)) + if(iseffect(summoner.loc)) Recall(TRUE) else new /obj/effect/temp_visual/guardian/phase/out(loc) diff --git a/code/game/gamemodes/miniantags/guardian/types/healer.dm b/code/game/gamemodes/miniantags/guardian/types/healer.dm index b4e74eb45bf..37bddc18807 100644 --- a/code/game/gamemodes/miniantags/guardian/types/healer.dm +++ b/code/game/gamemodes/miniantags/guardian/types/healer.dm @@ -90,7 +90,7 @@ set desc = "Mark a floor as your beacon point, allowing you to warp targets to it. Your beacon will not work in unfavorable atmospheric conditions." if(beacon_cooldown < world.time) var/turf/beacon_loc = get_turf(loc) - if(istype(beacon_loc, /turf/simulated/floor)) + if(isfloorturf(beacon_loc)) var/turf/simulated/floor/F = beacon_loc F.icon = 'icons/turf/floors.dmi' F.name = "bluespace recieving pad" diff --git a/code/game/gamemodes/miniantags/guardian/types/protector.dm b/code/game/gamemodes/miniantags/guardian/types/protector.dm index fda005a58ed..c5b0b905f1c 100644 --- a/code/game/gamemodes/miniantags/guardian/types/protector.dm +++ b/code/game/gamemodes/miniantags/guardian/types/protector.dm @@ -48,7 +48,7 @@ if(get_dist(get_turf(summoner),get_turf(src)) <= range) return else - if(istype(summoner.loc, /obj/effect)) + if(iseffect(summoner.loc)) to_chat(src, "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]!") visible_message("[src] jumps back to its user.") Recall(TRUE) diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index e4b038ef97c..a8ef2f10e72 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -249,7 +249,7 @@ if(holy_check(src)) return var/turf/T = get_turf(src) - if(istype(T, /turf/simulated/wall)) + if(iswallturf(T)) to_chat(src, "You cannot use abilities from inside of a wall.") return 0 if(inhibited) diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index 1a845d39e8d..50b06cb4bac 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -100,10 +100,10 @@ if(L.stat == CONSCIOUS) // Probably a troublemaker - I'd like to see YOU fight when unconscious to_chat(L, "STOP FIGHTING.") L.ghostize() - if(istype(L, /mob/living/carbon/brain)) + if(isbrain(L)) // diediedie var/mob/living/carbon/brain/B = L - if(istype(B.loc, /obj/item)) + if(isitem(B.loc)) qdel(B.loc) if(B && B.container) qdel(B.container) diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 2c6855d79cc..575cf031c39 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -237,7 +237,7 @@ /obj/machinery/computer/HolodeckControl/proc/checkInteg(area/A) for(var/turf/T in A) - if(istype(T, /turf/space)) + if(isspaceturf(T)) return 0 return 1 @@ -540,7 +540,7 @@ visible_message("[G.assailant] dunks [G.affecting] into [src]!") qdel(W) return - else if(istype(W, /obj/item) && get_dist(src,user)<2) + else if(isitem(W) && get_dist(src,user)<2) user.drop_item(src) visible_message("[user] dunks [W] into [src]!") return diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 4e396e45178..a37303c59b7 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -469,7 +469,7 @@ playsound(loc, 'sound/effects/splat.ogg', 50, TRUE) M.adjust_nutrition(-50) //lose a lot of food var/turf/location = usr.loc - if(istype(location, /turf/simulated)) + if(issimulatedturf(location)) location.add_vomit_floor(TRUE) if(ORION_TRAIL_FLUX) if(prob(75)) diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index f6b71f1bd0a..b88ede1d511 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -95,7 +95,7 @@ else if(total_loss) health_display = "HURT ([total_loss])" var/turf/implant_location = get_turf(T) - if(!istype(implant_location, /turf/space)) + if(!isspaceturf(implant_location)) loc_display = "[get_area(implant_location)]" var/list/implant_info = list( diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index abdf84ab843..28654752385 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -169,7 +169,7 @@ update_req_desc() return - if(istype(P, /obj/item)) + if(isitem(P)) var/success for(var/I in req_components) if(istype(P, I) && (req_components[I] > 0) && (!(P.flags & NODROP) || istype(P, /obj/item/stack))) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 137e19562c7..bdb015779e2 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -740,7 +740,7 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) attack_ai(user) /obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target, height=0) - if(isElectrified() && density && istype(mover, /obj/item)) + if(isElectrified() && density && isitem(mover)) var/obj/item/I = mover if(I.flags & CONDUCT) do_sparks(5, 1, src) diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 7f23df56feb..473bef0b449 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -117,7 +117,7 @@ /obj/machinery/door/airlock/Bumped(atom/AM) ..(AM) - if(istype(AM, /obj/mecha)) + if(ismecha(AM)) var/obj/mecha/mecha = AM if(density && radio_connection && mecha.occupant && (allowed(mecha.occupant) || check_access_list(mecha.operation_req_access))) send_status(1) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 17f37f05433..e01621f8991 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -104,7 +104,7 @@ if((disable) || (last_flash && world.time < last_flash + 150)) return - if(istype(AM, /mob/living/carbon)) + if(iscarbon(AM)) var/mob/living/carbon/M = AM if((M.m_intent != MOVE_INTENT_WALK) && (anchored)) flash() diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index d07974434c9..419bbf99ad5 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -45,7 +45,7 @@ var/O_limit = 0 var/atom/target = get_edge_target_turf(src, dir) for(var/atom/movable/O in loc) - if((!O.anchored && O.move_resist != INFINITY) || istype(O, /obj/mecha)) //Mechs need their launch platforms. Also checks if something is anchored or has move resist INFINITY, which should stop ghost flinging. + if((!O.anchored && O.move_resist != INFINITY) || ismecha(O)) //Mechs need their launch platforms. Also checks if something is anchored or has move resist INFINITY, which should stop ghost flinging. O_limit++ if(O_limit >= 20)//so no more than 20 items are sent at a time, probably for counter-lag purposes diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 5424aaa49cc..b165688f797 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -520,7 +520,7 @@ GLOBAL_LIST_EMPTY(turret_icons) if(AA.invisibility > SEE_INVISIBLE_LIVING) //Let's not do typechecks and stuff on invisible things continue - if(istype(A, /obj/mecha)) + if(ismecha(A)) var/obj/mecha/ME = A assess_and_assign(ME.occupant, targets, secondarytargets) @@ -922,7 +922,7 @@ GLOBAL_LIST_EMPTY(turret_icons) build_step = 6 return - if(istype(I, /obj/item/pen)) //you can rename turrets like bots! + if(is_pen(I)) //you can rename turrets like bots! var/t = input(user, "Enter new turret name", name, finish_name) as text t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN)) if(!t) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index e60b62e3883..5d28d900788 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -108,7 +108,7 @@ /obj/machinery/recycler/proc/eat(atom/AM0, sound = 1) var/list/to_eat = list(AM0) - if(istype(AM0, /obj/item)) + if(isitem(AM0)) to_eat += AM0.GetAllContents() var/items_recycled = 0 @@ -121,7 +121,7 @@ crush_living(AM) else emergency_stop(AM) - else if(istype(AM, /obj/item)) + else if(isitem(AM)) recycle_item(AM) items_recycled++ else diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 7c978170caa..a69eebad978 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -287,7 +287,7 @@ visible_message("[src] shuts off!") shields_down() else - if(istype(get_turf(src), /turf/space)) + if(isspaceturf(get_turf(src))) return //No wrenching these in space! WRENCH_ANCHOR_MESSAGE anchored = !anchored diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 910410727c1..14755537f61 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -38,12 +38,12 @@ // Get the turf 1 tile to the EAST. var/turf/east = locate(T.x + 1, T.y, T.z) - if(istype(east, /turf/simulated/floor)) + if(isfloorturf(east)) new /obj/machinery/conveyor/auto(east, WEST) // Get the turf 1 tile to the WEST. var/turf/west = locate(T.x - 1, T.y, T.z) - if(istype(west, /turf/simulated/floor)) + if(isfloorturf(west)) new /obj/machinery/conveyor/auto(west, WEST) /obj/machinery/transformer/power_change() @@ -156,12 +156,12 @@ // Get the turf 2 tiles to the EAST. var/turf/east2 = locate(T.x + 2, T.y, T.z) - if(istype(east2, /turf/simulated/floor)) + if(isfloorturf(east2)) new /obj/machinery/conveyor/auto(east2, EAST) // Get the turf 2 tiles to the WEST. var/turf/west2 = locate(T.x - 2, T.y, T.z) - if(istype(west2, /turf/simulated/floor)) + if(isfloorturf(west2)) new /obj/machinery/conveyor/auto(west2, EAST) /obj/machinery/transformer/xray/power_change() diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index c968a6d36a7..a0af9e3a5be 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -26,7 +26,7 @@ set category = "Object" set src in oview(1) - if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check. + if(!isliving(usr)) //ew ew ew usr, but it's the only way to check. return if( state != 4 ) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 463688e04eb..7f1c1ea2bac 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -230,8 +230,8 @@ switch(mode) if(MECH_RCD_MODE_DECONSTRUCT) - if(istype(target, /turf/simulated/wall)) - if((istype(target, /turf/simulated/wall/r_wall) && !canRwall) || istype(target, /turf/simulated/wall/indestructible)) + if(iswallturf(target)) + if((isreinforcedwallturf(target) && !canRwall) || istype(target, /turf/simulated/wall/indestructible)) return 0 var/turf/simulated/wall/W = target occupant_message("Deconstructing [target]...") @@ -239,7 +239,7 @@ chassis.spark_system.start() W.ChangeTurf(/turf/simulated/floor/plating) playsound(W, usesound, 50, 1) - else if(istype(target, /turf/simulated/floor)) + else if(isfloorturf(target)) var/turf/simulated/floor/F = target occupant_message("Deconstructing [target]...") if(do_after_cooldown(F)) @@ -254,14 +254,14 @@ qdel(target) playsound(target, usesound, 50, 1) if(MECH_RCD_MODE_WALL_OR_FLOOR) - if(istype(target, /turf/space)) + if(isspaceturf(target)) var/turf/space/S = target occupant_message("Building Floor...") if(do_after_cooldown(S)) S.ChangeTurf(/turf/simulated/floor/plating) playsound(S, usesound, 50, 1) chassis.spark_system.start() - else if(istype(target, /turf/simulated/floor)) + else if(isfloorturf(target)) var/turf/simulated/floor/F = target occupant_message("Building Wall...") if(do_after_cooldown(F)) @@ -269,7 +269,7 @@ playsound(F, usesound, 50, 1) chassis.spark_system.start() if(MECH_RCD_MODE_AIRLOCK) - if(istype(target, /turf/simulated/floor)) + if(isfloorturf(target)) occupant_message("Building Airlock...") if(do_after_cooldown(target)) chassis.spark_system.start() @@ -318,7 +318,7 @@ if(!action_checks(target) || get_dist(chassis, target)>3) return - if(istype(target, /turf/simulated/floor)) + if(isfloorturf(target)) occupant_message("Building Wall...") if(do_after_cooldown(target)) new /obj/structure/barricade/mime/mrcd(target) @@ -416,7 +416,7 @@ last_piece = null /obj/item/mecha_parts/mecha_equipment/cable_layer/proc/dismantleFloor(turf/new_turf) - if(istype(new_turf, /turf/simulated/floor)) + if(isfloorturf(new_turf)) var/turf/simulated/floor/T = new_turf if(!istype(T, /turf/simulated/floor/plating)) if(!T.broken && !T.burnt) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 6f24077fb83..11c3ae8a0de 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -210,7 +210,7 @@ /obj/machinery/mecha_part_fabricator/proc/build_design_timer_finish(datum/design/D, list/final_cost) // Spawn the item (in a lockbox if restricted) OR mob (e.g. IRC body) var/atom/A = new D.build_path(get_step(src, output_dir)) - if(istype(A, /obj/item)) + if(isitem(A)) var/obj/item/I = A I.materials = final_cost if(D.locked) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d4c5f70ad52..ab850bf4a42 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1209,7 +1209,7 @@ /obj/mecha/proc/pilot_is_mmi() var/atom/movable/mob_container - if(istype(occupant, /mob/living/carbon/brain)) + if(isbrain(occupant)) var/mob/living/carbon/brain/brain = occupant mob_container = brain.container if(istype(mob_container, /obj/item/mmi)) diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index c4ca1069cd6..37b2a9e720a 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -156,7 +156,7 @@ qdel(src) /obj/item/mecha_parts/mecha_tracking/proc/in_mecha() - if(istype(loc, /obj/mecha)) + if(ismecha(loc)) return loc return FALSE diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 9268b006c45..fc2a414eddd 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -28,7 +28,7 @@ if(metal) var/turf/T = get_turf(src) - if(istype(T, /turf/space) && !istype(T, /turf/space/transit)) + if(isspaceturf(T) && !istype(T, /turf/space/transit)) T.ChangeTurf(/turf/simulated/floor/plating/metalfoam) var/turf/simulated/floor/plating/metalfoam/MF = get_turf(src) MF.metal = metal diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 19284d6352d..4b9c7fb573a 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -149,7 +149,7 @@ var/blast = FALSE /datum/effect_system/smoke_spread/freezing/proc/Chilled(atom/A) - if(istype(A, /turf/simulated)) + if(issimulatedturf(A)) var/turf/simulated/T = A if(T.air) var/datum/gas_mixture/G = T.air diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index bbb9909e00e..031b5552ded 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -43,7 +43,7 @@ return TRUE if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider) || isterrorspider(mover)) return TRUE - else if(istype(mover, /mob/living)) + else if(isliving(mover)) if(prob(50)) to_chat(mover, "You get stuck in [src] for a moment.") return FALSE diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index bb2233d5785..0c32af8759b 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -156,10 +156,10 @@ //------- TURF FIRES ------- if(T) - if(flame_dist && prob(40) && !istype(T, /turf/space) && !T.density) + if(flame_dist && prob(40) && !isspaceturf(T) && !T.density) new /obj/effect/hotspot(T) //Mostly for ambience! if(dist > 0) - if(istype(T, /turf/simulated)) + if(issimulatedturf(T)) var/turf/simulated/S = T var/affecting_level if(dist == 1) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 80b5a32c17c..920c1c34053 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -147,7 +147,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons . = ..() for(var/path in actions_types) new path(src, action_icon[path], action_icon_state[path]) - if(istype(loc, /obj/item/storage)) //marks all items in storage as being such + if(isstorage(loc)) //marks all items in storage as being such in_storage = TRUE /obj/item/proc/determine_move_resist() @@ -299,7 +299,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage H.UpdateDamageIcon() - if(istype(src.loc, /obj/item/storage)) + if(isstorage(src.loc)) //If the item is in a storage item, take it out var/obj/item/storage/S = src.loc S.remove_from_storage(src) @@ -348,7 +348,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons // Due to storage type consolidation this should get used more now. // I have cleaned it up a little, but it could probably use more. -Sayu /obj/item/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/storage)) + if(isstorage(I)) var/obj/item/storage/S = I if(S.use_to_pickup) if(S.pickup_all_on_tile) //Mode is set to collect all items on a tile and we clicked on a valid one. @@ -376,7 +376,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons else if(S.can_be_inserted(src)) S.handle_item_insertion(src) else if(istype(I, /obj/item/stack/tape_roll)) - if(istype(src, /obj/item/storage)) //Don't tape the bag if we can put the duct tape inside it instead + if(isstorage(src)) //Don't tape the bag if we can put the duct tape inside it instead var/obj/item/storage/bag = src if(bag.can_be_inserted(I)) return ..() @@ -740,7 +740,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(!user || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || src == I) return - if(loc && I.loc == loc && istype(loc, /obj/item/storage) && loc.Adjacent(user)) // Are we trying to swap two items in the storage? + if(loc && I.loc == loc && isstorage(loc) && loc.Adjacent(user)) // Are we trying to swap two items in the storage? var/obj/item/storage/S = loc S.swap_items(src, I, user) remove_outline() //get rid of the hover effect in case the mouse exit isn't called if someone drags and drops an item and somthing goes wrong diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 22bdabf71d6..0b8009da412 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -271,15 +271,15 @@ //TODO: much much more. Unnamed airlocks, cameras, etc. /obj/item/areaeditor/proc/check_tile_is_border(turf/T2, dir) - if(istype(T2, /turf/space)) + if(isspaceturf(T2)) return BORDER_SPACE //omg hull breach we all going to die here if(get_area_type(T2.loc)!=AREA_SPACE) return BORDER_BETWEEN - if(istype(T2, /turf/simulated/wall)) + if(iswallturf(T2)) return BORDER_2NDTILE - if(istype(T2, /turf/simulated/mineral)) + if(ismineralturf(T2)) return BORDER_2NDTILE - if(!istype(T2, /turf/simulated)) + if(!issimulatedturf(T2)) return BORDER_BETWEEN for(var/obj/structure/window/W in T2) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 48d36d9ceac..df6f51fa9b7 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -29,7 +29,7 @@ /obj/structure/closet/body_bag/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/pen)) + if(is_pen(I)) var/t = rename_interactive(user, I) if(isnull(t)) return diff --git a/code/game/objects/items/devices/autopsy.dm b/code/game/objects/items/devices/autopsy.dm index 4c632e9cb3e..5953d1ad1ee 100644 --- a/code/game/objects/items/devices/autopsy.dm +++ b/code/game/objects/items/devices/autopsy.dm @@ -66,7 +66,7 @@ chemtraces += V /obj/item/autopsy_scanner/attackby(obj/item/P, mob/user) - if(istype(P, /obj/item/pen)) + if(is_pen(P)) var/dead_name = input("Insert name of deceased individual") var/dead_rank = input("Insert rank of deceased individual") var/dead_tod = input("Insert time of death") diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index bde004ccba3..5265c92439c 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -148,7 +148,7 @@ master.disrupt() /obj/effect/dummy/chameleon/relaymove(mob/user, direction) - if(!isturf(loc) || istype(loc, /turf/space) || !direction) + if(!isturf(loc) || isspaceturf(loc) || !direction) return // No magical movement! if(can_move) diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 71585752d8f..0fcf8ad9c19 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -112,7 +112,7 @@ qdel(L) return - if(istype(I, /obj/item/storage)) + if(isstorage(I)) var/obj/item/storage/S = I var/found_lightbulbs = FALSE var/replaced_something = TRUE diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 184f7739a76..862fbeb0fc4 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -242,7 +242,7 @@ if(pai.master_dna) return var/mob/M = usr - if(!istype(M, /mob/living/carbon)) + if(!iscarbon(M)) to_chat(usr, "You don't have any DNA, or your DNA is incompatible with this device.") else var/datum/dna/dna = usr.dna diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 045b0b30765..4aa61015d4f 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -338,7 +338,7 @@ update_icon(UPDATE_OVERLAYS) /obj/item/tape/attackby(obj/item/I, mob/user) - if(istype(I, /obj/item/pen)) + if(is_pen(I)) rename_interactive(user, I) /obj/item/tape/screwdriver_act(mob/living/user, obj/item/I) diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 861e9136220..46407f7e2cf 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -125,7 +125,7 @@ to_chat(M, "[src] will not work here!") /obj/item/teleporter/proc/tile_check(turf/T) - if(istype(T, /turf/simulated/floor) || istype(T, /turf/space)) + if(isfloorturf(T) || isspaceturf(T)) return TRUE /obj/item/teleporter/proc/dir_correction(mob/user) //Direction movement, screws with teleport distance and saving throw, and thus must be removed first diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index f366f2ac1e5..c2fe19a4dd2 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -375,7 +375,7 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( )) /obj/item/stack/sheet/cardboard/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/stamp/clown) && !istype(loc, /obj/item/storage)) + if(istype(I, /obj/item/stamp/clown) && !isstorage(loc)) var/atom/droploc = drop_location() if(use(1)) playsound(I, 'sound/items/bikehorn.ogg', 50, 1, -1) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 046ede2c5c3..23142e79b34 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -207,10 +207,10 @@ to_chat(usr, "There is another [R.title] here!") return FALSE - if(R.on_floor && !istype(get_turf(src), /turf/simulated)) + if(R.on_floor && !issimulatedturf(get_turf(src))) to_chat(usr, "\The [R.title] must be constructed on the floor!") return FALSE - if(R.on_floor_or_lattice && !(istype(get_turf(src), /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src))) + if(R.on_floor_or_lattice && !(issimulatedturf(get_turf(src)) || locate(/obj/structure/lattice) in get_turf(src))) to_chat(usr, "\The [R.title] must be constructed on the floor or lattice!") return FALSE @@ -252,12 +252,12 @@ src = null //dont kill proc after qdel() usr.unEquip(oldsrc, 1) qdel(oldsrc) - if(istype(O, /obj/item)) + if(isitem(O)) usr.put_in_hands(O) O.add_fingerprint(usr) //BubbleWrap - so newly formed boxes are empty - if(istype(O, /obj/item/storage)) + if(isstorage(O)) for(var/obj/item/I in O) qdel(I) //BubbleWrap END diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 859e6c6eada..4962a752622 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -440,7 +440,7 @@ */ /obj/item/rcd/proc/mode_decon(atom/A, mob/user) if(iswallturf(A)) - if(istype(A, /turf/simulated/wall/r_wall) && !canRwall) + if(isreinforcedwallturf(A) && !canRwall) return FALSE if(istype(A, /turf/simulated/wall/indestructible)) return FALSE diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index 6562784552f..42e0f353562 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -55,7 +55,7 @@ RSF /obj/item/rsf/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return - if(!(istype(A, /obj/structure/table) || istype(A, /turf/simulated/floor))) + if(!(istype(A, /obj/structure/table) || isfloorturf(A))) return var/spawn_location var/turf/T = get_turf(A) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 082ad69ca61..51876a471b0 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -382,7 +382,7 @@ return if(istype(O, /obj/item/card/id)) var/obj/item/card/id/I = O - if(istype(user, /mob/living) && user.mind) + if(isliving(user) && user.mind) if(user.mind.special_role) to_chat(usr, "The card's microscanners activate as you pass it over \the [I], copying its access.") src.access |= I.access //Don't copy access if user isn't an antag -- to prevent metagaming diff --git a/code/game/objects/items/weapons/caution.dm b/code/game/objects/items/weapons/caution.dm index c57013c1dd8..7dbd03facb4 100644 --- a/code/game/objects/items/weapons/caution.dm +++ b/code/game/objects/items/weapons/caution.dm @@ -46,7 +46,7 @@ /obj/item/caution/proximity_sign/HasProximity(atom/movable/AM) if(armed) - if(istype(AM, /mob/living/carbon) && !istype(AM, /mob/living/carbon/brain)) + if(iscarbon(AM) && !isbrain(AM)) var/mob/living/carbon/C = AM if(C.m_intent != MOVE_INTENT_WALK) src.visible_message("[src] beeps, \"Running on wet floors is hazardous to your health.\"") diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 4148c08c1bf..372c2bb6ea5 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -153,7 +153,7 @@ if(target) if(!QDELETED(target)) location = get_turf(target) - if(!ex_breach && istype(target, /turf/simulated/wall)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space. + if(!ex_breach && iswallturf(target)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space. var/turf/simulated/wall/W = target W.dismantle_wall(TRUE, TRUE) else diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 2a9dba2301a..7317c884d5b 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -46,7 +46,7 @@ /obj/item/implantcase/attackby(obj/item/W, mob/user) ..() - if(istype(W, /obj/item/pen)) + if(is_pen(W)) rename_interactive(user, W) else if(istype(W, /obj/item/implanter)) var/obj/item/implanter/I = W diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 8f56a57a9c5..a29e04483a4 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -41,7 +41,7 @@ /obj/item/implanter/attackby(obj/item/W, mob/user, params) ..() - if(istype(W, /obj/item/pen)) + if(is_pen(W)) rename_interactive(user, W) /obj/item/implanter/Initialize(mapload) diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm index f29a675070d..6742c041621 100644 --- a/code/game/objects/items/weapons/legcuffs.dm +++ b/code/game/objects/items/weapons/legcuffs.dm @@ -92,7 +92,7 @@ /obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj, oldloc) if(armed && isturf(src.loc)) - if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/hostile/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator)) + if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !isconstruct(AM) && !isshade(AM) && !istype(AM, /mob/living/simple_animal/hostile/viscerator)) var/mob/living/L = AM armed = FALSE update_icon() diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm index 2279f8423e4..36e4eff2089 100644 --- a/code/game/objects/items/weapons/pneumaticCannon.dm +++ b/code/game/objects/items/weapons/pneumaticCannon.dm @@ -56,7 +56,7 @@ if(loadedWeightClass >= maxWeightClass) to_chat(user, "\The [src] can't hold any more items!") return - if(istype(W, /obj/item)) + if(isitem(W)) var/obj/item/IW = W if(IW.flags & (ABSTRACT | NODROP | DROPDEL)) to_chat(user, "You can't put [IW] into [src]!") @@ -83,7 +83,7 @@ return TRUE /obj/item/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params) - if(istype(target, /obj/item/storage)) //So you can store it in backpacks + if(isstorage(target)) //So you can store it in backpacks return ..() if(istype(target, /obj/structure/closet)) //So you can store it in closets return ..() diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm index e218ca3fba2..0a3d70aa09e 100644 --- a/code/game/objects/items/weapons/shards.dm +++ b/code/game/objects/items/weapons/shards.dm @@ -50,7 +50,7 @@ return if(isturf(AM)) return - if(istype(AM, /obj/item/storage)) + if(isstorage(AM)) return if(ishuman(user)) var/mob/living/carbon/human/H = user diff --git a/code/game/objects/items/weapons/signs.dm b/code/game/objects/items/weapons/signs.dm index 40e627a3375..9697c084c0c 100644 --- a/code/game/objects/items/weapons/signs.dm +++ b/code/game/objects/items/weapons/signs.dm @@ -13,7 +13,7 @@ var/label = "" /obj/item/picket_sign/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/pen) || istype(W, /obj/item/toy/crayon)) + if(is_pen(W) || istype(W, /obj/item/toy/crayon)) var/txt = stripped_input(user, "What would you like to write on the sign?", "Sign Label", null , 30) if(txt) label = txt diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index e2ef0fb6487..e394affd562 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -60,7 +60,7 @@ user.visible_message("[user] begins to smear [src] on \the [target.name].") if(do_after(user, cleanspeed, target = target)) to_chat(user, "You 'clean' \the [target.name].") - if(istype(target, /turf/simulated)) + if(issimulatedturf(target)) new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target) else if(istype(target,/mob/living/carbon)) for(var/obj/item/carried_item in target.contents) diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 33cb6c44caf..ab46e89992e 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -746,7 +746,7 @@ icon_state = "[item_state]_closed" /obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/pen)) + if(is_pen(W)) //if a pen is used on the sack, dialogue to change its design appears if(contents.len) to_chat(user, "You can't modify [src] with items still inside!") diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index bec27a42a6d..626a29df431 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -297,7 +297,7 @@ return ..() /obj/item/storage/pill_bottle/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen)) + if(is_pen(I) || istype(I, /obj/item/flashlight/pen)) rename_interactive(user, I) else return ..() diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index caaf888573c..9dd44b8e65f 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -98,7 +98,7 @@ return var/mob/M = usr - if(istype(M.loc, /obj/mecha) || M.incapacitated(FALSE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated + if(ismecha(M.loc) || M.incapacitated(FALSE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated return if(over_object == M && Adjacent(M)) // this must come before the screen objects only block @@ -170,7 +170,7 @@ L += S.return_inv() for(var/obj/item/gift/G in src) L += G.gift - if(istype(G.gift, /obj/item/storage)) // If the gift contains a storage item + if(isstorage(G.gift)) // If the gift contains a storage item var/obj/item/storage/S = G.gift L += S.return_inv() for(var/obj/item/folder/F in src) @@ -361,7 +361,7 @@ to_chat(usr, "[src] cannot hold [I].") return FALSE - if(length(cant_hold) && istype(I, /obj/item/storage)) //Checks nested storage contents for restricted objects, we don't want people sneaking the NAD in via boxes now, do we? + if(length(cant_hold) && isstorage(I)) //Checks nested storage contents for restricted objects, we don't want people sneaking the NAD in via boxes now, do we? var/obj/item/storage/S = I for(var/obj/A in S.return_inv()) if(is_type_in_typecache(A, cant_hold)) @@ -383,7 +383,7 @@ to_chat(usr, "[src] is full, make some space.") return FALSE - if(I.w_class >= w_class && istype(I, /obj/item/storage)) + if(I.w_class >= w_class && isstorage(I)) if(!istype(src, /obj/item/storage/backpack/holding)) //BoHs should be able to hold backpacks again. The override for putting a BoH in a BoH is in backpack.dm. if(!stop_messages) to_chat(usr, "[src] cannot hold [I] as it's a storage item of the same size.") @@ -649,7 +649,7 @@ while(cur_atom && !(cur_atom in container.contents)) if(isarea(cur_atom)) return -1 - if(istype(cur_atom.loc, /obj/item/storage)) + if(isstorage(cur_atom.loc)) depth++ cur_atom = cur_atom.loc @@ -670,7 +670,7 @@ while(cur_atom && !isturf(cur_atom)) if(isarea(cur_atom)) return -1 - if(istype(cur_atom.loc, /obj/item/storage)) + if(isstorage(cur_atom.loc)) depth++ cur_atom = cur_atom.loc diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 20fa14aa343..013b4893559 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -817,12 +817,12 @@ Z.gib() playsound(user, 'sound/weapons/marauder.ogg', 50, 1) if(wielded) - if(istype(A, /turf/simulated/wall)) + if(iswallturf(A)) var/turf/simulated/wall/Z = A Z.ex_act(2) charged = 3 playsound(user, 'sound/weapons/marauder.ogg', 50, 1) - else if(istype(A, /obj/structure) || istype(A, /obj/mecha)) + else if(istype(A, /obj/structure) || ismecha(A)) var/obj/Z = A Z.ex_act(2) charged = 3 diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index e25c6480b32..ada9482cfd6 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -129,7 +129,7 @@ /obj/structure/alien/weeds/New(pos, node) ..() linked_node = node - if(istype(loc, /turf/space)) + if(isspaceturf(loc)) qdel(src) return if(icon_state == "weeds") @@ -146,7 +146,7 @@ /obj/structure/alien/weeds/proc/Life() var/turf/U = get_turf(src) - if(istype(U, /turf/space)) + if(isspaceturf(U)) qdel(src) return @@ -155,7 +155,7 @@ for(var/turf/T in U.GetAtmosAdjacentTurfs()) - if(locate(/obj/structure/alien/weeds) in T || istype(T, /turf/space)) + if(locate(/obj/structure/alien/weeds) in T || isspaceturf(T)) continue new /obj/structure/alien/weeds(T, linked_node) diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 91bc6174318..b54e4657a8c 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -71,7 +71,7 @@ M.show_message("\The [src] has been cut apart by [user] with \the [WC].", 3, "You hear cutting.", 2) qdel(src) return - if(istype(W, /obj/item/pen)) + if(is_pen(W)) var/decalselection = input("Please select a decal") as null|anything in list("Atmospherics", "Bartender", "Barber", "Blueshield", "Captain", "Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Assistant", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP", "HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Medical", "Mime", "Mining", "NT Representative", "Paramedic", diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index 8f93ccfe7da..73155a57a96 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -39,7 +39,7 @@ to_chat(user, " You disable the locking modules.") update_icon(UPDATE_ICON_STATE) return - else if(istype(O, /obj/item)) + else if(isitem(O)) user.changeNext_move(CLICK_CD_MELEE) var/obj/item/W = O if(smashed || localopened) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 0cbca570b34..ba0b74b936b 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -57,7 +57,7 @@ . += "There is a small paper placard on the assembly[doorname]." /obj/structure/door_assembly/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/pen)) + if(is_pen(W)) // The door assembly gets renamed to "Assembly - Foobar", // but the `t` returned from the proc is just "Foobar" without the prefix. var/t = rename_interactive(user, W) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index b38335df9d0..a317cbb75eb 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -128,7 +128,7 @@ to_chat(user, "[src] is blocked!") return TRUE - if(!istype(T, /turf/simulated/floor)) + if(!isfloorturf(T)) to_chat(user, "[src] bolts must be tightened on the floor!") return TRUE user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.") diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index a2bb074fd75..e6f1103fb57 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -156,7 +156,7 @@ deconstruct() /obj/structure/grille/screwdriver_act(mob/user, obj/item/I) - if(!(anchored || istype(loc, /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src))) + if(!(anchored || issimulatedturf(loc) || locate(/obj/structure/lattice) in get_turf(src))) return . = TRUE if(shock(user, 90)) diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 9dc455fa8dc..9f154632a2d 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -148,7 +148,7 @@ operate() else operate() - else if(istype(user, /obj/mecha)) + else if(ismecha(user)) operate() /obj/structure/inflatable/door/proc/operate() diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 1a8ad73211c..bef27095511 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -78,7 +78,7 @@ operate() else operate() - else if(istype(user, /obj/mecha)) + else if(ismecha(user)) operate() /obj/structure/mineral_door/proc/operate() diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index d781b6aebcf..8b59023dc16 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -133,7 +133,7 @@ return /obj/structure/morgue/attackby(P as obj, mob/user as mob, params) - if(istype(P, /obj/item/pen)) + if(is_pen(P)) var/t = rename_interactive(user, P) if(isnull(t)) @@ -355,7 +355,7 @@ GLOBAL_LIST_EMPTY(crematoriums) update_icon(UPDATE_OVERLAYS) /obj/structure/crematorium/attackby(P as obj, mob/user as mob, params) - if(istype(P, /obj/item/pen)) + if(is_pen(P)) rename_interactive(user, P) add_fingerprint(user) return diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index 8d980204638..5ffc0ab9d50 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -65,11 +65,11 @@ var/obj/item/P = locate(href_list["write"]) if((P && P.loc == src)) //ifthe paper's on the board - if(istype(usr.r_hand, /obj/item/pen)) //and you're holding a pen + if(is_pen(usr.r_hand)) //and you're holding a pen add_fingerprint(usr) P.attackby(usr.r_hand, usr) //then do ittttt else - if(istype(usr.l_hand, /obj/item/pen)) //check other hand for pen + if(is_pen(usr.l_hand)) //check other hand for pen add_fingerprint(usr) P.attackby(usr.l_hand, usr) else diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 1c3ab77b135..2bf047fac99 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -88,7 +88,7 @@ occupant.Weaken(12 SECONDS) occupant.Stuttering(12 SECONDS) playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1) - if(istype(A, /mob/living)) + if(isliving(A)) var/mob/living/victim = A victim.Weaken(12 SECONDS) victim.Stuttering(12 SECONDS) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index ac1ea5a9e7b..e7ecab3b8d5 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -177,7 +177,7 @@ /obj/structure/table/MouseDrop_T(obj/O, mob/user) ..() - if((!( istype(O, /obj/item) ) || user.get_active_hand() != O)) + if((!( isitem(O) ) || user.get_active_hand() != O)) return if(isrobot(user)) return @@ -841,7 +841,7 @@ . = . || mover.checkpass(PASSTABLE) /obj/structure/rack/MouseDrop_T(obj/O, mob/user) - if((!( istype(O, /obj/item) ) || user.get_active_hand() != O)) + if((!( isitem(O) ) || user.get_active_hand() != O)) return if(isrobot(user)) return diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index ec6bc72e8f8..bb76a2c5266 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -165,7 +165,7 @@ else W.forceMove(loc) - else if(istype(W, /obj/item/pen)) + else if(is_pen(W)) var/t = rename_interactive(user, W) if(!isnull(t)) created_name = t diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index de18fc311ba..e4993d8c10c 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -131,7 +131,7 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama return ChangeTurf(/turf/simulated/floor/plating) /turf/simulated/floor/ChangeTurf(turf/simulated/floor/T, defer_change = FALSE, keep_icon = TRUE, ignore_air = FALSE, copy_existing_baseturf = TRUE) - if(!istype(src, /turf/simulated/floor)) + if(!isfloorturf(src)) return ..() //fucking turfs switch the fucking src of the fucking running procs if(!ispath(T, /turf/simulated/floor)) return ..() diff --git a/code/game/turfs/simulated/floor/asteroid.dm b/code/game/turfs/simulated/floor/asteroid.dm index ace8fef10c2..6b07f173231 100644 --- a/code/game/turfs/simulated/floor/asteroid.dm +++ b/code/game/turfs/simulated/floor/asteroid.dm @@ -292,7 +292,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me for(var/thing in urange(12, T)) //prevents mob clumps if(!ishostile(thing) && !istype(thing, /obj/structure/spawner)) continue - if((ispath(randumb, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(thing)) && get_dist(T, thing) <= 7) + if((ismegafauna(randumb) || ismegafauna(thing)) && get_dist(T, thing) <= 7) return //if there's a megafauna within standard view don't spawn anything at all if(ispath(randumb, /mob/living/simple_animal/hostile/asteroid) || istype(thing, /mob/living/simple_animal/hostile/asteroid)) return //if the random is a standard mob, avoid spawning if there's another one within 12 tiles diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8160f78a5b0..7134fd8049d 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -304,10 +304,10 @@ var/turf_count = 0 for(var/turf/T in atmos_adjacent_turfs) - if(istype(T, /turf/space))//Counted as no air + if(isspaceturf(T))//Counted as no air turf_count++//Considered a valid turf for air calcs continue - else if(istype(T, /turf/simulated/floor)) + else if(isfloorturf(T)) var/turf/simulated/S = T if(S.air)//Add the air's contents to the holders aoxy += S.air.oxygen diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 01982df37c9..79f97a90c32 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -893,7 +893,7 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space if(!frommob.ckey) return 0 - if(istype(tothing, /obj/item)) + if(isitem(tothing)) var/mob/living/toitem = tothing var/ask = alert("Are you sure you want to allow [frommob.name]([frommob.key]) to possess [toitem.name]?", "Place ghost in control of item?", "Yes", "No") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a7b2fa0753a..028a6e0ac66 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -787,7 +787,7 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list( return if(!istype(H)) - if(istype(H, /mob/living/carbon/brain)) + if(isbrain(H)) var/mob/living/carbon/brain/B = H if(istype(B.container, /obj/item/mmi/robotic_brain/positronic)) var/obj/item/mmi/robotic_brain/positronic/C = B.container @@ -813,7 +813,7 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list( return if(!istype(H)) - if(istype(H, /mob/living/carbon/brain)) + if(isbrain(H)) var/mob/living/carbon/brain/B = H if(istype(B.container, /obj/item/mmi/robotic_brain/positronic)) var/obj/item/mmi/robotic_brain/positronic/C = B.container diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index dd1212af73e..7eb73e0ea86 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2667,7 +2667,7 @@ if(istype(O,/mob)) var/mob/M = O M.real_name = obj_name - if(where == "inhand" && isliving(usr) && istype(O, /obj/item)) + if(where == "inhand" && isliving(usr) && isitem(O)) var/mob/living/L = usr var/obj/item/I = O L.put_in_hands(I) @@ -2972,7 +2972,7 @@ if("fakeguns") SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Fake Guns") for(var/obj/item/W in world) - if(istype(W, /obj/item/clothing) || istype(W, /obj/item/card/id) || istype(W, /obj/item/disk) || istype(W, /obj/item/tank)) + if(isclothing(W) || istype(W, /obj/item/card/id) || istype(W, /obj/item/disk) || istype(W, /obj/item/tank)) continue W.icon = 'icons/obj/guns/projectile.dmi' W.icon_state = "revolver" diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 3ab9b9f3017..af538663c44 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -10,7 +10,7 @@ var/datum/gas_mixture/GM = target.return_air() var/burning = 0 - if(istype(target, /turf/simulated)) + if(issimulatedturf(target)) var/turf/simulated/T = target if(T.active_hotspot) burning = 1 diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 0ae0ebed05f..4eb0d468584 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -275,7 +275,7 @@ if(blocked >= 100) return 0 var/mob/living/carbon/human/H = firer - if(istype(target, /obj/item)) + if(isitem(target)) var/obj/item/I = target if(!I.anchored) to_chat(firer, "You pull [I] towards yourself.") @@ -472,7 +472,7 @@ var/obj/item/I = hitby - if(!istype(I.loc, /mob/living)) + if(!isliving(I.loc)) // Maybe it's on the ground? Maybe it's being used telekinetically? IDK return diff --git a/code/modules/antagonists/vampire/vamp_datum.dm b/code/modules/antagonists/vampire/vamp_datum.dm index d01470f4814..c3ce96ddd30 100644 --- a/code/modules/antagonists/vampire/vamp_datum.dm +++ b/code/modules/antagonists/vampire/vamp_datum.dm @@ -263,7 +263,7 @@ hud.show_hud(hud.hud_version) hud.vampire_blood_display.maptext = "