mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-22 04:05:42 +00:00
Add challenge, shard, and TP tracking to last 10 runs
Make dilation give eternity rewards
This commit is contained in:
parent
47a2227cc7
commit
14f130b4f1
@ -176,8 +176,8 @@ export function getTP(antimatter, requireEternity) {
|
||||
return getBaseTP(antimatter, requireEternity).times(tachyonGainMultiplier());
|
||||
}
|
||||
|
||||
// Returns the amount of TP gained, subtracting out current TP; used only for displaying gained TP
|
||||
// and for "exit dilation" button (saying whether you need more antimatter)
|
||||
// Returns the amount of TP gained, subtracting out current TP; used for displaying gained TP, text on the
|
||||
// "exit dilation" button (saying whether you need more antimatter), and in last 10 eternities
|
||||
export function getTachyonGain(requireEternity) {
|
||||
return getTP(Currency.antimatter.value, requireEternity).minus(Currency.tachyonParticles.value).clampMin(0);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export function eternity(force, auto, specialConditions = {}) {
|
||||
if (!force) {
|
||||
if (!Player.canEternity) return false;
|
||||
EventHub.dispatch(GAME_EVENT.ETERNITY_RESET_BEFORE);
|
||||
if (!player.dilation.active) giveEternityRewards(auto);
|
||||
giveEternityRewards(auto);
|
||||
player.requirementChecks.reality.noEternities = false;
|
||||
}
|
||||
|
||||
|
@ -275,11 +275,11 @@ window.player = {
|
||||
fullGameCompletions: 0,
|
||||
totalAntimatter: DC.E1,
|
||||
lastTenInfinities: Array.range(0, 10).map(() =>
|
||||
[Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE]),
|
||||
[Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE, ""]),
|
||||
lastTenEternities: Array.range(0, 10).map(() =>
|
||||
[Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE]),
|
||||
[Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE, "", DC.D0]),
|
||||
lastTenRealities: Array.range(0, 10).map(() =>
|
||||
[Number.MAX_VALUE, DC.D1, 1, Number.MAX_VALUE, 0]),
|
||||
[Number.MAX_VALUE, DC.D1, 1, Number.MAX_VALUE, 0, "", 0]),
|
||||
thisInfinity: {
|
||||
time: 0,
|
||||
realTime: 0,
|
||||
|
@ -206,15 +206,18 @@ export function averageRun(allRuns, name) {
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
export function addInfinityTime(time, realTime, ip, infinities) {
|
||||
let challenge = "";
|
||||
if (player.challenge.normal.current) challenge = `Normal Challenge ${player.challenge.normal.current}`;
|
||||
if (player.challenge.infinity.current) challenge = `Infinity Challenge ${player.challenge.infinity.current}`;
|
||||
player.records.lastTenInfinities.pop();
|
||||
player.records.lastTenInfinities.unshift([time, ip, infinities, realTime]);
|
||||
player.records.lastTenInfinities.unshift([time, ip, infinities, realTime, challenge]);
|
||||
GameCache.bestRunIPPM.invalidate();
|
||||
}
|
||||
|
||||
export function resetInfinityRuns() {
|
||||
player.records.lastTenInfinities = Array.from(
|
||||
{ length: 10 },
|
||||
() => [Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE]
|
||||
() => [Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE, ""]
|
||||
);
|
||||
GameCache.bestRunIPPM.invalidate();
|
||||
}
|
||||
@ -229,15 +232,24 @@ export function getInfinitiedMilestoneReward(ms, considerMilestoneReached) {
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
export function addEternityTime(time, realTime, ep, eternities) {
|
||||
let challenge = "";
|
||||
if (player.challenge.eternity.current) {
|
||||
const currEC = player.challenge.eternity.current;
|
||||
const ec = EternityChallenge(currEC);
|
||||
challenge = `Eternity Challenge ${currEC} (${formatInt(ec.completions)}/${formatInt(ec.maxCompletions)})`;
|
||||
}
|
||||
if (player.dilation.active) challenge = "Time Dilation";
|
||||
// If we call this function outside of dilation, it uses the existing AM and produces an erroneous number
|
||||
const gainedTP = player.dilation.active ? getTachyonGain() : DC.D0;
|
||||
player.records.lastTenEternities.pop();
|
||||
player.records.lastTenEternities.unshift([time, ep, eternities, realTime]);
|
||||
player.records.lastTenEternities.unshift([time, ep, eternities, realTime, challenge, gainedTP]);
|
||||
GameCache.averageRealTimePerEternity.invalidate();
|
||||
}
|
||||
|
||||
export function resetEternityRuns() {
|
||||
player.records.lastTenEternities = Array.from(
|
||||
{ length: 10 },
|
||||
() => [Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE]
|
||||
() => [Number.MAX_VALUE, DC.D1, DC.D1, Number.MAX_VALUE, "", DC.D0]
|
||||
);
|
||||
GameCache.averageRealTimePerEternity.invalidate();
|
||||
}
|
||||
@ -262,8 +274,14 @@ export function getOfflineEPGain(ms) {
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
export function addRealityTime(time, realTime, rm, level, realities) {
|
||||
let reality = "";
|
||||
const celestials = [Teresa, Effarig, Enslaved, V, Ra, Laitela];
|
||||
for (const cel of celestials) {
|
||||
if (cel.isRunning) reality = `${cel.possessiveName} Reality`;
|
||||
}
|
||||
const shards = Effarig.shardsGained;
|
||||
player.records.lastTenRealities.pop();
|
||||
player.records.lastTenRealities.unshift([time, rm, realities, realTime, level]);
|
||||
player.records.lastTenRealities.unshift([time, rm, realities, realTime, level, reality, shards]);
|
||||
}
|
||||
|
||||
export function gainedInfinities() {
|
||||
|
@ -79,6 +79,12 @@ export default {
|
||||
const gameTimeString = this.runTime(run);
|
||||
const realTimeString = this.isRealityUnlocked ? ` (${this.realRunTime(run)} real time)` : "";
|
||||
return `${gameTimeString}${realTimeString}`;
|
||||
},
|
||||
runChallenge(run) {
|
||||
return this.singular === "Reality" ? run[5] : run[4];
|
||||
},
|
||||
gainedTP(run) {
|
||||
return (this.singular === "Eternity" && Decimal.neq(run[5], 0)) ? format(run[5], 2, 2) : null;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -120,6 +126,12 @@ export default {
|
||||
{{ prestigeCountReward(runPrestigeCountGain(run, false), run) }},
|
||||
{{ averageRunGain(run, 2, plural) }}
|
||||
</span>
|
||||
<span v-if="gainedTP(run)">
|
||||
and {{ gainedTP(run) }} TP
|
||||
</span>
|
||||
<span v-if="runChallenge(run)">
|
||||
({{ runChallenge(run) }})
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
|
Loading…
Reference in New Issue
Block a user