Merge pull request #18 from doublespeakgames/master

Update 2015-09-20
This commit is contained in:
Andrea Rendine
2015-09-20 14:41:47 +02:00
36 changed files with 11313 additions and 4425 deletions
+5 -4
View File
@@ -9,26 +9,27 @@ a minimalist text adventure game for your browser
<table> <table>
<tr><th colspan=4>Available Languages</tr> <tr><th colspan=4>Available Languages</tr>
<tr> <tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese (Simplified)</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese (Traditional)</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=en">English</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=en">English</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=fr">French</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=fr">French</a></td>
</tr><tr> </tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=de">German</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=de">German</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=el">Greek</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=el">Greek</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=id">Indonesian</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=it">Italian</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=it">Italian</a></td>
</tr><tr> </tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ja">Japanese</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=ja">Japanese</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ko">Korean</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=ko">Korean</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=nb">Norwegian</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=nb">Norwegian</a></td>
</tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=pl">Polish</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=pl">Polish</a></td>
</tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=pt">Portuguese</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=pt">Portuguese</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=pt_br">Portuguese (Brazil)</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=pt_br">Portuguese (Brazil)</a></td>
</tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ru">Russian</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=ru">Russian</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=es">Spanish</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=es">Spanish</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=sv">Swedish</a></td>
</tr><tr> </tr><tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=sv">Swedish</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=tr">Turkish</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=tr">Turkish</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=uk">Ukrainian</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=uk">Ukrainian</a></td>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=vi">Vietnamese</a></td> <td><a href="http://adarkroom.doublespeakgames.com/?lang=vi">Vietnamese</a></td>
+4
View File
@@ -182,6 +182,10 @@ div.row_val {
float: right; float: right;
} }
div.total {
font-weight: bold;
}
/* Notifications */ /* Notifications */
div#notifications { div#notifications {
+1 -1
View File
File diff suppressed because one or more lines are too long
+1689 -1576
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2699 -1838
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -137,7 +137,7 @@ msgstr "Un village bruyant"
#: ../../script/outside.js:551 #: ../../script/outside.js:551
msgid "the sky is grey and the wind blows relentlessly" msgid "the sky is grey and the wind blows relentlessly"
msgstr "le ciel est gris et le vents souffle implacablement" msgstr "le ciel est gris et le vent souffle implacablement"
#: ../../script/outside.js:561 #: ../../script/outside.js:561
msgid "dry brush and dead branches litter the forest floor" msgid "dry brush and dead branches litter the forest floor"
@@ -516,7 +516,7 @@ msgstr "aciérie"
#: ../../script/room.js:134 #: ../../script/room.js:134
msgid "builder says the villagers could make steel, given the tools" msgid "builder says the villagers could make steel, given the tools"
msgstr "" msgstr ""
"l'ouvrière dit qu'avec les bon outils, les villageois pourraient fabriquer " "l'ouvrière dit qu'avec les bons outils, les villageois pourraient fabriquer "
"de l'acier" "de l'acier"
#: ../../script/room.js:135 #: ../../script/room.js:135
+3
View File
@@ -0,0 +1,3 @@
.button{width: 100px !important;}
#outsidePanel .button{width: 115px !important;}
.eventPanel .button {width: 122px !important;}
File diff suppressed because one or more lines are too long
+3468
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -4,6 +4,7 @@ var langs = {
'en':'english', 'en':'english',
'es':'español', 'es':'español',
'fr':'français', 'fr':'français',
'id':'bahasa indonesia',
'it':'italiano', 'it':'italiano',
'ja':'日本語', 'ja':'日本語',
'ko':'한국어', 'ko':'한국어',
@@ -16,5 +17,6 @@ var langs = {
'tr':'türkçe', 'tr':'türkçe',
'uk':'українська', 'uk':'українська',
'vi':'tiếng việt', 'vi':'tiếng việt',
'zh_cn':'简体中文' 'zh_cn':'简体中文',
'zh_tw':'繁體中文'
}; };
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+928 -880
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -50,7 +50,7 @@ msgstr "добыватель угля"
#: ../../script/outside.js:69 ../../script/localization.js:32 #: ../../script/outside.js:69 ../../script/localization.js:32
msgid "sulphur miner" msgid "sulphur miner"
msgstr "добыватель серы" msgstr "спелеолог"
#: ../../script/outside.js:77 ../../script/localization.js:35 #: ../../script/outside.js:77 ../../script/localization.js:35
msgid "steelworker" msgid "steelworker"
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
.button{width: 100px !important;}
#outsidePanel .button{width: 115px !important;}
.eventPanel .button {width: 122px !important;}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+46 -13
View File
@@ -24,6 +24,9 @@ var Button = {
el.append($("<div>").addClass('cooldown')); el.append($("<div>").addClass('cooldown'));
// waiting for expiry of residual cooldown detected in state
Button.cooldown(el, 'state');
if(options.cost) { if(options.cost) {
var ttPos = options.ttPos ? options.ttPos : "bottom right"; var ttPos = options.ttPos ? options.ttPos : "bottom right";
var costTooltip = $('<div>').addClass('tooltip ' + ttPos); var costTooltip = $('<div>').addClass('tooltip ' + ttPos);
@@ -43,6 +46,8 @@ var Button = {
return el; return el;
}, },
saveCooldown: true,
setDisabled: function(btn, disabled) { setDisabled: function(btn, disabled) {
if(btn) { if(btn) {
if(!disabled && !btn.data('onCooldown')) { if(!disabled && !btn.data('onCooldown')) {
@@ -61,29 +66,57 @@ var Button = {
return false; return false;
}, },
cooldown: function(btn) { cooldown: function(btn, option) {
var cd = btn.data("cooldown"); var cd = btn.data("cooldown");
var id = 'cooldown.'+ btn.attr('id');
if(cd > 0) { if(cd > 0) {
milliseconds = cd * 1000; // param "start" takes value from cooldown time if not specified
if (Engine.options.doubleTime){ var start, left;
milliseconds /= 2; switch(option){
// a switch will allow for several uses of cooldown function
case 'state':
if(!$SM.get(id)){
return;
}
start = Math.min($SM.get(id), cd);
left = (start / cd).toFixed(4);
break;
default:
start = cd;
left = 1;
} }
Button.clearCooldown(btn);
$('div.cooldown', btn).stop(true, true).width("100%").animate({width: '0%'}, milliseconds, 'linear', function() { if(Button.saveCooldown){
var b = $(this).closest('.button'); $SM.set(id,start);
b.data('onCooldown', false); // residual value is measured in seconds
if(!b.data('disabled')) { // saves program performance
b.removeClass('disabled'); btn.data('countdown', Engine.setInterval(function(){
} $SM.set(id, $SM.get(id, true) - 0.5, true);
},500));
}
var time = start;
if (Engine.options.doubleTime){
time /= 2;
}
$('div.cooldown', btn).width(left * 100 +"%").animate({width: '0%'}, time * 1000, 'linear', function() {
Button.clearCooldown(btn, true);
}); });
btn.addClass('disabled'); btn.addClass('disabled');
btn.data('onCooldown', true); btn.data('onCooldown', true);
} }
}, },
clearCooldown: function(btn) { clearCooldown: function(btn, ended) {
$('div.cooldown', btn).stop(true, true); var ended = ended || false;
if(!ended){
$('div.cooldown', btn).stop(true, true);
}
btn.data('onCooldown', false); btn.data('onCooldown', false);
if(btn.data('countdown')){
window.clearInterval(btn.data('countdown'));
$SM.remove('cooldown.'+ btn.attr('id'));
btn.removeData('countdown');
}
if(!btn.data('disabled')) { if(!btn.data('disabled')) {
btn.removeClass('disabled'); btn.removeClass('disabled');
} }
+2
View File
@@ -955,6 +955,7 @@ var Events = {
Engine.event('game event', 'event'); Engine.event('game event', 'event');
Engine.keyLock = true; Engine.keyLock = true;
Engine.tabNavigation = false; Engine.tabNavigation = false;
Button.saveCooldown = false;
Events.eventStack.unshift(event); Events.eventStack.unshift(event);
event.eventPanel = $('<div>').attr('id', 'event').addClass('eventPanel').css('opacity', '0'); event.eventPanel = $('<div>').attr('id', 'event').addClass('eventPanel').css('opacity', '0');
if(options != null && options.width != null) { if(options != null && options.width != null) {
@@ -988,6 +989,7 @@ var Events = {
Engine.log(Events.eventStack.length + ' events remaining'); Engine.log(Events.eventStack.length + ' events remaining');
Engine.keyLock = false; Engine.keyLock = false;
Engine.tabNavigation = true; Engine.tabNavigation = true;
Button.saveCooldown = true;
if (Events.BLINK_INTERVAL) { if (Events.BLINK_INTERVAL) {
Events.stopTitleBlink(); Events.stopTitleBlink();
} }
+2
View File
@@ -171,6 +171,8 @@ var Outside = {
cooldown: Outside._GATHER_DELAY, cooldown: Outside._GATHER_DELAY,
width: '80px' width: '80px'
}).appendTo('div#outsidePanel'); }).appendTo('div#outsidePanel');
Outside.updateTrapButton();
}, },
getMaxPopulation: function() { getMaxPopulation: function() {
+9
View File
@@ -885,6 +885,7 @@ var Room = {
updateIncomeView: function() { updateIncomeView: function() {
var stores = $('div#resources'); var stores = $('div#resources');
var totalIncome = {};
if(stores.length === 0 || typeof $SM.get('income') == 'undefined') return; if(stores.length === 0 || typeof $SM.get('income') == 'undefined') return;
$('div.storeRow', stores).each(function(index, el) { $('div.storeRow', stores).each(function(index, el) {
el = $(el); el = $(el);
@@ -900,10 +901,18 @@ var Room = {
.addClass('row_val') .addClass('row_val')
.text(Engine.getIncomeMsg(income.stores[store], income.delay)) .text(Engine.getIncomeMsg(income.stores[store], income.delay))
.appendTo(tt); .appendTo(tt);
if (!totalIncome[store] || totalIncome[store].income === undefined) {
totalIncome[store] = { income: 0 };
}
totalIncome[store].income += Number(income.stores[store]);
totalIncome[store].delay = income.delay;
} }
} }
} }
if(tt.children().length > 0) { if(tt.children().length > 0) {
var total = totalIncome[storeName].income;
$('<div>').addClass('total row_key').text(_('total')).appendTo(tt);
$('<div>').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName].delay)).appendTo(tt);
tt.appendTo(el); tt.appendTo(el);
} }
}); });
+9 -8
View File
@@ -28,17 +28,18 @@ var StateManager = {
//create categories //create categories
var cats = [ var cats = [
'features', //big features like buildings, location availability, unlocks, etc 'features', // big features like buildings, location availability, unlocks, etc
'stores', //little stuff, items, weapons, etc 'stores', // little stuff, items, weapons, etc
'character', //this is for player's character stats such as perks 'character', // this is for player's character stats such as perks
'income', 'income',
'timers', 'timers',
'game', //mostly location related: fire temp, workers, population, world map, etc 'game', // mostly location related: fire temp, workers, population, world map, etc
'playStats', //anything play related: play time, loads, etc 'playStats', // anything play related: play time, loads, etc
'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc 'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc
'outfit', // used to temporarily store the items to be taken on the path 'outfit', // used to temporarily store the items to be taken on the path
'config', 'config',
'wait' // mysterious wanderers are coming back 'wait', // mysterious wanderers are coming back
'cooldown' // residual values for cooldown buttons
]; ];
for(var which in cats) { for(var which in cats) {
@@ -193,7 +194,7 @@ var StateManager = {
} }
}, },
removeBranch(stateName, noEvent) { removeBranch: function(stateName, noEvent) {
for(var i in $SM.get(stateName)){ for(var i in $SM.get(stateName)){
if(typeof $SM.get(stateName)[i] == 'object'){ if(typeof $SM.get(stateName)[i] == 'object'){
$SM.removeBranch(stateName +'["'+ i +'"]'); $SM.removeBranch(stateName +'["'+ i +'"]');
+3 -3
View File
@@ -890,10 +890,8 @@ var World = {
} }
World.state = null; World.state = null;
// Clear the embark cooldown
var btn = Button.clearCooldown($('#embarkButton'));
if(Path.outfit['cured meat'] > 0) { if(Path.outfit['cured meat'] > 0) {
Button.setDisabled(btn, false); Button.setDisabled($('#embarkButton'), false);
} }
for(var k in Path.outfit) { for(var k in Path.outfit) {
@@ -959,6 +957,8 @@ var World = {
onArrival: function() { onArrival: function() {
Engine.tabNavigation = false; Engine.tabNavigation = false;
// Clear the embark cooldown
Button.clearCooldown($('#embarkButton'));
Engine.keyLock = false; Engine.keyLock = false;
// Explore in a temporary world-state. We'll commit the changes if you return home safe. // Explore in a temporary world-state. We'll commit the changes if you return home safe.
World.state = $.extend(true, {}, $SM.get('game.world')); World.state = $.extend(true, {}, $SM.get('game.world'));