mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] some istype to macros (#9802)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
73486c399b
commit
ed79946ade
@@ -266,7 +266,7 @@ update_flag
|
||||
src.add_fingerprint(user)
|
||||
healthcheck()
|
||||
|
||||
if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
|
||||
if(isrobot(user) && istype(W, /obj/item/tank/jetpack))
|
||||
var/datum/gas_mixture/thejetpack = W:air_contents
|
||||
var/env_pressure = thejetpack.return_pressure()
|
||||
var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.return_pressure() - env_pressure)/2)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
/obj/machinery/meter/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/observer/dead)))
|
||||
if(get_dist(user, src) > 3 && !(isAI(user) || isobserver(user)))
|
||||
. += span_warning("You are too far away to read it.")
|
||||
|
||||
else if(stat & (NOPOWER|BROKEN))
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
/obj/machinery/meter/Click()
|
||||
|
||||
if(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine
|
||||
if(ishuman(usr) || isAI(usr)) // ghosts can call ..() for examine
|
||||
var/mob/living/L = usr
|
||||
if(!L.get_active_hand() || !L.Adjacent(src))
|
||||
usr.examinate(src)
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
/obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1)
|
||||
// The only way for AI to reactivate cameras are malf abilities, this gives them different messages.
|
||||
if(istype(user, /mob/living/silicon/ai))
|
||||
if(isAI(user))
|
||||
user = null
|
||||
|
||||
if(choice != 1)
|
||||
@@ -393,7 +393,7 @@
|
||||
return 0
|
||||
|
||||
/obj/machinery/camera/interact(mob/living/user as mob)
|
||||
if(!panel_open || istype(user, /mob/living/silicon/ai))
|
||||
if(!panel_open || isAI(user))
|
||||
return
|
||||
|
||||
if(stat & BROKEN)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
lostTarget(target)
|
||||
|
||||
/obj/machinery/camera/proc/newTarget(var/mob/target)
|
||||
if (istype(target, /mob/living/silicon/ai)) return 0
|
||||
if (isAI(target)) return 0
|
||||
if (detectTime == 0)
|
||||
detectTime = world.time // start the clock
|
||||
if (!(target in motionTargets))
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
else
|
||||
TB.names.Add(name)
|
||||
TB.namecounts[name] = 1
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
TB.humans[name] = M
|
||||
else
|
||||
TB.others[name] = M
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/cell_charger/attack_ai(mob/user)
|
||||
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough
|
||||
if(isrobot(user) && Adjacent(user)) // Borgs can remove the cell if they are near enough
|
||||
if(charging)
|
||||
user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].")
|
||||
charging.loc = src.loc
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
if((M.stat != 2) || (!M.client))
|
||||
continue
|
||||
//They need a brain!
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.has_brain())
|
||||
continue
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
if(severity >= 3) //you didn't pray hard enough
|
||||
to_chat(M, span_warning("An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit."))
|
||||
spawn(30)
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.vomit()
|
||||
if(ORION_TRAIL_FLUX)
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
if(scan)
|
||||
to_chat(usr, "You remove \the [scan] from \the [src].")
|
||||
scan.forceMove(get_turf(src))
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
if(!usr.get_active_hand() && ishuman(usr))
|
||||
usr.put_in_hands(scan)
|
||||
scan = null
|
||||
else if(modify)
|
||||
to_chat(usr, "You remove \the [modify] from \the [src].")
|
||||
modify.forceMove(get_turf(src))
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
if(!usr.get_active_hand() && ishuman(usr))
|
||||
usr.put_in_hands(modify)
|
||||
modify = null
|
||||
else
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
if(giver)
|
||||
to_chat(usr, span_notice("You remove \the [giver] from \the [src]."))
|
||||
giver.loc = get_turf(src)
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
if(!usr.get_active_hand() && ishuman(usr))
|
||||
usr.put_in_hands(giver)
|
||||
else
|
||||
giver.loc = src.loc
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
if(scan)
|
||||
to_chat(usr, "You remove \the [scan] from \the [src].")
|
||||
scan.loc = get_turf(src)
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
if(!usr.get_active_hand() && ishuman(usr))
|
||||
usr.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
sendPDAs["[P.name]"] = "\ref[P]"
|
||||
data["possibleRecipients"] = sendPDAs
|
||||
|
||||
data["isMalfAI"] = ((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.special_role && user.mind.original == user))
|
||||
data["isMalfAI"] = ((isAI(user) || isrobot(user)) && (user.mind.special_role && user.mind.original == user))
|
||||
|
||||
return data
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
temp = noserver
|
||||
//Hack the Console to get the password
|
||||
if("hack")
|
||||
if((istype(ui.user, /mob/living/silicon/ai) || istype(ui.user, /mob/living/silicon/robot)) && (ui.user.mind.special_role && ui.user.mind.original == ui.user))
|
||||
if((isAI(ui.user) || isrobot(ui.user)) && (ui.user.mind.special_role && ui.user.mind.original == ui.user))
|
||||
hacking = 1
|
||||
update_icon()
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
if(scan)
|
||||
to_chat(usr, "You remove \the [scan] from \the [src].")
|
||||
scan.loc = get_turf(src)
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
if(!usr.get_active_hand() && ishuman(usr))
|
||||
usr.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/attack_alien(var/mob/user) //Familiar, right? Doors. -Mechoid
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
if(src.locked || src.welded)
|
||||
@@ -999,7 +999,7 @@ About the new airlock wires panel:
|
||||
else
|
||||
to_chat(user, span_warning("[hold_open] is holding \the [src] open!"))
|
||||
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
src.attack_alien(user)
|
||||
@@ -1169,7 +1169,7 @@ About the new airlock wires panel:
|
||||
|
||||
src.add_fingerprint(user)
|
||||
if (attempt_vr(src,"attackby_vr",list(C, user))) return
|
||||
if(istype(C, /mob/living))
|
||||
if(isliving(C))
|
||||
..()
|
||||
return
|
||||
//VOREstation Edit: Removing material cost from repair requirements
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
//Proc: attack_hand
|
||||
//Description: Attacked with empty hand. Only to allow special attack_bys.
|
||||
/obj/machinery/door/blast/attack_hand(mob/user as mob)
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
src.attack_alien(user)
|
||||
@@ -217,7 +217,7 @@
|
||||
// Parameters: Attacking Xeno mob.
|
||||
// Description: Forces open the door after a delay.
|
||||
/obj/machinery/door/blast/attack_alien(var/mob/user) //Familiar, right? Doors.
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
if(src.density)
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
else
|
||||
do_animate("deny")
|
||||
|
||||
if(istype(AM, /mob/living/bot))
|
||||
if(isbot(AM))
|
||||
var/mob/living/bot/bot = AM
|
||||
if(src.check_access(bot.botcard))
|
||||
if(density)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
if(operating)
|
||||
return//Already doing something.
|
||||
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
src.attack_alien(user)
|
||||
@@ -195,7 +195,7 @@
|
||||
close()
|
||||
|
||||
/obj/machinery/door/firedoor/attack_alien(var/mob/user) //Familiar, right? Doors.
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/X = user
|
||||
if(istype(X.species, /datum/species/xenos))
|
||||
if(src.blocked)
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
/obj/machinery/door/window/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.species.can_shred(H))
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
|
||||
@@ -278,7 +278,7 @@ Just a object used in constructing fire alarms
|
||||
ASSERT(isarea(A))
|
||||
var/d1
|
||||
var/d2
|
||||
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
|
||||
if(ishuman(user) || isAI(user))
|
||||
|
||||
if(A.party)
|
||||
d1 = text("<A href='byond://?src=\ref[];reset=1'>No Party :(</A>", src)
|
||||
@@ -329,7 +329,7 @@ Just a object used in constructing fire alarms
|
||||
..()
|
||||
if(usr.stat || stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (isAI(usr)))
|
||||
usr.machine = src
|
||||
if(href_list["reset"])
|
||||
reset()
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
continue
|
||||
|
||||
var/flash_time = strength
|
||||
if(istype(O, /mob/living/carbon/human))
|
||||
if(ishuman(O))
|
||||
var/mob/living/carbon/human/H = O
|
||||
//VOREStation Edit Start
|
||||
if(H.nif && H.nif.flag_check(NIF_V_FLASHPROT,NIF_FLAGS_VISION))
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
visible_message("\The [src] shuts down.")
|
||||
|
||||
/obj/machinery/floodlight/attack_ai(mob/user as mob)
|
||||
if(istype(user, /mob/living/silicon/robot) && Adjacent(user))
|
||||
if(isrobot(user) && Adjacent(user))
|
||||
return attack_hand(user)
|
||||
|
||||
if(on)
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
set name = "Toggle Mode"
|
||||
set src in view(1)
|
||||
|
||||
if(!istype(usr, /mob/living))
|
||||
if(!isliving(usr))
|
||||
to_chat(usr, span_warning("You can't do that."))
|
||||
return
|
||||
|
||||
|
||||
@@ -171,7 +171,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)
|
||||
|
||||
@@ -668,7 +668,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
return "Unknown"
|
||||
|
||||
/obj/machinery/newscaster/proc/scan_user(mob/living/user)
|
||||
if(istype(user,/mob/living/carbon/human)) //User is a human
|
||||
if(ishuman(user)) //User is a human
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
var/obj/item/card/id/I = human_user.GetIdCard()
|
||||
if(I)
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/recharger/attack_ai(mob/user)
|
||||
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough
|
||||
if(isrobot(user) && Adjacent(user)) // Borgs can remove the cell if they are near enough
|
||||
if(charging)
|
||||
user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].")
|
||||
charging.update_icon()
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
return
|
||||
if (istype(O, /obj/item/grab) && get_dist(src,user)<2)
|
||||
var/obj/item/grab/G = O
|
||||
if(istype(G.affecting,/mob/living))
|
||||
if(isliving(G.affecting))
|
||||
var/mob/living/M = G.affecting
|
||||
qdel(O)
|
||||
go_in(M)
|
||||
@@ -252,7 +252,7 @@
|
||||
if(occupant)
|
||||
return
|
||||
|
||||
if(istype(L, /mob/living/silicon/robot))
|
||||
if(isrobot(L))
|
||||
var/mob/living/silicon/robot/R = L
|
||||
|
||||
if(R.incapacitated())
|
||||
@@ -273,7 +273,7 @@
|
||||
return 1
|
||||
|
||||
//VOREStation Add Start
|
||||
else if(istype(L, /mob/living/silicon/pai))
|
||||
else if(ispAI(L))
|
||||
var/mob/living/silicon/pai/P = L
|
||||
|
||||
if(P.incapacitated())
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/obj/machinery/syndicate_beacon/attack_hand(var/mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/dat = "<font color=#005500><i>Scanning [pick("retina pattern", "voice print", "fingerprints", "dna sequence")]...<br>Identity confirmed,<br></i></font>"
|
||||
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
|
||||
if(ishuman(user) || isAI(user))
|
||||
if(is_special_character(user))
|
||||
dat += "<font color=#07700><i>Operative record found. Greetings, Agent [user.name].</i></font><br>"
|
||||
else if(charges < 1)
|
||||
@@ -56,7 +56,7 @@
|
||||
return
|
||||
if(2)
|
||||
return
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/N = M
|
||||
to_chat(N, span_infoplain(span_bold("You have joined the ranks of the Syndicate and become a traitor to the station!")))
|
||||
traitors.add_antagonist(N.mind)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/obj/machinery/syndicate_beacon/virgo/attack_hand(var/mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/dat = "<font color=#005500><i>Scanning [pick("retina pattern", "voice print", "fingerprints", "dna sequence")]...<br>Identity confirmed,<br></i></font>"
|
||||
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
|
||||
if(ishuman(user) || isAI(user))
|
||||
if(is_special_character(user))
|
||||
dat += "<font color=#07700><i>Operative record found. Greetings, Agent [user.name].</i></font><br>"
|
||||
else if(charges < 1)
|
||||
@@ -30,7 +30,7 @@
|
||||
updateUsrDialog()
|
||||
return
|
||||
charges -= 1
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/N = M
|
||||
to_chat(N, span_infoplain(span_bold("Access granted, here are the supplies!")))
|
||||
traitors.spawn_uplink(N)
|
||||
|
||||
@@ -411,11 +411,11 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
||||
if(!R.client?.prefs?.read_preference(/datum/preference/toggle/holder/hear_radio))
|
||||
continue
|
||||
|
||||
if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes.
|
||||
if(isnewplayer(R)) // we don't want new players to hear messages. rare but generates runtimes.
|
||||
continue
|
||||
|
||||
// Ghosts hearing all radio chat don't want to hear syndicate intercepts, they're duplicates
|
||||
if(data == DATA_ANTAG && istype(R, /mob/observer/dead) && R.client?.prefs?.read_preference(/datum/preference/toggle/ghost_radio))
|
||||
if(data == DATA_ANTAG && isobserver(R) && R.client?.prefs?.read_preference(/datum/preference/toggle/ghost_radio))
|
||||
continue
|
||||
|
||||
// ChompEDIT START - Ghost blacklist for certain spammy radio channels
|
||||
|
||||
@@ -641,7 +641,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
|
||||
log.parameters["race"] = race
|
||||
|
||||
if(!istype(M, /mob/new_player) && M)
|
||||
if(!isnewplayer(M) && M)
|
||||
log.parameters["uspeech"] = M.universal_speak
|
||||
else
|
||||
log.parameters["uspeech"] = 0
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
set src in oview(1)
|
||||
set desc = "ID Tag:"
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living))
|
||||
if(stat & (NOPOWER|BROKEN) || !isliving(usr))
|
||||
return
|
||||
if(t)
|
||||
id = t
|
||||
@@ -168,7 +168,7 @@
|
||||
return
|
||||
if(istype(M, /atom/movable))
|
||||
//VOREStation Addition Start: Prevent taurriding abuse
|
||||
if(istype(M, /mob/living))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
if(LAZYLEN(L.buckled_mobs))
|
||||
var/datum/riding/R = L.riding_datum
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
/obj/machinery/washing_machine/proc/start()
|
||||
|
||||
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)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
to_chat(user, span_infoplain("The Wish Granter lies silent."))
|
||||
return
|
||||
|
||||
else if(!istype(user, /mob/living/carbon/human))
|
||||
else if(!ishuman(user))
|
||||
to_chat(user, span_infoplain("You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's."))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user