mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2025-02-16 15:40:16 +00:00
Add auto-reality modes for time and relic shards
This commit is contained in:
parent
ea4f187982
commit
47a2227cc7
@ -41,12 +41,30 @@ Autobuyer.reality = new class RealityAutobuyerState extends AutobuyerState {
|
||||
this.data.glyph = value;
|
||||
}
|
||||
|
||||
get time() {
|
||||
return this.data.time;
|
||||
}
|
||||
|
||||
set time(value) {
|
||||
this.data.time = value;
|
||||
}
|
||||
|
||||
get shard() {
|
||||
return this.data.shard;
|
||||
}
|
||||
|
||||
set shard(value) {
|
||||
this.data.shard = value;
|
||||
}
|
||||
|
||||
toggleMode() {
|
||||
this.mode = [
|
||||
AUTO_REALITY_MODE.RM,
|
||||
AUTO_REALITY_MODE.GLYPH,
|
||||
AUTO_REALITY_MODE.EITHER,
|
||||
AUTO_REALITY_MODE.BOTH
|
||||
AUTO_REALITY_MODE.BOTH,
|
||||
AUTO_REALITY_MODE.TIME,
|
||||
AUTO_REALITY_MODE.RELIC_SHARD
|
||||
]
|
||||
.nextSibling(this.mode);
|
||||
}
|
||||
@ -74,6 +92,12 @@ Autobuyer.reality = new class RealityAutobuyerState extends AutobuyerState {
|
||||
case AUTO_REALITY_MODE.BOTH:
|
||||
proc = rmProc && glyphProc;
|
||||
break;
|
||||
case AUTO_REALITY_MODE.TIME:
|
||||
proc = player.records.thisReality.realTime / 1000 > this.time;
|
||||
break;
|
||||
case AUTO_REALITY_MODE.RELIC_SHARD:
|
||||
proc = Effarig.shardsGained > this.shard;
|
||||
break;
|
||||
}
|
||||
if (proc) autoReality();
|
||||
}
|
||||
|
@ -215,7 +215,9 @@ window.AUTO_REALITY_MODE = {
|
||||
RM: 0,
|
||||
GLYPH: 1,
|
||||
EITHER: 2,
|
||||
BOTH: 3
|
||||
BOTH: 3,
|
||||
TIME: 4,
|
||||
RELIC_SHARD: 5,
|
||||
};
|
||||
|
||||
// Free tickspeed multiplier with TS171. Shared here because formatting glyph effects depends on it
|
||||
|
@ -62,6 +62,8 @@ window.player = {
|
||||
mode: 0,
|
||||
rm: DC.D1,
|
||||
glyph: 0,
|
||||
time: 0,
|
||||
shard: 0,
|
||||
isActive: false
|
||||
},
|
||||
eternity: {
|
||||
|
@ -23,30 +23,41 @@ export default {
|
||||
return {
|
||||
mode: AUTO_REALITY_MODE.RM,
|
||||
levelCap: 0,
|
||||
isOverCap: false
|
||||
isOverCap: false,
|
||||
hasAlternateInputs: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
autobuyer: () => Autobuyer.reality,
|
||||
modes: () => [
|
||||
AUTO_REALITY_MODE.RM,
|
||||
AUTO_REALITY_MODE.GLYPH,
|
||||
AUTO_REALITY_MODE.EITHER,
|
||||
AUTO_REALITY_MODE.BOTH
|
||||
]
|
||||
hasRelicMode: () => TeresaUnlocks.effarig.canBeApplied,
|
||||
modes() {
|
||||
const availableModes = [
|
||||
AUTO_REALITY_MODE.RM,
|
||||
AUTO_REALITY_MODE.GLYPH,
|
||||
AUTO_REALITY_MODE.EITHER,
|
||||
AUTO_REALITY_MODE.BOTH,
|
||||
AUTO_REALITY_MODE.TIME
|
||||
];
|
||||
if (this.hasRelicMode) availableModes.push(AUTO_REALITY_MODE.RELIC_SHARD);
|
||||
return availableModes;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
update() {
|
||||
this.mode = this.autobuyer.mode;
|
||||
this.levelCap = Glyphs.levelCap;
|
||||
this.isOverCap = this.autobuyer.glyph > this.levelCap;
|
||||
// The container only has room for 2 textboxes, so we switch what they go to based on the current mode
|
||||
this.hasAlternateInputs = Autobuyer.reality.mode > AUTO_REALITY_MODE.BOTH;
|
||||
},
|
||||
modeName(mode) {
|
||||
switch (mode) {
|
||||
case AUTO_REALITY_MODE.RM: return "Reality Machines";
|
||||
case AUTO_REALITY_MODE.GLYPH: return "Glyph level";
|
||||
case AUTO_REALITY_MODE.EITHER: return "Either";
|
||||
case AUTO_REALITY_MODE.BOTH: return "Both";
|
||||
case AUTO_REALITY_MODE.EITHER: return "RM OR Level";
|
||||
case AUTO_REALITY_MODE.BOTH: return "RM AND Level";
|
||||
case AUTO_REALITY_MODE.TIME: return "Real-time seconds";
|
||||
case AUTO_REALITY_MODE.RELIC_SHARD: return "Relic Shards";
|
||||
}
|
||||
throw new Error("Unknown Auto Reality mode");
|
||||
},
|
||||
@ -79,19 +90,29 @@ export default {
|
||||
</ExpandingControlBox>
|
||||
</template>
|
||||
<template #toggleSlot>
|
||||
<div>Target Reality Machines:</div>
|
||||
<div v-if="hasAlternateInputs">
|
||||
Target Time (seconds):
|
||||
</div>
|
||||
<div v-else>
|
||||
Target Reality Machines:
|
||||
</div>
|
||||
<AutobuyerInput
|
||||
:autobuyer="autobuyer"
|
||||
type="decimal"
|
||||
property="rm"
|
||||
:type="hasAlternateInputs ? 'float' : 'decimal'"
|
||||
:property="hasAlternateInputs ? 'time' : 'rm'"
|
||||
/>
|
||||
</template>
|
||||
<template #checkboxSlot>
|
||||
<div>Target Glyph level:</div>
|
||||
<div v-if="hasAlternateInputs && hasRelicMode">
|
||||
Target Relic Shards:
|
||||
</div>
|
||||
<div v-else>
|
||||
Target Glyph level:
|
||||
</div>
|
||||
<AutobuyerInput
|
||||
:autobuyer="autobuyer"
|
||||
type="int"
|
||||
property="glyph"
|
||||
:type="(hasAlternateInputs && hasRelicMode) ? 'float' : 'int'"
|
||||
:property="(hasAlternateInputs && hasRelicMode) ? 'shard' : 'glyph'"
|
||||
/>
|
||||
<div v-if="isOverCap">
|
||||
Autobuyer will trigger at the Glyph level cap of {{ formatInt(levelCap) }}.
|
||||
|
Loading…
Reference in New Issue
Block a user