var
timestart = 0
s = 120
proc/GetTimeString(s=0 as num)
s = (s>356400 ? 356400 : s)
var
m = 0
h = 0
m = round(s/60)
s -= m*60
h = round(m/60)
m -= h*60
return ((m>=10 ? "[m]" : "[m]") + \
":" + (s>=10 ? "[s]" : "0[s]"))
proc/GetTimeString2(s=0 as num)
s = (s>356400 ? 356400 : s)
var
m = 0
h = 0
m = round(s/60)
s -= m*60
h = round(m/60)
m -= h*60
return ((h>=10 ? "[h]" : "0[h]") + ":" + (m>=10 ? "[m]" : "0[m]") + \
":" + (s>=10 ? "[s]" : "0[s]"))
mob
var/testing = 0 // Can't run 2 timers at once!
proc
ClearClock()
if(!client)
return 0
for(var/obj/Number/N in client.screen)
del N
DrawClock(time, startx = 15 as num, starty = 1 as num, xoffset = 4 as num, yoffset = 4 as num)
if(!client)
return 0
if(isnum(time))
time=num2text(time)
if(time)
ClearClock()
var/offset = xoffset
var/xpos = startx
for(var/i=1,i<=length(time),i++)
var/char = copytext(time,i,i+1)
new/obj/Number(client,char,"[xpos]:[offset],[starty]:[yoffset]")
offset += (char_widths[char] ? char_widths[char] : default_width) + char_distance
while(offset > 32)
offset -= 32
xpos++
obj/Number
icon = 'numbers.dmi'
New(client/C, char, s_l="1,1")
..()
icon_state = char
screen_loc = s_l
C.screen+=src
var
default_width = 6 // Default number width. (in pixels)
char_widths[] = list("1"=1,":"=1) // For alternative widths. (like the number "1" is 1 pixel wide)
char_distance = 7 // Pixels between numbers.
mob
var
os = 0
proc
Tick()
if(s<=0||!timestart||!currentartist)
TimeOver()
return
for(var/mob/M in world)
if(!M.client) continue
else
M.os = s
M.DrawClock(GetTimeString(M.os))
sleep(10)
s--
if(s == 30)
var/txt
txt = "[copytext(word,1,3)]"
var/new_text = "[txt]"
var/i = length(word)-2 // the amount of underscores to add
while(i --)
new_text += " _"
world << "<span class=game>Hint: [new_text]</span>"
Tick()
TimeOver()
if(currentartist && timestart)
End(null)
s = 120
for(var/mob/M in world)
M.os = s
M.DrawClock(GetTimeString(M.os))
timestart=0
return
TimeLimit()
if(timestart) return
timestart=1
s=120
Tick()
Thanks for any help provided. Also I posted this in Developer How-To because I really don't know if the problem is there, or somewhere else. So I rather just ask for signs of infinite loops, and look through my code to see whats up.
-Doh