Refactors anti-magic into a component
This commit is contained in:
@@ -31,6 +31,12 @@
|
||||
to_chat(user, "<span class='notice'>They are too far away!</span>")
|
||||
return
|
||||
|
||||
if(target.anti_magic_check())
|
||||
to_chat(user, "<span class='warning'>The spell had no effect!</span>")
|
||||
target.visible_message("<span class='danger'>[target]'s face bursts into flames, which instantly burst outward, leaving [target] unharmed!</span>", \
|
||||
"<span class='danger'>Your face starts burning up, but the flames are repulsed by your anti-magic protection!</span>")
|
||||
return
|
||||
|
||||
var/list/masks = list(/obj/item/clothing/mask/spig, /obj/item/clothing/mask/cowmask, /obj/item/clothing/mask/horsehead)
|
||||
var/list/mSounds = list('sound/magic/pighead_curse.ogg', 'sound/magic/cowhead_curse.ogg', 'sound/magic/horsehead_curse.ogg')
|
||||
var/randM = rand(1,3)
|
||||
|
||||
@@ -202,6 +202,10 @@
|
||||
revert_cast()
|
||||
return
|
||||
|
||||
if(target.anti_magic_check(TRUE, TRUE))
|
||||
to_chat(target, "<span class='warning'>You feel a freezing darkness closing in on you, but it rapidly dissipates.</span>")
|
||||
return
|
||||
|
||||
to_chat(target, "<span class='userdanger'>A freezing darkness surrounds you...</span>")
|
||||
target.playsound_local(get_turf(target), 'sound/hallucinations/i_see_you1.ogg', 50, 1)
|
||||
user.playsound_local(get_turf(user), 'sound/effects/ghost2.ogg', 50, 1)
|
||||
@@ -294,6 +298,7 @@
|
||||
sound = 'sound/weapons/resonator_blast.ogg'
|
||||
proj_trigger_range = 0
|
||||
ignore_factions = list("cult")
|
||||
check_holy = TRUE
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/inflict_handler/juggernaut
|
||||
name = "Gauntlet Echo"
|
||||
|
||||
@@ -195,6 +195,8 @@
|
||||
continue
|
||||
if(locate(/datum/objective/sintouched) in H.mind.objectives)
|
||||
continue
|
||||
if(H.anti_magic_check(FALSE, TRUE))
|
||||
continue
|
||||
H.influenceSin()
|
||||
H.Knockdown(400)
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
var/proj_step_delay = 1 //lower = faster
|
||||
var/list/ignore_factions = list() //Faction types that will be ignored
|
||||
|
||||
var/check_antimagic = TRUE
|
||||
var/check_holy = FALSE
|
||||
|
||||
/obj/effect/proc_holder/spell/dumbfire/choose_targets(mob/user = usr)
|
||||
|
||||
var/turf/T = get_turf(user)
|
||||
@@ -74,7 +77,7 @@
|
||||
break
|
||||
|
||||
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - user
|
||||
if(L && L.stat != DEAD)
|
||||
if(L && L.stat != DEAD && L.anti_magic_check(check_antimagic, check_holy))
|
||||
if(!ignore_factions.len)
|
||||
projectile.cast(L.loc,user=user)
|
||||
break
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/proc_holder/spell/targeted/emplosion
|
||||
name = "Emplosion"
|
||||
desc = "This spell emplodes an area."
|
||||
@@ -13,4 +14,23 @@
|
||||
for(var/mob/living/target in targets)
|
||||
empulse(target.loc, emp_heavy, emp_light)
|
||||
|
||||
=======
|
||||
/obj/effect/proc_holder/spell/targeted/emplosion
|
||||
name = "Emplosion"
|
||||
desc = "This spell emplodes an area."
|
||||
|
||||
var/emp_heavy = 2
|
||||
var/emp_light = 3
|
||||
|
||||
action_icon_state = "emp"
|
||||
sound = 'sound/weapons/zapbang.ogg'
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/emplosion/cast(list/targets,mob/user = usr)
|
||||
playsound(get_turf(user), sound, 50,1)
|
||||
for(var/mob/living/target in targets)
|
||||
if(target.anti_magic_check())
|
||||
continue
|
||||
empulse(target.loc, emp_heavy, emp_light)
|
||||
|
||||
>>>>>>> 2ac902a... Refactors anti-magic into a component (#35639)
|
||||
return
|
||||
@@ -8,8 +8,9 @@
|
||||
var/ex_flash = 4
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/explosion/cast(list/targets,mob/user = usr)
|
||||
|
||||
for(var/mob/living/target in targets)
|
||||
if(target.anti_magic_check())
|
||||
continue
|
||||
explosion(target.loc,ex_severe,ex_heavy,ex_light,ex_flash)
|
||||
|
||||
return
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
/obj/effect/forcefield/wizard/CanPass(atom/movable/mover, turf/target)
|
||||
if(mover == wizard)
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
var/mob/M = mover
|
||||
if(M.anti_magic_check())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets,mob/user = usr)
|
||||
playMagSound()
|
||||
for(var/mob/living/carbon/target in targets)
|
||||
if(target.anti_magic_check())
|
||||
continue
|
||||
if(!target.dna)
|
||||
continue
|
||||
for(var/A in mutations)
|
||||
|
||||
@@ -57,6 +57,20 @@
|
||||
for(var/mob/living/L in view(src, 7))
|
||||
if(L != user)
|
||||
L.flash_act(affect_silicon = FALSE)
|
||||
var/atom/A = M.anti_magic_check()
|
||||
if(A)
|
||||
if(isitem(A))
|
||||
target.visible_message("<span class='warning'>[target]'s [A] glows brightly as it wards off the spell!</span>")
|
||||
user.visible_message("<span class='warning'>The feedback blows [user]'s arm off!</span>","<span class='userdanger'>The spell bounces from [M]'s skin back into your arm!</span>")
|
||||
user.flash_act()
|
||||
var/obj/item/bodypart/part
|
||||
var/index = user.get_held_index_of_item(src)
|
||||
if(index)
|
||||
part = user.hand_bodyparts[index]
|
||||
if(part)
|
||||
part.dismember()
|
||||
..()
|
||||
return
|
||||
M.gib()
|
||||
..()
|
||||
|
||||
@@ -78,6 +92,11 @@
|
||||
to_chat(user, "<span class='notice'>You can't get the words out!</span>")
|
||||
return
|
||||
var/mob/living/M = target
|
||||
if(M.anti_magic_check())
|
||||
to_chat(user, "<span class='warning'>The spell can't seem to affect [M]!</span>")
|
||||
to_chat(M, "<span class='warning'>You feel your flesh turn to stone for a moment, then revert back!</span>")
|
||||
..()
|
||||
return
|
||||
M.Stun(40)
|
||||
M.petrify()
|
||||
..()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/proc_holder/spell/targeted/inflict_handler
|
||||
name = "Inflict Handler"
|
||||
desc = "This spell blinds and/or destroys/damages/heals and/or knockdowns/stuns the target."
|
||||
@@ -45,4 +46,57 @@
|
||||
target.blur_eyes(amt_eye_blurry)
|
||||
//summoning
|
||||
if(summon_type)
|
||||
=======
|
||||
/obj/effect/proc_holder/spell/targeted/inflict_handler
|
||||
name = "Inflict Handler"
|
||||
desc = "This spell blinds and/or destroys/damages/heals and/or knockdowns/stuns the target."
|
||||
|
||||
var/amt_knockdown = 0
|
||||
var/amt_unconscious = 0
|
||||
var/amt_stun = 0
|
||||
|
||||
//set to negatives for healing
|
||||
var/amt_dam_fire = 0
|
||||
var/amt_dam_brute = 0
|
||||
var/amt_dam_oxy = 0
|
||||
var/amt_dam_tox = 0
|
||||
|
||||
var/amt_eye_blind = 0
|
||||
var/amt_eye_blurry = 0
|
||||
|
||||
var/destroys = "none" //can be "none", "gib" or "disintegrate"
|
||||
|
||||
var/summon_type = null //this will put an obj at the target's location
|
||||
|
||||
var/check_anti_magic = TRUE
|
||||
var/check_holy = FALSE
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/inflict_handler/cast(list/targets,mob/user = usr)
|
||||
for(var/mob/living/target in targets)
|
||||
playsound(target,sound, 50,1)
|
||||
if(target.anti_magic_check(check_anti_magic, check_holy))
|
||||
return
|
||||
switch(destroys)
|
||||
if("gib")
|
||||
target.gib()
|
||||
if("disintegrate")
|
||||
target.dust()
|
||||
|
||||
if(!target)
|
||||
continue
|
||||
//damage/healing
|
||||
target.adjustBruteLoss(amt_dam_brute)
|
||||
target.adjustFireLoss(amt_dam_fire)
|
||||
target.adjustToxLoss(amt_dam_tox)
|
||||
target.adjustOxyLoss(amt_dam_oxy)
|
||||
//disabling
|
||||
target.Knockdown(amt_knockdown)
|
||||
target.Unconscious(amt_unconscious)
|
||||
target.Stun(amt_stun)
|
||||
|
||||
target.blind_eyes(amt_eye_blind)
|
||||
target.blur_eyes(amt_eye_blurry)
|
||||
//summoning
|
||||
if(summon_type)
|
||||
>>>>>>> 2ac902a... Refactors anti-magic into a component (#35639)
|
||||
new summon_type(target.loc, target)
|
||||
@@ -65,6 +65,9 @@
|
||||
/obj/effect/proc_holder/spell/targeted/tesla/proc/Bolt(mob/origin,mob/target,bolt_energy,bounces,mob/user = usr)
|
||||
origin.Beam(target,icon_state="lightning[rand(1,12)]",time=5)
|
||||
var/mob/living/carbon/current = target
|
||||
if(current.anti_magic_check())
|
||||
playsound(get_turf(current), 'sound/magic/lightningshock.ogg', 50, 1, -1)
|
||||
current.visible_message("<span class='warning'>[current] absorbs the spell, remaining unharmed!</span>", "<span class='userdanger'>You absorb the spell, remaining unharmed!</span>")
|
||||
if(bounces < 1)
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1)
|
||||
playsound(get_turf(current), 'sound/magic/lightningshock.ogg', 50, 1, -1)
|
||||
|
||||
@@ -54,7 +54,7 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
return
|
||||
|
||||
var/datum/mind/TM = target.mind
|
||||
if((TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev)) || cmptext(copytext(target.key,1,2),"@"))
|
||||
if((target.anti_magic_check() || TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev)) || cmptext(copytext(target.key,1,2),"@"))
|
||||
to_chat(user, "<span class='warning'>[target.p_their(TRUE)] mind is resisting your spell!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -45,5 +45,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/effect/immovablerod/wizard/penetrate(mob/living/L)
|
||||
if(L.anti_magic_check())
|
||||
L.visible_message("<span class='danger'>[src] hits [L], but it bounces back, then vanishes!</span>" , "<span class='userdanger'>[src] hits you... but it bounces back, then vanishes!</span>" , "<span class ='danger'>You hear a weak, sad, CLANG.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[L] is penetrated by an immovable rod!</span>" , "<span class='userdanger'>The rod penetrates you!</span>" , "<span class ='danger'>You hear a CLANG!</span>")
|
||||
L.adjustBruteLoss(70 + damage_bonus)
|
||||
|
||||
@@ -85,6 +85,10 @@
|
||||
dir = pick(GLOB.cardinals)
|
||||
|
||||
/obj/effect/cross_action/spacetime_dist/proc/walk_link(atom/movable/AM)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.anti_magic_check())
|
||||
return
|
||||
if(linked_dist && walks_left > 0)
|
||||
flick("purplesparkles", src)
|
||||
linked_dist.get_walker(AM)
|
||||
|
||||
@@ -258,6 +258,7 @@
|
||||
sound = 'sound/magic/repulse.ogg'
|
||||
var/maxthrow = 5
|
||||
var/sparkle_path = /obj/effect/temp_visual/gravpush
|
||||
var/anti_magic_check = TRUE
|
||||
|
||||
action_icon_state = "repulse"
|
||||
|
||||
@@ -275,6 +276,11 @@
|
||||
if(AM == user || AM.anchored)
|
||||
continue
|
||||
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.anti_magic_check(anti_magic_check, FALSE))
|
||||
continue
|
||||
|
||||
throwtarget = get_edge_target_turf(user, get_dir(user, get_step_away(AM, user)))
|
||||
distfromcaster = get_dist(user, AM)
|
||||
if(distfromcaster == 0)
|
||||
@@ -304,6 +310,7 @@
|
||||
action_icon = 'icons/mob/actions/actions_xeno.dmi'
|
||||
action_icon_state = "tailsweep"
|
||||
action_background_icon_state = "bg_alien"
|
||||
anti_magic_check = FALSE
|
||||
|
||||
/obj/effect/proc_holder/spell/aoe_turf/repulse/xeno/cast(list/targets,mob/user = usr)
|
||||
if(iscarbon(user))
|
||||
@@ -328,10 +335,13 @@
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/sacred_flame/cast(list/targets, mob/user = usr)
|
||||
for(var/mob/living/L in targets)
|
||||
if(L.anti_magic_check(TRUE, TRUE))
|
||||
continue
|
||||
L.adjust_fire_stacks(20)
|
||||
if(isliving(user))
|
||||
var/mob/living/U = user
|
||||
U.IgniteMob()
|
||||
if(!U.anti_magic_check(TRUE, TRUE))
|
||||
U.IgniteMob()
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/conjure_item/spellpacket
|
||||
name = "Thrown Lightning"
|
||||
@@ -356,7 +366,8 @@
|
||||
if(!..())
|
||||
if(isliving(hit_atom))
|
||||
var/mob/living/M = hit_atom
|
||||
M.electrocute_act(80, src, illusion = 1)
|
||||
if(!M.anti_magic_check())
|
||||
M.electrocute_act(80, src, illusion = 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/spellpacket/lightningbolt/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
|
||||
|
||||
Reference in New Issue
Block a user