[MIRROR] some istype to macros (#9802)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-01-05 15:01:49 -07:00
committed by GitHub
parent 73486c399b
commit ed79946ade
409 changed files with 750 additions and 751 deletions

View File

@@ -91,7 +91,7 @@
/obj/item/melee/changeling/process() //Stolen from ninja swords.
if(!creator || loc != creator || !creator.item_is_in_hands(src))
// Tidy up a bit.
if(istype(loc,/mob/living))
if(isliving(loc))
var/mob/living/carbon/human/host = loc
if(istype(host))
for(var/obj/item/organ/external/organ in host.organs)

View File

@@ -15,7 +15,7 @@
set desc = "Turns yourself almost invisible, as long as you move slowly."
if(istype(src,/mob/living/carbon/human))
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(H.mind.changeling.cloaked)

View File

@@ -650,7 +650,7 @@
/obj/item/spell/construct/slam/on_melee_cast(atom/hit_atom, mob/living/user, def_zone)
var/attack_message = "slams"
if(istype(user, /mob/living/simple_mob))
if(isanimal(user))
var/mob/living/simple_mob/S = user
attack_message = pick(S.attacktext)
if(isliving(hit_atom))

View File

@@ -166,7 +166,7 @@
/obj/effect/gateway/active/Crossed(var/atom/A)
if(A.is_incorporeal())
return
if(!istype(A, /mob/living))
if(!isliving(A))
return
var/mob/living/M = A

View File

@@ -298,7 +298,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
/obj/item/book/tome/attack(mob/living/M as mob, mob/living/user as mob)
add_attack_logs(user,M,"Hit with [name]")
if(istype(M,/mob/observer/dead))
if(isobserver(M))
var/mob/observer/dead/D = M
D.manifest(user)
return
@@ -449,7 +449,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun")
r = input(user, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking
var/obj/effect/rune/R = new /obj/effect/rune
if(istype(user, /mob/living/carbon/human))
if(ishuman(user))
var/mob/living/carbon/human/H = user
R.blood_DNA = list()
R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type

View File

@@ -26,7 +26,7 @@ var/list/sacrificed = list()
allrunesloc[index] = R.loc
if(index >= 5)
to_chat(user, span_danger("You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric."))
if (istype(user, /mob/living))
if (isliving(user))
user.take_overall_damage(5, 0)
qdel(src)
if(allrunesloc && index != 0)
@@ -59,7 +59,7 @@ var/list/sacrificed = list()
runecount++
if(runecount >= 2)
to_chat(user, span_danger("You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric."))
if (istype(user, /mob/living))
if (isliving(user))
user.take_overall_damage(5, 0)
qdel(src)
for(var/mob/living/carbon/C in orange(1,src))
@@ -661,7 +661,7 @@ var/list/sacrificed = list()
for(var/mob/H in victims)
var/worth = 0
if(istype(H,/mob/living/carbon/human))
if(ishuman(H))
var/mob/living/carbon/human/lamb = H
if(lamb.species.rarity_value > 3)
worth = 1

View File

@@ -20,7 +20,7 @@
//////////////////////////////Capturing////////////////////////////////////////////////////////
/obj/item/soulstone/attack(mob/living/carbon/human/M as mob, mob/user as mob)
if(!istype(M, /mob/living/carbon/human))//If target is not a human.
if(!ishuman(M))//If target is not a human.
return ..()
if(istype(M, /mob/living/carbon/human/dummy))
return..()

View File

@@ -48,7 +48,7 @@
// Nom.
for(var/atom/movable/A in T)
if(A)
if(istype(A,/mob/living))
if(isliving(A))
qdel(A)
else if(istype(A,/mob)) // Observers, AI cameras.
continue
@@ -98,7 +98,7 @@
/turf/unsimulated/wall/supermatter/Bumped(atom/AM as mob|obj)
if(istype(AM, /mob/living))
if(isliving(AM))
var/mob/living/M = AM
var/datum/gender/T = gender_datums[M.get_visible_gender()]
AM.visible_message(span_warning("\The [AM] slams into \the [src] inducing a resonance... [T.his] body starts to glow and catch flame before flashing into ash."),\

View File

@@ -119,7 +119,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
/datum/universal_state/supermatter_cascade/proc/PlayerSet()
for(var/datum/mind/M in player_list)
if(!istype(M.current,/mob/living))
if(!isliving(M.current))
continue
if(M.current.stat!=2)
M.current.Weaken(10)

View File

@@ -32,7 +32,7 @@
if(1)
command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
if(!isnewplayer(M))
M << sound('sound/AI/meteors.ogg')
spawn(100)
meteor_wave()
@@ -44,7 +44,7 @@
if(2)
command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
if(!isnewplayer(M))
M << sound('sound/AI/granomalies.ogg')
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
@@ -148,7 +148,7 @@ var/hadevent = 0
continue
if(isNotStationLevel(T.z))
continue
if(istype(H,/mob/living/carbon/human))
if(ishuman(H))
H.apply_effect((rand(15,75)),IRRADIATE,0)
if (prob(5))
H.apply_effect((rand(90,150)),IRRADIATE,0)

View File

@@ -94,7 +94,7 @@ The "dust" will damage the hull of the station causin minor hull breaches.
spawn(0)
if(prob(50))
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)
if (A)
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)

View File

@@ -27,7 +27,7 @@
..()
/obj/item/toy/xmas_cracker/attack(mob/target, mob/user)
if( !cracked && (istype(target,/mob/living/silicon) || (istype(target,/mob/living/carbon/human) && !target.get_active_hand())) && target.stat == CONSCIOUS)
if( !cracked && (issilicon(target) || (ishuman(target) && !target.get_active_hand())) && target.stat == CONSCIOUS)
target.visible_message(span_notice("[user] and [target] pop \an [src]! *pop*"), span_notice("You pull \an [src] with [target]! *pop*"), span_notice("You hear a *pop*."))
var/obj/item/paper/Joke = new /obj/item/paper(user.loc)
Joke.name = "[pick("awful","terrible","unfunny")] joke"

View File

@@ -426,9 +426,9 @@ var/global/list/additional_antag_types = list()
for(var/mob/player in player_list)
if(!player.client)
continue
if(istype(player, /mob/new_player))
if(isnewplayer(player))
continue
if(istype(player, /mob/observer/dead) && !ghosts_only)
if(isobserver(player) && !ghosts_only)
continue
if(!role || (player.client.prefs.be_special & role))
log_debug("[player.key] had [antag_id] enabled, so we are drafting them.")

View File

@@ -133,7 +133,7 @@
/datum/game_mode/meme/check_finished()
var/memes_alive = 0
for(var/datum/mind/meme in memes)
if(!istype(meme.current,/mob/living))
if(!isliving(meme.current))
continue
if(meme.current.stat==2)
continue

View File

@@ -23,7 +23,7 @@
var/list/datum/objective/assassinate/missions = list()
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if((target != traitor) && ishuman(target.current))
if(target && target.current)
var/datum/objective/target_obj = new /datum/objective/assassinate(null,job,target)
missions += target_obj
@@ -34,7 +34,7 @@
var/list/datum/objective/frame/missions = list()
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if((target != traitor) && ishuman(target.current))
if(target && target.current)
var/datum/objective/target_obj = new /datum/objective/frame(null,job,target)
missions += target_obj
@@ -45,7 +45,7 @@
var/list/datum/objective/frame/missions = list()
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if((target != traitor) && ishuman(target.current))
if(target && target.current)
var/datum/objective/target_obj = new /datum/objective/protection(null,job,target)
missions += target_obj
@@ -388,7 +388,7 @@ datum
find_target_by_role(var/role)
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role))
if((possible_target != owner) && ishuman(possible_target.current) && (possible_target.assigned_role == role))
target = possible_target
break
@@ -404,7 +404,7 @@ datum
var/list/possible_targets = list()
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human))
if((possible_target != owner) && ishuman(possible_target.current))
possible_targets += possible_target
if(possible_targets.len > 0)
@@ -439,7 +439,7 @@ datum
find_target_by_role(var/role)
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role))
if((possible_target != owner) && ishuman(possible_target.current) && (possible_target.assigned_role == role))
target = possible_target
break
@@ -1068,7 +1068,7 @@ datum
if(steal_target)
for(var/obj/item/aicard/C in owner.current.get_contents())
for(var/mob/living/silicon/ai/M in C)
if(istype(M, /mob/living/silicon/ai) && M.stat != 2)
if(isAI(M) && M.stat != 2)
return 1
for(var/mob/living/silicon/ai/M in world)
if(istype(M.loc, /turf))
@@ -1336,7 +1336,7 @@ datum
var/current_amount
var/obj/item/rig/S
if(istype(owner.current,/mob/living/carbon/human))
if(ishuman(owner.current))
var/mob/living/carbon/human/H = owner.current
S = H.back
if(!S || !istype(S) || !S.stored_research.len)

