New wizard spell: The Traps (#24571)

* New wizard spell: The Traps

🆑 coiax
add: Wizards now have a new spell "The Traps" in their spellbook.
Summon an array of temporary and permament hazards for your foes, but
don't fall into your own trap(s).
/🆑

Conjures some traps in an aoe, traps include Hand of God traps and
swarmer shocking traps. Hand of God traps require 60 seconds to recharge
between trapping.

I saw Cobby give this as a TC trade, and I thought it seems reasonable
as a silly wizard spell.

* Added The Traps to spellbook, modifed trap code more

* Adds action icon for The Traps

* Need to be adjacent to disarm

* Invocation is now Latin for "BEWARE THE TRAPS"
This commit is contained in:
coiax
2017-03-08 12:13:03 +13:00
committed by oranges
parent 7e577608ec
commit 311ea1c7f1
6 changed files with 86 additions and 29 deletions
+52 -27
View File
@@ -4,58 +4,82 @@
icon = 'icons/obj/hand_of_god_structures.dmi'
icon_state = "trap"
density = 0
anchored = TRUE
alpha = 30 //initially quite hidden when not "recharging"
var/last_trigger = 0
var/time_between_triggers = 600 //takes a minute to recharge
/obj/structure/trap/Crossed(atom/movable/AM)
if(last_trigger + time_between_triggers > world.time)
return
alpha = initial(alpha)
if(isliving(AM))
var/mob/living/L = AM
last_trigger = world.time
alpha = 200
trap_effect(L)
animate(src, alpha = initial(alpha), time = time_between_triggers)
var/list/static/ignore_typecache
var/datum/effect_system/spark_spread/spark_system
/obj/structure/trap/Initialize(mapload)
..()
spark_system = new
spark_system.set_up(4,1,src)
spark_system.attach(src)
if(!ignore_typecache)
ignore_typecache = typecacheof(list(
/obj/effect,
/mob/dead))
/obj/structure/trap/Destroy()
qdel(spark_system)
spark_system = null
. = ..()
/obj/structure/trap/examine(mob/user)
..()
if(!isliving(user)) //bad ghosts, stop trying to powergame from beyond the grave
if(!isliving(user))
return
user << "You reveal a trap!"
if(get_dist(user, src) <= 1)
user << "<span class='notice'>You reveal [src]!</span>"
flare()
/obj/structure/trap/proc/flare()
// Makes the trap visible, and starts the cooldown until it's
// able to be triggered again.
visible_message("<span class='warning'>[src] flares brightly!</span>")
alpha = 200
animate(src, alpha = initial(alpha), time = time_between_triggers)
last_trigger = world.time
spark_system.start()
/obj/structure/trap/Crossed(atom/movable/AM)
if(last_trigger + time_between_triggers > world.time)
return
// Don't want the traps triggered by sparks, ghosts or projectiles.
if(is_type_in_typecache(AM, ignore_typecache))
return
flare()
if(isliving(AM))
trap_effect(AM)
/obj/structure/trap/proc/trap_effect(mob/living/L)
return
/obj/structure/trap/stun
name = "shock trap"
desc = "A trap that will shock you, it will burn your flesh and render you immobile, You'd better avoid it."
desc = "A trap that will shock and render you immobile. You'd better avoid it."
icon_state = "trap-shock"
/obj/structure/trap/stun/trap_effect(mob/living/L)
L << "<span class='danger'><B>You are paralyzed from the intense shock!</B></span>"
L.electrocute_act(30, src, safety=1) // electrocute act does a message.
L.Weaken(5)
var/turf/Lturf = get_turf(L)
new /obj/effect/particle_effect/sparks/electricity(Lturf)
new /obj/effect/particle_effect/sparks(Lturf)
/obj/structure/trap/fire
name = "flame trap"
desc = "A trap that will set you ablaze. You'd better avoid it."
icon_state = "trap-fire"
/obj/structure/trap/fire/trap_effect(mob/living/L)
L << "<span class='danger'><B>Spontaneous combustion!</B></span>"
L.Weaken(1)
var/turf/Lturf = get_turf(L)
new /obj/effect/hotspot(Lturf)
new /obj/effect/particle_effect/sparks(Lturf)
/obj/structure/trap/fire/flare()
..()
new /obj/effect/hotspot(get_turf(src))
/obj/structure/trap/chill
@@ -63,12 +87,11 @@
desc = "A trap that will chill you to the bone. You'd better avoid it."
icon_state = "trap-frost"
/obj/structure/trap/chill/trap_effect(mob/living/L)
L << "<span class='danger'><B>You're frozen solid!</B></span>"
L.Weaken(1)
L.bodytemperature -= 300
new /obj/effect/particle_effect/sparks(get_turf(L))
L.apply_status_effect(/datum/status_effect/freon)
/obj/structure/trap/damage
@@ -81,9 +104,11 @@
L << "<span class='danger'><B>The ground quakes beneath your feet!</B></span>"
L.Weaken(5)
L.adjustBruteLoss(35)
var/turf/Lturf = get_turf(L)
new /obj/effect/particle_effect/sparks(Lturf)
new /obj/structure/flora/rock(Lturf)
/obj/structure/trap/damage/flare()
..()
var/obj/structure/flora/rock/giant_rock = new(get_turf(src))
QDEL_IN(giant_rock, 200)
/obj/structure/trap/ward