Add hut fire event.

Closes #35
This commit is contained in:
Travis Weston
2015-02-06 16:26:18 -05:00
committed by Blake Grotewold
parent 0334219d9f
commit 8010597e44
17 changed files with 12691 additions and 17432 deletions
+29 -1
View File
@@ -63,7 +63,35 @@ Events.Outside = [
}
}
},
{
title: _('Fire'),
isAvailable: function() {
return $SM.get('game.buildings["hut"]', true) > 0 && $SM.get('game.population', true) > 5;
},
scenes: {
'start': {
text: [
_('a fire rampages through one of the huts, destroying it.'),
_('all residents in the hut perished in the fire.')
],
notification: _('a fire has started'),
blink: true,
onLoad: function() {
var population = $SM.get('game.population', true);
var huts = $SM.get('game.buildings["hut"]', true);
$SM.set('game.buildings["hut"]', (huts - 1));
$SM.set('game.population', (population - 4));
},
buttons: {
'mourn': {
text: _('mourn'),
notification: _('some villagers have died'),
nextScene: 'end'
}
}
}
}
},
{ /* Sickness */
title: _('Sickness'),
isAvailable: function() {
+2 -1
View File
@@ -49,7 +49,8 @@ Events.Room = [
}
}
}
}, { /* Noises Outside -- gain wood/fur */
},
{ /* Noises Outside -- gain wood/fur */
title: _('Noises'),
isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.wood');