mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Ports Anti-magic from TG. (#27560)
* the rest of the fucking owl * OK hands need work but otherwise good * fuck time out fix vampire after * temporary codersprite do not merge this lmao * codersprite up * pause, time out * deploy the antimagic * Update code/__HELPERS/trait_helpers.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> * Update code/datums/status_effects/buffs.dm Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> * Update code/game/gamemodes/wizard/magic_tarot.dm Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
|
||||
/obj/item/projectile/magic/chaos/on_hit(atom/target, blocked = 0)
|
||||
. = ..()
|
||||
|
||||
if(!.)
|
||||
return
|
||||
if(iswallturf(target) || isobj(target))
|
||||
target.color = pick(GLOB.random_color_list)
|
||||
return
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
var/can_charge = TRUE
|
||||
var/ammo_type
|
||||
var/no_den_usage
|
||||
var/antimagic_flags = MAGIC_RESISTANCE
|
||||
origin_tech = null
|
||||
clumsy_check = FALSE
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
|
||||
@@ -31,6 +32,9 @@
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
if(!user.can_cast_magic(antimagic_flags))
|
||||
to_chat(user, "<span class='warning'>[src] whizzles quietly.</span>")
|
||||
return FALSE
|
||||
..()
|
||||
|
||||
/obj/item/gun/magic/can_shoot()
|
||||
|
||||
@@ -6,6 +6,28 @@
|
||||
nodamage = 1
|
||||
armour_penetration_percentage = 100
|
||||
flag = MAGIC
|
||||
/// determines what type of antimagic can block the spell projectile
|
||||
var/antimagic_flags = MAGIC_RESISTANCE
|
||||
/// determines the drain cost on the antimagic item
|
||||
var/antimagic_charge_cost = 1
|
||||
|
||||
/obj/item/projectile/magic/prehit(atom/target)
|
||||
if(isliving(target))
|
||||
var/mob/living/victim = target
|
||||
if(victim.can_block_magic(antimagic_flags, antimagic_charge_cost))
|
||||
visible_message("<span class='warning'>[src] fizzles on contact with [victim]!</span>")
|
||||
damage = 0
|
||||
nodamage = 1
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/magic/on_hit(atom/target, blocked, hit_zone)
|
||||
if(isliving(target))
|
||||
var/mob/living/victim = target
|
||||
if(victim.can_block_magic(antimagic_flags, antimagic_charge_cost)) // Yes we have to check this twice welcome to bullet hell code
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/projectile/magic/death
|
||||
name = "bolt of death"
|
||||
@@ -21,7 +43,7 @@
|
||||
muzzle_flash_range = 2
|
||||
muzzle_flash_color_override = LIGHT_COLOR_PURPLE
|
||||
impact_light_intensity = 7
|
||||
impact_light_range = 2.5
|
||||
impact_light_range = 2.5
|
||||
impact_light_color_override = LIGHT_COLOR_PURPLE
|
||||
|
||||
/obj/item/projectile/magic/fireball
|
||||
@@ -41,6 +63,8 @@
|
||||
|
||||
/obj/item/projectile/magic/death/on_hit(mob/living/carbon/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
if(isliving(target))
|
||||
if(target.mob_biotypes & MOB_UNDEAD) //negative energy heals the undead
|
||||
if(target.revive())
|
||||
@@ -75,6 +99,8 @@
|
||||
|
||||
/obj/item/projectile/magic/fireball/on_hit(target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
var/turf/T = get_turf(target)
|
||||
explosion(T, exp_devastate, exp_heavy, exp_light, exp_flash, 0, flame_range = exp_fire)
|
||||
if(ismob(target)) //multiple flavors of pain
|
||||
@@ -95,6 +121,8 @@
|
||||
|
||||
/obj/item/projectile/magic/resurrection/on_hit(mob/living/carbon/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
if(ismob(target))
|
||||
if(target.mob_biotypes & MOB_UNDEAD) //positive energy harms the undead
|
||||
target.death(FALSE)
|
||||
@@ -121,6 +149,8 @@
|
||||
|
||||
/obj/item/projectile/magic/teleport/on_hit(mob/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
var/teleammount = 0
|
||||
var/teleloc = target
|
||||
if(!isturf(target))
|
||||
@@ -142,6 +172,8 @@
|
||||
|
||||
/obj/item/projectile/magic/door/on_hit(atom/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
var/atom/T = target.loc
|
||||
if(isturf(target) && target.density)
|
||||
if(!(istype(target, /turf/simulated/wall/indestructible)))
|
||||
@@ -179,6 +211,8 @@
|
||||
|
||||
/obj/item/projectile/magic/change/on_hit(atom/change)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
wabbajack(change)
|
||||
|
||||
GLOBAL_LIST_INIT(wabbajack_hostile_animals, list(
|
||||
@@ -380,6 +414,9 @@ GLOBAL_LIST_INIT(wabbajack_docile_animals, list(
|
||||
SpinAnimation()
|
||||
|
||||
/obj/item/projectile/magic/slipping/on_hit(atom/target, blocked = 0)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.slip(src, slip_weaken, 0, FALSE, TRUE) //Slips even with noslips/magboots on. NO ESCAPE!
|
||||
@@ -394,7 +431,6 @@ GLOBAL_LIST_INIT(wabbajack_docile_animals, list(
|
||||
to_chat(target, "<span class='notice'>You get splatted by [src].</span>")
|
||||
L.Weaken(slip_weaken)
|
||||
L.Stun(slip_stun)
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/magic/arcane_barrage
|
||||
name = "arcane bolt"
|
||||
|
||||
Reference in New Issue
Block a user