Skip to content

Commit

Permalink
style: Fix some typos in code
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jan 26, 2023
1 parent c9a19a2 commit c0b6e88
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
"chronospheres",
"cinfo",
"Craftable",
"cryo",
"Cryochamber",
"Cryochambers",
"Cryptotheology",
"cwarn",
"devcontainer",
"eludium",
Expand All @@ -52,22 +54,28 @@
"nagas",
"nbsp",
"necrocorn",
"necrocorns",
"Numeromancy",
"oliversalzburg",
"POSIX",
"prio",
"promotekittens",
"railguns",
"redmoon",
"savegame",
"solarfarm",
"Stackable",
"starchart",
"Steamworks",
"sunspire",
"Tampermonkey",
"Toggleable",
"tradepost",
"typecheck",
"ucfirst",
"unobtainium",
"userscript",
"Ziggurath"
"Ziggurath",
"zigguraths"
]
}
16 changes: 8 additions & 8 deletions packages/userscript/source/ReligionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class ReligionManager implements Automation {
// We now want to determine how quickly the cost of given building is neutralized
// by its effect on production of unicorns.

let bestAmoritization = Infinity;
let bestAmortization = Infinity;
let bestBuilding: ZiggurathUpgrades | null = null;
const unicornsPerTickBase = mustExist(
this._host.gamePage.bld.getBuildingExt("unicornPasture").meta.effects["unicornsPerTickBase"]
Expand All @@ -316,8 +316,8 @@ export class ReligionManager implements Automation {
// set it as the default. This is likely to protect against cases where
// production of unicorns is 0.
const pastureAmortization = mustExist(pastureButton.model.prices)[0].val / pastureProduction;
if (pastureAmortization < bestAmoritization) {
bestAmoritization = pastureAmortization;
if (pastureAmortization < bestAmortization) {
bestAmortization = pastureAmortization;
bestBuilding = "unicornPasture";
}

Expand Down Expand Up @@ -366,9 +366,9 @@ export class ReligionManager implements Automation {
buildingProduction += riftBonus;
const amortization = unicornPrice / buildingProduction;

if (amortization < bestAmoritization) {
if (amortization < bestAmortization) {
if (0 < riftBonus || (religionRatio < religionBonus && 0 < unicornPrice)) {
bestAmoritization = amortization;
bestAmortization = amortization;
bestBuilding = button.id;
}
}
Expand Down Expand Up @@ -660,7 +660,7 @@ export class ReligionManager implements Automation {
// Transcend
if (transcendenceReached) {
// How much our adoration ratio increases from transcending.
const adoreIncreaceRatio = Math.pow(
const adoreIncreaseRatio = Math.pow(
(transcendenceTierCurrent + 2) / (transcendenceTierCurrent + 1),
2
);
Expand All @@ -669,10 +669,10 @@ export class ReligionManager implements Automation {
this._host.gamePage.religion._getTranscendTotalPrice(transcendenceTierCurrent + 1) -
this._host.gamePage.religion._getTranscendTotalPrice(transcendenceTierCurrent);

// We want to determine the ideal value for when to trancend.
// We want to determine the ideal value for when to transcend.
// TODO: How exactly this works isn't understood yet.
const x = needNextLevel;
const k = adoreIncreaceRatio;
const k = adoreIncreaseRatio;
const epiphanyRecommend =
((1 - k + Math.sqrt(80 * (k * k - 1) * x + (k - 1) * (k - 1))) * k) /
(40 * (k + 1) * (k + 1) * (k - 1)) +
Expand Down
7 changes: 4 additions & 3 deletions packages/userscript/source/TradeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export class TradeManager implements Automation {
}
} else {
// We can reach this branch if we have partial necrocorns from resets.
// The partial necrocorns will then be fead to the elders to bring us back
// The partial necrocorns will then be feed to the elders to bring us back
// to even zero.
if (0.25 * (1 + this._host.gamePage.getEffect("corruptionBoostRatio")) < 1) {
this._host.engine.storeForSummary("feed", necrocorns.value);
Expand Down Expand Up @@ -538,7 +538,8 @@ export class TradeManager implements Automation {

// All of this code is straight-forward. Buy low, sell high.

// Exchanges up to a certain threshold, in order to keep a good exchange rate, then waits for a higher treshold before exchanging for relics.
// Exchanges up to a certain threshold, in order to keep a good exchange rate, then waits
// for a higher threshold before exchanging for relics.
if (
coinPrice < (this.settings.tradeBlackcoin.buy ?? 950.0) &&
(this.settings.tradeBlackcoin.trigger ?? 0) < relicsInitial
Expand Down Expand Up @@ -628,7 +629,7 @@ export class TradeManager implements Automation {
}

// Add to the cost.
// We consider all resources to be equal in the profatibility calculation.
// We consider all resources to be equal in the profitability calculation.
// We just add the cost of the resource, divided by how much of it we're
// producing. So resources that we produce a lot of, don't "cost" as much.
cost += amount / tick;
Expand Down
2 changes: 1 addition & 1 deletion packages/userscript/source/helper/BulkPurchaseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export class BulkPurchaseHelper {
}

/**
* Determing the price modifier for the given building.
* Determine the price modifier for the given building.
*
* @param data The building metadata.
* @param source The tab the building belongs to.
Expand Down

0 comments on commit c0b6e88

Please sign in to comment.