Commit 85f67093 authored by pixeldesu's avatar pixeldesu

added new event

parent b9e8bfdb
......@@ -232,7 +232,17 @@ eventTimer = ->
window.gameVars.people.shelter += i
title = "*Le wild fire appeared"
message = "A fire destroyed a part of a nearby city!<br /><br />You need to grant shelter for #{i} people."
when 7 # remove people from shelter
if window.gameVars.people.shelter >= 1
i = Math.floor((Math.random() * 10000000) % window.gameVars.people.shelter) + 1
window.gameVars.people.shelter -= i
title = "People move out!"
message = "The nearby city was rebuilt and #{i} people moved out."
else if window.gameVars.people.shelter == 0
title = "Nothing happens..."
message = "This message is empty."
break
updateCounters()
NProgress.start()
$.growl {
......
// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.8.0
(function() {
var cattleGridTimer, cgtim, cgtimEnabled, currPos, eventTimer, evtim, fieldTimer, fitim, getPrice, initItem, livestockTimer, loadGame, lstim, lstimEnabled, marketBuyItem, marketSellItem, marketSliderChange, progressTimer, prtim, saveGame, setPriceLabels, updateCounters, warTimer, wheatTimer, whtim;
......@@ -253,6 +253,18 @@
window.gameVars.people.shelter += i;
title = "*Le wild fire appeared";
message = "A fire destroyed a part of a nearby city!<br /><br />You need to grant shelter for " + i + " people.";
break;
case 7:
if (window.gameVars.people.shelter >= 1) {
i = Math.floor((Math.random() * 10000000) % window.gameVars.people.shelter) + 1;
window.gameVars.people.shelter -= i;
title = "People move out!";
message = "The nearby city was rebuilt and " + i + " people moved out.";
} else if (window.gameVars.people.shelter === 0) {
title = "Nothing happens...";
message = "This message is empty.";
break;
}
}
updateCounters();
NProgress.start();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment