# Lua
[ToC]
## Base
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
end
end
```
## It's right behind you (:
<details>
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
local healthdoll = nil
local function wrap_top_text(text_to_wrap)
return "<span style=\"color: gray; font-family: Fixedsys, monospace; text-align: center; -dm-text-outline: 1 black;\">" .. text_to_wrap .. "</span>"
end
local function wrap_bottom_text(text_to_wrap)
return "<span style=\"color: black; text-align: center; font-family: Fixedsys\"><i>" .. text_to_wrap .. "</i></span>"
end
local function set_text_slow(top_text, bottom_text)
for i = 1, string.len(top_text) do
healthdoll:set_var("maptext", (wrap_top_text(string.sub(top_text, 1, i))))
SS13.wait(0.1)
end
for i = 1, string.len(bottom_text) do
healthdoll:set_var("maptext", wrap_top_text(top_text) .. "<br>" .. (wrap_bottom_text(string.sub(bottom_text, 1, i))))
SS13.wait(0.1)
end
end
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
mobhud = mob:get_var("hud_used")
healthdoll = mobhud:get_var("healthdoll")
healthdoll:set_var("maptext_height", 320)
healthdoll:set_var("maptext_width", 320)
healthdoll:set_var("maptext_x", -460)
healthdoll:set_var("maptext_y", 96)
set_text_slow("You hear something right behind you.", "It's right there...")
SS13.wait(3)
healthdoll:set_var("maptext", "")
end
end
```
</details>
## Panic Demon 2
<details>
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
-- |------------------------------------------------------------------------------------|
local panicset = {
" panic ohfuckit'srightthere",
" PANIC panic",
" panic panic",
"<br>",
" fuckfuckfuck it hurts panic",
" PANIC",
" PANIC icanhearit",
"panic shitSHITFUCK panic",
" panic",
" PANIC ohfuck",
"<br><br>",
"panicpanicpanic OHFUCK icanhearit",
" panic PANIC",
" panic panicpanic",
" PANICPANICPAN PANIC",
"panic PANIC panic",
"hurts panic panic fuckfuck",
" ohno panic fuckfuckfuck",
" panicpanicPA ",
" FUCKFUCKFUCK PANIC panic",
" panic",
" panic",
"panic PANIC",
" OHFUCK ohgodwhereisit",
" panic panic",
" PANIC panic",
" panic panic",
" panic",
" panic panic",
" OHSHITIT'STHERE PANIC",
" it hurts PANIC shitpanicpanicpanic panic",
" fuckfuckfuck panic",
}
local function wrap_bottom_text(text_to_wrap)
return "<span style=\"color: red; font-family: Fixedsys\">" .. text_to_wrap .. "</span>"
end
local function set_text()
total_string = ""
for index, phrase in panicset do
total_string = total_string .. "<br>" .. phrase
end
healthdoll:set_var("maptext", wrap_bottom_text(total_string))
end
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
mobhud = mob:get_var("hud_used")
healthdoll = mobhud:get_var("healthdoll")
healthdoll:set_var("maptext_height", 640)
healthdoll:set_var("maptext_width", 640)
healthdoll:set_var("maptext_x", -620)
healthdoll:set_var("maptext_y", -200)
plane_master_list = mobhud:get_var("plane_master_controllers")
plane_master = plane_master_list:get("plane_masters_game")
if plane_master then
plane_master:call_proc("add_filter", "psychic_wave", 10, dm.global_proc("wave_filter", 240, 240, 3, 0, 1))
plane_master:call_proc("add_filter", "psychic_blur", 10, dm.global_proc("angular_blur_filter", 0, 0, 3))
end
set_text()
mob:call_proc("set_timed_status_effect", 5 * 1.5 * 10, dm.global_proc("_text2path", "/datum/status_effect/confusion"), true) -- 5 iterations of 1.5s times 10 for ds to s
for i = 1, 5 do
mob:call_proc("playsound_local", mob, "sound/effects/singlebeat.ogg", 50 + (i * 10))
SS13.wait(1.5)
end
if plane_master then
plane_master:call_proc("remove_filter", "psychic_blur")
plane_master:call_proc("remove_filter", "psychic_wave")
end
healthdoll:set_var("maptext", "")
end
end
```
</details>
## Hyperdeath
<details>
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
local delay = 0.4
local volume = 90
local function beam_from_to(from_loc, to_loc, mob)
from_loc:call_proc("Beam", to_loc, beamtype, dm.global_proc("icon", "icons/effects/beam.dmi"), 7.5)
dm.global_proc("playsound", from_loc, "sound/magic/blink.ogg", volume, true)
mob:call_proc("forceMove", to_loc)
if over_exec_usage(0.9) then
sleep()
end
end
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
SS13.register_signal(mob, "mob_examinate", function(_, examinate)
beamtype = "kinesis"
cancel_on_nonmob = true
dramatic_ending = true
if not (SS13.istype(examinate, "/mob/living")) then
if cancel_on_nonmob then
SS13.unregister_signal(mob, "mob_examinate", callback)
end
return
end
SS13.unregister_signal(mob, "mob_examinate")
gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", mob:get_var("loc"))
mob:call_proc("put_in_hands", gun)
gun:set_var("fire_delay", 0)
gun:call_proc("toggle_safety", mob, "off") -- ready to KILL
beam_from_to(dm.global_proc("_get_step", mob, 0), dm.global_proc("_locate", examinate:get_var("x"), examinate:get_var("y") - 2, examinate:get_var("z")), mob)
gun:call_proc("fire_gun", examinate, mob)
SS13.wait(delay)
beam_from_to(dm.global_proc("_get_step", mob, 0), dm.global_proc("_locate", examinate:get_var("x") + 2, examinate:get_var("y"), examinate:get_var("z")), mob)
gun:call_proc("fire_gun", examinate, mob)
SS13.wait(delay)
beam_from_to(dm.global_proc("_get_step", mob, 0), dm.global_proc("_locate", examinate:get_var("x"), examinate:get_var("y") + 2, examinate:get_var("z")), mob)
gun:call_proc("fire_gun", examinate, mob)
SS13.wait(delay)
beam_from_to(dm.global_proc("_get_step", mob, 0), dm.global_proc("_locate", examinate:get_var("x") - 2, examinate:get_var("y"), examinate:get_var("z")), mob)
gun:call_proc("fire_gun", examinate, mob)
if dramatic_ending then
SS13.wait(delay * 1.25)
target_turf = dm.global_proc("_locate", examinate:get_var("x"), examinate:get_var("y") - 2, examinate:get_var("z"))
mob_turf:call_proc("Beam", target_turf, beamtype, dm.global_proc("icon", "icons/effects/beam.dmi"), 7.5)
dm.global_proc("playsound", mob_turf, "sound/magic/blink.ogg", volume, true)
mob:call_proc("forceMove", target_turf)
for i = 1, 4 do
gun:call_proc("fire_gun", examinate, mob)
SS13.wait(0.05)
end
end
end)
end
end
```
</details>
## Slab - Omni
<details>
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
local delay = 0.4
local volume = 90
local dramatic_ending = true
local cancel_onmob = true
local abilities = {"shotgun", "dash", "link", "pulse", "tower", "personnel", "clone", "end Signal"}
selected_ability = nil
linked_mobs = {}
linked_shotguns = {}
reprisal_turf = nil
moves_until_reprisal = 25
reprisals_left = 2 -- die twice, and the third's for real.
local function span_notice(text)
return "<span class='notice'>" .. text .. "</span>"
end
local function span_warning(text)
return "<span class='warning'>" .. text .. "</span>"
end
local function span_boldwarning(text)
return "<span class='boldwarning'>" .. text .. "</span>"
end
local function beam_from_to(pointed, mob, x_offset, y_offset)
local from_loc = dm.global_proc("_get_step", mob, 0)
local to_loc = dm.global_proc("_locate", pointed:get_var("x") + x_offset, pointed:get_var("y") + y_offset, pointed:get_var("z"))
from_loc:call_proc("Beam", to_loc, "kinesis", dm.global_proc("icon", "icons/effects/beam.dmi"), 7.5)
dm.global_proc("playsound", from_loc, "sound/magic/blink.ogg", volume, true)
mob:call_proc("forceMove", to_loc)
if over_exec_usage(0.9) then
sleep()
end
end
local function clone_shotgun(mob, pointed, x_offset, y_offset)
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", dm.global_proc("_locate", mob:get_var("x") + x_offset, mob:get_var("y") + y_offset, mob:get_var("z")))
gun:set_var("appearance", mob:get_var("appearance"))
gun:set_var("anchored", 1)
gun:set_var("fire_delay", 0)
local gun_safety = gun:global_proc("GetComponent", dm.global_proc("text2path", "/datum/component/gun_safety"))
gun_safety:set_var("safety_currently_on", 0)
return gun
end
local function shotgun_ability(mob, pointed)
if not (SS13.istype(pointed, "/mob/living")) then
return
end
if pointed == mob then
return
end
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", mob:get_var("loc"))
mob:call_proc("put_in_hands", gun)
gun:set_var("fire_delay", 0)
gun:set_var("color", "#2940c2")
gun:set_var("name", "bluespace Bulldog Shotgun")
gun:set_var("desc", "The famed Syndicate shotgun, except this one has a powerful energy eminating from it... somehow.")
local gun_safety = gun:global_proc("GetComponent", dm.global_proc("text2path", "/datum/component/gun_safety"))
gun_safety:set_var("safety_currently_on", 0)
gun:call_proc("toggle_safety", mob, "off") -- ready to KILL
beam_from_to(pointed, mob, 0, -2)
gun:call_proc("fire_gun", pointed, mob)
SS13.wait(delay)
beam_from_to(pointed, mob, 2, 0)
gun:call_proc("fire_gun", pointed, mob)
SS13.wait(delay)
beam_from_to(pointed, mob, 0, 2)
gun:call_proc("fire_gun", pointed, mob)
SS13.wait(delay)
beam_from_to(pointed, mob, -2, 0)
gun:call_proc("fire_gun", pointed, mob)
if dramatic_ending then
SS13.wait(delay * 1.25)
beam_from_to(pointed, mob, 0, -2)
for i = 1, 4 do
gun:call_proc("fire_gun", pointed, mob)
SS13.wait(0.05)
end
end
SS13.set_timeout(1, function()
dm.global_proc("qdel", gun)
end)
end
local function tower_ability(mob, pointed)
if SS13.istype(pointed, "/mob/living") and (pointed ~= mob) then
for _, gun in linked_shotguns do
dm.global_proc("do_sparks", 2, true, gun)
if over_exec_usage(0.9) then
sleep()
end
gun:call_proc("fire_gun", pointed, mob)
end
for index, gun in linked_shotguns do
dm.global_proc("qdel", gun)
if over_exec_usage(0.9) then
sleep()
end
linked_shotguns[index] = nil
end
elseif SS13.istype(pointed, "/turf/open") then
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", pointed)
gun:set_var("fire_delay", 0)
gun:set_var("anchored", 1)
gun:set_var("color", "#2940c2")
gun:set_var("name", "bluespace Bulldog Shotgun")
gun:set_var("desc", "The famed Syndicate shotgun, except this one has a powerful energy eminating from it... somehow.")
local gun_safety = gun:global_proc("GetComponent", dm.global_proc("text2path", "/datum/component/gun_safety"))
gun_safety:set_var("safety_currently_on", 0)
gun:call_proc("toggle_safety", mob, "off")
beam_from_to(mob, pointed, 0, 0)
table.insert(linked_shotguns, gun)
end
end
local function dash_ability(mob, pointed)
if not (SS13.istype(pointed, "/turf")) then
return
end
beam_from_to(pointed, mob, 0, 0)
end
local function link_ability(mob, pointed)
dm.global_proc("playsound", pointed, "sound/effects/empulse.ogg", volume, true)
for _, thing in dm.global_proc("_range", 2, pointed):to_table() do
if (SS13.istype(thing, "/mob/living/carbon/human")) and (thing ~= mob) then
thing:call_proc("add_filter", "slab_link", 1, dm.global_proc("outline_filter", 1, "#b52110"))
dm.global_proc("to_chat", thing, span_boldwarning("You feel your skin charge with some red aura as you feel more... linked to the others near you."))
table.insert(linked_mobs, thing)
SS13.register_signal(thing, "mob_apply_damage", function(_, damage, damagetype, def_zone)
for _, mob in linked_mobs do
if mob ~= nil then
if mob ~= thing then
if damagetype == "oxygen" then
damage = damage * 0.25
else
damage = damage * 0.8
end
if damage >= 5 then
dm.global_proc("to_chat", mob, span_warning("You feel a stabbing pain as you suddenly gain more wounds!"))
end
mob:call_proc("take_overall_damage", damage)
end
end
end
end)
SS13.set_timeout(15, function()
thing:call_proc("remove_filter", "slab_link")
SS13.unregister_signal(thing, "mob_apply_damage")
dm.global_proc("to_chat", thing, span_notice("You feel your skin discharge."))
end)
end
end
SS13.set_timeout(15, function()
for index in pairs(linked_mobs) do
linked_mobs[index] = nil
end
end)
end
local function pulse_ability(mob, pointed)
if SS13.istype(pointed, "/mob/living") and (pointed ~= mob) then
-- Absolutely fucking powerfling them
local throwdist = 50
local throwspeed = 8
local delay = 0.5
local start_turf = dm.global_proc("_get_step", pointed, 0)
local yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 1) --north first
dm.global_proc("to_chat", pointed, span_warning("You feel a force grab hold of your torso!"))
pointed:call_proc("Paralyze", 50)
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 2) -- now south
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay * 0.5) -- now we shove them back into the first spot they were in
pointed:call_proc("safe_throw_at", start_turf, dm.global_proc("_get_dist", start_turf, dm.global_proc("_get_step", pointed, 0)), throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", start_turf, pointed))
SS13.wait(delay * 0.5)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 4) -- east
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 8) -- and finally west
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
return
end
for _, thing in dm.global_proc("_range", 3, pointed):to_table() do
if (SS13.istype(thing, "/atom/movable")) and (thing ~= mob) and thing:get_var("anchored") ~= 1 then
local yeet_turf = dm.global_proc("get_edge_target_turf", pointed, dm.global_proc("_get_dir", pointed, thing))
thing:call_proc("safe_throw_at", yeet_turf, 4, 2)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", thing, 0), dm.global_proc("_get_dir", thing, yeet_turf))
if SS13.istype(thing, "/mob/living/") then
dm.global_proc("to_chat", thing, span_warning("You feel yourself get forcefully flung!"))
end
end
end
end
local function personnel_ability(mob, pointed)
if SS13.istype(pointed, "/mob/living/carbon/human") and (pointed ~= mob) then
local target_dir = pointed:get_var("dir")
if target_dir == 1 then
beam_from_to(pointed, mob, 0, -1)
mob:call_proc("setDir", 1)
elseif target_dir == 2 then
beam_from_to(pointed, mob, 0, 1)
mob:call_proc("setDir", 2)
elseif target_dir == 4 then
beam_from_to(pointed, mob, -1, 0)
mob:call_proc("setDir", 4)
elseif target_dir == 8 then
beam_from_to(pointed, mob, 1, 0)
mob:call_proc("setDir", 8)
end
local sword = SS13.new("/obj/item/katana/ninja_blade", mob:get_var("loc"))
mob:call_proc("put_in_hands", sword)
sword:set_var("color", "#2940c2")
sword:set_var("name", "bluespace energy katana")
sword:set_var("desc", "An energy katana infused with unstable bluespace energy.")
mob:call_proc("say", "Nothing personnel, kid.")
pointed:call_proc("Stun", 10, 1) -- Good luck
SS13.wait(0.2)
sword:call_proc("attack", pointed, mob)
local personnel_head = pointed:call_proc("get_bodypart", "head")
if personnel_head then
personnel_head:call_proc("dismember")
end
SS13.set_timeout(2, function()
dm.global_proc("qdel", sword)
end)
end
end
local function reprisal_ability(mob, gibbed)
if reprisals_left <= 0 then
return -- shit outta luck buddy
end
if reprisal_turf == nil then
return -- I dunno how but you did it
end
reprisals_left -= 1
SS13.set_timeout(7.5, function()
if gibbed == nil then -- gibbing cancels reprisal because I cba to handle that
local new_effect = SS13.new("/obj/effect", dm.global_proc("_get_step", mob, 0))
new_effect:set_var("appearance", mob:get_var("appearance"))
new_effect:set_var("desc", "They seem to be almost... frozen in mid-air, and are completely incorporeal.")
new_effect:call_proc("add_filter", "reprise_dropshadow_pink", 1, dm.global_proc("drop_shadow_filter", -1, 1, 1, 0, "#a821d1"))
new_effect:call_proc("add_filter", "reprise_dropshadow_yellow", 2, dm.global_proc("drop_shadow_filter", 1, -1, 1, 0, "#a1990a"))
new_effect:call_proc("add_filter", "reprise_blur", 3, dm.global_proc("radial_blur_filter", 0.1, 10, 10))
new_effect:call_proc("add_filter", "reprise_wave", 4, dm.global_proc("wave_filter", 1, 1, 1))
new_effect:call_proc("visible_message", span_boldwarning(mob:get_var("name") .. "'s body quickly blurs out, becoming non-solid!"))
dm.global_proc("playsound", new_effect, "sound/magic/staff_animation.ogg", volume, true)
mob:call_proc("forceMove", reprisal_turf)
mob:call_proc("revive", 16777215) -- That massive number is the equivalence of the ALL aka ~0 bitflag
dm.global_proc("playsound", mob, "sound/magic/staff_animation.ogg", volume, true)
mob:call_proc("add_filter", "reprise_appear", 1, dm.global_proc("wave_filter", 10, 0, 3, 0, 1)) -- x, y, size, offset, flags
mob:call_proc("transition_filter", "reprise_appear", 30, {["x"] = 0, ["y"] = 0, ["size"] = 3, ["offset"] = 0, ["flags"] = 1})
new_effect:call_proc("visible_message", span_notic(mob:get_var("name") .. " phases into visibility!"))
end
end)
end
local function clone_ability(mob, pointed) -- extra thematic finisher
if SS13.istype(pointed, "/mob/living/carbon/human") and (pointed ~= mob) then
local clone_list = {}
pointed:call_proc("Stun", 100, 1) -- Stay a while
beam_from_to(pointed, mob, 0, -2)
mob:call_proc("setDir", 1)
table.insert(clone_list, clone_shotgun(mob, pointed, 1, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, -1, 0))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, 2, 0)
mob:call_proc("setDir", 8)
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 1))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, -1))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, 0, 2)
mob:call_proc("setDir", 2)
table.insert(clone_list, clone_shotgun(mob, pointed, 1, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, -1, 0))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, -2, 0)
mob:call_proc("setDir", 4)
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 1))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, -1))
if over_exec_usage(0.9) then
sleep()
end
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", mob:get_var("loc"))
mob:call_proc("put_in_hands", gun)
gun:set_var("fire_delay", 0)
gun:set_var("color", "#2940c2")
gun:set_var("name", "bluespace Bulldog Shotgun")
gun:set_var("desc", "The famed Syndicate shotgun, except this one has a powerful energy eminating from it... somehow.")
local gun_safety = gun:global_proc("GetComponent", dm.global_proc("text2path", "/datum/component/gun_safety"))
gun_safety:set_var("safety_currently_on", 0)
table.insert(clone_list, gun)
for _, shotgun in clone_list do
if over_exec_usage(0.9) then
sleep()
end
shotgun:call_proc("fire_gun", pointed, mob)
end
for _, shotgun in clone_list do -- qdeling is in a seperate loop because i don't want shooting to get choked up
if over_exec_usage(0.9) then
sleep()
end
dm.global_proc("qdel", shotgun)
end
end
end
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
reprisal_turf = dm.global_proc("_get_step", mob, 0)
-- examining (for self)
SS13.register_signal(mob, "mob_examinate", function(_, examined)
if examined == mob then
local ability_choice, _ = SS13.await(SS13.global_proc, "tgui_input_list", mob, "Choose ability. Reprisals left: " .. reprisals_left, "Choose ability.", abilities)
if ability_choice == nil then
return
end
if ability_choice == "end Signal" then -- Keep updated w/ signal list
SS13.unregister_signal(mob, "mob_examinate")
SS13.unregister_signal(mob, "mob_pointed")
SS13.unregister_signal(mob, "mob_client_moved")
SS13.unregister_signal(mob, "living_death")
else
selected_ability = ability_choice
end
return
end
end)
-- Pointing (for others)
SS13.register_signal(mob, "mob_pointed", function(_, pointed)
if selected_ability == nil then
return
elseif selected_ability == "shotgun" then
shotgun_ability(mob, pointed)
elseif selected_ability == "dash" then
dash_ability(mob, pointed)
elseif selected_ability == "link" then
link_ability(mob, pointed)
elseif selected_ability == "pulse" then
pulse_ability(mob, pointed)
elseif selected_ability == "tower" then
tower_ability(mob, pointed)
elseif selected_ability == "personnel" then
personnel_ability(mob, pointed)
elseif selected_ability == "clone" then
clone_ability(mob, pointed)
end
end)
-- Reprise ability handling start
SS13.register_signal(mob, "mob_client_moved", function()
if mob:get_var("health") > 10 then -- if we're already pretty fucked up don't count our moves when finding a reprisal turf
moves_until_reprisal -= 1
if moves_until_reprisal <= 0 then
reprisal_turf = dm.global_proc("_get_step", mob, 0)
moves_until_reprisal = 25
end
end
end)
SS13.register_signal(mob, "living_death", function(_, gibbed)
reprisal_ability(mob, gibbed)
end)
-- Reprise ability handling end
end
end
```
</details>
## Slab - Util
<details>
```lua
SS13 = require("SS13")
local GLOB = dm.global_vars:get_var("GLOB")
local delay = 0.4
local volume = 90
local dramatic_ending = true
local cancel_onmob = true
local abilities = {"dash", "link", "pulse", "tower", "clone", "end Signal"}
selected_ability = nil
linked_mobs = {}
linked_shotguns = {}
reprisal_turf = nil
moves_until_reprisal = 25
reprisals_left = 2 -- die twice, and the third's for real.
local function span_notice(text)
return "<span class='notice'>" .. text .. "</span>"
end
local function span_warning(text)
return "<span class='warning'>" .. text .. "</span>"
end
local function span_boldwarning(text)
return "<span class='boldwarning'>" .. text .. "</span>"
end
local function beam_from_to(pointed, mob, x_offset, y_offset)
local from_loc = dm.global_proc("_get_step", mob, 0)
local to_loc = dm.global_proc("_locate", pointed:get_var("x") + x_offset, pointed:get_var("y") + y_offset, pointed:get_var("z"))
from_loc:call_proc("Beam", to_loc, "kinesis", dm.global_proc("icon", "icons/effects/beam.dmi"), 7.5)
dm.global_proc("playsound", from_loc, "sound/magic/blink.ogg", volume, true)
mob:call_proc("forceMove", to_loc)
if over_exec_usage(0.9) then
sleep()
end
end
local function clone_shotgun(mob, pointed, x_offset, y_offset)
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", dm.global_proc("_locate", mob:get_var("x") + x_offset, mob:get_var("y") + y_offset, mob:get_var("z")))
gun:set_var("appearance", mob:get_var("appearance"))
gun:set_var("anchored", 1)
gun:set_var("fire_delay", 0)
gun:call_proc("toggle_safety", mob, "off")
return gun
end
local function tower_ability(mob, pointed)
if SS13.istype(pointed, "/mob/living") and (pointed ~= mob) then
for _, gun in linked_shotguns do
dm.global_proc("do_sparks", 2, true, gun)
if over_exec_usage(0.9) then
sleep()
end
gun:call_proc("fire_gun", pointed, mob)
end
for index, gun in linked_shotguns do
dm.global_proc("qdel", gun)
if over_exec_usage(0.9) then
sleep()
end
linked_shotguns[index] = nil
end
elseif SS13.istype(pointed, "/turf/open") then
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", pointed)
gun:set_var("fire_delay", 0)
gun:set_var("anchored", 1)
gun:set_var("color", "#2940c2")
gun:set_var("name", "bluespace Bulldog Shotgun")
gun:set_var("desc", "The famed Syndicate shotgun, except this one has a powerful energy eminating from it... somehow.")
gun:call_proc("toggle_safety", mob, "off")
beam_from_to(mob, pointed, 0, 0)
table.insert(linked_shotguns, gun)
end
end
local function dash_ability(mob, pointed)
if not (SS13.istype(pointed, "/turf")) then
return
end
beam_from_to(pointed, mob, 0, 0)
end
local function link_ability(mob, pointed)
dm.global_proc("playsound", pointed, "sound/effects/empulse.ogg", volume, true)
for _, thing in dm.global_proc("_range", 2, pointed):to_table() do
if (SS13.istype(thing, "/mob/living/carbon/human")) and (thing ~= mob) then
thing:call_proc("add_filter", "slab_link", 1, dm.global_proc("outline_filter", 1, "#b52110"))
dm.global_proc("to_chat", thing, span_boldwarning("You feel your skin charge with some red aura as you feel more... linked to the others near you."))
table.insert(linked_mobs, thing)
SS13.register_signal(thing, "mob_apply_damage", function(_, damage, damagetype, def_zone)
for _, mob in linked_mobs do
if mob ~= nil then
if mob ~= thing then
if damagetype == "oxygen" then
damage = damage * 0.25
else
damage = damage * 0.8
end
if damage >= 5 then
dm.global_proc("to_chat", mob, span_warning("You feel a stabbing pain as you suddenly gain more wounds!"))
end
mob:call_proc("take_overall_damage", damage)
end
end
end
end)
SS13.set_timeout(15, function()
thing:call_proc("remove_filter", "slab_link")
SS13.unregister_signal(thing, "mob_apply_damage")
dm.global_proc("to_chat", thing, span_notice("You feel your skin discharge."))
end)
end
end
SS13.set_timeout(15, function()
for index in pairs(linked_mobs) do
linked_mobs[index] = nil
end
end)
end
local function pulse_ability(mob, pointed)
if SS13.istype(pointed, "/mob/living") and (pointed ~= mob) then
-- Absolutely fucking powerfling them
local throwdist = 50
local throwspeed = 8
local delay = 0.5
local start_turf = dm.global_proc("_get_step", pointed, 0)
local yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 1) --north first
dm.global_proc("to_chat", pointed, span_warning("You feel a force grab hold of your torso!"))
pointed:call_proc("Paralyze", 50)
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 2) -- now south
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay * 0.5) -- now we shove them back into the first spot they were in
pointed:call_proc("safe_throw_at", start_turf, dm.global_proc("_get_dist", start_turf, dm.global_proc("_get_step", pointed, 0)), throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", start_turf, pointed))
SS13.wait(delay * 0.5)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 4) -- east
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
SS13.wait(delay)
yeet_turf = dm.global_proc("get_edge_target_turf", pointed, 8) -- and finally west
pointed:call_proc("safe_throw_at", yeet_turf, throwdist, throwspeed)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", pointed, 0), dm.global_proc("_get_dir", pointed, yeet_turf))
return
end
for _, thing in dm.global_proc("_range", 3, pointed):to_table() do
if (SS13.istype(thing, "/atom/movable")) and (thing ~= mob) and thing:get_var("anchored") ~= 1 then
local yeet_turf = dm.global_proc("get_edge_target_turf", pointed, dm.global_proc("_get_dir", pointed, thing))
thing:call_proc("safe_throw_at", yeet_turf, 4, 2)
SS13.new("/obj/effect/temp_visual/gravpush", dm.global_proc("_get_step", thing, 0), dm.global_proc("_get_dir", thing, yeet_turf))
if SS13.istype(thing, "/mob/living/") then
dm.global_proc("to_chat", thing, span_warning("You feel yourself get forcefully flung!"))
end
end
end
end
local function reprisal_ability(mob, gibbed)
if reprisals_left <= 0 then
return -- shit outta luck buddy
end
if reprisal_turf == nil then
return -- I dunno how but you did it
end
reprisals_left -= 1
SS13.set_timeout(7.5, function()
if gibbed == nil then -- gibbing cancels reprisal because I cba to handle that
local new_effect = SS13.new("/obj/effect", dm.global_proc("_get_step", mob, 0))
new_effect:set_var("appearance", mob:get_var("appearance"))
new_effect:set_var("desc", "They seem to be almost... frozen in mid-air, and are completely incorporeal.")
new_effect:call_proc("add_filter", "reprise_dropshadow_pink", 1, dm.global_proc("drop_shadow_filter", -1, 1, 1, 0, "#a821d1"))
new_effect:call_proc("add_filter", "reprise_dropshadow_yellow", 2, dm.global_proc("drop_shadow_filter", 1, -1, 1, 0, "#a1990a"))
new_effect:call_proc("add_filter", "reprise_blur", 3, dm.global_proc("radial_blur_filter", 0.1, 10, 10))
new_effect:call_proc("add_filter", "reprise_wave", 4, dm.global_proc("wave_filter", 1, 1, 1))
new_effect:call_proc("visible_message", span_boldwarning(mob:get_var("name") .. "'s body quickly blurs out, becoming non-solid!"))
dm.global_proc("playsound", new_effect, "sound/magic/staff_animation.ogg", volume, true)
mob:call_proc("forceMove", reprisal_turf)
mob:call_proc("revive", 16777215) -- That massive number is the equivalence of the ALL aka ~0 bitflag
dm.global_proc("playsound", mob, "sound/magic/staff_animation.ogg", volume, true)
mob:call_proc("add_filter", "reprise_appear", 1, dm.global_proc("wave_filter", 10, 0, 3, 0, 1)) -- x, y, size, offset, flags
mob:call_proc("transition_filter", "reprise_appear", 30, {["x"] = 0, ["y"] = 0, ["size"] = 3, ["offset"] = 0, ["flags"] = 1})
new_effect:call_proc("visible_message", span_notic(mob:get_var("name") .. " phases into visibility!"))
end
end)
end
local function clone_ability(mob, pointed) -- extra thematic finisher
if SS13.istype(pointed, "/mob/living/carbon/human") and (pointed ~= mob) then
local clone_list = {}
pointed:call_proc("Stun", 100, 1) -- Stay a while
beam_from_to(pointed, mob, 0, -2)
mob:call_proc("setDir", 1)
table.insert(clone_list, clone_shotgun(mob, pointed, 1, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, -1, 0))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, 2, 0)
mob:call_proc("setDir", 8)
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 1))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, -1))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, 0, 2)
mob:call_proc("setDir", 2)
table.insert(clone_list, clone_shotgun(mob, pointed, 1, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 0))
table.insert(clone_list, clone_shotgun(mob, pointed, -1, 0))
if over_exec_usage(0.9) then
sleep()
end
SS13.wait(delay)
beam_from_to(pointed, mob, -2, 0)
mob:call_proc("setDir", 4)
table.insert(clone_list, clone_shotgun(mob, pointed, 0, 1))
table.insert(clone_list, clone_shotgun(mob, pointed, 0, -1))
if over_exec_usage(0.9) then
sleep()
end
local gun = SS13.new("/obj/item/gun/ballistic/shotgun/bulldog/unrestricted", mob:get_var("loc"))
mob:call_proc("put_in_hands", gun)
gun:set_var("fire_delay", 0)
gun:set_var("color", "#2940c2")
gun:set_var("name", "bluespace Bulldog Shotgun")
gun:set_var("desc", "The famed Syndicate shotgun, except this one has a powerful energy eminating from it... somehow.")
table.insert(clone_list, gun)
for _, shotgun in clone_list do
if over_exec_usage(0.9) then
sleep()
end
shotgun:call_proc("fire_gun", pointed, mob)
end
for _, shotgun in clone_list do -- qdeling is in a seperate loop because i don't want shooting to get choked up
if over_exec_usage(0.9) then
sleep()
end
dm.global_proc("qdel", shotgun)
end
end
end
for _, mob in GLOB:get_var("player_list"):to_table() do
if mob:get_var("ckey") == "zonespace" then
reprisal_turf = dm.global_proc("_get_step", mob, 0)
-- examining (for self)
SS13.register_signal(mob, "mob_examinate", function(_, examined)
if examined == mob then
local ability_choice, _ = SS13.await(SS13.global_proc, "tgui_input_list", mob, "Choose ability. Reprisals left: " .. reprisals_left, "Choose ability.", abilities)
if ability_choice == nil then
return
end
if ability_choice == "end Signal" then -- Keep updated w/ signal list
SS13.unregister_signal(mob, "mob_examinate")
SS13.unregister_signal(mob, "mob_pointed")
SS13.unregister_signal(mob, "mob_client_moved")
SS13.unregister_signal(mob, "living_death")
else
selected_ability = ability_choice
end
return
end
end)
-- Pointing (for others)
SS13.register_signal(mob, "mob_pointed", function(_, pointed)
if selected_ability == nil then
return
elseif selected_ability == "dash" then
dash_ability(mob, pointed)
elseif selected_ability == "link" then
link_ability(mob, pointed)
elseif selected_ability == "pulse" then
pulse_ability(mob, pointed)
elseif selected_ability == "tower" then
tower_ability(mob, pointed)
elseif selected_ability == "clone" then
clone_ability(mob, pointed)
end
end)
-- Reprise ability handling start
SS13.register_signal(mob, "mob_client_moved", function()
if mob:get_var("health") > 10 then -- if we're already pretty fucked up don't count our moves when finding a reprisal turf
moves_until_reprisal -= 1
if moves_until_reprisal <= 0 then
reprisal_turf = dm.global_proc("_get_step", mob, 0)
moves_until_reprisal = 25
end
end
end)
SS13.register_signal(mob, "living_death", function(_, gibbed)
reprisal_ability(mob, gibbed)
end)
-- Reprise ability handling end
end
end
```
</details>