diff --git a/code/datums/status_effects/gas.dm b/code/datums/status_effects/gas.dm index 1ed1848f1b4..529c266efc1 100644 --- a/code/datums/status_effects/gas.dm +++ b/code/datums/status_effects/gas.dm @@ -12,7 +12,7 @@ /datum/status_effect/freon/on_apply() if(!owner.stat) - owner << "You become frozen in a cube!" + owner << "You become frozen in a cube!" cube = icon('icons/effects/freeze.dmi', "ice_cube") owner.add_overlay(cube) owner.update_canmove() diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 4acf1fc0032..3033de04700 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -277,6 +277,14 @@ category = "Defensive" cost = 1 +/datum/spellbook_entry/the_traps + name = "The Traps!" + spell_type = /obj/effect/proc_holder/spell/aoe_turf/conjure/the_traps + log_name = "TT" + category = "Offensive" + cost = 1 + + /datum/spellbook_entry/item name = "Buy Item" refundable = 0 @@ -773,7 +781,7 @@ recoil(user) else user.mind.AddSpell(S) - user <<"you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!" + user <<"You rapidly read through the arcane book. Suddenly you realize you understand [spellname]!" user.log_message("learned the spell [spellname] ([S]).", INDIVIDUAL_ATTACK_LOG) onlearned(user) diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm index b6c9e0ba7bb..e3778e802a9 100644 --- a/code/game/objects/structures/traps.dm +++ b/code/game/objects/structures/traps.dm @@ -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 << "You reveal [src]!" + flare() + +/obj/structure/trap/proc/flare() + // Makes the trap visible, and starts the cooldown until it's + // able to be triggered again. + visible_message("[src] flares brightly!") 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 << "You are paralyzed from the intense shock!" + 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 << "Spontaneous combustion!" 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 << "You're frozen solid!" 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 << "The ground quakes beneath your feet!" 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 diff --git a/code/modules/spells/spell_types/the_traps.dm b/code/modules/spells/spell_types/the_traps.dm new file mode 100644 index 00000000000..ca3da766172 --- /dev/null +++ b/code/modules/spells/spell_types/the_traps.dm @@ -0,0 +1,23 @@ +/obj/effect/proc_holder/spell/aoe_turf/conjure/the_traps + name = "The Traps!" + desc = "Summon a number of traps to confuse and weaken your enemies, and possibly you." + + charge_max = 250 + cooldown_min = 100 + + clothes_req = 1 + invocation = "CAVERE INSIDIAS" + invocation_type = "shout" + range = 3 + + summon_type = list( + /obj/structure/trap/stun, + /obj/structure/trap/fire, + /obj/structure/trap/chill, + /obj/structure/trap/damage, + /obj/structure/swarmer/trap + ) + summon_lifespan = 0 + summon_amt = 5 + + action_icon_state = "the_traps" diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index 42d2a4fe9d4..775b81dfdde 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 11660a37bd6..788654dcc18 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1967,6 +1967,7 @@ #include "code\modules\spells\spell_types\shapeshift.dm" #include "code\modules\spells\spell_types\spacetime_distortion.dm" #include "code\modules\spells\spell_types\summonitem.dm" +#include "code\modules\spells\spell_types\the_traps.dm" #include "code\modules\spells\spell_types\touch_attacks.dm" #include "code\modules\spells\spell_types\trigger.dm" #include "code\modules\spells\spell_types\turf_teleport.dm"