Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Andreas Nedbal
FarmingGame-web
Commits
b67334a2
Commit
b67334a2
authored
Oct 18, 2014
by
pixeldesu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more events
parent
3007d9dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
coffee/main.coffee
coffee/main.coffee
+20
-2
No files found.
coffee/main.coffee
View file @
b67334a2
...
...
@@ -164,7 +164,7 @@ progressTimer = ->
eventTimer
=
->
currPos
=
0
NProgress
.
done
()
ev
=
Math
.
floor
((
Math
.
random
()
*
10000000
)
%
8
)
ev
=
Math
.
floor
((
Math
.
random
()
*
10000000
)
%
10
)
console
.
log
"Event
#{
ev
}
"
...
...
@@ -242,7 +242,25 @@ eventTimer = ->
title
=
"Nothing happens..."
message
=
"This message is empty."
break
when
8
# destroyed cattle grids
if
window
.
gameVars
.
cattleGrid
.
count
<=
0
title
=
"Nothing happens..."
message
=
"Cows in the distance."
break
c
=
Math
.
floor
((
Math
.
random
()
*
10000000
)
%
(
window
.
gameVars
.
cattleGrid
.
count
-
(
window
.
gameVars
.
cattleGrid
.
count
/
3
)))
+
1
window
.
gameVars
.
cattleGrid
.
count
-=
c
title
=
"Oh noes!"
message
=
"
#{
f
}
cattle grids were destroyed by rampaging animals, these are not usable anymore."
when
9
# livestock died
if
window
.
gameVars
.
livestock
.
count
<=
0
title
=
"Nothing happens..."
message
=
"Your cattle grids are empty"
break
d
=
Math
.
floor
((
Math
.
random
()
*
10000000
)
%
(
window
.
gameVars
.
livestock
.
count
-
(
window
.
gameVars
.
livestock
.
count
/
2
)))
+
1
window
.
gameVars
.
livestock
.
count
-=
d
title
=
"Oh noes!"
message
=
"A flu killed some of your animals.<br /><br />You lost
#{
w
}
livestock."
updateCounters
()
NProgress
.
start
()
$
.
growl
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment