mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-10 06:02:13 +00:00
commit
270d22cea1
@ -14,7 +14,7 @@ Vue.component("time-dim-row", {
|
||||
rateOfChange: new Decimal(0),
|
||||
cost: new Decimal(0),
|
||||
isAffordable: false,
|
||||
autobuyers: player.reality.tdbuyers
|
||||
autobuyers: Array.from(player.reality.tdbuyers)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -45,6 +45,7 @@ Vue.component("time-dim-row", {
|
||||
}
|
||||
this.cost.copyFrom(dimension.cost);
|
||||
this.isAffordable = dimension.isAffordable;
|
||||
this.autobuyers = Array.from(player.reality.tdbuyers);
|
||||
},
|
||||
buyTimeDimension() {
|
||||
buyTimeDimension(this.tier);
|
||||
@ -70,4 +71,4 @@ Vue.component("time-dim-row", {
|
||||
@click="buyTimeDimension"
|
||||
>{{buttonContents}}</primary-button>
|
||||
</div>`,
|
||||
});
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ Vue.component("autobuyer-toggles", {
|
||||
case AutoRealityMode.EITHER: return "either";
|
||||
case AutoRealityMode.BOTH: return "both";
|
||||
}
|
||||
throw "Unknown auto reality mode";
|
||||
throw crash("Unknown auto reality mode");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -14,7 +14,7 @@ Vue.component("new-time-dimension-row", {
|
||||
rateOfChange: new Decimal(0),
|
||||
cost: new Decimal(0),
|
||||
isAffordable: false,
|
||||
autobuyers: player.reality.tdbuyers
|
||||
autobuyers: Array.from(player.reality.tdbuyers)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -45,6 +45,7 @@ Vue.component("new-time-dimension-row", {
|
||||
}
|
||||
this.cost.copyFrom(dimension.cost);
|
||||
this.isAffordable = dimension.isAffordable;
|
||||
this.autobuyers = Array.from(player.reality.tdbuyers);
|
||||
},
|
||||
buyTimeDimension() {
|
||||
buyTimeDimension(this.tier);
|
||||
@ -70,4 +71,4 @@ Vue.component("new-time-dimension-row", {
|
||||
@click="buyTimeDimension"
|
||||
>{{buttonContents}}</primary-button>
|
||||
</div>`,
|
||||
});
|
||||
});
|
||||
|
@ -38,5 +38,6 @@ let ui = {
|
||||
newUI: false,
|
||||
newsHidden: false
|
||||
},
|
||||
notationName: ""
|
||||
notationName: "",
|
||||
formatPreBreak: false
|
||||
};
|
||||
|
@ -22,10 +22,10 @@ const AutoEternityMode = {
|
||||
};
|
||||
|
||||
const AutoRealityMode = {
|
||||
RM: 1,
|
||||
GLYPH: 2,
|
||||
EITHER: 3,
|
||||
BOTH: 4
|
||||
RM: 0,
|
||||
GLYPH: 1,
|
||||
EITHER: 2,
|
||||
BOTH: 3
|
||||
};
|
||||
|
||||
// Free tickspeed multiplier with TS171. Shared here because formatting glyph effects depends on it
|
||||
@ -76,7 +76,7 @@ const AutoGlyphSacMode = {
|
||||
ALL: 1,
|
||||
RARITY_THRESHOLDS: 2,
|
||||
ADVANCED: 3,
|
||||
ALCHEMY: 4
|
||||
ALCHEMY: 4
|
||||
}
|
||||
|
||||
const AutoGlyphPickMode = {
|
||||
|
@ -391,7 +391,7 @@ dev.buyAllPerks = function() {
|
||||
}
|
||||
};
|
||||
|
||||
(function(){
|
||||
(function() {
|
||||
let kongTest;
|
||||
const setKongTest = value => {
|
||||
kongTest = value;
|
||||
|
@ -31,10 +31,10 @@ function shortenSmallInteger(value) {
|
||||
}
|
||||
|
||||
function shortenPostBreak(value, places, placesUnder1000) {
|
||||
const currentFormat = Notations.formatPreBreak;
|
||||
Notations.formatPreBreak = false;
|
||||
const currentFormat = ui.formatPreBreak;
|
||||
ui.formatPreBreak = false;
|
||||
const shortened = shorten(value, places, placesUnder1000);
|
||||
Notations.formatPreBreak = currentFormat;
|
||||
ui.formatPreBreak = currentFormat;
|
||||
return shortened;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,14 @@ GameKeyboard.bindRepeatableHotkey("e", () => eternity());
|
||||
|
||||
GameKeyboard.bindHotkey("a", () => Autobuyers.toggle());
|
||||
GameKeyboard.bindHotkey("b", () => BlackHoles.togglePause());
|
||||
GameKeyboard.bindHotkey("u", () => automatorOnOff());
|
||||
GameKeyboard.bindHotkey("u", () => {
|
||||
if (AutomatorBackend.isRunning) {
|
||||
AutomatorBackend.pause();
|
||||
}
|
||||
else if (AutomatorBackend.isOn) {
|
||||
AutomatorBackend.mode = AutomatorMode.RUN;
|
||||
}
|
||||
});
|
||||
|
||||
GameKeyboard.bindHotkey("esc", () => {
|
||||
if (Modal.isOpen) {
|
||||
|
@ -2,11 +2,14 @@
|
||||
|
||||
const GameIntervals = (function() {
|
||||
const interval = (handler, timeout) => {
|
||||
let id;
|
||||
let id = -1;
|
||||
return {
|
||||
start() {
|
||||
id = setInterval(handler, typeof timeout === "function" ? timeout() : timeout);
|
||||
},
|
||||
get isStarted() {
|
||||
return id !== -1;
|
||||
},
|
||||
stop() {
|
||||
clearInterval(id);
|
||||
},
|
||||
|
@ -74,12 +74,11 @@ const Notations = {
|
||||
},
|
||||
get current() {
|
||||
return GameUI.initialized ? ui.notation : Notation.mixedScientific;
|
||||
},
|
||||
formatPreBreak: true
|
||||
}
|
||||
};
|
||||
|
||||
ADNotations.Settings.isInfinite = decimal => Notations.formatPreBreak && decimal.gte(Decimal.MAX_NUMBER);
|
||||
ADNotations.Settings.isInfinite = decimal => ui.formatPreBreak && decimal.gte(Decimal.MAX_NUMBER);
|
||||
|
||||
EventHub.logic.on(GameEvent.GAME_TICK_AFTER, () => {
|
||||
Notations.formatPreBreak = !player.break || (NormalChallenge.isRunning && !Enslaved.isRunning);
|
||||
ui.formatPreBreak = !player.break || (NormalChallenge.isRunning && !Enslaved.isRunning);
|
||||
});
|
||||
|
@ -148,7 +148,9 @@ GameDatabase.achievements.secret = [
|
||||
{
|
||||
id: 42,
|
||||
name: "Was it even broken?",
|
||||
tooltip: '"Fix" your save.'
|
||||
tooltip: '"Fix" your save.',
|
||||
checkRequirement: () => player.secretUnlocks.fixed === "hasbeenfixed",
|
||||
checkEvent: GameEvent.GAME_LOAD
|
||||
},
|
||||
{
|
||||
id: 43,
|
||||
|
@ -59,10 +59,15 @@ GameDatabase.eternity.dilation = (function() {
|
||||
id: 5,
|
||||
cost: 1e9,
|
||||
description: () => {
|
||||
const mult = replicantiMult().pLog10();
|
||||
const ratio = DilationUpgrade.tdMultReplicanti.effectValue.pLog10() / mult;
|
||||
const out = ratio > 0.095 ? "0.1" : ratio.toFixed(2);
|
||||
return `Time Dimensions are affected by Replicanti multiplier ^${out}.`;
|
||||
const rep10 = replicantiMult().pLog10();
|
||||
let multiplier = "0.1";
|
||||
if (rep10 > 9000) {
|
||||
const ratio = DilationUpgrade.tdMultReplicanti.effectValue.pLog10() / rep10;
|
||||
if (ratio < 0.095) {
|
||||
multiplier = ratio.toFixed(2);
|
||||
}
|
||||
}
|
||||
return `Time Dimensions are affected by Replicanti multiplier ^${multiplier}.`;
|
||||
},
|
||||
effect: () => {
|
||||
let rep10 = replicantiMult().pLog10() * 0.1;
|
||||
|
@ -18,7 +18,7 @@ GameDatabase.reality.upgrades = (function() {
|
||||
props.formatCost = value => shorten(value, 2, 0);
|
||||
return props;
|
||||
};
|
||||
const isFirstEternity = () => player.realities > 0 && Player.gainedEternities === 0;
|
||||
const isFirstEternity = () => player.realities > 0 && Player.gainedEternities.eq(0);
|
||||
const isFirstInfinity = () => isFirstEternity() && player.infinitied.eq(0);
|
||||
return [
|
||||
rebuyable({
|
||||
|
@ -424,7 +424,13 @@ GameStorage.devMigrations = {
|
||||
},
|
||||
GameStorage.migrations.convertNewsToSet,
|
||||
GameStorage.migrations.convertEternityCountToDecimal,
|
||||
GameStorage.migrations.renameDimboosts
|
||||
GameStorage.migrations.renameDimboosts,
|
||||
player => {
|
||||
// Reset reality autobuyer mode, since AutoRealityMode was incorrectly starting from 1 and not from 0.
|
||||
// Disable it also to not wreck people's long runs or smth
|
||||
player.auto.reality.mode = 0;
|
||||
player.auto.reality.isActive = false;
|
||||
}
|
||||
],
|
||||
|
||||
patch(player) {
|
||||
|
@ -127,9 +127,6 @@ const GameStorage = {
|
||||
if (player.infinitied.gt(0) && !NormalChallenge(1).isCompleted) {
|
||||
NormalChallenge(1).complete();
|
||||
}
|
||||
if (player.secretUnlocks.fixed === "hasbeenfixed") {
|
||||
SecretAchievement(42).unlock();
|
||||
}
|
||||
|
||||
ui.view.newsHidden = player.options.newsHidden;
|
||||
ui.view.newUI = player.options.newUI;
|
||||
@ -155,5 +152,8 @@ const GameStorage = {
|
||||
}
|
||||
nextTickDiff = player.options.updateRate;
|
||||
GameUI.update();
|
||||
if (GameIntervals.gameLoop.isStarted) {
|
||||
GameIntervals.gameLoop.restart();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -66,6 +66,10 @@ class TabState {
|
||||
Modal.hide();
|
||||
EventHub.dispatch(GameEvent.TAB_CHANGED);
|
||||
}
|
||||
|
||||
resetCurrentSubtab() {
|
||||
this._currentSubtab = this.subtabs[0];
|
||||
}
|
||||
}
|
||||
|
||||
const Tab = GameDatabase.tabs.mapToObject(
|
||||
@ -81,3 +85,9 @@ const Tabs = (function() {
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
EventHub.logic.on(GameEvent.GAME_LOAD, () => {
|
||||
for (const tab of Tabs.all) {
|
||||
tab.resetCurrentSubtab();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user