Skip to content

Commit

Permalink
Merge pull request #49 from nuclear-unicorn/dev/beta
Browse files Browse the repository at this point in the history
beta -> alpha
ZigguratV authored Mar 26, 2024
2 parents 7a68e3b + 82c46d7 commit 35421b9
Showing 10 changed files with 658 additions and 43 deletions.
1 change: 1 addition & 0 deletions core.js
Original file line number Diff line number Diff line change
@@ -2110,6 +2110,7 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingStackableBtnController", com.nu
var zebraOutpostMeta = this.game.bld.getBuildingExt("zebraOutpost").meta;
zebraOutpostMeta.calculateEffects(zebraOutpostMeta, this.game);
zebraOutpostMeta.jammed = false;
this.game.upgrade({policies : ["sharkRelationsBotanists"]});
this.game.diplomacy.onLeavingIW();
}

67 changes: 66 additions & 1 deletion game.js
Original file line number Diff line number Diff line change
@@ -1415,6 +1415,66 @@ dojo.declare("com.nuclearunicorn.game.EffectsManager", null, {
title: $I("effectsMgr.statics.globalRelationsBonus.title"),
type: "fixed"
},
"harborLimitRatioPolicy":{
title: $I("effectsMgr.statics.harborLimitRatioPolicy.title"),
type: "ratio"
},
"calcinerSteelRatioBonus":{
title: $I("effectsMgr.statics.calcinerSteelRatioBonus.title"),
type: "ratio"
},
"magnetoBoostBonusPolicy":{
title: $I("effectsMgr.statics.magnetoBoostBonusPolicy.title"),
type: "ratio"
},
"parchmentTradeChanceIncrease":{
title: $I("effectsMgr.statics.parchmentTradeChanceIncrease.title"),
type: "ratio"
},
"manuscriptTradeChanceIncrease":{
title: $I("effectsMgr.statics.manuscriptTradeChanceIncrease.title"),
type: "ratio"
},
"quarrySlabCraftBonus":{
title: $I("effectsMgr.statics.quarrySlabCraftBonus.title"),
type: "ratio"
},
"zigguratTempleEffectPolicy":{
title: $I("effectsMgr.statics.zigguratTempleEffectPolicy.title"),
type: "ratio"
},
"refinePolicyRatio":{
title: $I("effectsMgr.statics.refinePolicyRatio.title"),
type: "ratio"
},
"biolabEnergyRatio":{
title: $I("effectsMgr.statics.biolabEnergyRatio.title"),
type: "ratio"
},
"breweryPolicyManpowerRatio":{
title: $I("effectsMgr.statics.breweryPolicyManpowerRatio.title"),
type: "ratio"
},
"religionUpgradesDiscount":{
title: $I("effectsMgr.statics.religionUpgradesDiscount.title"),
type: "ratio"
},
"ironBuyRatioIncrease":{
title: $I("effectsMgr.statics.ironBuyRatioIncrease.title"),
type: "ratio"
},
"nagaBlueprintTradeChance":{
title: $I("effectsMgr.statics.nagaBlueprintTradeChance.title"),
type: "ratio"
},
"starchartPolicyRatio":{
title: $I("effectsMgr.statics.starchartPolicyRatio.title"),
type: "ratio"
},
"mintIvoryRatio": {
title: $I("effectsMgr.statics.mintIvoryRatio.title"),
type: "ratio"
},
//philosophy
"luxuryDemandRatio":{
title: $I("effectsMgr.statics.luxuryDemandRatio.title"),
@@ -1503,6 +1563,10 @@ dojo.declare("com.nuclearunicorn.game.EffectsManager", null, {
"mineralsPolicyRatio":{
title: $I("effectsMgr.statics.mineralsPolicyRatio.title"),
type: "ratio"
},
"oilPolicyRatio":{
title: $I("effectsMgr.statics.oilPolicyRatio.title"),
type: "ratio"
},
"woodPolicyRatio":{
title: $I("effectsMgr.statics.woodPolicyRatio.title"),
@@ -3658,7 +3722,8 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {

getResCraftRatio: function(craftedResName) {
if (craftedResName == "wood") {
var refineRatio = this.getEffect("refineRatio");
var policyRefineRatio = this.getEffect("refinePolicyRatio");
var refineRatio = (policyRefineRatio) + (1 + policyRefineRatio) * this.getEffect("refineRatio");
return this.ironWill
? ((1 + refineRatio) * (1 + this.getEffect("woodRatio"))) - 1
: refineRatio;
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -656,7 +656,7 @@ <h1 id="exportToText">Text Export:</h1>

<div id="importDiv" style="display: none" class="dialog help">
<div id="importWarning">Warning! Importing data will overwrite your current game data.</div>
<h1 id="importFrom">Import Form:</h1>
<h1 id="importFrom">Import From:</h1>
<input id="importFromDropbox" type="button" onclick="gamePage.saveImportDropbox();" value="Dropbox (Beta)">
<br>
<h1 id="importFromText">Text Import:</h1>
@@ -711,4 +711,4 @@ <h1 id="importFromText">Text Import:</h1>
</div>

</body>
</html>
</html>
47 changes: 39 additions & 8 deletions js/buildings.js
Original file line number Diff line number Diff line change
@@ -693,7 +693,7 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
self.togglable = true;
self.effects["catnipPerTickCon"] = -1;
self.effects["oilPerTickProd"] = 0.02 * (1 + game.getEffect("biofuelRatio"));
self.effects["energyConsumption"] = 1;
self.effects["energyConsumption"] = 1 * (1 + game.getEffect("biolabEnergyRatio"));
}else{
self.togglable = false;
self.effects["catnipPerTickCon"] = 0;
@@ -898,7 +898,7 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
var shipVal = game.resPool.get("ship").value;

//100% to 225% with slow falldown on the 75%
var limit = 2.25 + game.getEffect("shipLimit") * game.bld.get("reactor").on;
var limit = 2.25 + game.getEffect("shipLimit") * game.bld.get("reactor").on * (1 + game.getEffect("harborLimitRatioPolicy"));
var ratio = 1 + game.getLimitedDR(cargoShips.effects["harborRatio"] * shipVal, limit);

effects["catnipMax"] *= ratio;
@@ -967,18 +967,23 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
"mineralsRatio": 0.35,
"coalPerTickBase": 0.015,
"uraniumPerTickBase": 0,
"cathPollutionPerTickProd": 0.25
"cathPollutionPerTickProd": 0.25,
"slabCraftRatio": 0
},
calculateEffects: function(self, game){
var effects = {
"mineralsRatio": 0.35,
"coalPerTickBase": 0.015,
"uraniumPerTickBase": 0,
"cathPollutionPerTickProd": 0.25
"cathPollutionPerTickProd": 0.25,
"slabCraftRatio": 0
};
if (game.workshop.get("orbitalGeodesy").researched){
effects["uraniumPerTickBase"] = 0.0005; //4% of accelerator output
}
if (game.science.getPolicy("nagaRelationsMasons").researched){
effects["slabCraftRatio"] = game.getEffect("quarrySlabCraftBonus");
}
self.effects = effects;
self.togglable = game.science.get("ecology").researched;
},
@@ -1153,7 +1158,8 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
self.effects["ironPerTickCon"] *= amt;

// Automated production, metallurgist leader won't help here
self.effects["steelPerTickProd"] *= amt * (1 + game.getCraftRatio() * game.getEffect("calcinerSteelCraftRatio") + game.bld.get("reactor").on * game.getEffect("calcinerSteelReactorBonus"));
self.effects["steelPerTickProd"] *= amt * (1 + game.getCraftRatio() * game.getEffect("calcinerSteelCraftRatio") + game.bld.get("reactor").on * game.getEffect("calcinerSteelReactorBonus")) *
(1 + game.getEffect("calcinerSteelRatioBonus"));

return amt;
}
@@ -1225,6 +1231,7 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
}
}
self.effects["manuscriptPerTickProd"] = amt;
self.effects["magnetoBoostRatio"] = 0.15 + game.getEffect("magnetoBoostBonusPolicy");

//Update description to explain what automation does:
if (game.workshop.get("factoryAutomation").researched) {
@@ -1649,7 +1656,7 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
mpratio *= (1 + game.village.map.villageLevel * 0.005);
mpratio *= (1 + game.getEffect("mintRatio"));
self.effects["fursPerTickProd"] = mpratio * 1.25; //2
self.effects["ivoryPerTickProd"] = mpratio * 0.3; //1.5
self.effects["ivoryPerTickProd"] = mpratio * 0.3 * (1 + game.getEffect("mintIvoryRatio")); //1.5

var amt = game.resPool.getAmtDependsOnStock(
[{res: "gold", amt: -self.effects["goldPerTickCon"]},
@@ -1683,7 +1690,8 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
"catnipPerTickCon" : -1,
"spicePerTickCon" : -0.1,
"festivalRatio" : 0.01,
"festivalArrivalRatio" : 0.001
"festivalArrivalRatio" : 0.001,
"manpowerRatio" : 0
},
effectsCalculated: {},
togglable: true,
@@ -1693,7 +1701,8 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
"catnipPerTickCon" : -1 * (1 + game.getEffect("breweryConsumptionRatio")),
"spicePerTickCon" : -0.1 * (1 + game.getEffect("breweryConsumptionRatio")),
"festivalRatio" : 0.01,
"festivalArrivalRatio" : 0.001
"festivalArrivalRatio" : 0.001,
"manpowerRatio" : game.getEffect("breweryPolicyManpowerRatio")
};
self.effectsCalculated = dojo.clone(self.effects);
},
@@ -1707,6 +1716,7 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
self.effects["spicePerTickCon"] = self.effectsCalculated["spicePerTickCon"] * amt;
self.effects["festivalRatio"] = self.effectsCalculated["festivalRatio"] * amt;
self.effects["festivalArrivalRatio"] = self.effectsCalculated["festivalArrivalRatio"] * amt;
self.effects["manpowerRatio"] = self.effectsCalculated["manpowerRatio"] * amt;
return amt;
},
flavor: $I("buildings.brewery.flavor"),
@@ -1827,6 +1837,9 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
{ name : "manuscript", val: 10 }
],
priceRatio: 1.15,
upgrades: {
buildings: ["ziggurat"]
},
effects: {
"culturePerTickBase" : 0,
"faithPerTickBase" : 0,
@@ -1925,13 +1938,31 @@ dojo.declare("classes.managers.BuildingsManager", com.nuclearunicorn.core.TabMan
{ name : "megalith", val: 50 }
],
priceRatio: 1.25,
upgrades: {
buildings: ["temple"]
},
effects: {
"cultureMaxRatio": 0.08
},
calculateEffects: function(self, game) {
var effects = {
cultureMaxRatio: 0.08
};
if(game.science.getPolicy("nagaRelationsCultists").researched) {
game.upgrade(
self.upgrades
);
var multiplier = game.getEffect("zigguratTempleEffectPolicy");
var templeEffects = Object.assign({}, game.bld.getBuildingExt("temple").meta.effects);

for (var key in templeEffects) {
templeEffects[key] *= multiplier;
}
//Object.keys(templeEffects).forEach(key => {
// templeEffects[key] *= multiplier;
//});
effects = Object.assign(effects, templeEffects);
}
effects["cultureMaxRatio"] = 0.08 + game.getEffect("cultureMaxRatioBonus");
self.effects = effects;
if(self.val){
4 changes: 2 additions & 2 deletions js/calendar.js
Original file line number Diff line number Diff line change
@@ -966,7 +966,7 @@ if (++this.cycleYear >= this.yearsPerCycle) {
}
}

this.game.upgrade({policies: ["authocracy"]});
this.game.upgrade({policies: ["authocracy", "dragonRelationsAstrologers", "lizardRelationsEcologists"]});

if (updateUI) {
this.game.ui.render();
@@ -1043,7 +1043,7 @@ if (++this.cycleYear >= this.yearsPerCycle) {
}
}

this.game.upgrade({policies: ["authocracy"]});
this.game.upgrade({policies: ["authocracy", "dragonRelationsAstrologers", "lizardRelationsEcologists"]});

if (updateUI) {
this.game.ui.render();
14 changes: 11 additions & 3 deletions js/diplomacy.js
Original file line number Diff line number Diff line change
@@ -383,7 +383,8 @@ dojo.declare("classes.managers.DiplomacyManager", null, {
"winter": -0.5};
}
}
}
}

},

onLeavingIW: function(){
@@ -520,8 +521,12 @@ dojo.declare("classes.managers.DiplomacyManager", null, {
}

//-------------- 10% chance to get blueprint ---------------
var blueprintTradeChance = 0.1;
if (race.name == "nagas") {
blueprintTradeChance += this.game.getEffect("nagaBlueprintTradeChance");
}
boughtResources["blueprint"] = Math.floor(
this.game.math.binominalRandomInteger(successfullTradeAmount, 0.1)
this.game.math.binominalRandomInteger(successfullTradeAmount, blueprintTradeChance)
);

//-------------- 15% + 0.35% chance per ship to get titanium ---------------
@@ -534,6 +539,7 @@ dojo.declare("classes.managers.DiplomacyManager", null, {
//Update Trade Stats
this.game.stats.getStat("totalTrades").val = Math.min(this.game.stats.getStat("totalTrades").val + successfullTradeAmount, Number.MAX_VALUE);
this.game.stats.getStatCurrent("totalTrades").val += successfullTradeAmount;
this.game.upgrade({policies : ["sharkRelationsMerchants"]});

return boughtResources;
},
@@ -1029,12 +1035,14 @@ dojo.declare("classes.diplomacy.ui.EmbassyButtonController", com.nuclearunicorn.

buyItem: function(model, event, callback) {
this.inherited(arguments);
this.game.upgrade({policies: ["lizardRelationsDiplomats", "nagaRelationsArchitects", "spiderRelationsGeologists"]}); //Upgrade, since the policy is based on number of embassies.
this.game.science.unlockRelations(); //Check if we can unlock new relation policies based on number of embassies.
this.game.ui.render();
},

incrementValue: function(model) {
this.inherited(arguments);
model.options.race.embassyLevel++;
model.options.race.embassyLevel++;
},

hasSellLink: function(model){
3 changes: 3 additions & 0 deletions js/prestige.js
Original file line number Diff line number Diff line change
@@ -147,6 +147,9 @@ dojo.declare("classes.managers.PrestigeManager", com.nuclearunicorn.core.TabMana
effects:{
"standingRatio" : 0.1
},
upgrades:{
policies: ["lizardRelationsEcologists"]
},
unlocks: {
"perks": ["zebraDiplomacy"]
}
Loading

0 comments on commit 35421b9

Please sign in to comment.