Merge branch 'release' of https://github.com/VOREStation/VOREStation into vore-update

This commit is contained in:
izac112
2024-04-02 17:26:31 +02:00
195 changed files with 5125 additions and 792 deletions
+67 -9
View File
@@ -18,6 +18,8 @@
var/fieldsactive = 0
var/burst_time = 50
var/fieldlimit = 3
var/spreadmode = 0
var/cascading = 0
/obj/item/resonator/upgraded
name = "upgraded resonator"
@@ -30,20 +32,75 @@
var/turf/T = get_turf(target)
if(locate(/obj/effect/resonance) in T)
return
if(fieldsactive < fieldlimit)
if(fieldsactive > fieldlimit || cascading)
to_chat(creator, span_warning("You've exceeded the field limit! Wait for them to dissipate."))
return
if(spreadmode)
//log_debug("Starting cascade...")
cascading = TRUE
var/depth = 0
var/fields = 0
if(depth == 0)
//log_debug("Creating resonance at the target spot.")
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
new /obj/effect/resonance(T, WEAKREF(creator), burst_time)
fields++
depth++
var/origin_dir = get_cardinal_dir(creator, T)
var/dir
while(fields < fieldlimit)
for(var/i=0, i<=2, i++)
//log_debug("Fields are [fields], doing [i] iteration of subloop")
if(fields >= fieldlimit)
//log_debug("[fields] exceeded fieldlimit, exiting procedure.")
sleep(burst_time)
cascading = FALSE
return
switch(i) //Using a switch statement rather than (-90 + i * 90) to favour going straight ahead
if(0)
dir = origin_dir
if(1)
dir = turn(origin_dir, 90)
if(2)
dir = turn(origin_dir, -90)
var/turf/newT = T
for(var/step = 1, step<=depth, step++)
//log_debug("Taking a step until [depth] steps taken.")
var/turf/oldT = newT
newT = get_step(oldT, dir)
if(step == depth)
new /obj/effect/resonance(newT, WEAKREF(creator), burst_time)
fields++
if(depth > 1 && fields < fieldlimit) //Works until 15 fieldlimit.
oldT = newT
dir = turn(dir, (i == 2 ? 135 : -135))
newT = get_step(oldT, dir)
new /obj/effect/resonance(newT, WEAKREF(creator), burst_time)
fields++
depth++
else
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
new /obj/effect/resonance(T, creator, burst_time)
new /obj/effect/resonance(T, WEAKREF(creator), burst_time)
fieldsactive++
spawn(burst_time)
fieldsactive--
/obj/item/resonator/attack_self(mob/user)
if(burst_time == 50)
burst_time = 30
to_chat(user, "<span class='info'>You set the resonator's fields to detonate after 3 seconds.</span>")
else
burst_time = 50
to_chat(user, "<span class='info'>You set the resonator's fields to detonate after 5 seconds.</span>")
switch(tgui_alert(user, "Change Detonation Time or toggle Cascading?","Setting", list("Toggle Cascade", "Resonance Time")))
if("Resonance Time")
if(burst_time == 50)
burst_time = 30
to_chat(user, "<span class='info'>You set the resonator's fields to detonate after 3 seconds.</span>")
else
burst_time = 50
to_chat(user, "<span class='info'>You set the resonator's fields to detonate after 5 seconds.</span>")
if("Toggle Cascade")
spreadmode = !spreadmode
to_chat(user, span_info("You have [(spreadmode ? "enabled" : "disabled")] the resonance cascade mode."))
/obj/item/resonator/afterattack(atom/target, mob/user, proximity_flag)
if(proximity_flag)
@@ -61,6 +118,7 @@
mouse_opacity = 0
var/resonance_damage = 20
/obj/effect/resonance/Initialize(mapload, var/creator = null, var/timetoburst)
. = ..()
// Start small and grow to big size as we are about to burst
@@ -90,7 +148,7 @@
if(environment.temperature < 250)
name = "strong resonance field"
resonance_damage = 50
for(var/mob/living/L in src.loc)
if(creator)
add_attack_logs(creator, L, "used a resonator field on")