fix(gameplay & db): fix casino spin freeze, bank deposit sync, and plant selection menu (fixes #8, #9, #10)
This commit is contained in:
+45
-2
@@ -117,7 +117,20 @@ window.PvZAuth = (function () {
|
||||
lastVisit: Date.now()
|
||||
},
|
||||
treeOfWisdom: { height: 0, cheats: {} },
|
||||
achievements: {}
|
||||
achievements: {},
|
||||
casino: {
|
||||
deposit: 0,
|
||||
depositStartTime: 0,
|
||||
loan: 0,
|
||||
spinsTotal: 0,
|
||||
totalWon: 0,
|
||||
jackpotsWon: 0
|
||||
},
|
||||
zombieLab: {
|
||||
unlockedStage: 1,
|
||||
levels: { normal: 1, conehead: 1, buckethead: 1, football: 1, dancing: 1 },
|
||||
mutations: {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -301,7 +314,37 @@ window.PvZAuth = (function () {
|
||||
achievements: {
|
||||
...(loc.achievements || {}),
|
||||
...(base.achievements || {})
|
||||
}
|
||||
},
|
||||
casino: (base.casino || loc.casino)
|
||||
? {
|
||||
...def.casino,
|
||||
...(loc.casino || {}),
|
||||
...(base.casino || {}),
|
||||
deposit: (base.casino && base.casino.deposit !== undefined) ? Number(base.casino.deposit) : (Number(loc.casino?.deposit) || 0),
|
||||
depositStartTime: (base.casino && base.casino.depositStartTime) ? Number(base.casino.depositStartTime) : (Number(loc.casino?.depositStartTime) || 0),
|
||||
loan: (base.casino && base.casino.loan !== undefined) ? Number(base.casino.loan) : (Number(loc.casino?.loan) || 0),
|
||||
spinsTotal: Math.max(Number(base.casino?.spinsTotal) || 0, Number(loc.casino?.spinsTotal) || 0),
|
||||
totalWon: Math.max(Number(base.casino?.totalWon) || 0, Number(loc.casino?.totalWon) || 0),
|
||||
jackpotsWon: Math.max(Number(base.casino?.jackpotsWon) || 0, Number(loc.casino?.jackpotsWon) || 0)
|
||||
}
|
||||
: def.casino,
|
||||
zombieLab: (base.zombieLab || loc.zombieLab)
|
||||
? {
|
||||
...def.zombieLab,
|
||||
...(loc.zombieLab || {}),
|
||||
...(base.zombieLab || {}),
|
||||
unlockedStage: Math.max(Number(base.zombieLab?.unlockedStage) || 1, Number(loc.zombieLab?.unlockedStage) || 1),
|
||||
levels: {
|
||||
...def.zombieLab.levels,
|
||||
...(loc.zombieLab?.levels || {}),
|
||||
...(base.zombieLab?.levels || {})
|
||||
},
|
||||
mutations: {
|
||||
...(loc.zombieLab?.mutations || {}),
|
||||
...(base.zombieLab?.mutations || {})
|
||||
}
|
||||
}
|
||||
: def.zombieLab
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user