Finished first version of medicine feature.

This commit is contained in:
Zarkonnen
2013-07-10 12:53:28 +02:00
parent 4334f36e57
commit bb953de92b
8 changed files with 285 additions and 40 deletions
+114
View File
@@ -63,6 +63,120 @@ Events.Outside = [
}
},
{ /* Sickness */
title: 'Sickness',
isAvailable: function() {
return Engine.activeModule == Outside && Outside.getPopulation() > 10 && Outside.getPopulation() < 50;
},
scenes: {
'start': {
text: [
'a sickness is spreading through the village.',
'medicine is needed immediately.'
],
buttons: {
'heal': {
text: '1 medicine',
cost: { 'medicine' : 1 },
nextScene: {1: 'healed'}
},
'ignore': {
text: 'ignore it',
nextScene: {1: 'death'}
}
}
},
'healed': {
text: [
'the sickness is cured in time.'
],
buttons: {
'end': {
text: 'go home',
nextScene: 'end'
}
}
},
'death': {
text: [
'the sickness spreads through the village.',
'the days are spent with burials.',
'the nights are rent with screams.'
],
onLoad: function() {
var numKilled = Math.floor(Math.random() * 20) + 1;
Outside.killVillagers(numKilled);
},
buttons: {
'end': {
text: 'go home',
nextScene: 'end'
}
}
}
}
},
{ /* Plague */
title: 'Plague',
isAvailable: function() {
return Engine.activeModule == Outside && Outside.getPopulation() > 50;
},
scenes: {
'start': {
text: [
'a terrible plague is fast spreading through the village.',
'medicine is needed immediately.'
],
buttons: {
'heal': {
text: '5 medicine',
cost: { 'medicine' : 5 },
nextScene: {1: 'healed'}
},
'ignore': {
text: 'do nothing',
nextScene: {1: 'death'}
}
}
},
'healed': {
text: [
'the plague is kept from spreading.',
'only a few die.',
'the rest bury them.'
],
onLoad: function() {
var numKilled = Math.floor(Math.random() * 5) + 2;
Outside.killVillagers(numKilled);
},
buttons: {
'end': {
text: 'go home',
nextScene: 'end'
}
}
},
'death': {
text: [
'the plague rips through the village.',
'the nights are rent with screams.',
'the only hope is a quick death.'
],
onLoad: function() {
var numKilled = Math.floor(Math.random() * 80) + 10;
Outside.killVillagers(numKilled);
},
buttons: {
'end': {
text: 'go home',
nextScene: 'end'
}
}
}
}
},
{ /* Beast attack */
title: 'A Beast Attack',
isAvailable: function() {