fixes constructs (#17146)

- gets rid of sleeps
- makes it so their spells show
This commit is contained in:
Cameron Lennox
2025-02-15 01:55:47 -05:00
committed by GitHub
parent 600b7471f2
commit 8c26ed816d
3 changed files with 30 additions and 29 deletions
+27 -26
View File
@@ -46,8 +46,7 @@
/spell/aoe_turf/conjure/floor/conjure_animation(var/atom/movable/overlay/animation, var/turf/target)
animation.icon_state = "cultfloor"
flick("cultfloor",animation)
spawn(10)
qdel(animation)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), animation), 1 SECOND)
/spell/aoe_turf/conjure/wall
name = "Lesser Construction"
@@ -65,8 +64,7 @@
/spell/aoe_turf/conjure/wall/conjure_animation(var/atom/movable/overlay/animation, var/turf/target)
animation.icon_state = "cultwall"
flick("cultwall",animation)
spawn(10)
qdel(animation)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), animation), 1 SECOND)
/spell/aoe_turf/conjure/wall/reinforced
name = "Greater Construction"
@@ -194,15 +192,14 @@
return */
for(var/turf/T in targets)
for(var/obj/machinery/door/door in T.contents)
spawn(1)
if(istype(door,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/AL = door
AL.locked = 0 //The spirits of the damned care not for your locks.
AL.welded = 0 //Or your welding tools.
else if(istype(door, /obj/machinery/door/firedoor))
var/obj/machinery/door/firedoor/FD = door
FD.blocked = 0
door.open(1)
if(istype(door,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/AL = door
AL.locked = 0 //The spirits of the damned care not for your locks.
AL.welded = 0 //Or your welding tools.
else if(istype(door, /obj/machinery/door/firedoor))
var/obj/machinery/door/firedoor/FD = door
FD.blocked = 0
door.open(1)
return
/*
@@ -523,19 +520,23 @@
return P
/obj/item/spell/construct/projectile/proc/set_up(atom/hit_atom, mob/living/user)
if(spell_projectile)
if(pay_energy(energy_cost_per_shot))
if(pre_shot_delay)
var/image/target_image = image(icon = 'icons/obj/spells.dmi', loc = get_turf(hit_atom), icon_state = "target")
user << target_image
user.Stun(pre_shot_delay / 10)
sleep(pre_shot_delay)
qdel(target_image)
if(owner)
return TRUE
return FALSE // We got dropped before the firing occured.
return TRUE // No delay, no need to check.
return FALSE
if(!spell_projectile || !pay_energy(energy_cost_per_shot) || !owner)
return FALSE
if(!pre_shot_delay)
return TRUE
var/succeeded = FALSE
var/turf/T = get_turf(hit_atom)
var/image/target_image = image(icon = 'icons/obj/spells.dmi', icon_state = "target")
T.add_overlay(target_image)
if(do_after(user, pre_shot_delay))
succeeded = TRUE
T.cut_overlay(target_image)
qdel(target_image)
return succeeded
/obj/item/spell/construct/spawner
name = "spawner template"
@@ -97,8 +97,8 @@
/mob/living/simple_mob/construct/cultify()
return
/mob/living/simple_mob/construct/New()
..()
/mob/living/simple_mob/construct/Initialize(mapload)
. = ..()
name = text("[initial(name)] ([rand(1, 1000)])")
real_name = name
for(var/spell in construct_spells)
+1 -1
View File
@@ -11,7 +11,7 @@
..()
if(spell_masters)
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
spell_master.toggle_open(1)
spell_master.toggle_open()
client.screen -= spell_master
// TODO: Investigate if this matters