mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +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
@@ -51,7 +51,7 @@ var/global/floorIsLava = 0
|
||||
body += " played by <b>[M.client]</b> "
|
||||
body += "\[<A href='byond://?src=\ref[src];[HrefToken()];editrights=show'>[M.client.holder ? M.client.holder.rank : "Player"]</A>\]"
|
||||
|
||||
if(istype(M, /mob/new_player))
|
||||
if(isnewplayer(M))
|
||||
body += " <B>Hasn't Entered Game</B> "
|
||||
else
|
||||
body += " \[<A href='byond://?src=\ref[src];[HrefToken()];revive=\ref[M]'>Heal</A>\] "
|
||||
@@ -102,7 +102,7 @@ var/global/floorIsLava = 0
|
||||
"}
|
||||
|
||||
if (M.client)
|
||||
if(!istype(M, /mob/new_player))
|
||||
if(!isnewplayer(M))
|
||||
body += "<br><br>"
|
||||
body += span_bold("Transformation:")
|
||||
body += "<br>"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
if(build_mode != "Yes")
|
||||
to_chat(src, "Will not re-enter buildmode after switch.")
|
||||
|
||||
if(istype(mob,/mob/observer/dead))
|
||||
if(isobserver(mob))
|
||||
//re-enter
|
||||
var/mob/observer/dead/ghost = mob
|
||||
if(ghost.can_reenter_corpse)
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
feedback_add_details("admin_verb","P") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
else if(istype(mob,/mob/new_player))
|
||||
else if(isnewplayer(mob))
|
||||
to_chat(src, span_filter_system(span_warning("Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.")))
|
||||
else
|
||||
//ghostize
|
||||
@@ -198,7 +198,7 @@
|
||||
if(holder)
|
||||
if(holder.fakekey)
|
||||
holder.fakekey = null
|
||||
if(istype(src.mob, /mob/new_player))
|
||||
if(isnewplayer(src.mob))
|
||||
mob.name = capitalize(ckey)
|
||||
else
|
||||
var/new_key = ckeyEx(tgui_input_text(usr, "Enter your desired display name.", "Fake Key", key))
|
||||
@@ -208,7 +208,7 @@
|
||||
new_key = copytext(new_key, 1, 26)
|
||||
holder.fakekey = new_key
|
||||
createStealthKey()
|
||||
if(istype(mob, /mob/new_player))
|
||||
if(isnewplayer(mob))
|
||||
mob.name = new_key
|
||||
log_and_message_admins("[key_name(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]")
|
||||
feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if(A)
|
||||
var/icon/img = getFlatIcon(A)
|
||||
if(istype(img, /icon))
|
||||
if(istype(A, /mob/living) && A:lying)
|
||||
if(isliving(A) && A:lying)
|
||||
img.BecomeLying()
|
||||
var/xoff = (A.x - tx) * 32
|
||||
var/yoff = (A.y - ty) * 32
|
||||
|
||||
@@ -772,7 +772,7 @@
|
||||
X.orbit(target)
|
||||
|
||||
if("ai")
|
||||
if(!istype(target, /mob/living))
|
||||
if(!isliving(target))
|
||||
to_chat(ui.user, span_notice("This can only be used on instances of type /mob/living"))
|
||||
return
|
||||
var/mob/living/L = target
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
else
|
||||
M_job = JOB_LIVING
|
||||
|
||||
else if(istype(M,/mob/new_player))
|
||||
else if(isnewplayer(M))
|
||||
M_job = JOB_NEW_PLAYER
|
||||
|
||||
else if(isobserver(M))
|
||||
@@ -336,9 +336,9 @@
|
||||
dat += "<td>Cyborg</td>"
|
||||
else if(ishuman(M))
|
||||
dat += "<td>[M.real_name]</td>"
|
||||
else if(istype(M, /mob/living/silicon/pai))
|
||||
else if(ispAI(M))
|
||||
dat += "<td>pAI</td>"
|
||||
else if(istype(M, /mob/new_player))
|
||||
else if(isnewplayer(M))
|
||||
dat += "<td>New Player</td>"
|
||||
else if(isobserver(M))
|
||||
dat += "<td>Ghost</td>"
|
||||
@@ -350,7 +350,7 @@
|
||||
dat += "<td>Unknown</td>"
|
||||
|
||||
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.mind && H.mind.assigned_role)
|
||||
dat += "<td>[H.mind.assigned_role]</td>"
|
||||
|
||||
@@ -1098,7 +1098,7 @@
|
||||
if(!ismob(M))
|
||||
to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob"))
|
||||
return
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/living/silicon/ai"))
|
||||
return
|
||||
|
||||
@@ -1119,7 +1119,7 @@
|
||||
if(!M) return
|
||||
|
||||
M.loc = prison_cell
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/prisoner = M
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/prison(prisoner), slot_w_uniform)
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes)
|
||||
@@ -1161,7 +1161,7 @@
|
||||
if(!ismob(M))
|
||||
to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob"))
|
||||
return
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/living/silicon/ai"))
|
||||
return
|
||||
|
||||
@@ -1186,7 +1186,7 @@
|
||||
if(!ismob(M))
|
||||
to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob"))
|
||||
return
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/living/silicon/ai"))
|
||||
return
|
||||
|
||||
@@ -1211,7 +1211,7 @@
|
||||
if(!ismob(M))
|
||||
to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob"))
|
||||
return
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/living/silicon/ai"))
|
||||
return
|
||||
|
||||
@@ -1233,14 +1233,14 @@
|
||||
if(!ismob(M))
|
||||
to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob"))
|
||||
return
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/living/silicon/ai"))
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
M.drop_from_inventory(I)
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/observer = M
|
||||
observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform)
|
||||
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes)
|
||||
@@ -1303,7 +1303,7 @@
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
var/mob/M = locate(href_list["makeanimal"])
|
||||
if(istype(M, /mob/new_player))
|
||||
if(isnewplayer(M))
|
||||
to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/new_player"))
|
||||
return
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
var/mob/living/carbon/human/M = tgui_input_list(usr, "Select mob.", "Edit Appearance", human_mob_list)
|
||||
|
||||
if(!istype(M, /mob/living/carbon/human))
|
||||
if(!ishuman(M))
|
||||
to_chat(usr, span_warning("You can only do this to humans!"))
|
||||
return
|
||||
if(tgui_alert(usr, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No")) != "Yes")
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
if(!ticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
log_admin("[key_name(src)] has robotized [M.key].")
|
||||
spawn(10)
|
||||
M:Robotize()
|
||||
@@ -120,7 +120,7 @@
|
||||
tgui_alert_async(usr, "That mob doesn't seem to exist, close the panel and try again.")
|
||||
return
|
||||
|
||||
if(istype(M, /mob/new_player))
|
||||
if(isnewplayer(M))
|
||||
tgui_alert_async(usr, "The mob must not be a new_player.")
|
||||
return
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
if (!ticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
if (ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if (H.wear_id)
|
||||
var/obj/item/card/id/id = H.wear_id
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
to_chat(usr, span_notice("Ghosts shouldn't be narrated! If you want a ghost, make it a subtype of mob/living!"))
|
||||
return
|
||||
//We require a static mob/living type to check for .client and also later on, to use the unique .say mechanics for stuttering and language
|
||||
if(istype(E, /mob/living))
|
||||
if(isliving(E))
|
||||
var/mob/living/L = E
|
||||
if(L.client)
|
||||
to_chat(usr, span_notice("[L.name] is a player. All attempts to speak through them \
|
||||
@@ -170,7 +170,7 @@
|
||||
to_chat(usr, span_notice("[name] has invalid reference, deleting"))
|
||||
holder.entity_names -= name
|
||||
holder.entity_refs -= name
|
||||
if(istype(selection, /mob/living))
|
||||
if(isliving(selection))
|
||||
var/mob/living/our_entity = selection
|
||||
if(our_entity.client) //Making sure we can't speak for players
|
||||
log_and_message_admins("used entity-narrate to speak through [our_entity.ckey]'s mob", usr)
|
||||
@@ -267,7 +267,7 @@
|
||||
tgui_selected_type = ""
|
||||
tgui_selected_name = ""
|
||||
tgui_selected_refs = null
|
||||
if(istype(tgui_selected_refs, /mob/living))
|
||||
if(isliving(tgui_selected_refs))
|
||||
var/mob/living/L = tgui_selected_refs
|
||||
if(L.client)
|
||||
tgui_selected_type = "!!!!PLAYER!!!!"
|
||||
@@ -296,7 +296,7 @@
|
||||
entity_refs -= entity
|
||||
tgui_selected_id_multi -= entity
|
||||
continue
|
||||
if(istype(ref, /mob/living))
|
||||
if(isliving(ref))
|
||||
var/mob/living/L = ref
|
||||
if(L.client)
|
||||
log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", ui.user)
|
||||
@@ -316,7 +316,7 @@
|
||||
tgui_selected_name = ""
|
||||
tgui_selected_refs = null
|
||||
return
|
||||
if(istype(ref, /mob/living))
|
||||
if(isliving(ref))
|
||||
var/mob/living/L = ref
|
||||
if(L.client)
|
||||
log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", ui.user)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//Initializing our working list
|
||||
for(var/player in player_list_local)
|
||||
|
||||
if(!istype(player, /mob/living)) continue //We only care for living players
|
||||
if(!isliving(player)) continue //We only care for living players
|
||||
var/mob/living/L = player
|
||||
players += 1
|
||||
if(L.client.inactivity > INACTIVITY_CAP)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return
|
||||
|
||||
if (ismob(M))
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
if(isAI(M))
|
||||
tgui_alert_async(usr, "The AI can't be sent to prison you jerk!")
|
||||
return
|
||||
//strip their stuff before they teleport into a cell :downs:
|
||||
@@ -34,7 +34,7 @@
|
||||
M.Paralyse(5)
|
||||
sleep(5) //so they black out before warping
|
||||
M.loc = pick(prisonwarp)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/prisoner = M
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/prison(prisoner), slot_w_uniform)
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes)
|
||||
@@ -764,7 +764,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
log_admin("[key_name(usr)] has gibbed [key_name(M)]")
|
||||
message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]", 1)
|
||||
|
||||
if(istype(M, /mob/observer/dead))
|
||||
if(isobserver(M))
|
||||
gibs(M.loc)
|
||||
return
|
||||
|
||||
@@ -782,7 +782,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!confirm)
|
||||
return
|
||||
if(confirm == "Yes")
|
||||
if (istype(mob, /mob/observer/dead)) // so they don't spam gibs everywhere
|
||||
if (isobserver(mob)) // so they don't spam gibs everywhere
|
||||
return
|
||||
else
|
||||
mob.gib()
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
if(!check_rights(0)) return
|
||||
|
||||
var/mob/M = locate(href_list["give_ai"])
|
||||
if(!istype(M, /mob/living))
|
||||
if(!isliving(M))
|
||||
to_chat(usr, span_notice("This can only be used on instances of type /mob/living"))
|
||||
return
|
||||
var/mob/living/L = M
|
||||
@@ -419,17 +419,17 @@
|
||||
var/list/possibleverbs = list()
|
||||
possibleverbs += "Cancel" // One for the top...
|
||||
possibleverbs += typesof(/mob/proc, /mob/verb)
|
||||
if(istype(H,/mob/observer/dead))
|
||||
if(isobserver(H))
|
||||
possibleverbs += typesof(/mob/observer/dead/proc,/mob/observer/dead/verb)
|
||||
if(istype(H,/mob/living))
|
||||
if(isliving(H))
|
||||
possibleverbs += typesof(/mob/living/proc,/mob/living/verb)
|
||||
if(istype(H,/mob/living/carbon/human))
|
||||
if(ishuman(H))
|
||||
possibleverbs += typesof(/mob/living/carbon/proc,/mob/living/carbon/verb,/mob/living/carbon/human/verb,/mob/living/carbon/human/proc)
|
||||
if(istype(H,/mob/living/silicon/robot))
|
||||
if(isrobot(H))
|
||||
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/robot/proc,/mob/living/silicon/robot/verb)
|
||||
if(istype(H,/mob/living/silicon/ai))
|
||||
if(isAI(H))
|
||||
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/ai/proc,/mob/living/silicon/ai/verb)
|
||||
if(istype(H,/mob/living/simple_mob))
|
||||
if(isanimal(H))
|
||||
possibleverbs += typesof(/mob/living/simple_mob/proc)
|
||||
possibleverbs -= H.verbs
|
||||
possibleverbs += "Cancel" // ...And one for the bottom
|
||||
|
||||
Reference in New Issue
Block a user