mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +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
@@ -204,7 +204,7 @@
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(!istype(src.loc, /mob/living)) // Needs to be in your hands to reset
|
||||
if(!isliving(src.loc)) // Needs to be in your hands to reset
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
//Otherwise, if you want handle_click_empty() to be called, check in consume_next_projectile() and return null there.
|
||||
/obj/item/gun/proc/special_check(var/mob/user)
|
||||
|
||||
if(!istype(user, /mob/living))
|
||||
if(!isliving(user))
|
||||
return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return 0
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
var/recievefailchance = failure_chance
|
||||
var/sendfailchance = failure_chance
|
||||
if(istype(user, /mob/living))
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(LAZYLEN(L.buckled_mobs))
|
||||
for(var/rider in L.buckled_mobs)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/brute
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/brute/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-10)
|
||||
else
|
||||
@@ -46,7 +46,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/burn
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/burn/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustFireLoss(-10)
|
||||
else
|
||||
@@ -59,7 +59,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/stabilize
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/stabilize/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.adjustOxyLoss(-30)
|
||||
for(var/name in list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TORSO))
|
||||
var/obj/item/organ/external/O = target.organs_by_name[name]
|
||||
@@ -87,7 +87,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/toxin
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/toxin/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustToxLoss(-10)
|
||||
else
|
||||
@@ -100,7 +100,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/omni
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/omni/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-5)
|
||||
target.adjustFireLoss(-5)
|
||||
@@ -116,7 +116,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/antirad
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/antirad/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustToxLoss(-5)
|
||||
target.radiation = max(target.radiation - 350, 0) //same as 5 units of arithrazine, sans the brute damage
|
||||
@@ -130,7 +130,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/brute2
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/brute2/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-20)
|
||||
else
|
||||
@@ -143,7 +143,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/burn2
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/burn2/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustFireLoss(-20)
|
||||
else
|
||||
@@ -156,7 +156,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/stabilize2
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/stabilize2/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.adjustOxyLoss(-200)
|
||||
for(var/name in list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TORSO))
|
||||
var/obj/item/organ/external/O = target.organs_by_name[name]
|
||||
@@ -179,7 +179,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/omni2
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/omni2/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-10)
|
||||
target.adjustFireLoss(-10)
|
||||
@@ -195,7 +195,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/toxin2
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/toxin2/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustToxLoss(-20)
|
||||
else
|
||||
@@ -208,7 +208,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/haste
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/haste/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.add_modifier(/datum/modifier/ml3mhaste, 20 SECONDS)
|
||||
else
|
||||
return 1
|
||||
@@ -228,7 +228,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/resist
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/resist/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.add_modifier(/datum/modifier/resistance, 20 SECONDS)
|
||||
else
|
||||
return 1
|
||||
@@ -248,7 +248,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/corpse_mend
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/corpse_mend/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat == DEAD)
|
||||
target.adjustBruteLoss(-50)
|
||||
target.adjustFireLoss(-50)
|
||||
@@ -264,7 +264,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/brute3
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/brute3/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-40)
|
||||
else
|
||||
@@ -277,7 +277,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/burn3
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/burn3/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustFireLoss(-40)
|
||||
else
|
||||
@@ -290,7 +290,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/toxin3
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/toxin3/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustToxLoss(-40)
|
||||
else
|
||||
@@ -303,7 +303,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/omni3
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/omni3/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
if(target.stat != DEAD)
|
||||
target.adjustBruteLoss(-20)
|
||||
target.adjustFireLoss(-20)
|
||||
@@ -320,7 +320,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/shrink
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/shrink/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.resize(0.5)
|
||||
target.show_message(span_blue("The beam fires into your body, changing your size!"))
|
||||
target.update_icon()
|
||||
@@ -334,7 +334,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/grow
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/grow/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.resize(2.0)
|
||||
target.show_message(span_blue("The beam fires into your body, changing your size!"))
|
||||
target.update_icon()
|
||||
@@ -348,7 +348,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/normalsize
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/normalsize/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.resize(1)
|
||||
target.show_message(span_blue("The beam fires into your body, changing your size!"))
|
||||
target.update_icon()
|
||||
|
||||
@@ -115,14 +115,14 @@
|
||||
projectile_type = /obj/item/projectile/beam/medical_cell/phys_heal
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/phys_heal/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.adjustBruteLoss(-20)
|
||||
target.adjustFireLoss(-20)
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/beam/medical_cell/detox/on_hit(var/mob/living/carbon/human/target)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
target.adjustToxLoss(-15)
|
||||
target.radiation = max(target.radiation - 75, 0) //worse than mlem for rad, better for tox.
|
||||
else
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
update_icon()
|
||||
update_held_icon()
|
||||
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.update_inv_l_hand()
|
||||
H.update_inv_r_hand()
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
one_handed_penalty = 30
|
||||
recoil = 5
|
||||
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.update_inv_l_hand()
|
||||
H.update_inv_r_hand()
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
if(3)
|
||||
var/obj/item/gun/projectile/heavysniper/collapsible/gun = new (get_turf(src), 0)
|
||||
if(usr && istype(usr, /mob/living/carbon/human))
|
||||
if(usr && ishuman(usr))
|
||||
var/mob/living/carbon/human/user = usr
|
||||
user.unEquip(src, force=1)
|
||||
user.put_in_any_hand_if_possible(gun) || gun.dropInto(loc)
|
||||
|
||||
@@ -574,7 +574,7 @@
|
||||
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
if(istype(A, /mob/living))
|
||||
if(isliving(A))
|
||||
//if they have a neck grab on someone, that person gets hit instead
|
||||
var/obj/item/grab/G = locate() in M
|
||||
if(G && G.state >= GRAB_NECK)
|
||||
@@ -710,7 +710,7 @@
|
||||
return FALSE
|
||||
|
||||
var/impacted_organ = parse_zone(def_zone)
|
||||
if(istype(target_mob, /mob/living/simple_mob))
|
||||
if(isanimal(target_mob))
|
||||
var/mob/living/simple_mob/SM = target_mob
|
||||
var/decl/mob_organ_names/organ_plan = SM.organ_names
|
||||
impacted_organ = pick(organ_plan.hit_zones)
|
||||
|
||||
@@ -365,11 +365,11 @@
|
||||
/obj/item/projectile/beam/stun/disabler/on_hit(atom/target, blocked = 0, def_zone)
|
||||
. = ..(target, blocked, def_zone)
|
||||
|
||||
if(. && istype(target, /mob/living/silicon/robot) && prob(agony))
|
||||
if(. && isrobot(target) && prob(agony))
|
||||
var/mob/living/silicon/robot/R = target
|
||||
var/drainamt = agony * (rand(5, 15) / 10)
|
||||
R.drain_power(0, 0, drainamt)
|
||||
if(istype(firer, /mob/living/silicon/robot)) // Mischevious sappers, the swarm drones are.
|
||||
if(isrobot(firer)) // Mischevious sappers, the swarm drones are.
|
||||
var/mob/living/silicon/robot/A = firer
|
||||
if(A.cell)
|
||||
A.cell.give(drainamt * 2)
|
||||
@@ -562,7 +562,7 @@
|
||||
impact_type = /obj/effect/projectile/impact/medigun
|
||||
|
||||
/obj/item/projectile/beam/medigun/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/M = target
|
||||
if(M.health < M.maxHealth)
|
||||
var/obj/effect/overlay/pulse = new /obj/effect/overlay(get_turf(M))
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
wabbajack(change)
|
||||
|
||||
/obj/item/projectile/change/proc/wabbajack(var/mob/M)
|
||||
if(istype(M, /mob/living) && M.stat != DEAD)
|
||||
if(isliving(M) && M.stat != DEAD)
|
||||
if(M.transforming)
|
||||
return
|
||||
if(M.has_brain_worms())
|
||||
return //Borer stuff - RR
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot))
|
||||
if(isrobot(M))
|
||||
var/mob/living/silicon/robot/Robot = M
|
||||
if(Robot.mmi)
|
||||
qdel(Robot.mmi)
|
||||
|
||||
@@ -167,13 +167,13 @@
|
||||
done_mob_unique = TRUE
|
||||
success = TRUE
|
||||
if(I_HURT)
|
||||
if(prob(10) && istype(L, /mob/living/carbon/human))
|
||||
if(prob(10) && ishuman(L))
|
||||
to_chat(L, span_warning("\The [src] rips at your hands!"))
|
||||
ranged_disarm(L)
|
||||
success = TRUE
|
||||
done_mob_unique = TRUE
|
||||
if(I_DISARM)
|
||||
if(prob(disarm_chance) && istype(L, /mob/living/carbon/human))
|
||||
if(prob(disarm_chance) && ishuman(L))
|
||||
ranged_disarm(L)
|
||||
else
|
||||
L.visible_message(span_danger("\The [src] sends \the [L] stumbling backwards."))
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
var/energetic_impact = 0 //Does this fuelrod cause a bright flash on impact with a mob?
|
||||
|
||||
/obj/item/projectile/bullet/magnetic/fuelrod/on_hit(var/atom/target, var/blocked = 0, var/def_zone = null) //Future-proofing. Special effects for impact.
|
||||
if(istype(target,/mob/living))
|
||||
if(isliving(target))
|
||||
var/mob/living/V = target
|
||||
if(detonate_mob)
|
||||
if(V.loc)
|
||||
@@ -154,7 +154,7 @@
|
||||
hud_state = "rocket_thermobaric"
|
||||
|
||||
/obj/item/projectile/bullet/magnetic/fuelrod/supermatter/on_hit(var/atom/target, var/blocked = 0, var/def_zone = null) //You cannot touch the supermatter without disentigrating. Assumedly, this is true for condensed rods of it flying at relativistic speeds.
|
||||
if(istype(target,/turf/simulated/wall) || istype(target,/mob/living))
|
||||
if(istype(target,/turf/simulated/wall) || isliving(target))
|
||||
target.visible_message(span_danger("The [src] burns a perfect hole through \the [target] with a blinding flash!"))
|
||||
playsound(target, 'sound/effects/teleport.ogg', 40, 0)
|
||||
return ..(target, blocked, def_zone)
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
|
||||
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)
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user