Add support for unshackled upgrades (#1086)

This commit is contained in:
domoddball
2022-06-03 06:19:06 -04:00
committed by GitHub
parent 9bfb8a44f9
commit fdcbbd7ab2
10 changed files with 19 additions and 11 deletions

View File

@@ -15,4 +15,6 @@ export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/Coo
export const LatestReleaseNotes = `This update adds support for some parts of cookie clicker 2.048</br>
- added support for Dragon Aura 'Supreme Intellect' in the pantheon calculations</br>
- added support for new tiers of Shimmering veil</br>
- added support for unshackled upgrades</br>
- updated some simulator logic to more cloesly match updated cookie clicker logic</br>
- resolved major issue for negative calculations due to missing glucosimium upgrades, kittens, and achievements</br>`;

View File

@@ -95,7 +95,7 @@ export default function InitialBuildingData(buildingName) {
};
}
// Below is needed for above eval, specifically for the GetTieredCpsMult function
// Below is needed for above eval, specifically for the SimGetTieredCpsMult function
you.baseCps = me.baseCps;
you.name = me.name;
you.tieredUpgrades = me.tieredUpgrades;
@@ -105,5 +105,6 @@ export default function InitialBuildingData(buildingName) {
you.baseCPS = me.baseCps;
you.id = me.id;
you.vanilla = me.vanilla;
you.unshackleUpgrade = me.unshackleUpgrade;
return you;
}

View File

@@ -12,7 +12,8 @@ export default function SimAuraMult(what) {
n = 1;
if (
Game.dragonAuras[SimDragonAura].name === 'Reality Bending' ||
Game.dragonAuras[SimDragonAura2].name === 'Reality Bending'
Game.dragonAuras[SimDragonAura2].name === 'Reality Bending' &&
Game.dragonLevel >= Game.dragonAurasBN[what].id + 4
)
n += 0.1;
return n;

View File

@@ -1,8 +1,7 @@
import SimAuraMult from './SimAuraMult';
/**
* This function calculates the sell multiplier based on current "sim data"
* It is called by CM.Sim.BuildingSell()
* This functions creates functions similarly to Game.getSellMultiplier but checks Sim Data instead of Game Data
* @returns {number} giveBack The multiplier
*/
export default function SimGetSellMultiplier() {

View File

@@ -5,10 +5,15 @@ import SimHas from './SimHas';
* This functions creates functions similarly to Game.GetTieredCpsMult but checks Sim Data instead of Game Data
*/
export default function SimGetTieredCpsMult(me) {
let mult = 1;
Object.keys(me.tieredUpgrades).forEach((i) => {
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name))
mult *= 2;
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)){
let tierMult=2;
// unshackled multipliers
if (Game.ascensionMode!==1 && SimHas(me.unshackleUpgrade) && SimHas(Game.Tiers[me.tieredUpgrades[i].tier].unshackleUpgrade)) tierMult+=me.id===1?0.5:(20-me.id)*0.1;
mult*=tierMult;
};
});
Object.keys(me.synergies).forEach((i) => {
if (SimHas(me.synergies[i].name)) {

View File

@@ -5,6 +5,6 @@ import { SimUpgrades } from '../VariablesAndData';
*/
export default function SimHas(what) {
const it = SimUpgrades[what];
if (Game.ascensionMode === 1 && (it.pool === 'prestige' || it.tier === 'fortune')) return 0;
if (it && Game.ascensionMode === 1 && (it.pool === 'prestige' || it.tier === 'fortune')) return 0;
return it ? it.bought : 0;
}