Fix extra commas in formatWithCommas(), alchemy text fixes

Fixes #189
This commit is contained in:
SpectralFlame 2019-07-16 17:09:42 -05:00 committed by Andrei Andreev
parent 7225c66c7d
commit 591e80785e
3 changed files with 8 additions and 15 deletions

View File

@ -19,17 +19,7 @@ Vue.component("alchemy-resource-info", {
return this.resource.isBaseResource;
},
reactionText() {
if (this.resource === AlchemyResource.reality) return this.realityReactionText;
const reagents = this.reaction.reagents
.map(r => `${r.cost}${r.resource.symbol}`)
.join(" + ");
return `${reagents}${this.reactionProduction}${this.resource.symbol}`;
},
realityReactionText() {
const reagents = this.reaction.reagents
.map(r => r.resource.symbol)
.join(" + ");
return `${reagents}${this.resource.symbol}`;
return this.resource.reactionText;
},
effectConfig() {
const resource = this.resource;

View File

@ -32,12 +32,12 @@ Vue.component("reality-glyph-creation", {
return [
{
desc: `At least ${shortenSmallInteger(5000)} Reality consumed for this glyph (Currently ` +
`${AlchemyResource.reality.amount.toFixed(1)})`,
`${shortenSmallInteger(AlchemyResource.reality.amount)})`,
value: AlchemyResource.reality.amount >= 5000
},
{
desc: `${shortenSmallInteger(150000)} total of all other alchemy resources (Currently ` +
`${sumOfOtherAlchemyResources.toFixed(1)})`,
`${shortenSmallInteger(sumOfOtherAlchemyResources)})`,
value: sumOfOtherAlchemyResources >= 150000
},
{
@ -60,7 +60,8 @@ Vue.component("reality-glyph-creation", {
Glyphs.addToInventory(GlyphGenerator.realityGlyph(
{ actualLevel: this.realityGlyphLevel, rawLevel: this.realityGlyphLevel }, this.selectedEffects));
AlchemyResources.resetAmount();
if (player.celestials.effarig.relicShards >= 1e30) {
// If the player leaves a choice open, don't spend shards
if (player.celestials.effarig.relicShards >= 1e30 && (this.selectedEffects === this.calculateMaxEffects())) {
player.celestials.effarig.relicShards -= 1e30;
}
},

View File

@ -63,5 +63,7 @@ function timeDisplayShort(ms) {
const commaRegexp = /\B(?=(\d{3})+(?!\d))/gu;
function formatWithCommas(value) {
return value.toString().replace(commaRegexp, ",");
const decimalPointSplit = value.toString().split(".");
decimalPointSplit[0] = decimalPointSplit[0].replace(commaRegexp, ",");
return decimalPointSplit.join(".");
}