More istypes replaced with helpers (#20767)

* shouldn't you be merging these by now

* my oh my do we have a lot of these

* a fellow pedantic shit
This commit is contained in:
Joan Lung
2016-10-02 20:40:13 -04:00
committed by oranges
parent de19e36a51
commit b5b4037e2e
87 changed files with 185 additions and 175 deletions
+4 -4
View File
@@ -34,7 +34,7 @@ var/global/BSACooldown = 0
body += " played by <b>[M.client]</b> "
body += "\[<A href='?_src_=holder;editrights=rank;ckey=[M.ckey]'>[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='?_src_=holder;revive=\ref[M]'>Heal</A>\] "
@@ -91,7 +91,7 @@ var/global/BSACooldown = 0
body += "<A href='?_src_=holder;subtlemessage=\ref[M]'>Subtle message</A>"
if (M.client)
if(!istype(M, /mob/new_player))
if(!isnewplayer(M))
body += "<br><br>"
body += "<b>Transformation:</b>"
body += "<br>"
@@ -773,8 +773,8 @@ var/global/BSACooldown = 0
/proc/kick_clients_in_lobby(message, kick_only_afk = 0)
var/list/kicked_client_names = list()
for(var/client/C in clients)
if(istype(C.mob, /mob/new_player))
if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
if(isnewplayer(C.mob))
if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
continue
if(message)
C << message
+2 -2
View File
@@ -358,7 +358,7 @@ var/list/admin_verbs_hideable = list(
set name = "Aghost"
if(!holder)
return
if(istype(mob,/mob/dead/observer))
if(isobserver(mob))
//re-enter
var/mob/dead/observer/ghost = mob
if(!ghost.mind || !ghost.mind.current) //won't do anything if there is no body
@@ -369,7 +369,7 @@ var/list/admin_verbs_hideable = list(
ghost.can_reenter_corpse = 1 //force re-entering even when otherwise not possible
ghost.reenter_corpse()
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))
src << "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.</font>"
else
//ghostize
+1 -1
View File
@@ -260,7 +260,7 @@
else
M_job = "Living"
else if(istype(M,/mob/new_player))
else if(isnewplayer(M))
M_job = "New player"
else if(isobserver(M))
+6 -6
View File
@@ -1339,7 +1339,7 @@
if(!ismob(M))
usr << "This can only be used on instances of type /mob."
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
return
@@ -1387,7 +1387,7 @@
if(!ismob(M))
usr << "This can only be used on instances of type /mob."
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
return
@@ -1417,7 +1417,7 @@
if(!ismob(M))
usr << "This can only be used on instances of type /mob."
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
return
@@ -1447,7 +1447,7 @@
if(!ismob(M))
usr << "This can only be used on instances of type /mob."
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
return
@@ -1470,7 +1470,7 @@
if(!ismob(M))
usr << "This can only be used on instances of type /mob."
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
return
@@ -1569,7 +1569,7 @@
return
var/mob/M = locate(href_list["makeanimal"])
if(istype(M, /mob/new_player))
if(isnewplayer(M))
usr << "This cannot be used on instances of type /mob/new_player."
return
+2 -2
View File
@@ -23,9 +23,9 @@
var/list/client/targets[0]
for(var/client/T)
if(T.mob)
if(istype(T.mob, /mob/new_player))
if(isnewplayer(T.mob))
targets["(New Player) - [T]"] = T
else if(istype(T.mob, /mob/dead/observer))
else if(isobserver(T.mob))
targets["[T.mob.name](Ghost) - [T]"] = T
else
targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T
+1 -1
View File
@@ -263,7 +263,7 @@
else if(istype(object,/turf/closed/wall/r_wall))
var/turf/T = object
T.ChangeTurf(/turf/closed/wall)
else if(istype(object,/obj))
else if(isobj(object))
qdel(object)
return
else if(istype(object,/turf) && alt_click && left_click)
+1 -1
View File
@@ -24,7 +24,7 @@
var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>ADMIN([src.holder.fakekey ? pick(nicknames) : src.key])</span> says, <span class='message'>\"[msg]\"</span></span>"
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
if(isnewplayer(M))
continue
if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
M.show_message(rendered, 2)
+2 -2
View File
@@ -280,7 +280,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
alert("That mob doesn't seem to exist, close the panel and try again.")
return
if(istype(M, /mob/new_player))
if(isnewplayer(M))
alert("The mob must not be a new_player.")
return
@@ -301,7 +301,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available
if(!choice)
return 0
if(!istype(choice, /mob/dead/observer))
if(!isobserver(choice))
var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No")
if(confirm != "Yes")
return 0
+21 -21
View File
@@ -147,32 +147,32 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /turf))
else if(isturf(O))
for(var/turf/A in world)
if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
CHECK_TICK
else
if(istype(O, /mob))
if(ismob(O))
for(var/mob/M in mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
A.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /turf))
else if(isturf(O))
for(var/turf/A in world)
if (A.type == O.type)
A.vars[variable] = O.vars[variable]
@@ -227,7 +227,7 @@
M.vars[variable] = new_value
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if ( istype(A , O.type) )
new_value = pre_processing
@@ -272,7 +272,7 @@
M.vars[variable] = new_value
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
new_value = pre_processing
@@ -322,7 +322,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if ( istype(A , O.type) )
if(variable=="luminosity")
@@ -350,7 +350,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
if(variable=="luminosity")
@@ -380,7 +380,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
@@ -399,7 +399,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
A.vars[variable] = O.vars[variable]
@@ -423,7 +423,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O.type, /obj))
else if(isobj(O.type))
for(var/obj/A in world)
if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
@@ -441,7 +441,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
A.vars[variable] = O.vars[variable]
@@ -464,7 +464,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
@@ -483,7 +483,7 @@
M.vars[variable] = O.vars[variable]
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if (A.type == O.type)
A.vars[variable] = O.vars[variable]
@@ -496,38 +496,38 @@
CHECK_TICK
if(method)
if(istype(O,/mob))
if(ismob(O))
for(var/mob/M in mob_list)
if(istype(M,O.type))
M.on_varedit(variable)
CHECK_TICK
else if(istype(O,/obj))
else if(isobj(O))
for(var/obj/A in world)
if(istype(A,O.type))
A.on_varedit(variable)
CHECK_TICK
else if(istype(O,/turf))
else if(isturf(O))
for(var/turf/A in block(locate(1,1,1),locate(world.maxx,world.maxy,world.maxz)))
if(istype(A,O.type))
A.on_varedit(variable)
CHECK_TICK
else
if(istype(O, /mob))
if(ismob(O))
for(var/mob/M in mob_list)
if(M.type == O.type)
M.on_varedit(variable)
CHECK_TICK
else if(istype(O, /obj))
else if(isobj(O))
for(var/obj/A in world)
if(A.type == O.type)
A.on_varedit(variable)
CHECK_TICK
else if(istype(O, /turf))
else if(isturf(O))
for(var/turf/A in world)
if(A.type == O.type)
A.on_varedit(variable)
+1 -1
View File
@@ -594,7 +594,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)]")
if(istype(M, /mob/dead/observer))
if(isobserver(M))
new /obj/effect/gibspawner/generic(M.loc, M.viruses)
return
if(confirm == "Yes")