mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-11 06:57:13 +08:00
@@ -12,22 +12,23 @@ a minimalist text adventure game for your browser
|
|||||||
<td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese</a></td>
|
<td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese</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>
|
||||||
<td><a href="http://adarkroom.doublespeakgames.com/?lang=de">German</a></td>
|
<td><a href="http://adarkroom.doublespeakgames.com/?lang=de">German</a></td>
|
||||||
</tr>
|
<td><a href="http://adarkroom.doublespeakgames.com/?lang=el">Greek</a></td>
|
||||||
<tr>
|
|
||||||
<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>
|
||||||
<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><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>
|
||||||
<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>
|
||||||
|
</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>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><a href="http://adarkroom.doublespeakgames.com/?lang=sv">Swedish</a></td>
|
<td><a href="http://adarkroom.doublespeakgames.com/?lang=sv">Swedish</a></td>
|
||||||
|
</tr><tr>
|
||||||
<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>
|
||||||
|
|||||||
@@ -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
+3392
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1824,7 +1824,7 @@ msgstr "餌を買う"
|
|||||||
|
|
||||||
#: script/events/room.js:33
|
#: script/events/room.js:33
|
||||||
msgid "traps are more effective with bait."
|
msgid "traps are more effective with bait."
|
||||||
msgstr "罠は餌があるとより効果的だ。"
|
msgstr "罠は餌があるとより効果的だ"
|
||||||
|
|
||||||
#: script/events/room.js:39
|
#: script/events/room.js:39
|
||||||
msgid "buy compass"
|
msgid "buy compass"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
var langs = {
|
var langs = {
|
||||||
'de':'deutsch',
|
'de':'deutsch',
|
||||||
|
'el':'ελληνικά',
|
||||||
'en':'english',
|
'en':'english',
|
||||||
'es':'español',
|
'es':'español',
|
||||||
'fr':'français',
|
'fr':'français',
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ Events.Room = [
|
|||||||
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
|
|
||||||
},
|
},
|
||||||
'goodbye': {
|
'goodbye': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
|
|||||||
+45
-9
@@ -437,7 +437,7 @@ var Room = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'compass': {
|
'compass': {
|
||||||
type: 'upgrade',
|
type: 'special',
|
||||||
maximum: 1,
|
maximum: 1,
|
||||||
cost: function() {
|
cost: function() {
|
||||||
return {
|
return {
|
||||||
@@ -462,6 +462,8 @@ var Room = {
|
|||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Room.pathDiscovery = Boolean($SM.get('stores["compass"]'));
|
||||||
|
|
||||||
if(Engine._debug) {
|
if(Engine._debug) {
|
||||||
this._ROOM_WARM_DELAY = 5000;
|
this._ROOM_WARM_DELAY = 5000;
|
||||||
this._BUILDER_STATE_DELAY = 5000;
|
this._BUILDER_STATE_DELAY = 5000;
|
||||||
@@ -748,8 +750,10 @@ var Room = {
|
|||||||
|
|
||||||
updateStoresView: function() {
|
updateStoresView: function() {
|
||||||
var stores = $('div#stores');
|
var stores = $('div#stores');
|
||||||
|
var resources = $('div#resources');
|
||||||
|
var special = $('div#special');
|
||||||
var weapons = $('div#weapons');
|
var weapons = $('div#weapons');
|
||||||
var needsAppend = false, wNeedsAppend = false, newRow = false;
|
var needsAppend = false, rNeedsAppend = false, sNeedsAppend = false, wNeedsAppend = false, newRow = false;
|
||||||
if(stores.length === 0) {
|
if(stores.length === 0) {
|
||||||
stores = $('<div>').attr({
|
stores = $('<div>').attr({
|
||||||
'id': 'stores',
|
'id': 'stores',
|
||||||
@@ -757,6 +761,18 @@ var Room = {
|
|||||||
}).css('opacity', 0);
|
}).css('opacity', 0);
|
||||||
needsAppend = true;
|
needsAppend = true;
|
||||||
}
|
}
|
||||||
|
if(resources.length === 0) {
|
||||||
|
resources = $('<div>').attr({
|
||||||
|
id: 'resources'
|
||||||
|
}).css('opacity', 0);
|
||||||
|
rNeedsAppend = true;
|
||||||
|
}
|
||||||
|
if(special.length === 0) {
|
||||||
|
special = $('<div>').attr({
|
||||||
|
id: 'special'
|
||||||
|
}).css('opacity', 0);
|
||||||
|
sNeedsAppend = true;
|
||||||
|
}
|
||||||
if(weapons.length === 0) {
|
if(weapons.length === 0) {
|
||||||
weapons = $('<div>').attr({
|
weapons = $('<div>').attr({
|
||||||
'id': 'weapons',
|
'id': 'weapons',
|
||||||
@@ -783,8 +799,11 @@ var Room = {
|
|||||||
case 'weapon':
|
case 'weapon':
|
||||||
location = weapons;
|
location = weapons;
|
||||||
break;
|
break;
|
||||||
|
case 'special':
|
||||||
|
location = special;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
location = stores;
|
location = resources;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -830,7 +849,17 @@ var Room = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(needsAppend && stores.children().length > 0) {
|
if(rNeedsAppend && resources.children().length > 0) {
|
||||||
|
resources.prependTo(stores);
|
||||||
|
resources.animate({opacity: 1}, 300, 'linear');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sNeedsAppend && special.children().length > 0) {
|
||||||
|
special.appendTo(stores);
|
||||||
|
special.animate({opacity: 1}, 300, 'linear');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(needsAppend && stores.find('div.storeRow').length > 0) {
|
||||||
stores.appendTo('div#storesContainer');
|
stores.appendTo('div#storesContainer');
|
||||||
stores.animate({opacity: 1}, 300, 'linear');
|
stores.animate({opacity: 1}, 300, 'linear');
|
||||||
}
|
}
|
||||||
@@ -847,10 +876,15 @@ var Room = {
|
|||||||
if($("div#outsidePanel").length) {
|
if($("div#outsidePanel").length) {
|
||||||
Outside.updateVillage();
|
Outside.updateVillage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($SM.get('stores.compass') && !Room.pathDiscovery){
|
||||||
|
Room.pathDiscovery = true;
|
||||||
|
Path.openPath();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateIncomeView: function() {
|
updateIncomeView: function() {
|
||||||
var stores = $('div#stores');
|
var stores = $('div#resources');
|
||||||
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 +934,6 @@ var Room = {
|
|||||||
Notifications.notify(Room, good.buildMsg);
|
Notifications.notify(Room, good.buildMsg);
|
||||||
|
|
||||||
$SM.add('stores["'+thing+'"]', 1);
|
$SM.add('stores["'+thing+'"]', 1);
|
||||||
|
|
||||||
if(thing == 'compass') {
|
|
||||||
Path.openPath();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
build: function(buildBtn) {
|
build: function(buildBtn) {
|
||||||
@@ -1109,6 +1139,12 @@ var Room = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
compassTooltip: function(direction){
|
||||||
|
var tt = $('<div>').addClass('tooltip bottom right');
|
||||||
|
$('<div>').addClass('row_key').text(_('the compass points '+ direction)).appendTo(tt);
|
||||||
|
tt.appendTo($('#row_compass'));
|
||||||
|
},
|
||||||
|
|
||||||
handleStateUpdates: function(e){
|
handleStateUpdates: function(e){
|
||||||
if(e.category == 'stores'){
|
if(e.category == 'stores'){
|
||||||
Room.updateStoresView();
|
Room.updateStoresView();
|
||||||
|
|||||||
@@ -423,6 +423,7 @@ var StateManager = {
|
|||||||
case 'tool':
|
case 'tool':
|
||||||
case 'weapon':
|
case 'weapon':
|
||||||
case 'upgrade':
|
case 'upgrade':
|
||||||
|
case 'special':
|
||||||
return $SM.get('stores["'+name+'"]', true);
|
return $SM.get('stores["'+name+'"]', true);
|
||||||
case 'building':
|
case 'building':
|
||||||
return $SM.get('game.buildings["'+name+'"]', true);
|
return $SM.get('game.buildings["'+name+'"]', true);
|
||||||
|
|||||||
+52
-12
@@ -156,6 +156,12 @@ var World = {
|
|||||||
|
|
||||||
Engine.updateOuterSlider();
|
Engine.updateOuterSlider();
|
||||||
|
|
||||||
|
// Map the ship and show compass tooltip
|
||||||
|
World.ship = World.mapSearch(World.TILE.SHIP,$SM.get('game.world.map'),1);
|
||||||
|
World.dir = World.compassDir(World.ship[0]);
|
||||||
|
// compass tooltip text
|
||||||
|
Room.compassTooltip(World.dir);
|
||||||
|
|
||||||
//subscribe to stateUpdates
|
//subscribe to stateUpdates
|
||||||
$.Dispatch('stateUpdate').subscribe(World.handleStateUpdates);
|
$.Dispatch('stateUpdate').subscribe(World.handleStateUpdates);
|
||||||
},
|
},
|
||||||
@@ -651,24 +657,58 @@ var World = {
|
|||||||
var landmark = World.LANDMARKS[k];
|
var landmark = World.LANDMARKS[k];
|
||||||
for(var i = 0; i < landmark.num; i++) {
|
for(var i = 0; i < landmark.num; i++) {
|
||||||
var pos = World.placeLandmark(landmark.minRadius, landmark.maxRadius, k, map);
|
var pos = World.placeLandmark(landmark.minRadius, landmark.maxRadius, k, map);
|
||||||
if(k == World.TILE.SHIP) {
|
|
||||||
var dx = pos[0] - World.RADIUS, dy = pos[1] - World.RADIUS;
|
|
||||||
var horz = dx < 0 ? 'west' : 'east';
|
|
||||||
var vert = dy < 0 ? 'north' : 'south';
|
|
||||||
if(Math.abs(dx) / 2 > Math.abs(dy)) {
|
|
||||||
World.dir = horz;
|
|
||||||
} else if(Math.abs(dy) / 2 > Math.abs(dx)){
|
|
||||||
World.dir = vert;
|
|
||||||
} else {
|
|
||||||
World.dir = vert + horz;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mapSearch: function(target,map,required){
|
||||||
|
var max = World.LANDMARKS[target].num;
|
||||||
|
if(!max){
|
||||||
|
// this restrict the research to numerable landmarks
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// restrict research if only a fixed number (usually 1) is required
|
||||||
|
max = (required) ? Math.min(required,max) : max;
|
||||||
|
var index = 0;
|
||||||
|
var targets = [];
|
||||||
|
search: // label for coordinate research
|
||||||
|
for(var i = 0; i <= World.RADIUS * 2; i++){
|
||||||
|
for(var j = 0; j <= World.RADIUS * 2; j++){
|
||||||
|
if(map[i][j].charAt(0) === target){
|
||||||
|
// search result is stored as an object;
|
||||||
|
// items are listed as they appear in the map, tl-br
|
||||||
|
// each item has relative coordinates and a compass-type direction
|
||||||
|
targets[index] = {
|
||||||
|
x : i - World.RADIUS,
|
||||||
|
y : j - World.RADIUS,
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
if(index === max){
|
||||||
|
// optimisation: stop the research if maximum number of items has been reached
|
||||||
|
break search;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return targets;
|
||||||
|
},
|
||||||
|
|
||||||
|
compassDir: function(pos){
|
||||||
|
var dir = '';
|
||||||
|
var horz = pos.x < 0 ? 'west' : 'east';
|
||||||
|
var vert = pos.y < 0 ? 'north' : 'south';
|
||||||
|
if(Math.abs(pos.x) / 2 > Math.abs(pos.y)) {
|
||||||
|
dir = horz;
|
||||||
|
} else if(Math.abs(pos.y) / 2 > Math.abs(pos.x)){
|
||||||
|
dir = vert;
|
||||||
|
} else {
|
||||||
|
dir = vert + horz;
|
||||||
|
}
|
||||||
|
return dir;
|
||||||
|
},
|
||||||
|
|
||||||
placeLandmark: function(minRadius, maxRadius, landmark, map) {
|
placeLandmark: function(minRadius, maxRadius, landmark, map) {
|
||||||
|
|
||||||
var x = World.RADIUS, y = World.RADIUS;
|
var x = World.RADIUS, y = World.RADIUS;
|
||||||
|
|||||||
Reference in New Issue
Block a user