Revert "randomize inf upgrades"

This reverts commit 90e5cc6053.
This commit is contained in:
L4R5W 2023-10-19 20:44:38 +02:00 committed by cyip92
parent 90e5cc6053
commit 1492d065f8
9 changed files with 110 additions and 131 deletions

View File

@ -1,21 +1,17 @@
<script>
import InfinityUpgradeButton from "@/components/InfinityUpgradeButton";
import IpMultiplierButton from "./IpMultiplierButton";
import PrimaryButton from "@/components/PrimaryButton";
import PrimaryToggleButton from "@/components/PrimaryToggleButton";
export default {
name: "InfinityUpgradesTab",
components: {
PrimaryButton,
PrimaryToggleButton,
InfinityUpgradeButton,
IpMultiplierButton
},
data() {
return {
isAutobuyerActive: false,
isAutoUnlocked: false,
isCapped: false,
isUseless: false,
chargeUnlocked: false,
totalCharges: 0,
@ -29,11 +25,33 @@ export default {
};
},
computed: {
ipUpgrade() {
return InfinityUpgrade.ipMult;
},
grid() {
return ADevil.getInfinityUpgradeGrid();
return [
[
InfinityUpgrade.totalTimeMult,
InfinityUpgrade.dim18mult,
InfinityUpgrade.dim36mult,
InfinityUpgrade.resetBoost
],
[
InfinityUpgrade.buy10Mult,
InfinityUpgrade.dim27mult,
InfinityUpgrade.dim45mult,
InfinityUpgrade.galaxyBoost
],
[
InfinityUpgrade.thisInfinityTimeMult,
InfinityUpgrade.unspentIPMult,
InfinityUpgrade.dimboostMult,
InfinityUpgrade.ipGen
],
[
InfinityUpgrade.skipReset1,
InfinityUpgrade.skipReset2,
InfinityUpgrade.skipReset3,
InfinityUpgrade.skipResetGalaxy
]
];
},
allColumnUpgrades() {
return this.grid.flat();
@ -47,9 +65,6 @@ export default {
offlineIpUpgrade: () => InfinityUpgrade.ipOffline
},
watch: {
isAutobuyerActive(newValue) {
Autobuyer.ipMult.isActive = newValue;
},
disCharge(newValue) {
player.celestials.ra.disCharge = newValue;
}
@ -63,9 +78,6 @@ export default {
},
methods: {
update() {
this.isAutoUnlocked = Autobuyer.ipMult.isUnlocked;
this.isAutobuyerActive = Autobuyer.ipMult.isActive;
this.isCapped = this.ipUpgrade.isCapped;
this.isUseless = Pelle.isDoomed;
this.chargeUnlocked = Ra.unlocks.chargedInfinityUpgrades.canBeApplied && !Pelle.isDoomed;
this.totalCharges = Ra.totalCharges;
@ -76,9 +88,6 @@ export default {
this.eternityUnlocked = PlayerProgress.current.isEternityUnlocked;
this.bottomRowUnlocked = Achievement(41).isUnlocked;
},
buyMaxIPMult() {
InfinityUpgrade.ipMult.buyMax();
},
btnClassObject(column) {
const classObject = {
"l-infinity-upgrade-grid__cell": true
@ -155,29 +164,7 @@ export default {
v-if="bottomRowUnlocked"
class="l-infinity-upgrades-bottom-row"
>
<div class="l-spoon-btn-group">
<InfinityUpgradeButton
:upgrade="ipUpgrade"
class="o-infinity-upgrade-btn--multiplier"
>
<template v-if="isCapped">
<br>
<span>(Capped at {{ quantify("Infinity Point", ipUpgrade.config.costCap) }})</span>
</template>
</InfinityUpgradeButton>
<PrimaryButton
class="l--spoon-btn-group__little-spoon o-primary-btn--small-spoon"
@click="buyMaxIPMult()"
>
Max Infinity Point mult
</PrimaryButton>
<PrimaryToggleButton
v-if="isAutoUnlocked"
v-model="isAutobuyerActive"
label="Autobuy IP mult"
class="l--spoon-btn-group__little-spoon o-primary-btn--small-spoon"
/>
</div>
<IpMultiplierButton class="l-infinity-upgrades-tab__mult-btn" />
<InfinityUpgradeButton
:upgrade="offlineIpUpgrade"
:class="btnClassObject(1)"

View File

@ -0,0 +1,71 @@
<script>
import InfinityUpgradeButton from "@/components/InfinityUpgradeButton";
import PrimaryButton from "@/components/PrimaryButton";
import PrimaryToggleButton from "@/components/PrimaryToggleButton";
export default {
name: "IpMultiplierButton",
components: {
PrimaryButton,
PrimaryToggleButton,
InfinityUpgradeButton
},
data() {
return {
isAutobuyerActive: false,
isAutoUnlocked: false,
isCapped: false
};
},
computed: {
upgrade() {
return InfinityUpgrade.ipMult;
}
},
watch: {
isAutobuyerActive(newValue) {
Autobuyer.ipMult.isActive = newValue;
}
},
methods: {
update() {
this.isAutoUnlocked = Autobuyer.ipMult.isUnlocked;
this.isAutobuyerActive = Autobuyer.ipMult.isActive;
this.isCapped = this.upgrade.isCapped;
},
buyMaxIPMult() {
InfinityUpgrade.ipMult.buyMax();
}
}
};
</script>
<template>
<div class="l-spoon-btn-group">
<InfinityUpgradeButton
:upgrade="upgrade"
class="o-infinity-upgrade-btn--multiplier"
>
<template v-if="isCapped">
<br>
<span>(Capped at {{ quantify("Infinity Point", upgrade.config.costCap) }})</span>
</template>
</InfinityUpgradeButton>
<PrimaryButton
class="l--spoon-btn-group__little-spoon o-primary-btn--small-spoon"
@click="buyMaxIPMult()"
>
Max Infinity Point mult
</PrimaryButton>
<PrimaryToggleButton
v-if="isAutoUnlocked"
v-model="isAutobuyerActive"
label="Autobuy IP mult"
class="l--spoon-btn-group__little-spoon o-primary-btn--small-spoon"
/>
</div>
</template>
<style scoped>
</style>

View File

@ -1,70 +0,0 @@
/* eslint-disable max-len */
export const ADevil = {
randomIndex(array) {
let type = array;
// Start with infinity upgrades for now
type = InfinityUpgrade.all;
let current = type.length, random;
while (current > 0) {
random = Math.floor(Math.random() * current);
current--;
[type[current], type[random]] =
[type[random], type[current]];
}
return type;
},
shuffleArray(array) {
for (let i = 0; i < array.length - 1; i++) {
const j = i + Math.floor(Math.random() * (array.length - i));
const temporary = array[j];
array[j] = array[i];
array[i] = temporary;
}
return array;
},
getInfinityUpgradeGrid() {
let upgrades = [
InfinityUpgrade.totalTimeMult, InfinityUpgrade.dim18mult, InfinityUpgrade.dim36mult, InfinityUpgrade.resetBoost,
InfinityUpgrade.buy10Mult, InfinityUpgrade.dim27mult, InfinityUpgrade.dim45mult, InfinityUpgrade.galaxyBoost,
InfinityUpgrade.thisInfinityTimeMult, InfinityUpgrade.unspentIPMult, InfinityUpgrade.dimboostMult,
InfinityUpgrade.ipGen, InfinityUpgrade.skipReset1, InfinityUpgrade.skipReset2, InfinityUpgrade.skipReset3,
InfinityUpgrade.skipResetGalaxy
];
upgrades = ADevil.shuffleArray(upgrades);
const names = [];
for (let i = 0; i < 16; i++) {
names.push(upgrades[i].config.id);
}
player.ADevil.infUpgGridNames = names;
const cl1 = upgrades.splice(0, 4);
const cl2 = upgrades.splice(0, 4);
const cl3 = upgrades.splice(0, 4);
const cl4 = upgrades;
return [
cl1, cl2, cl3, cl4
];
},
canBuyUpgrade(array) {
const upgrades = player.ADevil.infUpgGridNames;
let numbor = 0;
let rangeLow = 0;
for (let i = 0; i < 16; i++) {
if (upgrades[i] === array) {
numbor = i;
rangeLow = 4 * Math.floor(numbor / 4);
}
}
const upgradesToCheck = [];
for (let j = rangeLow; j < numbor; j++) {
upgradesToCheck.push(upgrades[j]);
}
if (InfinityUpgrade.all.filter(u => upgradesToCheck.includes(u.id) && u.isBought).length === numbor - rangeLow) return true;
return false;
}
};

View File

@ -187,7 +187,7 @@ export const Pelle = {
},
get uselessInfinityUpgrades() {
return ["ipGen", "ipMult", "infinitiedGeneration"];
return ["passiveGen", "ipMult", "infinitiedGeneration"];
},
get uselessTimeStudies() {

View File

@ -64,7 +64,6 @@ export * from "./dimensions/time-dimension";
export * from "./time-studies";
export * from "./adevil";
export * from "./dimboost";
export * from "./sacrifice";
export * from "./big-crunch";

View File

@ -29,7 +29,7 @@ export class InfinityUpgradeState extends SetPurchasableMechanicState {
}
get isAvailableForPurchase() {
return ADevil.canBuyUpgrade(this.config.id);
return this.config.checkRequirement?.() ?? true;
}
get isEffectActive() {

View File

@ -44,8 +44,6 @@ import PurgeGlyphModal from "@/components/modals/glyph-management/PurgeGlyphModa
import RefineGlyphModal from "@/components/modals/glyph-management/RefineGlyphModal";
import SacrificeGlyphModal from "@/components/modals/glyph-management/SacrificeGlyphModal";
import ADevilIntroModal from "@/components/modals/ADevilIntroModal";
import AutobuyerEditModal from "@/components/modals/AutobuyerEditModal";
import AutomatorScriptTemplate from "@/components/modals/AutomatorScriptTemplate";
import AwayProgressModal from "@/components/modals/AwayProgressModal";
@ -200,8 +198,6 @@ Modal.startEternityChallenge = new ChallengeConfirmationModal(EternityChallengeS
Modal.startInfinityChallenge = new ChallengeConfirmationModal(InfinityChallengeStartModal);
Modal.startNormalChallenge = new ChallengeConfirmationModal(NormalChallengeStartModal);
Modal.ADevilIntroModal = new TimeModal(ADevilIntroModal, -1);
Modal.catchup = new TimeModal(CatchupModal, -1);
Modal.dimensionBoost = new Modal(DimensionBoostModal, 1, GAME_EVENT.DIMBOOST_AFTER);

View File

@ -759,10 +759,6 @@ window.player = {
showBought: false,
}
},
ADevil: {
modded: false,
infUpgGridNames: {},
},
isGameEnd: false,
tabNotifications: new Set(),
triggeredTabNotificationBits: 0,

View File

@ -19,19 +19,19 @@ GlobalErrorHandler.cleanStart = true;
export function playerInfinityUpgradesOnReset() {
const infinityUpgrades = new Set(
["totalTimeMult", "dibuy10MultmMult", "thisInfinityTimeMult",
"skipReset1", "skipReset2", "unspentIPMult",
"dim27mult", "dim18mult", "dim36mult", "dimboostMult",
"skipReset3", "ipGen", "dim45mult",
["timeMult", "dimMult", "timeMult2",
"skipReset1", "skipReset2", "unspentBonus",
"27Mult", "18Mult", "36Mult", "resetMult",
"skipReset3", "passiveGen", "45Mult",
"resetBoost", "galaxyBoost", "skipResetGalaxy",
"ipOffline"]
);
const breakInfinityUpgrades = new Set(
["totalTimeMult", "buy10Mult", "thisInfinityTimeMult",
"skipReset1", "skipReset2", "unspentIPMult",
"dim27mult", "dim18mult", "dim36mult", "dimboostMult",
"skipReset3", "ipGen", "dim45mult",
["timeMult", "dimMult", "timeMult2",
"skipReset1", "skipReset2", "unspentBonus",
"27Mult", "18Mult", "36Mult", "resetMult",
"skipReset3", "passiveGen", "45Mult",
"resetBoost", "galaxyBoost", "skipResetGalaxy",
"totalMult", "currentMult", "postGalaxy",
"challengeMult", "achievementMult", "infinitiedMult",