Changeset 25047
- Timestamp:
- Mar 14, 2021, 1:43:19 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
r25043 r25047 1686 1686 PETRA.HQ.prototype.buildMoreHouses = function(gameState, queues) 1687 1687 { 1688 if (!gameState.isTemplateAvailable(gameState.applyCiv("structures/{civ}/house")) || 1689 gameState.getPopulationMax() <= gameState.getPopulationLimit()) 1688 let houseTemplateString = "structures/{civ}/apartment"; 1689 if (!gameState.isTemplateAvailable(gameState.applyCiv(houseTemplateString)) || 1690 !this.canBuild(gameState, houseTemplateString)) 1691 { 1692 houseTemplateString = "structures/{civ}/house"; 1693 if (!gameState.isTemplateAvailable(gameState.applyCiv(houseTemplateString))) 1694 return; 1695 } 1696 if (gameState.getPopulationMax() <= gameState.getPopulationLimit()) 1690 1697 return; 1691 1698 … … 1693 1700 if (numPlanned < 3 || numPlanned < 5 && gameState.getPopulation() > 80) 1694 1701 { 1695 let plan = new PETRA.ConstructionPlan(gameState, "structures/{civ}/house");1702 let plan = new PETRA.ConstructionPlan(gameState, ); 1696 1703 // change the starting condition according to the situation. 1697 1704 plan.goRequirement = "houseNeeded"; … … 1701 1708 if (numPlanned > 0 && this.phasing && gameState.getPhaseEntityRequirements(this.phasing).length) 1702 1709 { 1703 let houseTemplateName = gameState.applyCiv( "structures/{civ}/house");1710 let houseTemplateName = gameState.applyCiv(); 1704 1711 let houseTemplate = gameState.getTemplate(houseTemplateName); 1705 1712 … … 1734 1741 if (this.requireHouses) 1735 1742 { 1736 let houseTemplate = gameState.getTemplate(gameState.applyCiv( "structures/{civ}/house"));1743 let houseTemplate = gameState.getTemplate(gameState.applyCiv()); 1737 1744 if (!this.phasing || gameState.getPhaseEntityRequirements(this.phasing).every(req => 1738 1745 !houseTemplate.hasClass(req.class) || gameState.getOwnStructures().filter(API3.Filters.byClass(req.class)).length >= req.count)) … … 1743 1750 // - if no room to build, try to improve with technology 1744 1751 // - otherwise increase temporarily the priority of houses 1745 let house = gameState.applyCiv( "structures/{civ}/house");1752 let house = gameState.applyCiv(); 1746 1753 let HouseNb = gameState.getOwnFoundations().filter(API3.Filters.byClass("House")).length; 1747 1754 let popBonus = gameState.getTemplate(house).getPopulationBonus();
Note:
See TracChangeset
for help on using the changeset viewer.