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:
Qwertytoforty
2025-01-02 08:36:07 +00:00
committed by GitHub
co-authored by DGamerL Burzah
parent 6057ff5c31
commit 7bbebbb23f
62 changed files with 580 additions and 28 deletions
+24 -5
View File
@@ -16,6 +16,8 @@
throw_range = 0
throw_speed = 0
new_attack_chain = TRUE
/// Has it been blocked by antimagic? If so, abort.
var/blocked_by_antimagic = FALSE
/obj/item/melee/touch_attack/New(spell)
attached_spell = spell
@@ -37,6 +39,17 @@
to_chat(user, "<span class='warning'>You can't reach out!</span>")
return FINISH_ATTACK
/obj/item/melee/touch_attack/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
var/mob/mob_victim = target
if(istype(mob_victim) && mob_victim.can_block_magic(attached_spell.antimagic_flags))
to_chat(user, "<span class='danger'>[mob_victim] absorbs your spell!</span>")
blocked_by_antimagic = TRUE
if(attached_spell && attached_spell.cooldown_handler)
attached_spell.cooldown_handler.start_recharge(attached_spell.cooldown_handler.recharge_duration * 0.5)
qdel(src)
return
/obj/item/melee/touch_attack/proc/handle_delete(mob/user)
if(catchphrase)
user.say(catchphrase)
@@ -53,9 +66,10 @@
icon_state = "disintegrate"
item_state = "disintegrate"
/obj/item/melee/touch_attack/disintegrate/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(!proximity_flag || target == user || !ismob(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //exploding after touching yourself would be bad
if(!proximity_flag || target == user || blocked_by_antimagic || !ismob(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //exploding after touching yourself would be bad
return
var/mob/M = target
do_sparks(4, 0, M.loc) //no idea what the 0 is
@@ -72,7 +86,8 @@
/obj/item/melee/touch_attack/fleshtostone/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(!proximity_flag || target == user || !isliving(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //getting hard after touching yourself would also be bad
if(!proximity_flag || target == user || blocked_by_antimagic || !isliving(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //getting hard after touching yourself would also be bad
return
var/mob/living/L = target
L.Stun(4 SECONDS)
@@ -90,12 +105,14 @@
/obj/item/melee/touch_attack/plushify/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(!proximity_flag || target == user || !isliving(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //There are better ways to get a good nights sleep in a bed.
if(!proximity_flag || target == user || blocked_by_antimagic || !isliving(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //There are better ways to get a good nights sleep in a bed.
return
var/mob/living/L = target
L.plushify()
handle_delete(user)
/obj/item/melee/touch_attack/fake_disintegrate
name = "toy plastic hand"
desc = "This hand of mine glows with an awesome power! Ok, maybe just batteries."
@@ -107,7 +124,8 @@
/obj/item/melee/touch_attack/fake_disintegrate/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(!proximity_flag || target == user || !ismob(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //not exploding after touching yourself would be bad
if(!proximity_flag || target == user || blocked_by_antimagic || !ismob(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //not exploding after touching yourself would be bad
return
do_sparks(4, 0, target.loc)
playsound(target.loc, 'sound/goonstation/effects/gib.ogg', 50, 1)
@@ -123,7 +141,8 @@
/obj/item/melee/touch_attack/cluwne/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(!proximity_flag || target == user || !ishuman(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //clowning around after touching yourself would unsurprisingly, be bad
if(!proximity_flag || target == user || blocked_by_antimagic || !ishuman(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) //clowning around after touching yourself would unsurprisingly, be bad
return
if(iswizard(target))
+17 -1
View File
@@ -232,6 +232,11 @@
qdel(src)
/obj/item/magic_tarot_card/proc/pre_activate(mob/user, atom/movable/thrower)
if(user != thrower) //Ignore antimagic stuff if the user is the thrower (aka self activation)
if(user.can_block_magic(our_tarot.antimagic_flags, 1))
visible_message("<span class='warning'>[src] burns up in a flash on contact with [user]!</span>")
qdel(src)
return
has_been_activated = TRUE
forceMove(user)
var/obj/effect/temp_visual/card_preview/tarot/draft = new(user, "tarot_[our_tarot.card_icon]")
@@ -288,6 +293,8 @@
var/card_icon = "the_unknown"
/// Are we reversed? Used for the card back.
var/reversed = FALSE
/// What antimagic flags do we have?
var/antimagic_flags = MAGIC_RESISTANCE
/datum/tarot/proc/activate(mob/living/target)
stack_trace("A bugged tarot card was spawned and used. Please make an issue report! Type was [src.type]")
@@ -688,8 +695,11 @@
var/sparkle_path = /obj/effect/temp_visual/gravpush
for(var/turf/T in range(5, target)) //Done this way so things don't get thrown all around hilariously.
for(var/atom/movable/AM in T)
if(ismob(AM))
var/mob/victim_mob = AM
if(victim_mob.can_block_magic(antimagic_flags))
continue
thrown_atoms += AM
for(var/atom/movable/AM as anything in thrown_atoms)
if(AM == target || AM.anchored || (ismob(AM) && !isliving(AM)))
continue
@@ -729,6 +739,9 @@
/datum/tarot/reversed/the_empress/activate(mob/living/target)
for(var/mob/living/L in oview(9, target))
if(L.can_block_magic(antimagic_flags))
to_chat(L, "<span class='notice'>You feel calm for a second, but it quickly passes.</span>")
continue
L.apply_status_effect(STATUS_EFFECT_PACIFIED)
/datum/tarot/reversed/the_emperor
@@ -763,6 +776,8 @@
for(var/mob/living/M in shuffle(orange(7, target)))
if(M.stat == DEAD) //Let us not have dead mobs be used to make a disco inferno.
continue
if(M.can_block_magic(antimagic_flags)) //Be spared!
continue
if(active_chasers >= 2)
return
var/obj/effect/temp_visual/hierophant/chaser/C = new(get_turf(target), target, M, 1, FALSE)
@@ -959,6 +974,7 @@
desc = "May you remember lost memories."
extended_desc = "will reveal the memories of everyone in range to the user."
card_icon = "the_moon?"
antimagic_flags = MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND
/datum/tarot/reversed/the_moon/activate(mob/living/target)
for(var/mob/living/L in view(5, target)) //Shorter range as this kinda can give away antagonists, though that is also funny.
+3 -1
View File
@@ -499,7 +499,9 @@
//Weapons and Armors
/datum/spellbook_entry/item/battlemage
name = "Battlemage Armor"
desc = "An ensorceled spaceproof suit of protective yet light armor, protected by a powerful shield. The shield can completely negate 15 attacks before permanently failing."
desc = "An ensorceled spaceproof suit of protective yet light armor, protected by a powerful shield. The shield can completely negate 15 attacks before permanently failing. \
This armor grants you full protection from magical attacks, and allows you to cast magic despite that. However, this means it will also block wands or staffs of \
healing from working on you, and should be removed before application."
item_path = /obj/item/storage/box/wizard/hardsuit
limit = 1
category = "Weapons and Armors"