mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
started backup/loading mechanic
This commit is contained in:
@@ -3394,12 +3394,12 @@ Events.Setpieces = {
|
||||
}
|
||||
},
|
||||
"cache": { /* Cache - contains some of supplies from previous game */
|
||||
title: 'An Underground Cache',
|
||||
title: 'A Destroyed Village',
|
||||
scenes: {
|
||||
'start': {
|
||||
text: [
|
||||
'a destroyed village stands before you',
|
||||
'with bodies littering the ground.'
|
||||
'charred bodies littering the ground.'
|
||||
],
|
||||
notification: 'you smell the metallic tang of a wanderer afterburner.',
|
||||
buttons: {
|
||||
@@ -3415,7 +3415,7 @@ Events.Setpieces = {
|
||||
},
|
||||
'underground': {
|
||||
text: [
|
||||
'a small shack stands at the center of the village.',
|
||||
'a shack stands at the center of the village.',
|
||||
'there are still supplies inside.'
|
||||
],
|
||||
buttons: {
|
||||
@@ -3432,6 +3432,7 @@ Events.Setpieces = {
|
||||
],
|
||||
onLoad: function() {
|
||||
World.markVisited(World.curPos[0], World.curPos[1]);
|
||||
Prestige.load();
|
||||
},
|
||||
buttons: {
|
||||
'leave': {
|
||||
|
||||
+7
-1
@@ -11,7 +11,7 @@ var Prestige = {
|
||||
},
|
||||
|
||||
save: function() {
|
||||
prevStores = [ //g = goods, w = weapons, a = ammo
|
||||
var prevStores = [ //g = goods, w = weapons, a = ammo
|
||||
$SM.get('stores["wood"]'), // randGen('g'),
|
||||
$SM.get('stores["fur"]'), // randGen('g'),
|
||||
$SM.get('stores["meat"]'), // randGen('g'),
|
||||
@@ -37,9 +37,15 @@ var Prestige = {
|
||||
$SM.get('stores["grenade"]'), // randGen('a'),
|
||||
$SM.get('stores["bolas"]') // randGen('a')
|
||||
];
|
||||
$SM.set('previous.stores', prevStores);
|
||||
return prevStores;
|
||||
},
|
||||
|
||||
load: function() {
|
||||
var prevStores = $SM.get('previous.stores');
|
||||
return prevStores;
|
||||
}
|
||||
|
||||
/*randGen: function(storeType) {
|
||||
if (storeType == 'g') {
|
||||
divisor = Math.floor(Math.random()*10)
|
||||
|
||||
@@ -387,10 +387,12 @@ var Space = {
|
||||
},
|
||||
complete: function() {
|
||||
Prestige.save();
|
||||
backup = $SM.get('previous.stores');
|
||||
$('#starsContainer').remove();
|
||||
if(typeof Storage != 'undefined' && localStorage) {
|
||||
localStorage.clear();
|
||||
}
|
||||
$SM.set('previous.stores',backup);
|
||||
delete window.State;
|
||||
Engine.options = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user