- Timestamp:
- 06/25/11 02:47:46 (14 years ago)
- Location:
- ps/trunk/binaries/data/mods/public
- Files:
-
- 3 edited
-
gui/session/session.xml (modified) (1 diff)
-
simulation/components/Player.js (modified) (5 diffs)
-
simulation/helpers/Player.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/gui/session/session.xml
r9631 r9659 361 361 362 362 <!-- Population --> 363 <object size="374 0 464 100%" type="image" style="resourceCounter" tooltip="Population (current / maximum)" tooltip_style="sessionToolTipBold">363 <object size="374 0 464 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold"> 364 364 <object size="-2 0 30 28" type="image" style="resourceIcon" cell_id="4"/> 365 365 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/> -
ps/trunk/binaries/data/mods/public/simulation/components/Player.js
r9623 r9659 10 10 this.civ = undefined; 11 11 this.colour = { "r": 0.0, "g": 0.0, "b": 0.0, "a": 1.0 }; 12 this.popUsed = 0; // population of units owned by this player13 this.pop Reserved = 0; // population of units currently being trained14 this. popLimit =0; // maximum population12 this.popUsed = 0; // population of units owned or trained by this player 13 this.popBonuses = 0; // sum of population bonuses of player's entities 14 this.maxPop = 200; // maximum population 15 15 this.trainingQueueBlocked = false; // indicates whether any training queue is currently blocked 16 16 this.resourceCount = { … … 71 71 Player.prototype.TryReservePopulationSlots = function(num) 72 72 { 73 if (num > this.GetPopulationLimit() - this.GetPopulationCount())73 if (num > (this.GetPopulationLimit() - this.GetPopulationCount())) 74 74 return false; 75 75 76 this.pop Reserved += num;76 this.popUsed += num; 77 77 return true; 78 78 }; … … 80 80 Player.prototype.UnReservePopulationSlots = function(num) 81 81 { 82 this.pop Reserved -= num;82 this.popUsed -= num; 83 83 }; 84 84 85 85 Player.prototype.GetPopulationCount = function() 86 86 { 87 return this.popUsed + this.popReserved; 88 }; 89 90 Player.prototype.SetPopulationLimit = function(limit) 91 { 92 this.popLimit = limit; 87 return this.popUsed; 93 88 }; 94 89 95 90 Player.prototype.GetPopulationLimit = function() 96 91 { 97 return this.popLimit; 92 return Math.min(this.maxPop, this.popBonuses); 93 }; 94 95 Player.prototype.SetMaxPopulation = function(max) 96 { 97 this.maxPop = max; 98 }; 99 100 Player.prototype.GetMaxPopulation = function() 101 { 102 return this.maxPop; 98 103 }; 99 104 … … 275 280 { 276 281 this.popUsed -= cost.GetPopCost(); 277 this.pop Limit-= cost.GetPopBonus();282 this.popBonuses -= cost.GetPopBonus(); 278 283 } 279 284 } … … 288 293 { 289 294 this.popUsed += cost.GetPopCost(); 290 this.pop Limit+= cost.GetPopBonus();295 this.popBonuses += cost.GetPopBonus(); 291 296 } 292 297 } -
ps/trunk/binaries/data/mods/public/simulation/helpers/Player.js
r9623 r9659 93 93 if (getSetting(pData, pDefs, "PopulationLimit") !== undefined) 94 94 { 95 player.Set PopulationLimit(getSetting(pData, pDefs, "PopulationLimit"));95 player.SetMaxPopulation(getSetting(pData, pDefs, "PopulationLimit")); 96 96 } 97 97
Note:
See TracChangeset
for help on using the changeset viewer.
