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:
Mloc-Argent
2013-10-07 17:41:51 +01:00
parent 06df06a0a3
commit ebf2ba2d4a
8 changed files with 33 additions and 20 deletions

View File

@@ -418,6 +418,7 @@ its easier to just keep the beam vertical.
//returns 1 if made bloody, returns 0 otherwise //returns 1 if made bloody, returns 0 otherwise
/atom/proc/add_blood(mob/living/carbon/human/M as mob) /atom/proc/add_blood(mob/living/carbon/human/M as mob)
if(flags & NOBLOODY) return 0
.=1 .=1
if (!( istype(M, /mob/living/carbon/human) )) if (!( istype(M, /mob/living/carbon/human) ))
return 0 return 0

View File

@@ -27,6 +27,9 @@
set category = "Object" set category = "Object"
set src in oview(1) set src in oview(1)
if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check.
return
if( state != 4 ) if( state != 4 )
usr << "The washing machine cannot run in this state." usr << "The washing machine cannot run in this state."
return return

View File

@@ -16,6 +16,8 @@
var/spreadChance = 40 var/spreadChance = 40
var/spreadIntoAdjacentChance = 60 var/spreadIntoAdjacentChance = 60
var/evolveChance = 2 var/evolveChance = 2
var/lastTick = 0
var/spreaded = 1
/obj/effect/glowshroom/single /obj/effect/glowshroom/single
spreadChance = 0 spreadChance = 0
@@ -40,15 +42,21 @@
else //if on the floor, glowshroom on-floor sprite else //if on the floor, glowshroom on-floor sprite
icon_state = "glowshroomf" icon_state = "glowshroomf"
spawn(delay) processing_objects += src
SetLuminosity(round(potency/10))
Spread()
/obj/effect/glowshroom/proc/Spread() SetLuminosity(round(potency/10))
set background = 1 lastTick = world.timeofday
var/spreaded = 1
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 spreaded = 0
for(var/i=1,i<=yield,i++) for(var/i=1,i<=yield,i++)
@@ -90,8 +98,6 @@
if(prob(evolveChance)) //very low chance to evolve on its own if(prob(evolveChance)) //very low chance to evolve on its own
potency += rand(4,6) potency += rand(4,6)
sleep(delay)
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc) /obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
set background = 1 set background = 1
var/direction = 16 var/direction = 16

View File

@@ -5,13 +5,18 @@
anchored = 1 anchored = 1
w_class = 4.0 w_class = 4.0
canhear_range = 2 canhear_range = 2
flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY
var/number = 0 var/number = 0
var/anyai = 1 var/anyai = 1
var/mob/living/silicon/ai/ai = list() var/mob/living/silicon/ai/ai = list()
var/last_tick //used to delay the powercheck
/obj/item/device/radio/intercom/New() /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) /obj/item/device/radio/intercom/attack_ai(mob/user as mob)
@@ -51,10 +56,9 @@
return return
..() ..()
/obj/item/device/radio/intercom/proc/checkpower() /obj/item/device/radio/intercom/process()
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
// Simple loop, checks for power. Strictly for intercoms last_tick = world.timeofday
while(src)
if(!src.loc) if(!src.loc)
on = 0 on = 0
@@ -69,5 +73,3 @@
icon_state = "intercom-p" icon_state = "intercom-p"
else else
icon_state = "intercom" icon_state = "intercom"
sleep(30)

View File

@@ -12,8 +12,8 @@
<html> <html>
<head> <head>
<title>Permissions Panel</title> <title>Permissions Panel</title>
<script type='text/javascript' src='html/search.js'></script> <script type='text/javascript' src='search.js'></script>
<link rel='stylesheet' type='text/css' href='html/panels.css'> <link rel='stylesheet' type='text/css' href='panels.css'>
</head> </head>
<body onload='selectTextField();updateSearch();'> <body onload='selectTextField();updateSearch();'>
<div id='main'><table id='searchable' cellspacing='0'> <div id='main'><table id='searchable' cellspacing='0'>

View File

@@ -886,7 +886,7 @@
user.SetLuminosity(round(user.luminosity + (potency/10),1)) user.SetLuminosity(round(user.luminosity + (potency/10),1))
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user) /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.SetLuminosity(round(user.luminosity + (potency/10),1)) user.SetLuminosity(round(user.luminosity - (potency/10),1))
SetLuminosity(round(potency/10,1)) SetLuminosity(round(potency/10,1))

View File

@@ -189,6 +189,7 @@ var/MAX_EXPLOSION_RANGE = 14
#define CONDUCT 64 // conducts electricity (metal etc.) #define CONDUCT 64 // conducts electricity (metal etc.)
#define FPRINT 256 // takes a fingerprint #define FPRINT 256 // takes a fingerprint
#define ON_BORDER 512 // item has priority to check when entering or leaving #define ON_BORDER 512 // item has priority to check when entering or leaving
#define NOBLOODY 2048 // used to items if they don't want to get a blood overlay
#define GLASSESCOVERSEYES 1024 #define GLASSESCOVERSEYES 1024
#define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags #define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB