Start trad fr

This commit is contained in:
vanadar
2014-02-04 22:27:00 +01:00
parent 8ad2f82fd0
commit f986e0323e
9 changed files with 690 additions and 688 deletions
+2
View File
@@ -25,6 +25,8 @@
<script src="lib/jquery.event.move.js"></script> <script src="lib/jquery.event.move.js"></script>
<script src="lib/jquery.event.swipe.js"></script> <script src="lib/jquery.event.swipe.js"></script>
<script src="lib/base64.js"></script> <script src="lib/base64.js"></script>
<script src="lib/translate.js"></script>
<script src="lang/fr.js"></script>
<script src="script/Button.js"></script> <script src="script/Button.js"></script>
<script src="script/engine.js"></script> <script src="script/engine.js"></script>
<script src="script/state_manager.js"></script> <script src="script/state_manager.js"></script>
+56 -56
View File
@@ -17,48 +17,48 @@ var Engine = {
Perks: { Perks: {
'boxer': { 'boxer': {
desc: 'punches do more damage', desc: _('punches do more damage'),
notify: 'learned to throw punches with purpose' notify: _('learned to throw punches with purpose')
}, },
'martial artist': { 'martial artist': {
desc: 'punches do even more damage.', desc: _('punches do even more damage.'),
notify: 'learned to fight quite effectively without weapons' notify: _('learned to fight quite effectively without weapons')
}, },
'unarmed master': { 'unarmed master': {
desc: 'punch twice as fast, and with even more force', desc: _('punch twice as fast, and with even more force'),
notify: 'learned to strike faster without weapons' notify: _('learned to strike faster without weapons')
}, },
'barbarian': { 'barbarian': {
desc: 'melee weapons deal more damage', desc: _('melee weapons deal more damage'),
notify: 'learned to swing weapons with force' notify: _('learned to swing weapons with force')
}, },
'slow metabolism': { 'slow metabolism': {
desc: 'go twice as far without eating', desc: _('go twice as far without eating'),
notify: 'learned how to ignore the hunger' notify: _('learned how to ignore the hunger')
}, },
'desert rat': { 'desert rat': {
desc: 'go twice as far without drinking', desc: _('go twice as far without drinking'),
notify: 'learned to love the dry air' notify: _('learned to love the dry air')
}, },
'evasive': { 'evasive': {
desc: 'dodge attacks more effectively', desc: _('dodge attacks more effectively'),
notify: "learned to be where they're not" notify: _("learned to be where they're not")
}, },
'precise': { 'precise': {
desc: 'land blows more often', desc: _('land blows more often'),
notify: 'learned to predict their movement' notify: _('learned to predict their movement')
}, },
'scout': { 'scout': {
desc: 'see farther', desc: _('see farther'),
notify: 'learned to look ahead' notify: _('learned to look ahead')
}, },
'stealthy': { 'stealthy': {
desc: 'better avoid conflict in the wild', desc: _('better avoid conflict in the wild'),
notify: 'learned how not to be seen' notify: _('learned how not to be seen')
}, },
'gastronome': { 'gastronome': {
desc: 'restore more health when eating', desc: _('restore more health when eating'),
notify: 'learned to make the most of food' notify: _('learned to make the most of food')
} }
}, },
@@ -100,31 +100,31 @@ var Engine = {
$('<span>') $('<span>')
.addClass('lightsOff menuBtn') .addClass('lightsOff menuBtn')
.text('lights off.') .text(_('lights off.'))
.click(Engine.turnLightsOff) .click(Engine.turnLightsOff)
.appendTo(menu); .appendTo(menu);
$('<span>') $('<span>')
.addClass('menuBtn') .addClass('menuBtn')
.text('restart.') .text(_('restart.'))
.click(Engine.confirmDelete) .click(Engine.confirmDelete)
.appendTo(menu); .appendTo(menu);
$('<span>') $('<span>')
.addClass('menuBtn') .addClass('menuBtn')
.text('share.') .text(_('share.'))
.click(Engine.share) .click(Engine.share)
.appendTo(menu); .appendTo(menu);
$('<span>') $('<span>')
.addClass('menuBtn') .addClass('menuBtn')
.text('save.') .text(_('save.'))
.click(Engine.exportImport) .click(Engine.exportImport)
.appendTo(menu); .appendTo(menu);
$('<span>') $('<span>')
.addClass('menuBtn') .addClass('menuBtn')
.text('app store.') .text(_('app store.'))
.click(function() { window.open('https://itunes.apple.com/us/app/a-dark-room/id736683061'); }) .click(function() { window.open('https://itunes.apple.com/us/app/a-dark-room/id736683061'); })
.appendTo(menu); .appendTo(menu);
@@ -202,38 +202,38 @@ var Engine = {
exportImport: function() { exportImport: function() {
Events.startEvent({ Events.startEvent({
title: 'Export / Import', title: _('Export / Import'),
scenes: { scenes: {
start: { start: {
text: ['export or import save data, for backing up', text: [_('export or import save data, for backing up'),
'or migrating computers'], _('or migrating computers')],
buttons: { buttons: {
'export': { 'export': {
text: 'export', text: _('export'),
onChoose: Engine.export64 onChoose: Engine.export64
}, },
'import': { 'import': {
text: 'import', text: _('import'),
nextScene: {1: 'confirm'}, nextScene: {1: 'confirm'},
}, },
'cancel': { 'cancel': {
text: 'cancel', text: _('cancel'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'confirm': { 'confirm': {
text: ['are you sure?', text: [_('are you sure?'),
'if the code is invalid, all data will be lost.', _('if the code is invalid, all data will be lost.'),
'this is irreversible.'], _('this is irreversible.')],
buttons: { buttons: {
'yes': { 'yes': {
text: 'yes', text: _('yes'),
nextScene: 'end', nextScene: 'end',
onChoose: Engine.import64 onChoose: Engine.import64
}, },
'no': { 'no': {
text: 'no', text: _('no'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -249,14 +249,14 @@ var Engine = {
string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, ''); string64 = string64.replace(/\n/g, '');
Events.startEvent({ Events.startEvent({
title: 'Export', title: _('Export'),
scenes: { scenes: {
start: { start: {
text: ['save this.'], text: [_('save this.')],
textarea: string64, textarea: string64,
buttons: { buttons: {
'done': { 'done': {
text: 'got it', text: _('got it'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -266,7 +266,7 @@ var Engine = {
}, },
import64: function() { import64: function() {
var string64 = prompt("put the save code here.",""); var string64 = prompt(_("put the save code here."),"");
string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\s/g, '');
string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, ''); string64 = string64.replace(/\n/g, '');
@@ -283,18 +283,18 @@ var Engine = {
confirmDelete: function() { confirmDelete: function() {
Events.startEvent({ Events.startEvent({
title: 'Restart?', title: _('Restart?'),
scenes: { scenes: {
start: { start: {
text: ['restart the game?'], text: [_('restart the game?')],
buttons: { buttons: {
'yes': { 'yes': {
text: 'yes', text: _('yes'),
nextScene: 'end', nextScene: 'end',
onChoose: Engine.deleteSave onChoose: Engine.deleteSave
}, },
'no': { 'no': {
text: 'no', text: _('no'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -317,41 +317,41 @@ var Engine = {
share: function() { share: function() {
Events.startEvent({ Events.startEvent({
title: 'Share', title: _('Share'),
scenes: { scenes: {
start: { start: {
text: ['bring your friends.'], text: [_('bring your friends.')],
buttons: { buttons: {
'facebook': { 'facebook': {
text: 'facebook', text: _('facebook'),
nextScene: 'end', nextScene: 'end',
onChoose: function() { onChoose: function() {
window.open('https://www.facebook.com/sharer/sharer.php?u=' + Engine.SITE_URL, 'sharer', 'width=626,height=436,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); window.open('https://www.facebook.com/sharer/sharer.php?u=' + Engine.SITE_URL, 'sharer', 'width=626,height=436,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
} }
}, },
'google': { 'google': {
text:'google+', text:_('google+'),
nextScene: 'end', nextScene: 'end',
onChoose: function() { onChoose: function() {
window.open('https://plus.google.com/share?url=' + Engine.SITE_URL, 'sharer', 'width=480,height=436,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); window.open('https://plus.google.com/share?url=' + Engine.SITE_URL, 'sharer', 'width=480,height=436,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
} }
}, },
'twitter': { 'twitter': {
text: 'twitter', text: _('twitter'),
onChoose: function() { onChoose: function() {
window.open('https://twitter.com/intent/tweet?text=A%20Dark%20Room&url=' + Engine.SITE_URL, 'sharer', 'width=660,height=260,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no'); window.open('https://twitter.com/intent/tweet?text=A%20Dark%20Room&url=' + Engine.SITE_URL, 'sharer', 'width=660,height=260,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
}, },
nextScene: 'end' nextScene: 'end'
}, },
'reddit': { 'reddit': {
text: 'reddit', text: _('reddit'),
onChoose: function() { onChoose: function() {
window.open('http://www.reddit.com/submit?url=' + Engine.SITE_URL, 'sharer', 'width=960,height=700,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no'); window.open('http://www.reddit.com/submit?url=' + Engine.SITE_URL, 'sharer', 'width=960,height=700,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
}, },
nextScene: 'end' nextScene: 'end'
}, },
'close': { 'close': {
text: 'close', text: _('close'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -385,16 +385,16 @@ var Engine = {
if (darkCss == null) { if (darkCss == null) {
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />'); $('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
Engine.turnLightsOff; Engine.turnLightsOff;
$('.lightsOff').text('lights on.'); $('.lightsOff').text(_('lights on.'));
} }
else if (darkCss.disabled) { else if (darkCss.disabled) {
darkCss.disabled = false; darkCss.disabled = false;
$('.lightsOff').text('lights on.'); $('.lightsOff').text(_('lights on.'));
} }
else { else {
$("#darkenLights").attr("disabled", "disabled"); $("#darkenLights").attr("disabled", "disabled");
darkCss.disabled = true; darkCss.disabled = true;
$('.lightsOff').text('lights off.'); $('.lightsOff').text(_('lights off.'));
} }
}, },
+5 -5
View File
@@ -123,7 +123,7 @@ var Events = {
var btn = new Button.Button({ var btn = new Button.Button({
id: 'eat', id: 'eat',
text: 'eat meat', text: _('eat meat'),
cooldown: cooldown, cooldown: cooldown,
click: Events.eatMeat, click: Events.eatMeat,
cost: { 'cured meat': 1 } cost: { 'cured meat': 1 }
@@ -143,7 +143,7 @@ var Events = {
var btn = new Button.Button({ var btn = new Button.Button({
id: 'meds', id: 'meds',
text: 'use meds', text: _('use meds'),
cooldown: cooldown, cooldown: cooldown,
click: Events.useMeds, click: Events.useMeds,
cost: { 'medicine': 1 } cost: { 'medicine': 1 }
@@ -453,7 +453,7 @@ var Events = {
var btns = $('#buttons', Events.eventPanel()); var btns = $('#buttons', Events.eventPanel());
desc.empty(); desc.empty();
btns.empty(); btns.empty();
$('<div>').text('the ' + scene.enemy + (scene.plural ? ' are' : ' is') + ' dead.').appendTo(desc); $('<div>').text(_("the {0} is dead.",scene.enemy)).appendTo(desc);
Events.drawLoot(scene.loot); Events.drawLoot(scene.loot);
@@ -471,7 +471,7 @@ var Events = {
Events.endEvent(); Events.endEvent();
} }
}, },
text: 'leave' text: _('leave')
}).appendTo(btns); }).appendTo(btns);
Events.createEatMeatButton(0).appendTo(btns); Events.createEatMeatButton(0).appendTo(btns);
@@ -808,7 +808,7 @@ var Events = {
Engine.keyLock = false; Engine.keyLock = false;
// Force refocus on the body. I hate you, IE. // Force refocus on the body. I hate you, IE.
$('body').focus(); $('body').focus();
}); });
}, },
handleStateUpdates: function(e){ handleStateUpdates: function(e){
+20 -20
View File
@@ -4,7 +4,7 @@
Events.Encounters = [ Events.Encounters = [
/* Tier 1 */ /* Tier 1 */
{ /* Snarling Beast */ { /* Snarling Beast */
title: 'A Snarling Beast', title: _('A Snarling Beast'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() <= 10 && World.getTerrain() == World.TILE.FOREST; return World.getDistance() <= 10 && World.getTerrain() == World.TILE.FOREST;
}, },
@@ -34,12 +34,12 @@ Events.Encounters = [
chance: 0.8 chance: 0.8
} }
}, },
notification: 'a snarling beast leaps out of the underbrush' notification: _('a snarling beast leaps out of the underbrush')
} }
} }
}, },
{ /* Gaunt Man */ { /* Gaunt Man */
title: 'A Gaunt Man', title: _('A Gaunt Man'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() <= 10 && World.getTerrain() == World.TILE.BARRENS; return World.getDistance() <= 10 && World.getTerrain() == World.TILE.BARRENS;
}, },
@@ -69,12 +69,12 @@ Events.Encounters = [
chance: 0.5 chance: 0.5
} }
}, },
notification: 'a gaunt man approaches, a crazed look in his eye' notification: _('a gaunt man approaches, a crazed look in his eye')
} }
} }
}, },
{ /* Strange Bird */ { /* Strange Bird */
title: 'A Strange Bird', title: _('A Strange Bird'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() <= 10 && World.getTerrain() == World.TILE.FIELD; return World.getDistance() <= 10 && World.getTerrain() == World.TILE.FIELD;
}, },
@@ -104,13 +104,13 @@ Events.Encounters = [
chance: 0.8 chance: 0.8
} }
}, },
notification: 'a strange looking bird speeds across the plains' notification: _('a strange looking bird speeds across the plains')
} }
} }
}, },
/* Tier 2*/ /* Tier 2*/
{ /* Shivering Man */ { /* Shivering Man */
title: 'A Shivering Man', title: _('A Shivering Man'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.BARRENS; return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.BARRENS;
}, },
@@ -145,12 +145,12 @@ Events.Encounters = [
chance: 0.7 chance: 0.7
} }
}, },
notification: 'a shivering man approaches and attacks with surprising strength' notification: _('a shivering man approaches and attacks with surprising strength')
} }
} }
}, },
{ /* Man-eater */ { /* Man-eater */
title: 'A Man-Eater', title: _('A Man-Eater'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.FOREST; return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.FOREST;
}, },
@@ -180,12 +180,12 @@ Events.Encounters = [
chance: 0.8 chance: 0.8
} }
}, },
notification: 'a large creature attacks, claws freshly bloodied' notification: _('a large creature attacks, claws freshly bloodied')
} }
} }
}, },
{ /* Scavenger */ { /* Scavenger */
title: 'A Scavenger', title: _('A Scavenger'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.BARRENS; return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.BARRENS;
}, },
@@ -220,12 +220,12 @@ Events.Encounters = [
chance: 0.1 chance: 0.1
} }
}, },
notification: 'a scavenger draws close, hoping for an easy score' notification: _('a scavenger draws close, hoping for an easy score')
} }
} }
}, },
{ /* Huge Lizard */ { /* Huge Lizard */
title: 'A Huge Lizard', title: _('A Huge Lizard'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.FIELD; return World.getDistance() > 10 && World.getDistance() <= 20 && World.getTerrain() == World.TILE.FIELD;
}, },
@@ -255,13 +255,13 @@ Events.Encounters = [
chance: 0.8 chance: 0.8
} }
}, },
notification: 'the grass thrashes wildly as a huge lizard pushes through' notification: _('the grass thrashes wildly as a huge lizard pushes through')
} }
} }
}, },
/* Tier 3*/ /* Tier 3*/
{ /* Feral Terror */ { /* Feral Terror */
title: 'A Feral Terror', title: _('A Feral Terror'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 20 && World.getTerrain() == World.TILE.FOREST; return World.getDistance() > 20 && World.getTerrain() == World.TILE.FOREST;
}, },
@@ -291,12 +291,12 @@ Events.Encounters = [
chance: 0.8 chance: 0.8
} }
}, },
notification: 'a beast, wilder than imagining, erupts out of the foliage' notification: _('a beast, wilder than imagining, erupts out of the foliage')
} }
} }
}, },
{ /* Soldier */ { /* Soldier */
title: 'A Soldier', title: _('A Soldier'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 20 && World.getTerrain() == World.TILE.BARRENS; return World.getDistance() > 20 && World.getTerrain() == World.TILE.BARRENS;
}, },
@@ -332,12 +332,12 @@ Events.Encounters = [
chance: 0.1 chance: 0.1
} }
}, },
notification: 'a soldier opens fire from across the desert' notification: _('a soldier opens fire from across the desert')
} }
} }
}, },
{ /* Sniper */ { /* Sniper */
title: 'A Sniper', title: _('A Sniper'),
isAvailable: function() { isAvailable: function() {
return World.getDistance() > 20 && World.getTerrain() == World.TILE.FIELD; return World.getDistance() > 20 && World.getTerrain() == World.TILE.FIELD;
}, },
@@ -373,7 +373,7 @@ Events.Encounters = [
chance: 0.1 chance: 0.1
} }
}, },
notification: 'a shot rings out, from somewhere in the long grass' notification: _('a shot rings out, from somewhere in the long grass'à
} }
} }
} }
+13 -13
View File
@@ -3,33 +3,33 @@
**/ **/
Events.Global = [ Events.Global = [
{ /* The Thief */ { /* The Thief */
title: 'The Thief', title: _('The Thief'),
isAvailable: function() { isAvailable: function() {
return (Engine.activeModule == Room || Engine.activeModule == Outside) && $SM.get('game.thieves') == 1; return (Engine.activeModule == Room || Engine.activeModule == Outside) && $SM.get('game.thieves') == 1;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'the villagers haul a filthy man out of the store room.', _('the villagers haul a filthy man out of the store room.'),
"say his folk have been skimming the supplies.", _("say his folk have been skimming the supplies."),
'say he should be strung up as an example.' _('say he should be strung up as an example.')
], ],
notification: 'a thief is caught', notification: _('a thief is caught'),
buttons: { buttons: {
'kill': { 'kill': {
text: 'hang him', text: _('hang him'),
nextScene: {1: 'hang'} nextScene: {1: 'hang'}
}, },
'spare': { 'spare': {
text: 'spare him', text: _('spare him'),
nextScene: {1: 'spare'} nextScene: {1: 'spare'}
} }
} }
}, },
'hang': { 'hang': {
text: [ text: [
'the villagers hang the thief high in front of the store room.', _('the villagers hang the thief high in front of the store room.'),
'the point is made. in the next few days, the missing supplies are returned.' _('the point is made. in the next few days, the missing supplies are returned.')
], ],
onLoad: function() { onLoad: function() {
$SM.set('game.thieves', 2); $SM.set('game.thieves', 2);
@@ -38,15 +38,15 @@ Events.Global = [
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'leave', text: _('leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'spare': { 'spare': {
text: [ text: [
"the man says he's grateful. says he won't come around any more.", _("the man says he's grateful. says he won't come around any more."),
"shares what he knows about sneaking before he goes." _("shares what he knows about sneaking before he goes.")
], ],
onLoad: function() { onLoad: function() {
$SM.set('game.thieves', 2); $SM.set('game.thieves', 2);
@@ -55,7 +55,7 @@ Events.Global = [
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'leave', text: _('leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
+46 -46
View File
@@ -3,15 +3,15 @@
**/ **/
Events.Outside = [ Events.Outside = [
{ /* Ruined traps */ { /* Ruined traps */
title: 'A Ruined Trap', title: _('A Ruined Trap'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && $SM.get('game.buildings["trap"]', true) > 0; return Engine.activeModule == Outside && $SM.get('game.buildings["trap"]', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'some of the traps have been torn apart.', _('some of the traps have been torn apart.'),
'large prints lead away, into the forest.' _('large prints lead away, into the forest.')
], ],
onLoad: function() { onLoad: function() {
var numWrecked = Math.floor(Math.random() * $SM.get('game.buildings["trap"]', true)) + 1; var numWrecked = Math.floor(Math.random() * $SM.get('game.buildings["trap"]', true)) + 1;
@@ -19,34 +19,34 @@ Events.Outside = [
Outside.updateVillage(); Outside.updateVillage();
Outside.updateTrapButton(); Outside.updateTrapButton();
}, },
notification: 'some traps have been destroyed', notification: _('some traps have been destroyed'),
buttons: { buttons: {
'track': { 'track': {
text: 'track them', text: _('track them'),
nextScene: {0.5: 'nothing', 1: 'catch'} nextScene: {0.5: 'nothing', 1: 'catch'}
}, },
'ignore': { 'ignore': {
text: 'ignore them', text: _('ignore them'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'nothing': { 'nothing': {
text: [ text: [
'the tracks disappear after just a few minutes.', _('the tracks disappear after just a few minutes.'),
'the forest is silent.' _('the forest is silent.')
], ],
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'catch': { 'catch': {
text: [ text: [
'not far from the village lies a large beast, its fur matted with blood.', _('not far from the village lies a large beast, its fur matted with blood.'),
'it puts up little resistance before the knife.' _('it puts up little resistance before the knife.')
], ],
reward: { reward: {
fur: 100, fur: 100,
@@ -55,7 +55,7 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -64,7 +64,7 @@ Events.Outside = [
}, },
{ /* Sickness */ { /* Sickness */
title: 'Sickness', title: _('Sickness'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && return Engine.activeModule == Outside &&
$SM.get('game.population', true) > 10 && $SM.get('game.population', true) > 10 &&
@@ -74,37 +74,37 @@ Events.Outside = [
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'a sickness is spreading through the village.', _('a sickness is spreading through the village.'),
'medicine is needed immediately.' _('medicine is needed immediately.')
], ],
buttons: { buttons: {
'heal': { 'heal': {
text: '1 medicine', text: _('1 medicine'),
cost: { 'medicine' : 1 }, cost: { 'medicine' : 1 },
nextScene: {1: 'healed'} nextScene: {1: 'healed'}
}, },
'ignore': { 'ignore': {
text: 'ignore it', text: _('ignore it'),
nextScene: {1: 'death'} nextScene: {1: 'death'}
} }
} }
}, },
'healed': { 'healed': {
text: [ text: [
'the sickness is cured in time.' _('the sickness is cured in time.')
], ],
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'death': { 'death': {
text: [ text: [
'the sickness spreads through the village.', _('the sickness spreads through the village.'),
'the days are spent with burials.', _('the days are spent with burials.'),
'the nights are rent with screams.' _('the nights are rent with screams.')
], ],
onLoad: function() { onLoad: function() {
var numKilled = Math.floor(Math.random() * 20) + 1; var numKilled = Math.floor(Math.random() * 20) + 1;
@@ -112,7 +112,7 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -121,33 +121,33 @@ Events.Outside = [
}, },
{ /* Plague */ { /* Plague */
title: 'Plague', title: _('Plague'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && $SM.get('game.population', true) > 50 && $SM.get('stores.medicine', true) > 0; return Engine.activeModule == Outside && $SM.get('game.population', true) > 50 && $SM.get('stores.medicine', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'a terrible plague is fast spreading through the village.', _('a terrible plague is fast spreading through the village.'),
'medicine is needed immediately.' _('medicine is needed immediately.')
], ],
buttons: { buttons: {
'heal': { 'heal': {
text: '5 medicine', text: _('5 medicine'),
cost: { 'medicine' : 5 }, cost: { 'medicine' : 5 },
nextScene: {1: 'healed'} nextScene: {1: 'healed'}
}, },
'ignore': { 'ignore': {
text: 'do nothing', text: _('do nothing'),
nextScene: {1: 'death'} nextScene: {1: 'death'}
} }
} }
}, },
'healed': { 'healed': {
text: [ text: [
'the plague is kept from spreading.', _('the plague is kept from spreading.'),
'only a few die.', _('only a few die.'),
'the rest bury them.' _('the rest bury them.')
], ],
onLoad: function() { onLoad: function() {
var numKilled = Math.floor(Math.random() * 5) + 2; var numKilled = Math.floor(Math.random() * 5) + 2;
@@ -155,16 +155,16 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'death': { 'death': {
text: [ text: [
'the plague rips through the village.', _('the plague rips through the village.'),
'the nights are rent with screams.', _('the nights are rent with screams.'),
'the only hope is a quick death.' _('the only hope is a quick death.')
], ],
onLoad: function() { onLoad: function() {
var numKilled = Math.floor(Math.random() * 80) + 10; var numKilled = Math.floor(Math.random() * 80) + 10;
@@ -172,7 +172,7 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -181,16 +181,16 @@ Events.Outside = [
}, },
{ /* Beast attack */ { /* Beast attack */
title: 'A Beast Attack', title: _('A Beast Attack'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && $SM.get('game.population', true) > 0; return Engine.activeModule == Outside && $SM.get('game.population', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'a pack of snarling beasts pours out of the trees.', _('a pack of snarling beasts pours out of the trees.'),
'the fight is short and bloody, but the beasts are repelled.', _('the fight is short and bloody, but the beasts are repelled.'),
'the villagers retreat to mourn the dead.' _('the villagers retreat to mourn the dead.')
], ],
onLoad: function() { onLoad: function() {
var numKilled = Math.floor(Math.random() * 10) + 1; var numKilled = Math.floor(Math.random() * 10) + 1;
@@ -203,7 +203,7 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -212,16 +212,16 @@ Events.Outside = [
}, },
{ /* Soldier attack */ { /* Soldier attack */
title: 'A Military Raid', title: _('A Military Raid'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && $SM.get('game.population', true) > 0 && $SM.get('game.cityCleared');; return Engine.activeModule == Outside && $SM.get('game.population', true) > 0 && $SM.get('game.cityCleared');;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'a gunshot rings through the trees.', _('a gunshot rings through the trees.'),
'well armed men charge out of the forest, firing into the crowd.', _('well armed men charge out of the forest, firing into the crowd.'),
'after a skirmish they are driven away, but not without losses.' _('after a skirmish they are driven away, but not without losses.')
], ],
onLoad: function() { onLoad: function() {
var numKilled = Math.floor(Math.random() * 40) + 1; var numKilled = Math.floor(Math.random() * 40) + 1;
@@ -233,7 +233,7 @@ Events.Outside = [
}, },
buttons: { buttons: {
'end': { 'end': {
text: 'go home', text: _('go home'),
nextScene: 'end' nextScene: 'end'
} }
} }
+120 -120
View File
@@ -3,82 +3,82 @@
**/ **/
Events.Room = [ Events.Room = [
{ /* The Nomad -- Merchant */ { /* The Nomad -- Merchant */
title: 'The Nomad', title: _('The Nomad'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.fur', true) > 0; return Engine.activeModule == Room && $SM.get('stores.fur', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'a nomad shuffles into view, laden with makeshift bags bound with rough twine.', _('a nomad shuffles into view, laden with makeshift bags bound with rough twine.'),
"won't say from where he came, but it's clear that he's not staying." _("won't say from where he came, but it's clear that he's not staying.")
], ],
notification: 'a nomad arrives, looking to trade', notification: _('a nomad arrives, looking to trade'),
buttons: { buttons: {
'buyScales': { 'buyScales': {
text: 'buy scales', text: _('buy scales'),
cost: { 'fur': 100 }, cost: { 'fur': 100 },
reward: { 'scales': 1 } reward: { 'scales': 1 }
}, },
'buyTeeth': { 'buyTeeth': {
text: 'buy teeth', text: _('buy teeth'),
cost: { 'fur': 200 }, cost: { 'fur': 200 },
reward: { 'teeth': 1 } reward: { 'teeth': 1 }
}, },
'buyBait': { 'buyBait': {
text: 'buy bait', text: _('buy bait'),
cost: { 'fur': 5 }, cost: { 'fur': 5 },
reward: { 'bait': 1 }, reward: { 'bait': 1 },
notification: 'traps are more effective with bait.' notification: _('traps are more effective with bait.')
}, },
'buyCompass': { 'buyCompass': {
available: function() { available: function() {
return $SM.get('stores.compass', true) < 1; return $SM.get('stores.compass', true) < 1;
}, },
text: 'buy compass', text: _('buy compass'),
cost: { fur: 300, scales: 15, teeth: 5 }, cost: { fur: 300, scales: 15, teeth: 5 },
reward: { 'compass': 1 }, reward: { 'compass': 1 },
notification: 'the old compass is dented and dusty, but it looks to work.', notification: _('the old compass is dented and dusty, but it looks to work.'),
onChoose: Path.openPath onChoose: Path.openPath
}, },
'goodbye': { 'goodbye': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
} }
} }
}, { /* Noises Outside -- gain wood/fur */ }, { /* Noises Outside -- gain wood/fur */
title: 'Noises', title: _('Noises'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.wood'); return Engine.activeModule == Room && $SM.get('stores.wood');
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'through the walls, shuffling noises can be heard.', _('through the walls, shuffling noises can be heard.'),
"can't tell what they're up to." _("can't tell what they're up to.")
], ],
notification: 'strange noises can be heard through the walls', notification: _('strange noises can be heard through the walls'),
buttons: { buttons: {
'investigate': { 'investigate': {
text: 'investigate', text: _('investigate'),
nextScene: { 0.3: 'stuff', 1: 'nothing' } nextScene: { 0.3: 'stuff', 1: 'nothing' }
}, },
'ignore': { 'ignore': {
text: 'ignore them', text: _('ignore them'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'nothing': { 'nothing': {
text: [ text: [
'vague shapes move, just out of sight.', _('vague shapes move, just out of sight.'),
'the sounds stop.' _('the sounds stop.')
], ],
buttons: { buttons: {
'backinside': { 'backinside': {
text: 'go back inside', text: _('go back inside'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -86,12 +86,12 @@ Events.Room = [
'stuff': { 'stuff': {
reward: { wood: 100, fur: 10 }, reward: { wood: 100, fur: 10 },
text: [ text: [
'a bundle of sticks lies just beyond the threshold, wrapped in coarse furs.', _('a bundle of sticks lies just beyond the threshold, wrapped in coarse furs.'),
'the night is silent.' _('the night is silent.')
], ],
buttons: { buttons: {
'backinside': { 'backinside': {
text: 'go back inside', text: _('go back inside'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -99,32 +99,32 @@ Events.Room = [
} }
}, },
{ /* Noises Inside -- trade wood for better good */ { /* Noises Inside -- trade wood for better good */
title: 'Noises', title: _('Noises'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.wood'); return Engine.activeModule == Room && $SM.get('stores.wood');
}, },
scenes: { scenes: {
start: { start: {
text: [ text: [
'scratching noises can be heard from the store room.', _('scratching noises can be heard from the store room.'),
'something\'s in there.' _('something\'s in there.')
], ],
notification: 'something\'s in the store room', notification: _('something\'s in the store room'),
buttons: { buttons: {
'investigate': { 'investigate': {
text: 'investigate', text: _('investigate'),
nextScene: { 0.5: 'scales', 0.8: 'teeth', 1: 'cloth' } nextScene: { 0.5: 'scales', 0.8: 'teeth', 1: 'cloth' }
}, },
'ignore': { 'ignore': {
text: 'ignore them', text: _('ignore them'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
scales: { scales: {
text: [ text: [
'some wood is missing.', _('some wood is missing.'),
'the ground is littered with small scales' _('the ground is littered with small scales')
], ],
onLoad: function() { onLoad: function() {
var numWood = $SM.get('stores.wood', true); var numWood = $SM.get('stores.wood', true);
@@ -136,15 +136,15 @@ Events.Room = [
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'leave', text: _('leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
teeth: { teeth: {
text: [ text: [
'some wood is missing.', _('some wood is missing.'),
'the ground is littered with small teeth' _('the ground is littered with small teeth')
], ],
onLoad: function() { onLoad: function() {
var numWood = $SM.get('stores.wood', true); var numWood = $SM.get('stores.wood', true);
@@ -156,15 +156,15 @@ Events.Room = [
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'leave', text: _('leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
cloth: { cloth: {
text: [ text: [
'some wood is missing.', _('some wood is missing.'),
'the ground is littered with scraps of cloth' _('the ground is littered with scraps of cloth')
], ],
onLoad: function() { onLoad: function() {
var numWood = $SM.get('stores.wood', true); var numWood = $SM.get('stores.wood', true);
@@ -176,7 +176,7 @@ Events.Room = [
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'leave', text: _('leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -184,30 +184,30 @@ Events.Room = [
} }
}, },
{ /* The Beggar -- trade fur for better good */ { /* The Beggar -- trade fur for better good */
title: 'The Beggar', title: _('The Beggar'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.fur'); return Engine.activeModule == Room && $SM.get('stores.fur');
}, },
scenes: { scenes: {
start: { start: {
text: [ text: [
'a beggar arrives.', _('a beggar arrives.'),
'asks for any spare furs to keep him warm at night.' _('asks for any spare furs to keep him warm at night.')
], ],
notification: 'a beggar arrives', notification: _('a beggar arrives'),
buttons: { buttons: {
'50furs': { '50furs': {
text: 'give 50', text: _('give 50'),
cost: {fur: 50}, cost: {fur: 50},
nextScene: { 0.5: 'scales', 0.8: 'teeth', 1: 'cloth' } nextScene: { 0.5: 'scales', 0.8: 'teeth', 1: 'cloth' }
}, },
'100furs': { '100furs': {
text: 'give 100', text: _('give 100'),
cost: {fur: 100}, cost: {fur: 100},
nextScene: { 0.5: 'teeth', 0.8: 'scales', 1: 'cloth' } nextScene: { 0.5: 'teeth', 0.8: 'scales', 1: 'cloth' }
}, },
'deny': { 'deny': {
text: 'turn him away', text: _('turn him away'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -215,12 +215,12 @@ Events.Room = [
scales: { scales: {
reward: { scales: 20 }, reward: { scales: 20 },
text: [ text: [
'the beggar expresses his thanks.', _('the beggar expresses his thanks.'),
'leaves a pile of small scales behind.' _('leaves a pile of small scales behind.')
], ],
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -228,12 +228,12 @@ Events.Room = [
teeth: { teeth: {
reward: { teeth: 20 }, reward: { teeth: 20 },
text: [ text: [
'the beggar expresses his thanks.', _('the beggar expresses his thanks.'),
'leaves a pile of small teeth behind.' _('leaves a pile of small teeth behind.')
], ],
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -241,12 +241,12 @@ Events.Room = [
cloth: { cloth: {
reward: { cloth: 20 }, reward: { cloth: 20 },
text: [ text: [
'the beggar expresses his thanks.', _('the beggar expresses his thanks.'),
'leaves some scraps of cloth behind.' _('leaves some scraps of cloth behind.')
], ],
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -255,68 +255,68 @@ Events.Room = [
}, },
{ /* Mysterious Wanderer -- wood gambling */ { /* Mysterious Wanderer -- wood gambling */
title: 'The Mysterious Wanderer', title: _('The Mysterious Wanderer'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.wood'); return Engine.activeModule == Room && $SM.get('stores.wood');
}, },
scenes: { scenes: {
start: { start: {
text: [ text: [
'a wanderer arrives with an empty cart. says if he leaves with wood, he\'ll be back with more.', _('a wanderer arrives with an empty cart. says if he leaves with wood, he\'ll be back with more.'),
"builder's not sure he's to be trusted." _("builder's not sure he's to be trusted.")
], ],
notification: 'a mysterious wanderer arrives', notification: _('a mysterious wanderer arrives'),
buttons: { buttons: {
'100wood': { '100wood': {
text: 'give 100', text: _('give 100'),
cost: {wood: 100}, cost: {wood: 100},
nextScene: { 1: '100wood'} nextScene: { 1: '100wood'}
}, },
'500wood': { '500wood': {
text: 'give 500', text: _('give 500'),
cost: {wood: 500}, cost: {wood: 500},
nextScene: { 1: '500wood' } nextScene: { 1: '500wood' }
}, },
'deny': { 'deny': {
text: 'turn him away', text: _('turn him away'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'100wood': { '100wood': {
text: [ text: [
'the wanderer leaves, cart loaded with wood' _('the wanderer leaves, cart loaded with wood')
], ],
onLoad: function() { onLoad: function() {
if(Math.random() < 0.5) { if(Math.random() < 0.5) {
setTimeout(function() { setTimeout(function() {
$SM.add('stores.wood', 300); $SM.add('stores.wood', 300);
Notifications.notify(Room, 'the mysterious wanderer returns, cart piled high with wood.'); Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
}, 60 * 1000); }, 60 * 1000);
} }
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'500wood': { '500wood': {
text: [ text: [
'the wanderer leaves, cart loaded with wood' _('the wanderer leaves, cart loaded with wood')
], ],
onLoad: function() { onLoad: function() {
if(Math.random() < 0.3) { if(Math.random() < 0.3) {
setTimeout(function() { setTimeout(function() {
$SM.add('stores.wood', 1500); $SM.add('stores.wood', 1500);
Notifications.notify(Room, 'the mysterious wanderer returns, cart piled high with wood.'); Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
}, 60 * 1000); }, 60 * 1000);
} }
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -325,68 +325,68 @@ Events.Room = [
}, },
{ /* Mysterious Wanderer -- fur gambling */ { /* Mysterious Wanderer -- fur gambling */
title: 'The Mysterious Wanderer', title: _('The Mysterious Wanderer'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.fur'); return Engine.activeModule == Room && $SM.get('stores.fur');
}, },
scenes: { scenes: {
start: { start: {
text: [ text: [
'a wanderer arrives with an empty cart. says if she leaves with furs, she\'ll be back with more.', _('a wanderer arrives with an empty cart. says if she leaves with furs, she\'ll be back with more.'),
"builder's not sure she's to be trusted." _("builder's not sure she's to be trusted.")
], ],
notification: 'a mysterious wanderer arrives', notification: _('a mysterious wanderer arrives'),
buttons: { buttons: {
'100fur': { '100fur': {
text: 'give 100', text: _('give 100'),
cost: {fur: 100}, cost: {fur: 100},
nextScene: { 1: '100fur'} nextScene: { 1: '100fur'}
}, },
'500fur': { '500fur': {
text: 'give 500', text: _('give 500'),
cost: {fur: 500}, cost: {fur: 500},
nextScene: { 1: '500fur' } nextScene: { 1: '500fur' }
}, },
'deny': { 'deny': {
text: 'turn her away', text: _('turn her away'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'100fur': { '100fur': {
text: [ text: [
'the wanderer leaves, cart loaded with furs' _('the wanderer leaves, cart loaded with furs')
], ],
onLoad: function() { onLoad: function() {
if(Math.random() < 0.5) { if(Math.random() < 0.5) {
setTimeout(function() { setTimeout(function() {
$SM.add('stores.fur', 300); $SM.add('stores.fur', 300);
Notifications.notify(Room, 'the mysterious wanderer returns, cart piled high with furs.'); Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
}, 60 * 1000); }, 60 * 1000);
} }
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'500fur': { '500fur': {
text: [ text: [
'the wanderer leaves, cart loaded with furs' _('the wanderer leaves, cart loaded with furs')
], ],
onLoad: function() { onLoad: function() {
if(Math.random() < 0.3) { if(Math.random() < 0.3) {
setTimeout(function() { setTimeout(function() {
$SM.add('stores.fur', 1500); $SM.add('stores.fur', 1500);
Notifications.notify(Room, 'the mysterious wanderer returns, cart piled high with furs.'); Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
}, 60 * 1000); }, 60 * 1000);
} }
}, },
buttons: { buttons: {
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -395,26 +395,26 @@ Events.Room = [
}, },
{ /* The Scout -- Map Merchant */ { /* The Scout -- Map Merchant */
title: 'The Scout', title: _('The Scout'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('features.location.world'); return Engine.activeModule == Room && $SM.get('features.location.world');
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
"the scout says she's been all over.", _("the scout says she's been all over."),
"willing to talk about it, for a price." _("willing to talk about it, for a price.")
], ],
notification: 'a scout stops for the night', notification: _('a scout stops for the night'),
buttons: { buttons: {
'buyMap': { 'buyMap': {
text: 'buy map', text: _('buy map'),
cost: { 'fur': 200, 'scales': 10 }, cost: { 'fur': 200, 'scales': 10 },
notification: 'the map uncovers a bit of the world', notification: _('the map uncovers a bit of the world'),
onChoose: World.applyMap onChoose: World.applyMap
}, },
'learn': { 'learn': {
text: 'learn scouting', text: _('learn scouting'),
cost: { 'fur': 1000, 'scales': 50, 'teeth': 20 }, cost: { 'fur': 1000, 'scales': 50, 'teeth': 20 },
available: function() { available: function() {
return !$SM.hasPerk('scout'); return !$SM.hasPerk('scout');
@@ -424,7 +424,7 @@ Events.Room = [
} }
}, },
'leave': { 'leave': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -433,20 +433,20 @@ Events.Room = [
}, },
{ /* The Wandering Master */ { /* The Wandering Master */
title: 'The Master', title: _('The Master'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('features.location.world'); return Engine.activeModule == Room && $SM.get('features.location.world');
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
'an old wanderer arrives.', _('an old wanderer arrives.'),
'he smiles warmly and asks for lodgings for the night.' _('he smiles warmly and asks for lodgings for the night.')
], ],
notification: 'an old wanderer arrives', notification: _('an old wanderer arrives'),
buttons: { buttons: {
'agree': { 'agree': {
text: 'agree', text: _('agree'),
cost: { cost: {
'cured meat': 100, 'cured meat': 100,
'fur': 100, 'fur': 100,
@@ -455,18 +455,18 @@ Events.Room = [
nextScene: {1: 'agree'} nextScene: {1: 'agree'}
}, },
'deny': { 'deny': {
text: 'turn him away', text: _('turn him away'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'agree': { 'agree': {
text: [ text: [
'in exchange, the wanderer offers his wisdom.' _('in exchange, the wanderer offers his wisdom.')
], ],
buttons: { buttons: {
'evasion': { 'evasion': {
text: 'evasion', text: _('evasion'),
available: function() { available: function() {
return !$SM.hasPerk('evasive'); return !$SM.hasPerk('evasive');
}, },
@@ -476,7 +476,7 @@ Events.Room = [
nextScene: 'end' nextScene: 'end'
}, },
'precision': { 'precision': {
text: 'precision', text: _('precision'),
available: function() { available: function() {
return !$SM.hasPerk('precise'); return !$SM.hasPerk('precise');
}, },
@@ -486,7 +486,7 @@ Events.Room = [
nextScene: 'end' nextScene: 'end'
}, },
'force': { 'force': {
text: 'force', text: _('force'),
available: function() { available: function() {
return !$SM.hasPerk('barbarian'); return !$SM.hasPerk('barbarian');
}, },
@@ -496,7 +496,7 @@ Events.Room = [
nextScene: 'end' nextScene: 'end'
}, },
'nothing': { 'nothing': {
text: 'nothing', text: _('nothing'),
nextScene: 'end' nextScene: 'end'
} }
} }
@@ -505,85 +505,85 @@ Events.Room = [
}, },
{ /* The Sick Man */ { /* The Sick Man */
title: 'The Sick Man', title: _('The Sick Man'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Room && $SM.get('stores.medicine', true) > 0; return Engine.activeModule == Room && $SM.get('stores.medicine', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
text: [ text: [
"a man hobbles up, coughing.", _("a man hobbles up, coughing."),
"he begs for medicine." _("he begs for medicine.")
], ],
notification: 'a sick man hobbles up', notification: _('a sick man hobbles up'),
buttons: { buttons: {
'help': { 'help': {
text: 'give 1 medicine', text: _('give 1 medicine'),
cost: { 'medicine': 1 }, cost: { 'medicine': 1 },
notification: 'the man swallows the medicine eagerly', notification: _('the man swallows the medicine eagerly'),
nextScene: { 0.1: 'alloy', 0.3: 'cells', 0.5: 'scales', 1.0: 'nothing' } nextScene: { 0.1: 'alloy', 0.3: 'cells', 0.5: 'scales', 1.0: 'nothing' }
}, },
'ignore': { 'ignore': {
text: 'tell him to leave', text: _('tell him to leave'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'alloy': { 'alloy': {
text: [ text: [
"the man is thankful.", _("the man is thankful."),
'he leaves a reward.', _('he leaves a reward.'),
'some weird metal he picked up on his travels.' _('some weird metal he picked up on his travels.')
], ],
onLoad: function() { onLoad: function() {
$SM.add('stores["alien alloy"]', 1); $SM.add('stores["alien alloy"]', 1);
}, },
buttons: { buttons: {
'bye': { 'bye': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'cells': { 'cells': {
text: [ text: [
"the man is thankful.", _("the man is thankful."),
'he leaves a reward.', _('he leaves a reward.'),
'some weird glowing boxes he picked up on his travels.' _('some weird glowing boxes he picked up on his travels.')
], ],
onLoad: function() { onLoad: function() {
$SM.add('stores["energy cell"]', 3); $SM.add('stores["energy cell"]', 3);
}, },
buttons: { buttons: {
'bye': { 'bye': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'scales': { 'scales': {
text: [ text: [
"the man is thankful.", _("the man is thankful."),
'he leaves a reward.', _('he leaves a reward.'),
'all he has are some scales.' _('all he has are some scales.')
], ],
onLoad: function() { onLoad: function() {
$SM.add('stores.scales', 5); $SM.add('stores.scales', 5);
}, },
buttons: { buttons: {
'bye': { 'bye': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
}, },
'nothing': { 'nothing': {
text: [ text: [
"the man expresses his thanks and hobbles off." _("the man expresses his thanks and hobbles off.")
], ],
buttons: { buttons: {
'bye': { 'bye': {
text: 'say goodbye', text: _('say goodbye'),
nextScene: 'end' nextScene: 'end'
} }
} }
+412 -412
View File
File diff suppressed because it is too large Load Diff
+16 -16
View File
@@ -87,32 +87,32 @@ var Outside = {
{ {
rollUnder: 0.5, rollUnder: 0.5,
name: 'fur', name: 'fur',
message: 'scraps of fur' message: _('scraps of fur')
}, },
{ {
rollUnder: 0.75, rollUnder: 0.75,
name: 'meat', name: 'meat',
message: 'bits of meat' message: _('bits of meat')
}, },
{ {
rollUnder: 0.85, rollUnder: 0.85,
name: 'scales', name: 'scales',
message: 'strange scales' message: _('strange scales')
}, },
{ {
rollUnder: 0.93, rollUnder: 0.93,
name: 'teeth', name: 'teeth',
message: 'scattered teeth' message: _('scattered teeth')
}, },
{ {
rollUnder: 0.995, rollUnder: 0.995,
name: 'cloth', name: 'cloth',
message: 'tattered cloth' message: _('tattered cloth')
}, },
{ {
rollUnder: 1.0, rollUnder: 1.0,
name: 'charm', name: 'charm',
message: 'a crudely made charm' message: _('a crudely made charm')
} }
], ],
@@ -153,7 +153,7 @@ var Outside = {
// Create the gather button // Create the gather button
new Button.Button({ new Button.Button({
id: 'gatherButton', id: 'gatherButton',
text: "gather wood", text: _("gather wood"),
click: Outside.gatherWood, click: Outside.gatherWood,
cooldown: Outside._GATHER_DELAY, cooldown: Outside._GATHER_DELAY,
width: '80px' width: '80px'
@@ -170,15 +170,15 @@ var Outside = {
var num = Math.floor(Math.random()*(space/2) + space/2); var num = Math.floor(Math.random()*(space/2) + space/2);
if(num == 0) num = 1; if(num == 0) num = 1;
if(num == 1) { if(num == 1) {
Notifications.notify(null, 'a stranger arrives in the night'); Notifications.notify(null, _('a stranger arrives in the night'));
} else if(num < 5) { } else if(num < 5) {
Notifications.notify(null, 'a weathered family takes up in one of the huts.'); Notifications.notify(null, _('a weathered family takes up in one of the huts.'));
} else if(num < 10) { } else if(num < 10) {
Notifications.notify(null, 'a small group arrives, all dust and bones.'); Notifications.notify(null, _('a small group arrives, all dust and bones.'));
} else if(num < 30) { } else if(num < 30) {
Notifications.notify(null, 'a convoy lurches in, equal parts worry and hope.'); Notifications.notify(null, _('a convoy lurches in, equal parts worry and hope.'));
} else { } else {
Notifications.notify(null, "the town's booming. word does get around."); Notifications.notify(null, _("the town's booming. word does get around."));
} }
Engine.log('population increased by ' + num); Engine.log('population increased by ' + num);
$SM.add('game.population', num); $SM.add('game.population', num);
@@ -215,11 +215,11 @@ var Outside = {
updateWorkersView: function() { updateWorkersView: function() {
var workers = $('div#workers'); var workers = $('div#workers');
// If our population is 0 and we don't already have a workers view, // If our population is 0 and we don't already have a workers view,
// there's nothing to do here. // there's nothing to do here.
if(!workers.length && $SM.get('game.population') == 0) return; if(!workers.length && $SM.get('game.population') == 0) return;
var needsAppend = false; var needsAppend = false;
if(workers.length == 0) { if(workers.length == 0) {
needsAppend = true; needsAppend = true;