View File

@@ -142,7 +142,7 @@ var/global/list/all_objectives = list()
return target
/datum/objective/anti_revolution/demote/check_completion()
if(target && target.current && istype(target,/mob/living/carbon/human))
if(target && target.current && ishuman(target))
var/obj/item/card/id/I = target.current:wear_id
if(istype(I, /obj/item/pda))
var/obj/item/pda/P = I
@@ -389,7 +389,7 @@ var/global/list/all_objectives = list()
if(already_completed)
return 1
if(target && target.current && istype(target.current, /mob/living/carbon/human))
if(target && target.current && ishuman(target.current))
if(target.current.stat == DEAD)
return 0
@@ -518,7 +518,7 @@ var/global/list/all_objectives = list()
for(var/obj/item/aicard/C in all_items) //Check for ai card
for(var/mob/living/silicon/ai/M in C)
if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card.
if(isAI(M) && M.stat != 2) //See if any AI's are alive inside that card.
return 1
for(var/mob/living/silicon/ai/ai in mob_list)
@@ -558,7 +558,7 @@ var/global/list/all_objectives = list()
var/current_amount
var/obj/item/rig/S
if(istype(owner.current,/mob/living/carbon/human))
if(ishuman(owner.current))
var/mob/living/carbon/human/H = owner.current
S = H.back

