Add guid to window.PLAYER and add constant MAX_RESO_PER_PLAYER
This commit is contained in:
parent
4926b5450c
commit
5f94d56578
@ -159,6 +159,7 @@ window.setupMap = function() {
|
|||||||
// included as inline script in the original site, the data is static
|
// included as inline script in the original site, the data is static
|
||||||
// and cannot be updated.
|
// and cannot be updated.
|
||||||
window.setupPlayerStat = function() {
|
window.setupPlayerStat = function() {
|
||||||
|
PLAYER.guid = playerNameToGuid(PLAYER.nickname);
|
||||||
var level;
|
var level;
|
||||||
var ap = parseInt(PLAYER.ap);
|
var ap = parseInt(PLAYER.ap);
|
||||||
for(level = 0; level < MIN_AP_FOR_LEVEL.length; level++) {
|
for(level = 0; level < MIN_AP_FOR_LEVEL.length; level++) {
|
||||||
|
@ -17,6 +17,17 @@ window.getPlayerName = function(guid) {
|
|||||||
return '{'+guid.slice(0, 12)+'}';
|
return '{'+guid.slice(0, 12)+'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.playerNameToGuid = function(playerName){
|
||||||
|
var guid = null;
|
||||||
|
$.each(Object.keys(localStorage), function(ind,key) {
|
||||||
|
if(playerName === localStorage[key]) {
|
||||||
|
guid = key;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return guid;
|
||||||
|
}
|
||||||
|
|
||||||
// resolves all player GUIDs that have been added to the list. Reruns
|
// resolves all player GUIDs that have been added to the list. Reruns
|
||||||
// renderPortalDetails when finished, so that then-unresolved names
|
// renderPortalDetails when finished, so that then-unresolved names
|
||||||
// get replaced by their correct versions.
|
// get replaced by their correct versions.
|
||||||
|
1
main.js
1
main.js
@ -189,6 +189,7 @@ window.CAPTURE_PORTAL = 500; //AP for capturing a portal
|
|||||||
window.DEPLOY_RESONATOR = 125; //AP for deploying a resonator
|
window.DEPLOY_RESONATOR = 125; //AP for deploying a resonator
|
||||||
window.COMPLETION_BONUS = 250; //AP for deploying all resonators on portal
|
window.COMPLETION_BONUS = 250; //AP for deploying all resonators on portal
|
||||||
window.MAX_PORTAL_LEVEL = 8;
|
window.MAX_PORTAL_LEVEL = 8;
|
||||||
|
window.MAX_RESO_PER_PLAYER = [0, 8, 4, 4, 4, 2, 2, 1, 1];
|
||||||
|
|
||||||
// OTHER MORE-OR-LESS CONSTANTS //////////////////////////////////////
|
// OTHER MORE-OR-LESS CONSTANTS //////////////////////////////////////
|
||||||
window.TEAM_NONE = 0;
|
window.TEAM_NONE = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user