Add mastery data for last four days

This commit is contained in:
Seth Posner 2022-12-16 16:58:22 -08:00
parent e9d45cae02
commit 3c9e2be650
5 changed files with 282 additions and 17 deletions

View file

@ -18,7 +18,7 @@ import {
createSequentialModifier,
Modifier
} from "game/modifiers";
import { NonPersistent, noPersist, Persistent } from "game/persistence";
import { NonPersistent, noPersist, persistent, Persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { WithRequired } from "util/common";
import { Computable, convertComputable } from "util/computed";
@ -780,6 +780,45 @@ const layer = createLayer(id, function (this: BaseLayer) {
ignoreTotal: true
});
const mastery = {
dyes: {
red: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
},
green: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
},
blue: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
},
yellow: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
},
purple: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
},
orange: {
amount: persistent<DecimalSource>(0),
buyable: { amount: persistent<DecimalSource>(0) }
}
},
upgrades: {
blueDyeUpg: { bought: persistent<boolean>(false) },
redDyeUpg: { bought: persistent<boolean>(false) },
yellowDyeUpg: { bought: persistent<boolean>(false) },
yellowDyeUpg2: { bought: persistent<boolean>(false) },
redDyeUpg2: { bought: persistent<boolean>(false) },
blueDyeUpg2: { bought: persistent<boolean>(false) },
coalUpg: { bought: persistent<boolean>(false) }
}
};
const mastered = persistent<boolean>(false);
return {
name,
color,
@ -810,7 +849,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
</div>
{render(upgrades.coalUpg)}
</>
))
)),
mastery,
mastered
};
});

View file

@ -253,6 +253,23 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
const mastery = {
letters: persistent<DecimalSource>(0),
totalLetters: persistent<DecimalSource>(0),
buyables: {
metalBuyable: { amount: persistent<DecimalSource>(0) },
plasticBuyable: { amount: persistent<DecimalSource>(0) },
paperBuyable: { amount: persistent<DecimalSource>(0) }
},
milestones: {
autoSmeltingMilestone: { earned: persistent<boolean>(false) },
miningMilestone: { earned: persistent<boolean>(false) },
synergyMilestone: { earned: persistent<boolean>(false) },
industrialCrucibleMilestone: { earned: persistent<boolean>(false) }
}
};
const mastered = persistent<boolean>(false);
return {
name,
day,
@ -281,11 +298,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
{milestonesDisplay()}
</>
)),
minimizedDisplay: jsx(() => (
<div>
{name} - {format(letters.value)} {letters.displayName}
</div>
))
minimizedDisplay: jsx(() => (<div>{name} - {format(letters.value)} {letters.displayName}</div>)),
mastery,
mastered
};
});

View file

@ -1653,6 +1653,191 @@ const layer = createLayer(id, () => {
}
});
const mastery = {
elfTraining: {
bonfireElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
boxElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
clothElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
coalDrillElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
cutterElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
expandersElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
fertilizerElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
heatedCutterElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
heatedPlanterElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
heavyDrillElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
kilnElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
metalElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
oilElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
paperElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
planterElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
},
smallfireElfTraining: {
exp: persistent<DecimalSource>(0),
milestones: [
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) },
{ earned: persistent<boolean>(false) }
]
}
},
teaching: { bought: persistent<boolean>(false) },
schools: { amount: persistent<DecimalSource>(0) },
classrooms: { amount: persistent<DecimalSource>(0) },
classroomUpgrade: { bought: persistent<boolean>(false) },
advancedUpgrade: { bought: persistent<boolean>(false) },
upgrades: {
focus1: { bought: persistent<boolean>(false) },
focus2: { bought: persistent<boolean>(false) },
focus3: { bought: persistent<boolean>(false) }
},
upgrades2: {
focus4: { bought: persistent<boolean>(false) },
focus5: { bought: persistent<boolean>(false) },
focus6: { bought: persistent<boolean>(false) }
},
focusMulti: persistent<DecimalSource>(1),
focusTargets: persistent<Record<string, boolean>>({}),
focusCooldown: persistent<number>(0),
focusTime: persistent<number>(0)
};
const mastered = persistent<boolean>(false);
// ------------------------------------------------------------------------------- Return
return {
@ -1727,7 +1912,10 @@ const layer = createLayer(id, () => {
""
)}
</>
))
)),
mastery,
mastered
};
});

View file

@ -311,6 +311,29 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
const mastery = {
plastic: persistent<DecimalSource>(0),
totalPlastic: persistent<DecimalSource>(0),
activeRefinery: persistent<DecimalSource>(0),
buildRefinery: { amount: persistent<DecimalSource>(0) },
upgrades: {
paperTools: { bought: persistent<boolean>(false) },
boxTools: { bought: persistent<boolean>(false) },
clothTools: { bought: persistent<boolean>(false) }
},
elfUpgrades: {
paperElf: { bought: persistent<boolean>(false) },
boxElf: { bought: persistent<boolean>(false) },
clothElf: { bought: persistent<boolean>(false) }
},
buyables: {
passivePaper: { amount: persistent<DecimalSource>(0) },
passiveBoxes: { amount: persistent<DecimalSource>(0) },
clothGains: { amount: persistent<DecimalSource>(0) }
}
};
const mastered = persistent<boolean>(false);
return {
name,
color,
@ -354,11 +377,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
</Row>
</>
)),
minimizedDisplay: jsx(() => (
<div>
{name} - {format(plastic.value)} {plastic.displayName}
</div>
))
minimizedDisplay: jsx(() => (<div>{name} - {format(plastic.value)} {plastic.displayName}</div>)),
mastery,
mastered
};
});

View file

@ -88,10 +88,10 @@ export const main = createLayer("main", function (this: BaseLayer) {
metal,
cloth,
oil,
// plastic,
// dyes,
// management,
// letters
plastic,
dyes,
management,
letters
]) { swapMastery(layer.mastery, layer) }
swappingMastery.value = false;