mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Finished first version of medicine feature.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user