phase() is now a separate proc from movement, and is asynchronous.

Able to return True or False for Phased or Not, in the event it's ever used in a sequence.
This commit is contained in:
Mechoid
2021-09-02 22:06:37 -07:00
parent d36a66887f
commit 63d6652dd0

View File

@@ -928,15 +928,8 @@
var/obj/O = obstacle
if(phasing && get_charge()>=phasing_energy_drain)//Phazon check. This could use an improvement elsewhere.
spawn()
if(can_phase)
can_phase = FALSE
flick("[initial_icon]-phase", src)
src.loc = get_step(src,src.dir)
src.use_power(phasing_energy_drain)
sleep(get_step_delay() * 3)
can_phase = TRUE
occupant_message("Phazed.")
src.use_power(phasing_energy_drain)
phase()
. = ..(obstacle)
return
if(istype(O, /obj/effect/portal)) //derpfix
@@ -951,15 +944,8 @@
else if(istype(obstacle, /turf))
if(phasing && get_charge()>=phasing_energy_drain)
spawn()
if(can_phase)
can_phase = FALSE
flick("[initial_icon]-phase", src)
src.loc = get_step(src,src.dir)
src.use_power(phasing_energy_drain)
sleep(get_step_delay() * 3)
can_phase = TRUE
occupant_message("Phazed.")
src.use_power(phasing_energy_drain)
phase()
. = ..(obstacle)
return
@@ -967,6 +953,18 @@
. = ..(obstacle)
return
/obj/mecha/proc/phase() // Force the mecha to move forward by phasing.
set waitfor = FALSE
if(can_phase)
can_phase = FALSE
flick("[initial_icon]-phase", src)
forceMove(get_step(src,src.dir))
sleep(get_step_delay() * 3)
can_phase = TRUE
occupant_message("Phazed.")
return TRUE // In the event this is sequenced
return FALSE
///////////////////////////////////
//////// Internal damage ////////
///////////////////////////////////