mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Makes blob point collection lag immune (#9944)
* Makes blob point collection lag immune Blob points are distributed based on the time since the lsat life() tick instead of having a set amount per life() tick. This stops lag from lowering the number of points received from blob life() of cores. Though lag will still affect things like pulse() which affect both resource/factory nodes. Incidentally this will about double the base generation rate of points for a single blob core, which seems needed both for beginning blobs as well as extra overminds that often barely get any points at all. * Fix the macro error
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
custom_process=1
|
||||
var/overmind_get_delay = 0 // we don't want to constantly try to find an overmind, do it every 30 seconds
|
||||
var/resource_delay = 0
|
||||
var/last_resource_collection
|
||||
var/point_rate = 2
|
||||
var/mob/camera/blob/creator = null
|
||||
layer = 7
|
||||
@@ -33,6 +34,7 @@
|
||||
if(!overmind)
|
||||
create_overmind(new_overmind)
|
||||
point_rate = new_rate
|
||||
last_resource_collection = world.time
|
||||
..(loc, newlook)
|
||||
|
||||
/obj/effect/blob/core/Destroy()
|
||||
@@ -79,9 +81,9 @@
|
||||
if(!overmind)
|
||||
create_overmind()
|
||||
else
|
||||
if(resource_delay <= world.time)
|
||||
resource_delay = world.time + 10 // 1 second
|
||||
overmind.add_points(point_rate)
|
||||
var/points_to_collect = Clamp(point_rate*round((world.time-last_resource_collection)/10), 0, 10)
|
||||
overmind.add_points(points_to_collect)
|
||||
last_resource_collection = world.time
|
||||
|
||||
if(health < maxhealth)
|
||||
health = min(maxhealth, health + 1)
|
||||
|
||||
Reference in New Issue
Block a user