View File

@@ -279,7 +279,7 @@ var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance
if(H.stat || H.restrained())
return
if(!istype(H, /mob/living/carbon/human))
if(!ishuman(H))
return 1 //why does this return 1?
if(H != owner)

View File

@@ -116,7 +116,7 @@
summoned_mobs -= A
continue
// Now check for dead mobs who shouldn't be on the list.
if(istype(A, /mob/living))
if(isliving(A))
var/mob/living/L = A
if(L.stat == DEAD)
summoned_mobs -= L

View File

@@ -19,7 +19,7 @@
return 1
if(L.mind && technomancers.is_antagonist(L.mind)) // This should be done better since we might want opposing technomancers later.
return 1
if(istype(L, /mob/living/simple_mob)) // Mind controlled simple mobs count as allies too.
if(isanimal(L)) // Mind controlled simple mobs count as allies too.
var/mob/living/simple_mob/SM = L
if(owner in SM.friends)
return 1
@@ -58,4 +58,4 @@
if(!L.stat) // Don't want to target dead people or SSDs.
chosen_target = L
break
return chosen_target
return chosen_target

View File

@@ -14,12 +14,12 @@
aspect = ASPECT_TELE
/obj/item/spell/abjuration/on_ranged_cast(atom/hit_atom, mob/user)
if(istype(hit_atom, /mob/living) && pay_energy(500) && within_range(hit_atom))
if(isliving(hit_atom) && pay_energy(500) && within_range(hit_atom))
var/mob/living/L = hit_atom
var/mob/living/simple_mob/SM = null
//Bit of a roundabout typecheck, in order to test for two variables from two different mob types in one line.
if(istype(L, /mob/living/simple_mob))
if(isanimal(L))
SM = L
if(L.summoned || (SM && SM.supernatural) )
if(L.client) // Player-controlled mobs are immune to being killed by this.

