mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Method and property fix
World.testMap() sets World.seenAll. The latter is true when the whole map has been explored. World.testMap() is called: * on world init * on return home (when the map is updated) * on applyMap() (when the map is bought from the scout)
This commit is contained in:
+5
-4
@@ -163,7 +163,7 @@ var World = {
|
||||
Room.compassTooltip(World.dir);
|
||||
|
||||
// Check if everything has been seen
|
||||
World.seenAll = World.testMap();
|
||||
World.testMap();
|
||||
|
||||
//subscribe to stateUpdates
|
||||
$.Dispatch('stateUpdate').subscribe(World.handleStateUpdates);
|
||||
@@ -621,8 +621,8 @@ var World = {
|
||||
},
|
||||
|
||||
testMap: function() {
|
||||
var dark;
|
||||
if(!World.seenAll) {
|
||||
var dark;
|
||||
var mask = $SM.get('game.world.mask');
|
||||
loop:
|
||||
for(var i = 0; i < mask.length; i++) {
|
||||
@@ -633,8 +633,8 @@ var World = {
|
||||
}
|
||||
}
|
||||
}
|
||||
World.seenAll = !dark;
|
||||
}
|
||||
return !dark;
|
||||
},
|
||||
|
||||
applyMap: function() {
|
||||
@@ -646,6 +646,7 @@ var World = {
|
||||
} while (mask[x][y]);
|
||||
World.uncoverMap(x, y, 5, mask);
|
||||
}
|
||||
World.testMap();
|
||||
},
|
||||
|
||||
generateMap: function() {
|
||||
@@ -897,7 +898,7 @@ var World = {
|
||||
goHome: function() {
|
||||
// Home safe! Commit the changes.
|
||||
$SM.setM('game.world', World.state);
|
||||
World.seenAll = World.testMap();
|
||||
World.testMap();
|
||||
|
||||
if(World.state.sulphurmine && $SM.get('game.buildings["sulphur mine"]', true) === 0) {
|
||||
$SM.add('game.buildings["sulphur mine"]', 1);
|
||||
|
||||
Reference in New Issue
Block a user