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
+2 -2
View File
@@ -345,7 +345,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Teleport"
set desc= "Teleport to a location"
if(!istype(usr, /mob/dead/observer))
if(!isobserver(usr))
usr << "Not when you're not dead!"
return
var/A
@@ -417,7 +417,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Jump to Mob"
set desc = "Teleport to a mob"
if(istype(usr, /mob/dead/observer)) //Make sure they're an observer!
if(isobserver(usr)) //Make sure they're an observer!
var/list/dest = list() //List of possible destinations (mobs)
+1 -1
View File
@@ -12,7 +12,7 @@
if(radio_freq)
var/atom/movable/virtualspeaker/V = speaker
if(istype(V.source, /mob/living/silicon/ai))
if(isAI(V.source))
var/mob/living/silicon/ai/S = V.source
speaker = S.eyeobj
else
+1 -1
View File
@@ -59,7 +59,7 @@
log_emote("[name]/[key] : [message]")
for(var/mob/M in dead_mob_list)
if (!M.client || istype(M, /mob/new_player))
if (!M.client || isnewplayer(M))
continue //skip monkeys, leavers, and new_players
if(M.stat == DEAD && (M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)) && !(M in viewers(src,null)))
M.show_message(message)
+1 -1
View File
@@ -125,7 +125,7 @@ var/global/posibrain_notif_cooldown = 0
if(!usr || !src)
return
if( (usr.disabilities & BLIND || usr.stat) && !istype(usr,/mob/dead/observer) )
if((usr.disabilities & BLIND || usr.stat) && !isobserver(usr))
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
+1 -1
View File
@@ -188,7 +188,7 @@
// Maybe some people are okay with that.
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
if(!M.client || isnewplayer(M))
continue //skip monkeys, leavers and new players
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
@@ -364,7 +364,7 @@
// Maybe some people are okay with that.
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
if(!M.client || isnewplayer(M))
continue //skip monkeys, leavers and new players
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
+2 -2
View File
@@ -212,7 +212,7 @@
if ("pout","pouts")
message = "<B>[src]</B> pouts."
m_type = 2
if ("scream","screams")
message = "<B>[src]</B> screams!"
m_type = 2
@@ -339,7 +339,7 @@
// Maybe some people are okay with that.
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
if(!M.client || isnewplayer(M))
continue //skip monkeys, leavers and new players
var/T = get_turf(src)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T,null)))
+2 -2
View File
@@ -304,7 +304,7 @@ var/list/ai_list = list()
/mob/living/silicon/ai/proc/ai_call_shuttle()
if(stat == DEAD)
return //won't work if dead
if(istype(usr,/mob/living/silicon/ai))
if(isAI(usr))
var/mob/living/silicon/ai/AI = src
if(AI.control_disabled)
usr << "Wireless control is disabled!"
@@ -343,7 +343,7 @@ var/list/ai_list = list()
set category = "Malfunction"
if(stat == DEAD)
return //won't work if dead
if(istype(usr,/mob/living/silicon/ai))
if(isAI(usr))
var/mob/living/silicon/ai/AI = src
if(AI.control_disabled)
src << "Wireless control is disabled!"
@@ -42,7 +42,7 @@
return ..()
/atom/proc/move_camera_by_click()
if(istype(usr, /mob/living/silicon/ai))
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
if(AI.eyeobj && AI.client.eye == AI.eyeobj)
AI.cameraFollow = null
@@ -46,7 +46,7 @@
/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
add_fingerprint(user)
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
if(opened && !wiresexposed && !issilicon(user))
if(cell)
cell.updateicon()
cell.add_fingerprint(user)
+3 -3
View File
@@ -5,14 +5,14 @@
/mob/living/proc/robot_talk(message)
log_say("[key_name(src)] : [message]")
var/desig = "Default Cyborg" //ezmode for taters
if(istype(src, /mob/living/silicon))
if(issilicon(src))
var/mob/living/silicon/S = src
desig = trim_left(S.designation + " " + S.job)
var/message_a = say_quote(message, get_spans())
var/rendered = "<i><span class='game say'>Robotic Talk, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for(var/mob/M in player_list)
if(M.binarycheck())
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
var/renderedAI = "<i><span class='game say'>Robotic Talk, <a href='?src=\ref[M];track=[html_encode(name)]'><span class='name'>[name] ([desig])</span></a> <span class='message'>[message_a]</span></span></i>"
M << renderedAI
else
@@ -21,7 +21,7 @@
var/following = src
// If the AI talks on binary chat, we still want to follow
// it's camera eye, like if it talked on the radio
if(istype(src, /mob/living/silicon/ai))
if(isAI(src))
var/mob/living/silicon/ai/ai = src
following = ai.eyeobj
var/link = FOLLOW_LINK(M, following)
@@ -157,10 +157,10 @@ var/global/mulebot_count = 0
wires.cut_random()
/mob/living/simple_animal/bot/mulebot/interact(mob/user)
if(open && !istype(user, /mob/living/silicon/ai))
if(open && !isAI(user))
wires.interact(user)
else
if(wires.is_cut(WIRE_RX) && istype(user, /mob/living/silicon/ai))
if(wires.is_cut(WIRE_RX) && isAI(user))
return
ui_interact(user)
@@ -636,7 +636,7 @@ var/global/mulebot_count = 0
if(wires.is_cut(WIRE_AVOIDANCE)) // usually just bumps, but if avoidance disabled knock over mobs
var/mob/M = obs
if(ismob(M))
if(istype(M,/mob/living/silicon/robot))
if(iscyborg(M))
visible_message("<span class='danger'>[src] bumps into [M]!</span>")
else
if(!paicard)
@@ -738,7 +738,7 @@ var/global/mulebot_count = 0
unload(get_dir(loc, A))
else
..()
/mob/living/simple_animal/bot/mulebot/insertpai(mob/user, obj/item/device/paicard/card)
if(..())
visible_message("[src] safeties are locked on.")
@@ -63,7 +63,7 @@
break
if(Target in view(1,src))
if(istype(Target, /mob/living/silicon))
if(issilicon(Target))
if(!Atkcool)
Atkcool = 1
spawn(45)
+2 -2
View File
@@ -483,7 +483,7 @@ var/next_mob_id = 0
set name = "Observe"
set category = "OOC"
if(stat != DEAD || istype(src, /mob/new_player))
if(stat != DEAD || isnewplayer(src))
usr << "<span class='notice'>You must be observing to use this!</span>"
return
@@ -565,7 +565,7 @@ var/next_mob_id = 0
return
if(!Adjacent(usr))
return
if(istype(M, /mob/living/silicon/ai))
if(isAI(M))
return
show_inv(usr)
@@ -4,8 +4,8 @@
//Note that this proc does NOT do MMI related stuff!
/mob/proc/change_mob_type(new_type = null, turf/location = null, new_name = null as text, delete_old_mob = 0 as num)
if(istype(src,/mob/new_player))
usr << "<span class='danger'>cannot convert players who have not entered yet.</span>"
if(isnewplayer(src))
usr << "<span class='danger'>Cannot convert players who have not entered yet.</span>"
return
if(!new_type)
@@ -18,8 +18,8 @@
usr << "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder."
return
if( new_type == /mob/new_player )
usr << "<span class='danger'>cannot convert into a new_player mob type.</span>"
if(ispath(new_type, /mob/new_player))
usr << "<span class='danger'>Cannot convert into a new_player mob type.</span>"
return
var/mob/M