View File

@@ -47,7 +47,7 @@
add_attack_logs(user,I,"Stolen with [src]")
qdel(src)
//Now let's try to teleport a living mob.
else if(istype(hit_atom, /mob/living))
else if(isliving(hit_atom))
var/mob/living/L = hit_atom
to_chat(L, span_danger("You are teleported towards \the [user]."))
var/datum/effect/effect/system/spark_spread/s1 = new /datum/effect/effect/system/spark_spread

View File

@@ -37,7 +37,7 @@
AI.wander = FALSE
AI.forget_everything()
if(istype(L, /mob/living/simple_mob))
if(isanimal(L))
var/mob/living/simple_mob/SM = L
SM.friends |= src.owner
@@ -55,7 +55,7 @@
AI.wander = initial(AI.wander)
AI.forget_everything()
if(istype(L, /mob/living/simple_mob))
if(isanimal(L))
var/mob/living/simple_mob/SM = L
SM.friends -= owner

View File

@@ -75,7 +75,7 @@
for(var/mob/living/L in view(owner))
// Spiders, carp... bears.
if(istype(L, /mob/living/simple_mob))
if(isanimal(L))
var/mob/living/simple_mob/SM = L
if(!is_ally(SM) && SM.has_AI() && SM.ai_holder.hostile)
hostile_mobs++
@@ -83,13 +83,13 @@
potential_spells |= /obj/item/spell/abjuration
// Always assume borgs are hostile.
if(istype(L, /mob/living/silicon/robot))
if(isrobot(L))
if(!istype(L, /mob/living/silicon/robot/drone)) // Drones are okay, however.
hostile_mobs++
potential_spells |= /obj/item/spell/projectile/ionic_bolt
// Finally we get to humanoids.
if(istype(L, /mob/living/carbon/human))
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(is_ally(H)) // Don't get scared by our apprentice.
continue

View File

@@ -49,11 +49,11 @@
qdel(src)
/obj/item/spell/insert/on_melee_cast(atom/hit_atom, mob/user)
if(istype(hit_atom, /mob/living))
if(isliving(hit_atom))
var/mob/living/L = hit_atom
insert(L,user)
/obj/item/spell/insert/on_ranged_cast(atom/hit_atom, mob/user)
if(istype(hit_atom, /mob/living))
if(isliving(hit_atom))
var/mob/living/L = hit_atom
insert(L,user)

View File

@@ -14,12 +14,12 @@
set_light(spell_light_range, spell_light_intensity, l_color = light_color)
/obj/item/spell/modifier/on_melee_cast(atom/hit_atom, mob/user)
if(istype(hit_atom, /mob/living))
if(isliving(hit_atom))
return on_add_modifier(hit_atom)
return FALSE
/obj/item/spell/modifier/on_ranged_cast(atom/hit_atom, mob/user)
if(istype(hit_atom, /mob/living))
if(isliving(hit_atom))
return on_add_modifier(hit_atom)
return FALSE

View File

@@ -29,7 +29,7 @@
to_chat(user, span_danger("\The [L]'s been dead for too long, even this function cannot replace cloning at this point."))
return 0
to_chat(user, span_notice("You stab \the [L] with a hidden integrated hypo, attempting to bring them back..."))
if(istype(L, /mob/living/simple_mob))
if(isanimal(L))
var/mob/living/simple_mob/SM = L
SM.health = SM.getMaxHealth() / 3
SM.set_stat(CONSCIOUS)