Skip to content

Commit

Permalink
Singularity tweaks (#536)
Browse files Browse the repository at this point in the history
* Singularity tweaks

* Changes power output of particles
  • Loading branch information
EgorDinamit authored Feb 10, 2024
1 parent 8bcd5bc commit 3490fa9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
toxmob(A)
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
A:energy += energy
// Regardless of energy level - singularity will not lose power after being hit
var/obj/singularity/S = A
if(istype(S))
S.dissipate_track = -10
else if(istype(A,/obj/machinery/power/fusion_core))
var/obj/machinery/power/fusion_core/collided_core = A
if(particle_type && particle_type != "neutron")
Expand Down Expand Up @@ -90,8 +94,8 @@

/obj/effect/accelerated_particle/weak
movement_range = 8
energy = 5
energy = 0

/obj/effect/accelerated_particle/strong
movement_range = 15
energy = 15
energy = 20
29 changes: 21 additions & 8 deletions code/modules/power/singularity/singularity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,29 @@
if(world.time < next_contained_check_time)
return last_contained_check

for(var/turf/T in range(6))
if(!ContainmentCheck(T))
last_contained_check = FALSE
// Might as well forget about checking entirely
next_contained_check_time = INFINITY
return FALSE
// Checks if we're contained from all cardinal directions
var/check_sum = 0
for(var/direction in GLOB.cardinal)
var/turf/T = get_turf(src)
for(var/i = 1 to 6)
T = get_step(T, direction)
if(!istype(T))
last_contained_check = FALSE
next_contained_check_time = world.time + 30 SECONDS
return FALSE

if(ContainmentCheck(T))
check_sum++
break

if(check_sum >= 4)
last_contained_check = TRUE
next_contained_check_time = world.time + 10 SECONDS
return TRUE

last_contained_check = TRUE
last_contained_check = FALSE
next_contained_check_time = world.time + 30 SECONDS
return TRUE
return FALSE

/obj/singularity/proc/event()
var/numb = pick(1, 2, 3, 4, 5, 6)
Expand Down

0 comments on commit 3490fa9

Please sign in to comment.