@@ -87,6 +87,7 @@ export class GameFarm {
|
||||
this._setHost("[data-analytics-host]", this._analyticsHtml(farm));
|
||||
this._setHost("[data-cosmetics-host]", this._cosmeticsHtml(farm));
|
||||
this._setHost("[data-daily-host]", this._dailyHtml(farm));
|
||||
this._setHost("[data-grant-host]", this._grantHtml(farm));
|
||||
this._setHost("[data-quest-host]", this._questsHtml(farm));
|
||||
}
|
||||
this._tick();
|
||||
@@ -128,12 +129,17 @@ export class GameFarm {
|
||||
const ciText = farm.ci_next_tier
|
||||
? `Upgrade to ${farm.ci_next_label} for faster builds`
|
||||
: "CI is at the top tier.";
|
||||
const prestigeBtn = farm.prestige_available
|
||||
? `<form method="post" action="/game/prestige" data-game-action="prestige"><button type="submit" class="btn btn-sm btn-primary" data-confirm="Refactor resets coins, level, CI, extra plots, and perks for a permanent +25% coin bonus. Continue?">Refactor</button></form>`
|
||||
const prestigeBtn = farm.refactor_affordable
|
||||
? `<form method="post" action="/game/prestige" data-game-action="prestige"><button type="submit" class="btn btn-sm btn-primary" data-confirm="Refactoring costs ${farm.refactor_cost}c and resets coins, level, CI, extra plots, and perks for a permanent +25% coin bonus. You carry over ${farm.refactor_carryover_preview}c and keep your Stars and Legacy upgrades. Continue?">Refactor (${farm.refactor_cost}c)</button></form>`
|
||||
: "";
|
||||
const prestigeText = farm.prestige_available
|
||||
? "Reset your farm for a permanent +25% coin bonus."
|
||||
: `Reach level ${farm.prestige_min_level} to refactor.`;
|
||||
let prestigeText;
|
||||
if (!farm.prestige_available) {
|
||||
prestigeText = `Reach level ${farm.prestige_min_level} to refactor.`;
|
||||
} else if (farm.refactor_affordable) {
|
||||
prestigeText = `Pay ${farm.refactor_cost}c to reset your farm for a permanent +25% coin bonus. You keep ${farm.refactor_carryover_pct}% of what remains (${farm.refactor_carryover_preview}c) plus your Stars and Legacy upgrades.`;
|
||||
} else {
|
||||
prestigeText = `Refactoring costs ${farm.refactor_cost}c right now - keep farming to afford it.`;
|
||||
}
|
||||
return (
|
||||
`<div class="shop-row"><div class="shop-info"><strong>CI upgrade</strong><span>${ciText}</span></div>${ciUpgrade}</div>` +
|
||||
`<div class="shop-row"><div class="shop-info"><strong>Refactor (prestige ${farm.prestige})</strong><span>${prestigeText}</span></div>${prestigeBtn}</div>`
|
||||
@@ -226,6 +232,13 @@ export class GameFarm {
|
||||
.join("");
|
||||
}
|
||||
|
||||
_grantHtml(farm) {
|
||||
const action = farm.grant_available
|
||||
? `<form method="post" action="/game/grant" data-game-action="grant"><button type="submit" class="btn btn-sm btn-primary">Claim +${farm.grant_amount}c</button></form>`
|
||||
: `<span class="daily-claimed">${farm.grant_reason}</span>`;
|
||||
return `<p class="daily-streak">Treasury: <strong>${farm.treasury_balance}</strong>c collected from refactor fees</p>${action}`;
|
||||
}
|
||||
|
||||
_dailyHtml(farm) {
|
||||
const action = farm.daily_available
|
||||
? `<form method="post" action="/game/daily" data-game-action="daily"><button type="submit" class="btn btn-sm btn-primary">Claim +${farm.daily_reward}c</button></form>`
|
||||
|
||||
Reference in New Issue
Block a user