mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-21 19:16:22 +01:00
Fixes.
Made glowshrooms and intercoms not use a ridiculous internal loop, and fixed a pickup luminosity bug with glowshrooms. fixes #3708 Fixes #3718 Fixes #3702 Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
var/spreadChance = 40
|
||||
var/spreadIntoAdjacentChance = 60
|
||||
var/evolveChance = 2
|
||||
var/lastTick = 0
|
||||
var/spreaded = 1
|
||||
|
||||
/obj/effect/glowshroom/single
|
||||
spreadChance = 0
|
||||
@@ -40,15 +42,21 @@
|
||||
else //if on the floor, glowshroom on-floor sprite
|
||||
icon_state = "glowshroomf"
|
||||
|
||||
spawn(delay)
|
||||
SetLuminosity(round(potency/10))
|
||||
Spread()
|
||||
processing_objects += src
|
||||
|
||||
/obj/effect/glowshroom/proc/Spread()
|
||||
set background = 1
|
||||
var/spreaded = 1
|
||||
SetLuminosity(round(potency/10))
|
||||
lastTick = world.timeofday
|
||||
|
||||
while(spreaded)
|
||||
/obj/effect/glowshroom/Del()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/effect/glowshroom/process()
|
||||
if(!spreaded)
|
||||
return
|
||||
|
||||
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
|
||||
lastTick = world.timeofday
|
||||
spreaded = 0
|
||||
|
||||
for(var/i=1,i<=yield,i++)
|
||||
@@ -90,8 +98,6 @@
|
||||
if(prob(evolveChance)) //very low chance to evolve on its own
|
||||
potency += rand(4,6)
|
||||
|
||||
sleep(delay)
|
||||
|
||||
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
|
||||
set background = 1
|
||||
var/direction = 16
|
||||
|
||||
@@ -5,13 +5,18 @@
|
||||
anchored = 1
|
||||
w_class = 4.0
|
||||
canhear_range = 2
|
||||
flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY
|
||||
var/number = 0
|
||||
var/anyai = 1
|
||||
var/mob/living/silicon/ai/ai = list()
|
||||
var/last_tick //used to delay the powercheck
|
||||
|
||||
/obj/item/device/radio/intercom/New()
|
||||
spawn(5)
|
||||
checkpower()
|
||||
..()
|
||||
processing_objects += src
|
||||
|
||||
/obj/item/device/radio/intercom/Del()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
|
||||
@@ -51,10 +56,9 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/intercom/proc/checkpower()
|
||||
|
||||
// Simple loop, checks for power. Strictly for intercoms
|
||||
while(src)
|
||||
/obj/item/device/radio/intercom/process()
|
||||
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
|
||||
last_tick = world.timeofday
|
||||
|
||||
if(!src.loc)
|
||||
on = 0
|
||||
@@ -69,5 +73,3 @@
|
||||
icon_state = "intercom-p"
|
||||
else
|
||||
icon_state = "intercom"
|
||||
|
||||
sleep(30)
|
||||
Reference in New Issue
Block a user