mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Merge pull request #4611 from VOREStation/vplk-misc-fixes
Misc. Fixes for Destroy etc.
This commit is contained in:
+21
-12
@@ -3,18 +3,27 @@
|
||||
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
|
||||
|
||||
|
||||
/atom/proc/SpinAnimation(speed = 10, loops = -1)
|
||||
var/matrix/m120 = matrix(transform)
|
||||
m120.Turn(120)
|
||||
var/matrix/m240 = matrix(transform)
|
||||
m240.Turn(240)
|
||||
var/matrix/m360 = matrix(transform)
|
||||
speed /= 3 //Gives us 3 equal time segments for our three turns.
|
||||
//Why not one turn? Because byond will see that the start and finish are the same place and do nothing
|
||||
//Why not two turns? Because byond will do a flip instead of a turn
|
||||
animate(src, transform = m120, time = speed, loops)
|
||||
animate(transform = m240, time = speed)
|
||||
animate(transform = m360, time = speed)
|
||||
/atom/proc/SpinAnimation(speed = 10, loops = -1, clockwise = 1, segments = 3)
|
||||
if(!segments)
|
||||
return
|
||||
var/segment = 360/segments
|
||||
if(!clockwise)
|
||||
segment = -segment
|
||||
var/list/matrices = list()
|
||||
for(var/i in 1 to segments-1)
|
||||
var/matrix/M = matrix(transform)
|
||||
M.Turn(segment*i)
|
||||
matrices += M
|
||||
var/matrix/last = matrix(transform)
|
||||
matrices += last
|
||||
|
||||
speed /= segments
|
||||
|
||||
animate(src, transform = matrices[1], time = speed, loops)
|
||||
for(var/i in 2 to segments) //2 because 1 is covered above
|
||||
animate(transform = matrices[i], time = speed)
|
||||
//doesn't have an object argument because this is "Stacking" with the animate call above
|
||||
//3 billion% intentional
|
||||
|
||||
//The X pixel offset of this matrix
|
||||
/matrix/proc/get_x_shift()
|
||||
|
||||
@@ -18,7 +18,7 @@ var/global/repository/radiation/radiation_repository = new()
|
||||
/datum/radiation_source/Destroy()
|
||||
radiation_repository.sources -= src
|
||||
if(radiation_repository.sources_assoc[src.source_turf] == src)
|
||||
radiation_repository.sources -= src.source_turf
|
||||
radiation_repository.sources_assoc -= src.source_turf
|
||||
src.source_turf = null
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@
|
||||
unregister_radio(src, frequency)
|
||||
qdel(wires)
|
||||
wires = null
|
||||
if(alarm_area && alarm_area.master_air_alarm == src)
|
||||
alarm_area.master_air_alarm = null
|
||||
elect_master(exclude_self = TRUE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/alarm/New()
|
||||
@@ -271,8 +274,10 @@
|
||||
/obj/machinery/alarm/proc/master_is_operating()
|
||||
return alarm_area && alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER | BROKEN))
|
||||
|
||||
/obj/machinery/alarm/proc/elect_master()
|
||||
/obj/machinery/alarm/proc/elect_master(exclude_self = FALSE)
|
||||
for(var/obj/machinery/alarm/AA in alarm_area)
|
||||
if(exclude_self && AA == src)
|
||||
continue
|
||||
if(!(AA.stat & (NOPOWER|BROKEN)))
|
||||
alarm_area.master_air_alarm = AA
|
||||
return 1
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
FG2.cleanup()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/containment_field/attack_hand(mob/user as mob)
|
||||
if(get_dist(src, user) > 1)
|
||||
|
||||
@@ -168,7 +168,7 @@ field_generator power level display
|
||||
|
||||
/obj/machinery/field_generator/Destroy()
|
||||
src.cleanup()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
|
||||
|
||||
@@ -312,12 +312,12 @@ field_generator power level display
|
||||
/obj/machinery/field_generator/proc/cleanup()
|
||||
clean_up = 1
|
||||
for (var/obj/machinery/containment_field/F in fields)
|
||||
if (isnull(F))
|
||||
if (QDELETED(F))
|
||||
continue
|
||||
qdel(F)
|
||||
fields = list()
|
||||
for(var/obj/machinery/field_generator/FG in connected_gens)
|
||||
if (isnull(FG))
|
||||
if (QDELETED(FG))
|
||||
continue
|
||||
FG.connected_gens.Remove(src)
|
||||
if(!FG.clean_up)//Makes the other gens clean up as well
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
/obj/singularity/energy_ball/process(var/wait = 20)
|
||||
set waitfor = FALSE
|
||||
if(!orbiting)
|
||||
handle_energy()
|
||||
if (handle_energy())
|
||||
return
|
||||
|
||||
move_the_basket_ball(max(wait - 5, 4 + orbiting_balls.len * 1.5))
|
||||
|
||||
@@ -91,6 +92,11 @@
|
||||
sleep(1) // So movement is smooth
|
||||
|
||||
/obj/singularity/energy_ball/proc/handle_energy()
|
||||
if (energy <= 0)
|
||||
investigate_log("collapsed.", I_SINGULO)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
if(energy >= energy_to_raise)
|
||||
energy_to_lower = energy_to_raise - 20
|
||||
energy_to_raise = energy_to_raise * 1.25
|
||||
|
||||
Reference in New Issue
Block a user