mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
suites des trads
This commit is contained in:
+4
-3
@@ -39,8 +39,8 @@
|
|||||||
<script src="script/path.js"></script>
|
<script src="script/path.js"></script>
|
||||||
<script src="script/ship.js"></script>
|
<script src="script/ship.js"></script>
|
||||||
<script src="script/space.js"></script>
|
<script src="script/space.js"></script>
|
||||||
<script src="script/prestige.js"></script>
|
<script src="script/prestige.js"></script>
|
||||||
<script src="script/scoring.js"></script>
|
<script src="script/scoring.js"></script>
|
||||||
<!-- Event modules -->
|
<!-- Event modules -->
|
||||||
<script src="script/events/global.js"></script>
|
<script src="script/events/global.js"></script>
|
||||||
<script src="script/events/room.js"></script>
|
<script src="script/events/room.js"></script>
|
||||||
@@ -63,6 +63,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="css/ship.css" />
|
<link rel="stylesheet" type="text/css" href="css/ship.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/space.css" />
|
<link rel="stylesheet" type="text/css" href="css/space.css" />
|
||||||
|
|
||||||
|
<script src="script/localization.js"></script>
|
||||||
<!-- Google Analytics -->
|
<!-- Google Analytics -->
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<div id="saveNotify">saved.</div>
|
<div id="saveNotify"><script>document.write(_("saved."));</script></div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="outerSlider">
|
<div id="outerSlider">
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+2176
-43
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -487,7 +487,8 @@ var Engine = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getIncomeMsg: function(num, delay) {
|
getIncomeMsg: function(num, delay) {
|
||||||
return (num > 0 ? "+" : "") + num + " per " + delay + "s";
|
return _("{0} per {1}s", (num > 0 ? "+" : "") + num, delay);
|
||||||
|
//return (num > 0 ? "+" : "") + num + " per " + delay + "s";
|
||||||
},
|
},
|
||||||
|
|
||||||
keyDown: function(e) {
|
keyDown: function(e) {
|
||||||
|
|||||||
@@ -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')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
(function(){
|
||||||
|
//only used for poedit to find translatable strings
|
||||||
|
var keywords = [ _('wood'),_('builder'),_('teeth'),_('meat'),_('fur'),
|
||||||
|
_('charm'),_('leather'),_('iron'), _('steel'), _('coal'),
|
||||||
|
_('hut'), _('cart'), _('trap'), _('gatherer'),_('cloth'),
|
||||||
|
_('torch'),_('medicine'),_('hunter'),_('trapper'),_('tanner'),
|
||||||
|
_("charcutier"),_('iron miner'),_('coal miner'), _('sulphur miner'), _('armourer'),
|
||||||
|
_('steelworker'),_('bait'),_('cured meat'), _('scales'), _('compass'),
|
||||||
|
_('scales'), _('bone spear'), _('rucksack'), _('l armour'), _('trading post'),
|
||||||
|
_('lodge'), _('tannery'), _('smokehouse'), _('workshop'), _('cured meat')];
|
||||||
|
delete keywords;
|
||||||
|
|
||||||
|
//translate text in css by overriding attributes
|
||||||
|
$("<style>").text('\
|
||||||
|
div#stores:before{ content: \''+ _("stores") + '\'}\
|
||||||
|
div#weapons:before{ content: \''+ _("weapons") + '\'}\
|
||||||
|
div#buildBtns:before{ content: \''+ _("build:") + '\'}\
|
||||||
|
div#craftBtns:before{ content: \''+ _("craft:") + '\'}\
|
||||||
|
div#buyBtns:before{ content: \''+ _("buy:") + '\'}\
|
||||||
|
').appendTo($('head'));
|
||||||
|
|
||||||
|
// resize buttons so the text is not wrap
|
||||||
|
function resizeButtons($div){
|
||||||
|
var maxWidth = 0;
|
||||||
|
$div.find('.button').css({
|
||||||
|
width: "auto",
|
||||||
|
display: "inline-block"
|
||||||
|
}).each(function(){
|
||||||
|
maxWidth = Math.max($(this).width(), maxWidth);
|
||||||
|
}).css({
|
||||||
|
display: "block",
|
||||||
|
width: maxWidth+"px"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
parseOutsidePanel = false;
|
||||||
|
$(document).on("DOMNodeInserted", "#outsidePanel",function(){
|
||||||
|
resizeButtons($(this));
|
||||||
|
});
|
||||||
|
$(document).on("DOMNodeInserted", ".buttons",function(){
|
||||||
|
resizeButtons($(this));
|
||||||
|
});
|
||||||
|
document.addEventListener("DOMNodeInserted", function(){
|
||||||
|
if(parseOutsidePanel) return;
|
||||||
|
else if($("#outsidePanel").length){
|
||||||
|
resizeButtons($("#outsidePanel"));
|
||||||
|
$('#outsidePanel')[0].addEventListener("DOMNodeInserted", resizeButtons($("#outsidePanel")));
|
||||||
|
parseOutsidePanel = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
+12
-12
@@ -128,7 +128,7 @@ var Outside = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the outside tab
|
// Create the outside tab
|
||||||
this.tab = Header.addLocation("A Silent Forest", "outside", Outside);
|
this.tab = Header.addLocation(_("A Silent Forest"), "outside", Outside);
|
||||||
|
|
||||||
// Create the Outside panel
|
// Create the Outside panel
|
||||||
this.panel = $('<div>').attr('id', "outsidePanel")
|
this.panel = $('<div>').attr('id', "outsidePanel")
|
||||||
@@ -494,7 +494,7 @@ var Outside = {
|
|||||||
if(btn.length == 0) {
|
if(btn.length == 0) {
|
||||||
new Button.Button({
|
new Button.Button({
|
||||||
id: 'trapsButton',
|
id: 'trapsButton',
|
||||||
text: "check traps",
|
text: _("check traps"),
|
||||||
click: Outside.checkTraps,
|
click: Outside.checkTraps,
|
||||||
cooldown: Outside._TRAPS_DELAY,
|
cooldown: Outside._TRAPS_DELAY,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
@@ -513,17 +513,17 @@ var Outside = {
|
|||||||
var numHuts = $SM.get('game.buildings["hut"]', true);
|
var numHuts = $SM.get('game.buildings["hut"]', true);
|
||||||
var title;
|
var title;
|
||||||
if(numHuts == 0) {
|
if(numHuts == 0) {
|
||||||
title = "A Silent Forest";
|
title = _("A Silent Forest");
|
||||||
} else if(numHuts == 1) {
|
} else if(numHuts == 1) {
|
||||||
title = "A Lonely Hut";
|
title = _("A Lonely Hut");
|
||||||
} else if(numHuts <= 4) {
|
} else if(numHuts <= 4) {
|
||||||
title = "A Tiny Village";
|
title = _("A Tiny Village");
|
||||||
} else if(numHuts <= 8) {
|
} else if(numHuts <= 8) {
|
||||||
title = "A Modest Village";
|
title = _("A Modest Village");
|
||||||
} else if(numHuts <= 14) {
|
} else if(numHuts <= 14) {
|
||||||
title = "A Large Village";
|
title = _("A Large Village");
|
||||||
} else {
|
} else {
|
||||||
title = "A Raucous Village";
|
title = _("A Raucous Village");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Engine.activeModule == this) {
|
if(Engine.activeModule == this) {
|
||||||
@@ -535,7 +535,7 @@ var Outside = {
|
|||||||
onArrival: function(transition_diff) {
|
onArrival: function(transition_diff) {
|
||||||
Outside.setTitle();
|
Outside.setTitle();
|
||||||
if(!$SM.get('game.outside.seenForest')) {
|
if(!$SM.get('game.outside.seenForest')) {
|
||||||
Notifications.notify(Outside, "the sky is grey and the wind blows relentlessly");
|
Notifications.notify(Outside, _("the sky is grey and the wind blows relentlessly"));
|
||||||
$SM.set('game.outside.seenForest', true);
|
$SM.set('game.outside.seenForest', true);
|
||||||
}
|
}
|
||||||
Outside.updateTrapButton();
|
Outside.updateTrapButton();
|
||||||
@@ -545,7 +545,7 @@ var Outside = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
gatherWood: function() {
|
gatherWood: function() {
|
||||||
Notifications.notify(Outside, "dry brush and dead branches litter the forest floor");
|
Notifications.notify(Outside, _("dry brush and dead branches litter the forest floor"));
|
||||||
var gatherAmt = $SM.get('game.buildings["cart"]', true) > 0 ? 50 : 10;
|
var gatherAmt = $SM.get('game.buildings["cart"]', true) > 0 ? 50 : 10;
|
||||||
$SM.add('stores.wood', gatherAmt);
|
$SM.add('stores.wood', gatherAmt);
|
||||||
},
|
},
|
||||||
@@ -571,12 +571,12 @@ var Outside = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var s = 'the traps contain ';
|
var s = _('the traps contain ');
|
||||||
for(var i = 0, len = msg.length; i < len; i++) {
|
for(var i = 0, len = msg.length; i < len; i++) {
|
||||||
if(len > 1 && i > 0 && i < len - 1) {
|
if(len > 1 && i > 0 && i < len - 1) {
|
||||||
s += ", ";
|
s += ", ";
|
||||||
} else if(len > 1 && i == len - 1) {
|
} else if(len > 1 && i == len - 1) {
|
||||||
s += " and ";
|
s += _(" and ");
|
||||||
}
|
}
|
||||||
s += msg[i];
|
s += msg[i];
|
||||||
}
|
}
|
||||||
|
|||||||
+72
-72
@@ -17,9 +17,9 @@ var Room = {
|
|||||||
'trap': {
|
'trap': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 10,
|
maximum: 10,
|
||||||
availableMsg: 'builder says she can make traps to catch any creatures might still be alive out there',
|
availableMsg: _('builder says she can make traps to catch any creatures might still be alive out there'),
|
||||||
buildMsg: 'more traps to catch more creatures',
|
buildMsg: _('more traps to catch more creatures'),
|
||||||
maxMsg: "more traps won't help now",
|
maxMsg: _("more traps won't help now"),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
var n = $SM.get('game.buildings["trap"]', true);
|
var n = $SM.get('game.buildings["trap"]', true);
|
||||||
@@ -31,8 +31,8 @@ var Room = {
|
|||||||
'cart': {
|
'cart': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: 'builder says she can make a cart for carrying wood',
|
availableMsg: _('builder says she can make a cart for carrying wood'),
|
||||||
buildMsg: 'the rickety cart will carry more wood from the forest',
|
buildMsg: _('the rickety cart will carry more wood from the forest'),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -43,9 +43,9 @@ var Room = {
|
|||||||
'hut': {
|
'hut': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 20,
|
maximum: 20,
|
||||||
availableMsg: "builder says there are more wanderers. says they'll work, too.",
|
availableMsg: _("builder says there are more wanderers. says they'll work, too."),
|
||||||
buildMsg: 'builder puts up a hut, out in the forest. says word will get around.',
|
buildMsg: _('builder puts up a hut, out in the forest. says word will get around.'),
|
||||||
maxMsg: 'no more room for huts.',
|
maxMsg: _('no more room for huts.'),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
var n = $SM.get('game.buildings["hut"]', true);
|
var n = $SM.get('game.buildings["hut"]', true);
|
||||||
@@ -57,8 +57,8 @@ var Room = {
|
|||||||
'lodge': {
|
'lodge': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: 'villagers could help hunt, given the means',
|
availableMsg: _('villagers could help hunt, given the means'),
|
||||||
buildMsg: 'the hunting lodge stands in the forest, a ways out of town',
|
buildMsg: _('the hunting lodge stands in the forest, a ways out of town'),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -71,8 +71,8 @@ var Room = {
|
|||||||
'trading post': {
|
'trading post': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "a trading post would make commerce easier",
|
availableMsg: _("a trading post would make commerce easier"),
|
||||||
buildMsg: "now the nomads have a place to set up shop, they might stick around a while",
|
buildMsg: _("now the nomads have a place to set up shop, they might stick around a while"),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -84,8 +84,8 @@ var Room = {
|
|||||||
'tannery': {
|
'tannery': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "builder says leather could be useful. says the villagers could make it.",
|
availableMsg: _("builder says leather could be useful. says the villagers could make it."),
|
||||||
buildMsg: 'tannery goes up quick, on the edge of the village',
|
buildMsg: _('tannery goes up quick, on the edge of the village'),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -97,8 +97,8 @@ var Room = {
|
|||||||
'smokehouse': {
|
'smokehouse': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "should cure the meat, or it'll spoil. builder says she can fix something up.",
|
availableMsg: _("should cure the meat, or it'll spoil. builder says she can fix something up."),
|
||||||
buildMsg: 'builder finishes the smokehouse. she looks hungry.',
|
buildMsg: _('builder finishes the smokehouse. she looks hungry.'),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -110,8 +110,8 @@ var Room = {
|
|||||||
'workshop': {
|
'workshop': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "builder says she could make finer things, if she had the tools",
|
availableMsg: _("builder says she could make finer things, if she had the tools"),
|
||||||
buildMsg: "workshop's finally ready. builder's excited to get to it",
|
buildMsg: _("workshop's finally ready. builder's excited to get to it"),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -124,8 +124,8 @@ var Room = {
|
|||||||
'steelworks': {
|
'steelworks': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "builder says the villagers could make steel, given the tools",
|
availableMsg: _("builder says the villagers could make steel, given the tools"),
|
||||||
buildMsg: "a haze falls over the village as the steelworks fires up",
|
buildMsg: _("a haze falls over the village as the steelworks fires up"),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -138,8 +138,8 @@ var Room = {
|
|||||||
'armoury': {
|
'armoury': {
|
||||||
button: null,
|
button: null,
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
availableMsg: "builder says it'd be useful to have a steady source of bullets",
|
availableMsg: _("builder says it'd be useful to have a steady source of bullets"),
|
||||||
buildMsg: "armoury's done, welcoming back the weapons of the past.",
|
buildMsg: _("armoury's done, welcoming back the weapons of the past."),
|
||||||
type: 'building',
|
type: 'building',
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -152,7 +152,7 @@ var Room = {
|
|||||||
'torch': {
|
'torch': {
|
||||||
button: null,
|
button: null,
|
||||||
type: 'tool',
|
type: 'tool',
|
||||||
buildMsg: 'a torch to keep the dark away',
|
buildMsg: _('a torch to keep the dark away'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 1,
|
'wood': 1,
|
||||||
@@ -164,7 +164,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'this waterskin\'ll hold a bit of water, at least',
|
buildMsg: _('this waterskin\'ll hold a bit of water, at least'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 50
|
'leather': 50
|
||||||
@@ -175,7 +175,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'the cask holds enough water for longer expeditions',
|
buildMsg: _('the cask holds enough water for longer expeditions'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 100,
|
'leather': 100,
|
||||||
@@ -187,7 +187,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'never go thirsty again',
|
buildMsg: _('never go thirsty again'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'iron': 100,
|
'iron': 100,
|
||||||
@@ -198,7 +198,7 @@ var Room = {
|
|||||||
'bone spear': {
|
'bone spear': {
|
||||||
button: null,
|
button: null,
|
||||||
type: 'weapon',
|
type: 'weapon',
|
||||||
buildMsg: "this spear's not elegant, but it's pretty good at stabbing",
|
buildMsg: _("this spear's not elegant, but it's pretty good at stabbing"),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 100,
|
'wood': 100,
|
||||||
@@ -210,7 +210,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'carrying more means longer expeditions to the wilds',
|
buildMsg: _('carrying more means longer expeditions to the wilds'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 200
|
'leather': 200
|
||||||
@@ -221,7 +221,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'the wagon can carry a lot of supplies',
|
buildMsg: _('the wagon can carry a lot of supplies'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 500,
|
'wood': 500,
|
||||||
@@ -233,7 +233,7 @@ var Room = {
|
|||||||
button: null,
|
button: null,
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: 'the convoy can haul mostly everything',
|
buildMsg: _('the convoy can haul mostly everything'),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 1000,
|
'wood': 1000,
|
||||||
@@ -245,7 +245,7 @@ var Room = {
|
|||||||
'l armour': {
|
'l armour': {
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: "leather's not strong. better than rags, though.",
|
buildMsg: _("leather's not strong. better than rags, though."),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 200,
|
'leather': 200,
|
||||||
@@ -256,7 +256,7 @@ var Room = {
|
|||||||
'i armour': {
|
'i armour': {
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: "iron's stronger than leather",
|
buildMsg: _("iron's stronger than leather"),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 200,
|
'leather': 200,
|
||||||
@@ -267,7 +267,7 @@ var Room = {
|
|||||||
's armour': {
|
's armour': {
|
||||||
type: 'upgrade',
|
type: 'upgrade',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
buildMsg: "steel's stronger than iron",
|
buildMsg: _("steel's stronger than iron"),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'leather': 200,
|
'leather': 200,
|
||||||
@@ -278,7 +278,7 @@ var Room = {
|
|||||||
'iron sword': {
|
'iron sword': {
|
||||||
button: null,
|
button: null,
|
||||||
type: 'weapon',
|
type: 'weapon',
|
||||||
buildMsg: "sword is sharp. good protection out in the wilds.",
|
buildMsg: _("sword is sharp. good protection out in the wilds."),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 200,
|
'wood': 200,
|
||||||
@@ -290,7 +290,7 @@ var Room = {
|
|||||||
'steel sword': {
|
'steel sword': {
|
||||||
button: null,
|
button: null,
|
||||||
type: 'weapon',
|
type: 'weapon',
|
||||||
buildMsg: "the steel is strong, and the blade true.",
|
buildMsg: _("the steel is strong, and the blade true."),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 500,
|
'wood': 500,
|
||||||
@@ -301,7 +301,7 @@ var Room = {
|
|||||||
},
|
},
|
||||||
'rifle': {
|
'rifle': {
|
||||||
type: 'weapon',
|
type: 'weapon',
|
||||||
buildMsg: "black powder and bullets, like the old days.",
|
buildMsg: _("black powder and bullets, like the old days."),
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
'wood': 200,
|
'wood': 200,
|
||||||
@@ -433,7 +433,7 @@ var Room = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
name: "Room",
|
name: _("Room"),
|
||||||
init: function(options) {
|
init: function(options) {
|
||||||
this.options = $.extend(
|
this.options = $.extend(
|
||||||
this.options,
|
this.options,
|
||||||
@@ -457,7 +457,7 @@ var Room = {
|
|||||||
|
|
||||||
|
|
||||||
// Create the room tab
|
// Create the room tab
|
||||||
this.tab = Header.addLocation("A Dark Room", "room", Room);
|
this.tab = Header.addLocation(_("A Dark Room"), "room", Room);
|
||||||
|
|
||||||
// Create the Room panel
|
// Create the Room panel
|
||||||
this.panel = $('<div>')
|
this.panel = $('<div>')
|
||||||
@@ -470,7 +470,7 @@ var Room = {
|
|||||||
// Create the light button
|
// Create the light button
|
||||||
new Button.Button({
|
new Button.Button({
|
||||||
id: 'lightButton',
|
id: 'lightButton',
|
||||||
text: 'light fire',
|
text: _('light fire'),
|
||||||
click: Room.lightFire,
|
click: Room.lightFire,
|
||||||
cooldown: Room._STOKE_COOLDOWN,
|
cooldown: Room._STOKE_COOLDOWN,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
@@ -480,7 +480,7 @@ var Room = {
|
|||||||
// Create the stoke button
|
// Create the stoke button
|
||||||
new Button.Button({
|
new Button.Button({
|
||||||
id: 'stokeButton',
|
id: 'stokeButton',
|
||||||
text: "stoke fire",
|
text: _("stoke fire"),
|
||||||
click: Room.stokeFire,
|
click: Room.stokeFire,
|
||||||
cooldown: Room._STOKE_COOLDOWN,
|
cooldown: Room._STOKE_COOLDOWN,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
@@ -516,9 +516,9 @@ var Room = {
|
|||||||
setTimeout(Room.unlockForest, Room._NEED_WOOD_DELAY);
|
setTimeout(Room.unlockForest, Room._NEED_WOOD_DELAY);
|
||||||
}
|
}
|
||||||
setTimeout($SM.collectIncome, 1000);
|
setTimeout($SM.collectIncome, 1000);
|
||||||
|
|
||||||
Notifications.notify(Room, "the room is " + Room.temperature.text);
|
Notifications.notify(Room, _("the room is {0}", Room.temperature.text));
|
||||||
Notifications.notify(Room, "the fire is " + Room.fire.text);
|
Notifications.notify(Room, _("the fire is {0}", Room.fire.text));
|
||||||
},
|
},
|
||||||
|
|
||||||
options: {}, // Nothing for now
|
options: {}, // Nothing for now
|
||||||
@@ -526,8 +526,8 @@ var Room = {
|
|||||||
onArrival: function(transition_diff) {
|
onArrival: function(transition_diff) {
|
||||||
Room.setTitle();
|
Room.setTitle();
|
||||||
if(Room.changed) {
|
if(Room.changed) {
|
||||||
Notifications.notify(Room, "the fire is " + Room.fire.text);
|
Notifications.notify(Room, _("the fire is {0}", Room.fire.text));
|
||||||
Notifications.notify(Room, "the room is " + Room.temperature.text);
|
Notifications.notify(Room, _("the room is {0}", Room.temperature.text));
|
||||||
Room.changed = false;
|
Room.changed = false;
|
||||||
}
|
}
|
||||||
if($SM.get('game.builder.level') == 3) {
|
if($SM.get('game.builder.level') == 3) {
|
||||||
@@ -537,7 +537,7 @@ var Room = {
|
|||||||
stores: {'wood' : 2 }
|
stores: {'wood' : 2 }
|
||||||
});
|
});
|
||||||
Room.updateIncomeView();
|
Room.updateIncomeView();
|
||||||
Notifications.notify(Room, "the stranger is standing by the fire. she says she can help. says she builds things.");
|
Notifications.notify(Room, _("the stranger is standing by the fire. she says she can help. says she builds things."));
|
||||||
}
|
}
|
||||||
|
|
||||||
Engine.moveStoresView(null, transition_diff);
|
Engine.moveStoresView(null, transition_diff);
|
||||||
@@ -552,11 +552,11 @@ var Room = {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
Freezing: { value: 0, text: 'freezing' },
|
Freezing: { value: 0, text: _('freezing') },
|
||||||
Cold: { value: 1, text: 'cold' },
|
Cold: { value: 1, text: _('cold') },
|
||||||
Mild: { value: 2, text: 'mild' },
|
Mild: { value: 2, text: _('mild') },
|
||||||
Warm: { value: 3, text: 'warm' },
|
Warm: { value: 3, text: _('warm') },
|
||||||
Hot: { value: 4, text: 'hot' }
|
Hot: { value: 4, text: _('hot') }
|
||||||
},
|
},
|
||||||
|
|
||||||
FireEnum: {
|
FireEnum: {
|
||||||
@@ -568,15 +568,15 @@ var Room = {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
Dead: { value: 0, text: 'dead' },
|
Dead: { value: 0, text: _('dead') },
|
||||||
Smoldering: { value: 1, text: 'smoldering' },
|
Smoldering: { value: 1, text: _('smoldering') },
|
||||||
Flickering: { value: 2, text: 'flickering' },
|
Flickering: { value: 2, text: _('flickering') },
|
||||||
Burning: { value: 3, text: 'burning' },
|
Burning: { value: 3, text: _('burning') },
|
||||||
Roaring: { value: 4, text: 'roaring' }
|
Roaring: { value: 4, text: _('roaring') }
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitle: function() {
|
setTitle: function() {
|
||||||
var title = Room.fire.value < 2 ? "A Dark Room" : "A Firelit Room";
|
var title = Room.fire.value < 2 ? _("A Dark Room") : _("A Firelit Room");
|
||||||
if(Engine.activeModule == this) {
|
if(Engine.activeModule == this) {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
}
|
}
|
||||||
@@ -614,7 +614,7 @@ var Room = {
|
|||||||
lightFire: function() {
|
lightFire: function() {
|
||||||
var wood = $SM.get('stores.wood');
|
var wood = $SM.get('stores.wood');
|
||||||
if(wood < 5) {
|
if(wood < 5) {
|
||||||
Notifications.notify(Room, "not enough wood to get the fire going");
|
Notifications.notify(Room, _("not enough wood to get the fire going"));
|
||||||
Button.clearCooldown($('#lightButton.button'));
|
Button.clearCooldown($('#lightButton.button'));
|
||||||
return;
|
return;
|
||||||
} else if(wood > 4) {
|
} else if(wood > 4) {
|
||||||
@@ -627,7 +627,7 @@ var Room = {
|
|||||||
stokeFire: function() {
|
stokeFire: function() {
|
||||||
var wood = $SM.get('stores.wood');
|
var wood = $SM.get('stores.wood');
|
||||||
if(wood === 0) {
|
if(wood === 0) {
|
||||||
Notifications.notify(Room, "the wood has run out");
|
Notifications.notify(Room, _("the wood has run out"));
|
||||||
Button.clearCooldown($('#stokeButton.button'));
|
Button.clearCooldown($('#stokeButton.button'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -644,10 +644,10 @@ var Room = {
|
|||||||
if(Engine.activeModule != Room) {
|
if(Engine.activeModule != Room) {
|
||||||
Room.changed = true;
|
Room.changed = true;
|
||||||
}
|
}
|
||||||
Notifications.notify(Room, "the fire is " + Room.fire.text, true);
|
Notifications.notify(Room, _("the fire is {0}", Room.fire.text), true);
|
||||||
if(Room.fire.value > 1 && $SM.get('game.builder.level') < 0) {
|
if(Room.fire.value > 1 && $SM.get('game.builder.level') < 0) {
|
||||||
$SM.set('game.builder.level', 0);
|
$SM.set('game.builder.level', 0);
|
||||||
Notifications.notify(Room, "the light from the fire spills from the windows, out into the dark");
|
Notifications.notify(Room, _("the light from the fire spills from the windows, out into the dark"));
|
||||||
setTimeout(Room.updateBuilderState, Room._BUILDER_STATE_DELAY);
|
setTimeout(Room.updateBuilderState, Room._BUILDER_STATE_DELAY);
|
||||||
}
|
}
|
||||||
window.clearTimeout(Room._fireTimer);
|
window.clearTimeout(Room._fireTimer);
|
||||||
@@ -660,7 +660,7 @@ var Room = {
|
|||||||
var wood = $SM.get('stores.wood');
|
var wood = $SM.get('stores.wood');
|
||||||
if(Room.fire.value <= Room.FireEnum.Flickering.value &&
|
if(Room.fire.value <= Room.FireEnum.Flickering.value &&
|
||||||
$SM.get('game.builder.level') > 3 && wood > 0) {
|
$SM.get('game.builder.level') > 3 && wood > 0) {
|
||||||
Notifications.notify(Room, "builder stokes the fire", true);
|
Notifications.notify(Room, _("builder stokes the fire"), true);
|
||||||
$SM.set('stores.wood', wood - 1);
|
$SM.set('stores.wood', wood - 1);
|
||||||
Room.fire = Room.FireEnum.fromInt(Room.fire.value + 1);
|
Room.fire = Room.FireEnum.fromInt(Room.fire.value + 1);
|
||||||
}
|
}
|
||||||
@@ -675,11 +675,11 @@ var Room = {
|
|||||||
var old = Room.temperature.value;
|
var old = Room.temperature.value;
|
||||||
if(Room.temperature.value > 0 && Room.temperature.value > Room.fire.value) {
|
if(Room.temperature.value > 0 && Room.temperature.value > Room.fire.value) {
|
||||||
Room.temperature = Room.TempEnum.fromInt(Room.temperature.value - 1);
|
Room.temperature = Room.TempEnum.fromInt(Room.temperature.value - 1);
|
||||||
Notifications.notify(Room, "the room is " + Room.temperature.text, true);
|
Notifications.notify(Room, _("the room is {0}" , Room.temperature.text), true);
|
||||||
}
|
}
|
||||||
if(Room.temperature.value < 4 && Room.temperature.value < Room.fire.value) {
|
if(Room.temperature.value < 4 && Room.temperature.value < Room.fire.value) {
|
||||||
Room.temperature = Room.TempEnum.fromInt(Room.temperature.value + 1);
|
Room.temperature = Room.TempEnum.fromInt(Room.temperature.value + 1);
|
||||||
Notifications.notify(Room, "the room is " + Room.temperature.text, true);
|
Notifications.notify(Room, _("the room is {0}" , Room.temperature.text), true);
|
||||||
}
|
}
|
||||||
if(Room.temperature.value != old) {
|
if(Room.temperature.value != old) {
|
||||||
Room.changed = true;
|
Room.changed = true;
|
||||||
@@ -690,15 +690,15 @@ var Room = {
|
|||||||
unlockForest: function() {
|
unlockForest: function() {
|
||||||
$SM.set('stores.wood', 4);
|
$SM.set('stores.wood', 4);
|
||||||
Outside.init();
|
Outside.init();
|
||||||
Notifications.notify(Room, "the wind howls outside");
|
Notifications.notify(Room, _("the wind howls outside"));
|
||||||
Notifications.notify(Room, "the wood is running out");
|
Notifications.notify(Room, _("the wood is running out"));
|
||||||
Engine.event('progress', 'outside');
|
Engine.event('progress', 'outside');
|
||||||
},
|
},
|
||||||
|
|
||||||
updateBuilderState: function() {
|
updateBuilderState: function() {
|
||||||
var lBuilder = $SM.get('game.builder.level');
|
var lBuilder = $SM.get('game.builder.level');
|
||||||
if(lBuilder == 0) {
|
if(lBuilder == 0) {
|
||||||
Notifications.notify(Room, "a ragged stranger stumbles through the door and collapses in the corner");
|
Notifications.notify(Room, _("a ragged stranger stumbles through the door and collapses in the corner"));
|
||||||
lBuilder = $SM.setget('game.builder.level', 1);
|
lBuilder = $SM.setget('game.builder.level', 1);
|
||||||
setTimeout(Room.unlockForest, Room._NEED_WOOD_DELAY);
|
setTimeout(Room.unlockForest, Room._NEED_WOOD_DELAY);
|
||||||
}
|
}
|
||||||
@@ -706,10 +706,10 @@ var Room = {
|
|||||||
var msg = "";
|
var msg = "";
|
||||||
switch(lBuilder) {
|
switch(lBuilder) {
|
||||||
case 1:
|
case 1:
|
||||||
msg = "the stranger shivers, and mumbles quietly. her words are unintelligible.";
|
msg = _("the stranger shivers, and mumbles quietly. her words are unintelligible.");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
msg = "the stranger in the corner stops shivering. her breathing calms.";
|
msg = _("the stranger in the corner stops shivering. her breathing calms.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Notifications.notify(Room, msg);
|
Notifications.notify(Room, msg);
|
||||||
@@ -911,7 +911,7 @@ var Room = {
|
|||||||
for(var k in cost) {
|
for(var k in cost) {
|
||||||
var have = $SM.get('stores["'+k+'"]', true);
|
var have = $SM.get('stores["'+k+'"]', true);
|
||||||
if(have < cost[k]) {
|
if(have < cost[k]) {
|
||||||
Notifications.notify(Room, "not enough " + k);
|
Notifications.notify(Room, _("not enough {0}", k));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
storeMod[k] = have - cost[k];
|
storeMod[k] = have - cost[k];
|
||||||
@@ -1013,7 +1013,7 @@ var Room = {
|
|||||||
craftable.button = new Button.Button({
|
craftable.button = new Button.Button({
|
||||||
id: 'build_' + k,
|
id: 'build_' + k,
|
||||||
cost: craftable.cost(),
|
cost: craftable.cost(),
|
||||||
text: k,
|
text: _(k),
|
||||||
click: Room.build,
|
click: Room.build,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
ttPos: loc.children().length > 10 ? 'top right' : 'bottom right'
|
ttPos: loc.children().length > 10 ? 'top right' : 'bottom right'
|
||||||
@@ -1047,7 +1047,7 @@ var Room = {
|
|||||||
good.button = new Button.Button({
|
good.button = new Button.Button({
|
||||||
id: 'build_' + k,
|
id: 'build_' + k,
|
||||||
cost: good.cost(),
|
cost: good.cost(),
|
||||||
text: k,
|
text: _(k),
|
||||||
click: Room.buy,
|
click: Room.buy,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
}).css('opacity', 0).attr('buildThing', k).appendTo(buySection).animate({opacity:1}, 300, 'linear');
|
}).css('opacity', 0).attr('buildThing', k).appendTo(buySection).animate({opacity:1}, 300, 'linear');
|
||||||
|
|||||||
Reference in New Issue
Block a user