@kitten-science/kitten-scientists 2.0.0-beta.11-dev.20250528141240 → 2.0.0-beta.11-nightly.20250605
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BonfireManager.d.ts +2 -6
- package/lib/BonfireManager.d.ts.map +1 -1
- package/lib/BonfireManager.js +11 -33
- package/lib/BonfireManager.js.map +1 -1
- package/lib/Engine.d.ts +7 -2
- package/lib/Engine.d.ts.map +1 -1
- package/lib/Engine.js +8 -8
- package/lib/Engine.js.map +1 -1
- package/lib/KittenScientists.d.ts.map +1 -1
- package/lib/KittenScientists.js +0 -3
- package/lib/KittenScientists.js.map +1 -1
- package/lib/ReligionManager.d.ts +3 -5
- package/lib/ReligionManager.d.ts.map +1 -1
- package/lib/ReligionManager.js +93 -92
- package/lib/ReligionManager.js.map +1 -1
- package/lib/ScienceManager.d.ts +0 -3
- package/lib/ScienceManager.d.ts.map +1 -1
- package/lib/ScienceManager.js +2 -8
- package/lib/ScienceManager.js.map +1 -1
- package/lib/SpaceManager.d.ts +2 -5
- package/lib/SpaceManager.d.ts.map +1 -1
- package/lib/SpaceManager.js +9 -33
- package/lib/SpaceManager.js.map +1 -1
- package/lib/TimeControlManager.d.ts +0 -3
- package/lib/TimeControlManager.d.ts.map +1 -1
- package/lib/TimeControlManager.js +2 -5
- package/lib/TimeControlManager.js.map +1 -1
- package/lib/TimeManager.d.ts +1 -5
- package/lib/TimeManager.d.ts.map +1 -1
- package/lib/TimeManager.js +14 -26
- package/lib/TimeManager.js.map +1 -1
- package/lib/TradeManager.d.ts +1 -10
- package/lib/TradeManager.d.ts.map +1 -1
- package/lib/TradeManager.js +0 -24
- package/lib/TradeManager.js.map +1 -1
- package/lib/UpgradeManager.d.ts +0 -2
- package/lib/UpgradeManager.d.ts.map +1 -1
- package/lib/UpgradeManager.js.map +1 -1
- package/lib/VillageManager.d.ts +2 -5
- package/lib/VillageManager.d.ts.map +1 -1
- package/lib/VillageManager.js +26 -20
- package/lib/VillageManager.js.map +1 -1
- package/lib/WorkshopManager.d.ts +4 -10
- package/lib/WorkshopManager.d.ts.map +1 -1
- package/lib/WorkshopManager.js +51 -40
- package/lib/WorkshopManager.js.map +1 -1
- package/lib/i18n/en-US.json +1 -0
- package/lib/settings/EngineSettings.d.ts +6 -1
- package/lib/settings/EngineSettings.d.ts.map +1 -1
- package/lib/settings/EngineSettings.js +8 -1
- package/lib/settings/EngineSettings.js.map +1 -1
- package/lib/settings/ResetUpgradeSettings.d.ts +1 -1
- package/lib/settings/TechSettings.d.ts +1 -1
- package/lib/settings/UpgradeSettings.d.ts +3 -2
- package/lib/settings/UpgradeSettings.d.ts.map +1 -1
- package/lib/settings/UpgradeSettings.js +1 -0
- package/lib/settings/UpgradeSettings.js.map +1 -1
- package/lib/types/core.d.ts +4 -4
- package/lib/types/core.d.ts.map +1 -1
- package/lib/types/game.d.ts +50 -1
- package/lib/types/game.d.ts.map +1 -1
- package/lib/types/index.d.ts +59 -3
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +15 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/time.d.ts +5 -2
- package/lib/types/time.d.ts.map +1 -1
- package/lib/ui/InternalsUi.d.ts.map +1 -1
- package/lib/ui/InternalsUi.js +1 -0
- package/lib/ui/InternalsUi.js.map +1 -1
- package/output/kitten-scientists-0.0.0-ci.min.user.js +8 -8
- package/output/kitten-scientists-0.0.0-ci.min.user.js.map +1 -1
- package/output/kitten-scientists-0.0.0-ci.user.js +229 -262
- package/output/kitten-scientists-0.0.0-ci.user.js.map +1 -1
- package/output/kitten-scientists-loader-0.0.0-ci.min.user.js +1 -1
- package/output/kitten-scientists-loader-0.0.0-ci.min.user.js.map +1 -1
- package/output/kitten-scientists-loader-0.0.0-ci.user.js +1 -1
- package/output/kitten-scientists.inject.js +16890 -15439
- package/output/kitten-scientists.inject.js.map +1 -1
- package/output/kitten-scientists.min.inject.js +11 -11
- package/output/kitten-scientists.min.inject.js.map +1 -1
- package/package.json +4 -5
- package/lib/TabManager.d.ts +0 -10
- package/lib/TabManager.d.ts.map +0 -1
- package/lib/TabManager.js +0 -21
- package/lib/TabManager.js.map +0 -1
|
@@ -1789,35 +1789,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1789
1789
|
this.upgradeBuildings.load(settings.upgradeBuildings);
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
|
-
class TabManager {
|
|
1793
|
-
constructor(host, name) {
|
|
1794
|
-
__publicField(this, "_host");
|
|
1795
|
-
__publicField(this, "tab");
|
|
1796
|
-
this._host = host;
|
|
1797
|
-
const tab = this._host.game.tabs.find((subject) => subject.tabId === name);
|
|
1798
|
-
if (isNil(tab)) {
|
|
1799
|
-
throw new Error(`Unable to find tab ${name}`);
|
|
1800
|
-
}
|
|
1801
|
-
this.tab = tab;
|
|
1802
|
-
this.render();
|
|
1803
|
-
}
|
|
1804
|
-
render() {
|
|
1805
|
-
if (this._host.game.ui.activeTabId !== this.tab.tabId) {
|
|
1806
|
-
this.tab.render();
|
|
1807
|
-
}
|
|
1808
|
-
return this;
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
1792
|
class BonfireManager {
|
|
1812
1793
|
constructor(host, workshopManager, settings = new BonfireSettings()) {
|
|
1813
1794
|
__publicField(this, "_host");
|
|
1814
1795
|
__publicField(this, "settings");
|
|
1815
|
-
__publicField(this, "manager");
|
|
1816
1796
|
__publicField(this, "_bulkManager");
|
|
1817
1797
|
__publicField(this, "_workshopManager");
|
|
1818
1798
|
this._host = host;
|
|
1819
1799
|
this.settings = settings;
|
|
1820
|
-
this.manager = new TabManager(this._host, "Bonfire");
|
|
1821
1800
|
this._workshopManager = workshopManager;
|
|
1822
1801
|
this._bulkManager = new BulkPurchaseHelper(this._host, this._workshopManager);
|
|
1823
1802
|
}
|
|
@@ -1825,7 +1804,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1825
1804
|
if (!this.settings.enabled) {
|
|
1826
1805
|
return;
|
|
1827
1806
|
}
|
|
1828
|
-
this.manager.render();
|
|
1829
1807
|
this.autoBuild(context);
|
|
1830
1808
|
this.autoMisc(context);
|
|
1831
1809
|
}
|
|
@@ -1833,7 +1811,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1833
1811
|
const bulkManager = this._bulkManager;
|
|
1834
1812
|
const metaData = {};
|
|
1835
1813
|
for (const build of Object.values(builds)) {
|
|
1836
|
-
metaData[build.building] = this.
|
|
1814
|
+
metaData[build.building] = this._host.game.bld.getBuildingExt(
|
|
1837
1815
|
build.baseBuilding ?? build.building
|
|
1838
1816
|
).meta;
|
|
1839
1817
|
}
|
|
@@ -1853,7 +1831,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1853
1831
|
if (this._workshopManager.getPotentialCatnip(true, 0, aqueducts) > 0) {
|
|
1854
1832
|
const prices = mustExist(pastureMeta.stages)[1].prices;
|
|
1855
1833
|
if (this._bulkManager.singleBuildPossible(pastureMeta, prices, 1)) {
|
|
1856
|
-
const button2 = this.
|
|
1834
|
+
const button2 = this.getBuild("pasture", 0);
|
|
1857
1835
|
if (!isNil(button2 == null ? void 0 : button2.model)) {
|
|
1858
1836
|
button2.controller.sellInternal(button2.model, 0, false);
|
|
1859
1837
|
pastureMeta.on = 0;
|
|
@@ -1872,7 +1850,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1872
1850
|
if (this._workshopManager.getPotentialCatnip(true, pastures, 0) > 0) {
|
|
1873
1851
|
const prices = mustExist(aqueductMeta.stages)[1].prices;
|
|
1874
1852
|
if (this._bulkManager.singleBuildPossible(aqueductMeta, prices, 1)) {
|
|
1875
|
-
const button2 = this.
|
|
1853
|
+
const button2 = this.getBuild("aqueduct", 0);
|
|
1876
1854
|
if (!isNil(button2 == null ? void 0 : button2.model)) {
|
|
1877
1855
|
button2.controller.sellInternal(button2.model, 0, false);
|
|
1878
1856
|
aqueductMeta.on = 0;
|
|
@@ -1903,7 +1881,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1903
1881
|
if (this._host.game.resPool.energyProd >= this._host.game.resPool.energyCons + energyConsumptionRate * libraryMeta.val / libToDat) {
|
|
1904
1882
|
const prices = mustExist(libraryMeta.stages)[1].prices;
|
|
1905
1883
|
if (this._bulkManager.singleBuildPossible(libraryMeta, prices, 1)) {
|
|
1906
|
-
const button2 = mustExist(this.
|
|
1884
|
+
const button2 = mustExist(this.getBuild("library", 0));
|
|
1907
1885
|
if (isNil(button2.model)) {
|
|
1908
1886
|
return;
|
|
1909
1887
|
}
|
|
@@ -1924,7 +1902,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1924
1902
|
if (this.settings.upgradeBuildings.buildings.spaceport.enabled && warehouseMeta.unlocked && warehouseMeta.stage === 0 && mustExist(warehouseMeta.stages)[1].stageUnlocked) {
|
|
1925
1903
|
const prices = mustExist(warehouseMeta.stages)[1].prices;
|
|
1926
1904
|
if (this._bulkManager.singleBuildPossible(warehouseMeta, prices, 1)) {
|
|
1927
|
-
const button2 = this.
|
|
1905
|
+
const button2 = this.getBuild("warehouse", 0);
|
|
1928
1906
|
if (!isNil(button2 == null ? void 0 : button2.model)) {
|
|
1929
1907
|
button2.controller.sellInternal(button2.model, 0, false);
|
|
1930
1908
|
warehouseMeta.on = 0;
|
|
@@ -1942,7 +1920,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1942
1920
|
if (this.settings.upgradeBuildings.buildings.broadcasttower.enabled && amphitheatreMeta.unlocked && amphitheatreMeta.stage === 0 && mustExist(amphitheatreMeta.stages)[1].stageUnlocked) {
|
|
1943
1921
|
const prices = mustExist(amphitheatreMeta.stages)[1].prices;
|
|
1944
1922
|
if (this._bulkManager.singleBuildPossible(amphitheatreMeta, prices, 1)) {
|
|
1945
|
-
const button2 = this.
|
|
1923
|
+
const button2 = this.getBuild("amphitheatre", 0);
|
|
1946
1924
|
if (!isNil(button2 == null ? void 0 : button2.model)) {
|
|
1947
1925
|
button2.controller.sellInternal(button2.model, 0, false);
|
|
1948
1926
|
amphitheatreMeta.on = 0;
|
|
@@ -1960,30 +1938,21 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1960
1938
|
if (this.settings.turnOnSteamworks.enabled) {
|
|
1961
1939
|
const steamworks = this._host.game.bld.getBuildingExt("steamworks");
|
|
1962
1940
|
if (steamworks.meta.val && steamworks.meta.on === 0) {
|
|
1963
|
-
const button2 =
|
|
1964
|
-
if (isNil(button2.model)) {
|
|
1965
|
-
return;
|
|
1966
|
-
}
|
|
1941
|
+
const button2 = this.getBuild("steamworks");
|
|
1967
1942
|
button2.controller.onAll(button2.model);
|
|
1968
1943
|
}
|
|
1969
1944
|
}
|
|
1970
1945
|
if (this.settings.turnOnMagnetos.enabled) {
|
|
1971
1946
|
const magnetos = this._host.game.bld.getBuildingExt("magneto");
|
|
1972
1947
|
if (magnetos.meta.val && magnetos.meta.on < magnetos.meta.val) {
|
|
1973
|
-
const button2 =
|
|
1974
|
-
if (isNil(button2.model)) {
|
|
1975
|
-
return;
|
|
1976
|
-
}
|
|
1948
|
+
const button2 = this.getBuild("magneto");
|
|
1977
1949
|
button2.controller.onAll(button2.model);
|
|
1978
1950
|
}
|
|
1979
1951
|
}
|
|
1980
1952
|
if (this.settings.turnOnReactors.enabled) {
|
|
1981
1953
|
const reactors = this._host.game.bld.getBuildingExt("reactor");
|
|
1982
1954
|
if (reactors.meta.val && reactors.meta.on < reactors.meta.val) {
|
|
1983
|
-
const button2 =
|
|
1984
|
-
if (isNil(button2.model)) {
|
|
1985
|
-
return;
|
|
1986
|
-
}
|
|
1955
|
+
const button2 = this.getBuild("reactor");
|
|
1987
1956
|
button2.controller.onAll(button2.model);
|
|
1988
1957
|
}
|
|
1989
1958
|
}
|
|
@@ -1995,11 +1964,8 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1995
1964
|
}
|
|
1996
1965
|
}
|
|
1997
1966
|
autoGather() {
|
|
1998
|
-
const controller = new classes.game.ui.GatherCatnipButtonController(
|
|
1999
|
-
this._host.game
|
|
2000
|
-
);
|
|
2001
1967
|
for (let clicks = 0; clicks < Math.floor(this._host.engine.settings.interval / 20); ++clicks) {
|
|
2002
|
-
|
|
1968
|
+
this._host.game.bld.gatherCatnip();
|
|
2003
1969
|
}
|
|
2004
1970
|
}
|
|
2005
1971
|
build(name, _stage3, amount) {
|
|
@@ -2054,13 +2020,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
2054
2020
|
);
|
|
2055
2021
|
}
|
|
2056
2022
|
}
|
|
2057
|
-
|
|
2058
|
-
return meta.stages && !isNil(stage) ? meta.stages[stage].label : mustExist(meta.label);
|
|
2059
|
-
}
|
|
2060
|
-
getBuild(name) {
|
|
2061
|
-
return this._host.game.bld.getBuildingExt(name);
|
|
2062
|
-
}
|
|
2063
|
-
getBuildButton(name, stage = 0) {
|
|
2023
|
+
getBuild(name, stage = 0) {
|
|
2064
2024
|
const metaRaw = game.bld.get(name);
|
|
2065
2025
|
const buildingMeta = new classes.BuildingMeta(metaRaw).getMeta();
|
|
2066
2026
|
const meta = !isNil(buildingMeta.stages) ? buildingMeta.stages[stage] : metaRaw;
|
|
@@ -2451,6 +2411,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
2451
2411
|
"ui.engine": "Enable Kitten Scientists",
|
|
2452
2412
|
"ui.faith": "Religion",
|
|
2453
2413
|
"ui.filter": "Log Filters",
|
|
2414
|
+
"ui.highlightStock": "Highlight resource stock",
|
|
2454
2415
|
"ui.infinity": "∞",
|
|
2455
2416
|
"ui.internals": "Internals",
|
|
2456
2417
|
"ui.internals.interval": "Interval: {0}",
|
|
@@ -3730,13 +3691,11 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3730
3691
|
constructor(host, bonfireManager, workshopManager, settings = new ReligionSettings()) {
|
|
3731
3692
|
__publicField(this, "_host");
|
|
3732
3693
|
__publicField(this, "settings");
|
|
3733
|
-
__publicField(this, "manager");
|
|
3734
3694
|
__publicField(this, "_bulkManager");
|
|
3735
3695
|
__publicField(this, "_bonfireManager");
|
|
3736
3696
|
__publicField(this, "_workshopManager");
|
|
3737
3697
|
this._host = host;
|
|
3738
3698
|
this.settings = settings;
|
|
3739
|
-
this.manager = new TabManager(this._host, "Religion");
|
|
3740
3699
|
this._workshopManager = workshopManager;
|
|
3741
3700
|
this._bulkManager = new BulkPurchaseHelper(this._host, this._workshopManager);
|
|
3742
3701
|
this._bonfireManager = bonfireManager;
|
|
@@ -3745,7 +3704,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3745
3704
|
if (!this.settings.enabled) {
|
|
3746
3705
|
return;
|
|
3747
3706
|
}
|
|
3748
|
-
this.manager.render();
|
|
3749
3707
|
this._autoBuild(context);
|
|
3750
3708
|
if (this.settings.sacrificeUnicorns.enabled) {
|
|
3751
3709
|
await this._autoSacrificeUnicorns();
|
|
@@ -3787,7 +3745,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3787
3745
|
}
|
|
3788
3746
|
}
|
|
3789
3747
|
_buildBestUnicornBuilding() {
|
|
3790
|
-
var _a2, _b;
|
|
3791
3748
|
const bestUnicornBuilding = this.getBestUnicornBuilding();
|
|
3792
3749
|
if (this.settings.bestUnicornBuildingCurrent !== bestUnicornBuilding) {
|
|
3793
3750
|
this.settings.bestUnicornBuildingCurrent = bestUnicornBuilding;
|
|
@@ -3800,33 +3757,46 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3800
3757
|
if (this.settings.bestUnicornBuildingCurrent === "unicornPasture") {
|
|
3801
3758
|
this._bonfireManager.build(this.settings.bestUnicornBuildingCurrent, 0, 1);
|
|
3802
3759
|
} else {
|
|
3803
|
-
const
|
|
3760
|
+
const buildImpl = this._getBuild(
|
|
3804
3761
|
this.settings.bestUnicornBuildingCurrent,
|
|
3805
3762
|
UnicornItemVariant.Ziggurat
|
|
3806
3763
|
);
|
|
3807
|
-
if (isNil(buildingButton == null ? void 0 : buildingButton.model)) {
|
|
3808
|
-
return;
|
|
3809
|
-
}
|
|
3810
3764
|
let tearsNeeded = 0;
|
|
3811
|
-
const priceTears = mustExist(
|
|
3765
|
+
const priceTears = mustExist(buildImpl.model.prices).find(
|
|
3812
3766
|
(subject) => subject.name === "tears"
|
|
3813
3767
|
);
|
|
3814
3768
|
if (!isNil(priceTears)) {
|
|
3815
3769
|
tearsNeeded = priceTears.val;
|
|
3816
3770
|
}
|
|
3817
3771
|
const tearsAvailableForUse = this._workshopManager.getValue("tears") - this._workshopManager.getStock("tears");
|
|
3818
|
-
if (
|
|
3772
|
+
if (tearsAvailableForUse < tearsNeeded) {
|
|
3819
3773
|
const maxSacrifice = Math.floor(
|
|
3820
3774
|
(this._workshopManager.getValue("unicorns") - this._workshopManager.getStock("unicorns")) / 2500
|
|
3821
3775
|
);
|
|
3822
3776
|
const needSacrifice = Math.ceil(
|
|
3823
3777
|
(tearsNeeded - tearsAvailableForUse) / this._host.game.bld.getBuildingExt("ziggurat").meta.on
|
|
3824
3778
|
);
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3779
|
+
const zigguratCount = this._host.game.bld.get("ziggurat").on;
|
|
3780
|
+
if (needSacrifice < maxSacrifice && 0 < zigguratCount) {
|
|
3781
|
+
const controller = new classes.ui.religion.TransformBtnController(this._host.game, {
|
|
3782
|
+
applyAtGain: (priceCount) => {
|
|
3783
|
+
this._host.game.stats.getStat("unicornsSacrificed").val += priceCount;
|
|
3784
|
+
},
|
|
3785
|
+
gainedResource: "tears",
|
|
3786
|
+
gainMultiplier: () => {
|
|
3787
|
+
return this._host.game.bld.get("ziggurat").on;
|
|
3788
|
+
},
|
|
3789
|
+
logfilterID: "unicornSacrifice",
|
|
3790
|
+
logTextID: "religion.sacrificeBtn.sacrifice.msg",
|
|
3791
|
+
overcapMsgID: "religion.sacrificeBtn.sacrifice.msg.overcap"
|
|
3792
|
+
});
|
|
3793
|
+
const model = controller.fetchModel({
|
|
3794
|
+
controller,
|
|
3795
|
+
description: "",
|
|
3796
|
+
name: "",
|
|
3797
|
+
prices: [{ name: "unicorns", val: 2500 }]
|
|
3798
|
+
});
|
|
3799
|
+
controller._transform(model, needSacrifice);
|
|
3830
3800
|
} else {
|
|
3831
3801
|
return;
|
|
3832
3802
|
}
|
|
@@ -3855,7 +3825,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3855
3825
|
this._buildReligionBuildings(context, builds);
|
|
3856
3826
|
}
|
|
3857
3827
|
_buildReligionBuildings(context, builds) {
|
|
3858
|
-
this.manager.render();
|
|
3859
3828
|
const metaData = this.getBuildMetaData(builds);
|
|
3860
3829
|
const sectionTrigger = this.settings.trigger;
|
|
3861
3830
|
const buildList = this._bulkManager.bulk(builds, metaData, sectionTrigger, "Religion");
|
|
@@ -3872,10 +3841,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3872
3841
|
}
|
|
3873
3842
|
getBestUnicornBuilding() {
|
|
3874
3843
|
var _a2, _b;
|
|
3875
|
-
const
|
|
3876
|
-
if (pastureButton === null) {
|
|
3877
|
-
return null;
|
|
3878
|
-
}
|
|
3844
|
+
const unicornPastureImpl = this._bonfireManager.getBuild("unicornPasture");
|
|
3879
3845
|
const validBuildings = [...UnicornItems].filter(
|
|
3880
3846
|
(item) => item !== "unicornPasture"
|
|
3881
3847
|
);
|
|
@@ -3906,45 +3872,47 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
3906
3872
|
(_a2 = this._host.game.bld.getBuildingExt("unicornPasture").meta.effects) == null ? void 0 : _a2.unicornsPerTickBase
|
|
3907
3873
|
);
|
|
3908
3874
|
const pastureProduction = unicornsPerTickBase * this._host.game.getTicksPerSecondUI() * globalRatio * religionRatio * paragonRatio * faithBonus * cycleBonus;
|
|
3909
|
-
const pastureAmortization = mustExist((_b =
|
|
3875
|
+
const pastureAmortization = mustExist((_b = unicornPastureImpl.model) == null ? void 0 : _b.prices)[0].val / pastureProduction;
|
|
3910
3876
|
if (pastureAmortization < bestAmortization) {
|
|
3911
3877
|
bestAmortization = pastureAmortization;
|
|
3912
3878
|
bestBuilding = "unicornPasture";
|
|
3913
3879
|
}
|
|
3914
|
-
for (const
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
}
|
|
3880
|
+
for (const building of validBuildings) {
|
|
3881
|
+
const buildingImpl = this._getBuild(building, UnicornItemVariant.Ziggurat);
|
|
3882
|
+
if (!buildingImpl.model.metadata.unlocked) {
|
|
3883
|
+
continue;
|
|
3884
|
+
}
|
|
3885
|
+
let unicornPrice = 0;
|
|
3886
|
+
for (const price of mustExist(buildingImpl.model.prices)) {
|
|
3887
|
+
if (price.name === "unicorns") {
|
|
3888
|
+
unicornPrice += price.val;
|
|
3924
3889
|
}
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
let riftChance = this._host.game.getEffect("riftChance");
|
|
3928
|
-
for (const effect in buildingInfo.effects) {
|
|
3929
|
-
if (effect === "unicornsRatioReligion") {
|
|
3930
|
-
religionBonus += mustExist(buildingInfo.effects.unicornsRatioReligion);
|
|
3931
|
-
}
|
|
3932
|
-
if (effect === "riftChance") {
|
|
3933
|
-
riftChance += mustExist(buildingInfo.effects.riftChance);
|
|
3934
|
-
}
|
|
3890
|
+
if (price.name === "tears") {
|
|
3891
|
+
unicornPrice += price.val * 2500 / zigguratRatio;
|
|
3935
3892
|
}
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3893
|
+
}
|
|
3894
|
+
const buildingInfo = mustExist(this._host.game.religion.getZU(building));
|
|
3895
|
+
let religionBonus = religionRatio;
|
|
3896
|
+
let riftChance = this._host.game.getEffect("riftChance");
|
|
3897
|
+
for (const effect in buildingInfo.effects) {
|
|
3898
|
+
if (effect === "unicornsRatioReligion") {
|
|
3899
|
+
religionBonus += mustExist(buildingInfo.effects.unicornsRatioReligion);
|
|
3900
|
+
}
|
|
3901
|
+
if (effect === "riftChance") {
|
|
3902
|
+
riftChance += mustExist(buildingInfo.effects.riftChance);
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
const unicornsPerRift = 500 * ((religionBonus - 1) * 0.1 + 1);
|
|
3906
|
+
let riftBonus = riftChance * riftChanceRatio / (1e4 * 2) * unicornsPerRift;
|
|
3907
|
+
riftBonus -= unicornRiftChange;
|
|
3908
|
+
let buildingProduction = unicornsPerSecondBase * globalRatio * religionBonus * paragonRatio * faithBonus * cycleBonus;
|
|
3909
|
+
buildingProduction -= unicornsPerSecond;
|
|
3910
|
+
buildingProduction += riftBonus;
|
|
3911
|
+
const amortization = unicornPrice / buildingProduction;
|
|
3912
|
+
if (amortization < bestAmortization) {
|
|
3913
|
+
if (0 < riftBonus || religionRatio < religionBonus && 0 < unicornPrice) {
|
|
3914
|
+
bestAmortization = amortization;
|
|
3915
|
+
bestBuilding = building;
|
|
3948
3916
|
}
|
|
3949
3917
|
}
|
|
3950
3918
|
}
|
|
@@ -4016,23 +3984,23 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4016
3984
|
getBuildMetaData(builds) {
|
|
4017
3985
|
const metaData = {};
|
|
4018
3986
|
for (const build of Object.values(builds)) {
|
|
4019
|
-
const buildInfo = this.
|
|
3987
|
+
const buildInfo = this.getUpgradeMeta(build.building, build.variant);
|
|
4020
3988
|
if (buildInfo === null) {
|
|
4021
3989
|
continue;
|
|
4022
3990
|
}
|
|
4023
3991
|
metaData[build.building] = buildInfo;
|
|
4024
3992
|
const buildMetaData = mustExist(metaData[build.building]);
|
|
4025
|
-
if (!this.
|
|
3993
|
+
if (!this._getBuild(build.building, build.variant)) {
|
|
4026
3994
|
buildMetaData.rHidden = true;
|
|
4027
3995
|
} else {
|
|
4028
|
-
const model = mustExist(this.
|
|
3996
|
+
const model = mustExist(this._getBuild(build.building, build.variant)).model;
|
|
4029
3997
|
const panel = build.variant === UnicornItemVariant.Cryptotheology ? this._host.game.science.get("cryptotheology").researched : true;
|
|
4030
3998
|
buildMetaData.rHidden = !((model == null ? void 0 : model.visible) && model.enabled && panel);
|
|
4031
3999
|
}
|
|
4032
4000
|
}
|
|
4033
4001
|
return metaData;
|
|
4034
4002
|
}
|
|
4035
|
-
|
|
4003
|
+
getUpgradeMeta(name, variant) {
|
|
4036
4004
|
switch (variant) {
|
|
4037
4005
|
case UnicornItemVariant.Ziggurat:
|
|
4038
4006
|
return this._host.game.religion.getZU(name) ?? null;
|
|
@@ -4043,29 +4011,29 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4043
4011
|
}
|
|
4044
4012
|
throw new Error(`Unknown build: ${name} (${variant})`);
|
|
4045
4013
|
}
|
|
4046
|
-
|
|
4047
|
-
let buttons;
|
|
4014
|
+
_getBuild(name, variant) {
|
|
4048
4015
|
switch (variant) {
|
|
4049
|
-
case UnicornItemVariant.Ziggurat:
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
case UnicornItemVariant.
|
|
4056
|
-
|
|
4057
|
-
|
|
4016
|
+
case UnicornItemVariant.Ziggurat: {
|
|
4017
|
+
return this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
4018
|
+
name,
|
|
4019
|
+
type: "zigguratUpgrades"
|
|
4020
|
+
});
|
|
4021
|
+
}
|
|
4022
|
+
case UnicornItemVariant.OrderOfTheSun: {
|
|
4023
|
+
return this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
4024
|
+
name,
|
|
4025
|
+
type: "religion"
|
|
4026
|
+
});
|
|
4027
|
+
}
|
|
4028
|
+
case UnicornItemVariant.Cryptotheology: {
|
|
4029
|
+
return this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
4030
|
+
name,
|
|
4031
|
+
type: "transcendenceUpgrades"
|
|
4032
|
+
});
|
|
4033
|
+
}
|
|
4058
4034
|
default:
|
|
4059
4035
|
throw new Error(`Invalid variant '${variant}'`);
|
|
4060
4036
|
}
|
|
4061
|
-
if (buttons.length === 0) {
|
|
4062
|
-
return null;
|
|
4063
|
-
}
|
|
4064
|
-
const button2 = buttons.find((button22) => button22.id === name) ?? null;
|
|
4065
|
-
if (button2 === null) {
|
|
4066
|
-
console.debug(...cl(`Couldn't find button for ${name}! This will likely create problems.`));
|
|
4067
|
-
}
|
|
4068
|
-
return button2;
|
|
4069
4037
|
}
|
|
4070
4038
|
_transformBtnSacrificeHelper(available, total, controller, model) {
|
|
4071
4039
|
const conversionPercentage = available / total;
|
|
@@ -4573,22 +4541,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4573
4541
|
class ScienceManager extends UpgradeManager {
|
|
4574
4542
|
constructor(host, workshopManager, settings = new ScienceSettings()) {
|
|
4575
4543
|
super(host);
|
|
4576
|
-
__publicField(this, "manager");
|
|
4577
4544
|
__publicField(this, "settings");
|
|
4578
4545
|
__publicField(this, "_workshopManager");
|
|
4579
4546
|
this.settings = settings;
|
|
4580
|
-
this.manager = new TabManager(this._host, "Science");
|
|
4581
4547
|
this._workshopManager = workshopManager;
|
|
4582
4548
|
}
|
|
4583
4549
|
async tick(_context) {
|
|
4584
4550
|
if (!this.settings.enabled) {
|
|
4585
4551
|
return;
|
|
4586
4552
|
}
|
|
4587
|
-
this.
|
|
4588
|
-
if (this.settings.techs.enabled && this._host.game.tabs[2].visible) {
|
|
4553
|
+
if (this.settings.techs.enabled && this._host.game.libraryTab.visible) {
|
|
4589
4554
|
await this.autoUnlock();
|
|
4590
4555
|
}
|
|
4591
|
-
if (this.settings.policies.enabled && this._host.game.
|
|
4556
|
+
if (this.settings.policies.enabled && this._host.game.libraryTab.visible) {
|
|
4592
4557
|
await this.autoPolicy();
|
|
4593
4558
|
}
|
|
4594
4559
|
if (this.settings.observe.enabled) {
|
|
@@ -4751,12 +4716,10 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4751
4716
|
constructor(host, workshopManager, settings = new SpaceSettings()) {
|
|
4752
4717
|
__publicField(this, "_host");
|
|
4753
4718
|
__publicField(this, "settings");
|
|
4754
|
-
__publicField(this, "manager");
|
|
4755
4719
|
__publicField(this, "_bulkManager");
|
|
4756
4720
|
__publicField(this, "_workshopManager");
|
|
4757
4721
|
this._host = host;
|
|
4758
4722
|
this.settings = settings;
|
|
4759
|
-
this.manager = new TabManager(this._host, "Space");
|
|
4760
4723
|
this._workshopManager = workshopManager;
|
|
4761
4724
|
this._bulkManager = new BulkPurchaseHelper(this._host, this._workshopManager);
|
|
4762
4725
|
}
|
|
@@ -4764,7 +4727,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4764
4727
|
if (!this.settings.enabled) {
|
|
4765
4728
|
return;
|
|
4766
4729
|
}
|
|
4767
|
-
this.manager.render();
|
|
4768
4730
|
this.autoBuild(context);
|
|
4769
4731
|
if (this.settings.unlockMissions.enabled) {
|
|
4770
4732
|
this.autoUnlock(context);
|
|
@@ -4788,8 +4750,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4788
4750
|
context.requestGameUiRefresh = true;
|
|
4789
4751
|
}
|
|
4790
4752
|
}
|
|
4791
|
-
autoUnlock(
|
|
4792
|
-
var _a2, _b;
|
|
4753
|
+
autoUnlock(_context) {
|
|
4793
4754
|
if (!this._host.game.tabs[6].visible) {
|
|
4794
4755
|
return;
|
|
4795
4756
|
}
|
|
@@ -4798,18 +4759,17 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4798
4759
|
if (0 < missions[i].val || !missions[i].unlocked || !this.settings.unlockMissions.missions[missions[i].name].enabled) {
|
|
4799
4760
|
continue;
|
|
4800
4761
|
}
|
|
4801
|
-
const
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
}
|
|
4805
|
-
const prices = mustExist(
|
|
4762
|
+
const button2 = this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
4763
|
+
name: missions[i].name,
|
|
4764
|
+
type: "spaceMission"
|
|
4765
|
+
});
|
|
4766
|
+
const prices = mustExist(button2.model.prices);
|
|
4806
4767
|
for (const resource of prices) {
|
|
4807
4768
|
if (this._workshopManager.getValueAvailable(resource.name) < resource.val) {
|
|
4808
4769
|
continue missionLoop;
|
|
4809
4770
|
}
|
|
4810
4771
|
}
|
|
4811
|
-
|
|
4812
|
-
context.requestGameUiRefresh = true;
|
|
4772
|
+
button2.controller.buyItem(button2.model);
|
|
4813
4773
|
if (i === 7 || i === 12) {
|
|
4814
4774
|
this._host.engine.iactivity("upgrade.space.mission", [missions[i].label], "ks-upgrade");
|
|
4815
4775
|
} else {
|
|
@@ -4851,22 +4811,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4851
4811
|
getBuild(name) {
|
|
4852
4812
|
return this._host.game.space.getBuilding(name);
|
|
4853
4813
|
}
|
|
4854
|
-
_getBuildButton(id) {
|
|
4855
|
-
const panels = this.manager.tab.planetPanels;
|
|
4856
|
-
if (isNil(panels)) {
|
|
4857
|
-
return null;
|
|
4858
|
-
}
|
|
4859
|
-
let button2 = null;
|
|
4860
|
-
for (const panel of panels) {
|
|
4861
|
-
button2 = panel.children.find((child) => child.id === id) ?? null;
|
|
4862
|
-
if (!isNil(button2)) {
|
|
4863
|
-
return button2;
|
|
4864
|
-
}
|
|
4865
|
-
}
|
|
4866
|
-
if (button2 === null) {
|
|
4867
|
-
throw new Error(`Couldn't find button for ${id}!`);
|
|
4868
|
-
}
|
|
4869
|
-
}
|
|
4870
4814
|
}
|
|
4871
4815
|
var LogFilterItemVariant = ((LogFilterItemVariant2) => {
|
|
4872
4816
|
LogFilterItemVariant2["build"] = "ks-activity type_ks-build";
|
|
@@ -4949,6 +4893,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
4949
4893
|
constructor(upgrade, enabled = false) {
|
|
4950
4894
|
super(enabled, -1);
|
|
4951
4895
|
__privateAdd(this, _upgrade2);
|
|
4896
|
+
__publicField(this, "$upgrade");
|
|
4952
4897
|
__privateSet(this, _upgrade2, upgrade);
|
|
4953
4898
|
}
|
|
4954
4899
|
get upgrade() {
|
|
@@ -5053,18 +4998,17 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5053
4998
|
constructor(host, settings = new WorkshopSettings()) {
|
|
5054
4999
|
super(host);
|
|
5055
5000
|
__publicField(this, "settings");
|
|
5056
|
-
__publicField(this, "manager");
|
|
5057
5001
|
this.settings = settings;
|
|
5058
|
-
this.manager = new TabManager(this._host, "Workshop");
|
|
5059
5002
|
}
|
|
5060
5003
|
tick(_context) {
|
|
5061
5004
|
if (!this.settings.enabled) {
|
|
5062
5005
|
return Promise.resolve();
|
|
5063
5006
|
}
|
|
5064
5007
|
this.autoCraft();
|
|
5065
|
-
this.
|
|
5008
|
+
if (this._host.engine.settings.highlighStock.enabled) {
|
|
5009
|
+
this.refreshStock();
|
|
5010
|
+
}
|
|
5066
5011
|
if (this.settings.unlockUpgrades.enabled) {
|
|
5067
|
-
this.manager.render();
|
|
5068
5012
|
return this.autoUnlock();
|
|
5069
5013
|
}
|
|
5070
5014
|
return Promise.resolve();
|
|
@@ -5079,11 +5023,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5079
5023
|
if (!setting2.enabled) {
|
|
5080
5024
|
continue;
|
|
5081
5025
|
}
|
|
5082
|
-
const upgrade = upgrades.find((subject) => subject.name === setting2.upgrade);
|
|
5026
|
+
const upgrade = setting2.$upgrade ?? upgrades.find((subject) => subject.name === setting2.upgrade);
|
|
5083
5027
|
if (isNil(upgrade)) {
|
|
5084
5028
|
console.error(...cl(`Upgrade '${setting2.upgrade}' not found in game!`));
|
|
5085
5029
|
continue;
|
|
5086
5030
|
}
|
|
5031
|
+
if (setting2.$upgrade === void 0) {
|
|
5032
|
+
setting2.$upgrade = upgrade;
|
|
5033
|
+
}
|
|
5087
5034
|
if (upgrade.researched || !upgrade.unlocked) {
|
|
5088
5035
|
continue;
|
|
5089
5036
|
}
|
|
@@ -5191,32 +5138,51 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5191
5138
|
craft.max === -1 ? amount : Math.min(amount, (craft.max - availableTarget) / recipeProduces)
|
|
5192
5139
|
);
|
|
5193
5140
|
}
|
|
5141
|
+
const orders = new Array();
|
|
5194
5142
|
for (const [craft, request] of craftRequests) {
|
|
5195
5143
|
if (request.countRequested < 1) {
|
|
5196
5144
|
continue;
|
|
5197
5145
|
}
|
|
5198
|
-
|
|
5146
|
+
orders.push({ amount: Math.floor(request.countRequested), name: craft.resource });
|
|
5147
|
+
}
|
|
5148
|
+
if (0 < orders.length) {
|
|
5149
|
+
this.craftMultiple(orders);
|
|
5199
5150
|
}
|
|
5200
5151
|
}
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5152
|
+
craftMultiple(orders) {
|
|
5153
|
+
const messages = new Array();
|
|
5154
|
+
for (const order of orders) {
|
|
5155
|
+
const craft = this.getCraft(order.name);
|
|
5156
|
+
const ratio = this._host.game.getResCraftRatio(craft.name);
|
|
5157
|
+
const craftSucceeded = this._host.game.workshop.craft(
|
|
5158
|
+
craft.name,
|
|
5159
|
+
order.amount,
|
|
5160
|
+
true,
|
|
5161
|
+
false,
|
|
5162
|
+
false
|
|
5163
|
+
);
|
|
5164
|
+
if (!craftSucceeded) {
|
|
5165
|
+
console.error(
|
|
5166
|
+
...cl(
|
|
5167
|
+
`Failed trying to craft ${order.amount}x ${order.name}! This is a problem and should be reported.`
|
|
5168
|
+
)
|
|
5169
|
+
);
|
|
5170
|
+
continue;
|
|
5171
|
+
}
|
|
5172
|
+
const resourceName = mustExist(this._host.game.resPool.get(order.name)).title;
|
|
5173
|
+
const craftedAmount = Number.parseFloat((order.amount * (1 + ratio)).toFixed(2));
|
|
5174
|
+
this._host.engine.storeForSummary(resourceName, craftedAmount, "craft");
|
|
5175
|
+
messages.push(
|
|
5176
|
+
this._host.engine.i18n("act.craft", [
|
|
5177
|
+
this._host.game.getDisplayValueExt(craftedAmount),
|
|
5178
|
+
resourceName
|
|
5179
|
+
])
|
|
5180
|
+
);
|
|
5205
5181
|
}
|
|
5206
|
-
|
|
5207
|
-
|
|
5182
|
+
this._host.game.updateResources();
|
|
5183
|
+
for (const message of messages) {
|
|
5184
|
+
this._host.engine.printOutput("ks-activity type_ks-craft", "#e65C00", message);
|
|
5208
5185
|
}
|
|
5209
|
-
const craft = this.getCraft(name);
|
|
5210
|
-
const ratio = this._host.game.getResCraftRatio(craft.name);
|
|
5211
|
-
this._host.game.craft(craft.name, amountCalculated);
|
|
5212
|
-
const resourceName = mustExist(this._host.game.resPool.get(name)).title;
|
|
5213
|
-
amountCalculated = Number.parseFloat((amountCalculated * (1 + ratio)).toFixed(2));
|
|
5214
|
-
this._host.engine.storeForSummary(resourceName, amountCalculated, "craft");
|
|
5215
|
-
this._host.engine.iactivity(
|
|
5216
|
-
"act.craft",
|
|
5217
|
-
[this._host.game.getDisplayValueExt(amountCalculated), resourceName],
|
|
5218
|
-
"ks-craft"
|
|
5219
|
-
);
|
|
5220
5186
|
}
|
|
5221
5187
|
_canCraft(name, amount) {
|
|
5222
5188
|
if (!this._host.game.workshopTab.visible && name !== "wood") {
|
|
@@ -5392,22 +5358,35 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5392
5358
|
return baseProd;
|
|
5393
5359
|
}
|
|
5394
5360
|
refreshStock() {
|
|
5361
|
+
const resourceCells = [
|
|
5362
|
+
...document.querySelectorAll(
|
|
5363
|
+
"#game .res-row .res-cell.resAmount, #game .res-row .res-cell.resource-value"
|
|
5364
|
+
)
|
|
5365
|
+
];
|
|
5366
|
+
const cellMap = new Map(
|
|
5367
|
+
resourceCells.map((_) => [
|
|
5368
|
+
mustExist(
|
|
5369
|
+
[..._.parentNode.classList.entries()].find(
|
|
5370
|
+
([_i, __]) => __.startsWith("resource_")
|
|
5371
|
+
)
|
|
5372
|
+
)[1].substring(9),
|
|
5373
|
+
_
|
|
5374
|
+
])
|
|
5375
|
+
);
|
|
5395
5376
|
for (const [name, resource] of objectEntries(this._host.engine.settings.resources.resources)) {
|
|
5396
|
-
const
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5377
|
+
const cell = cellMap.get(name);
|
|
5378
|
+
if (!cell) {
|
|
5379
|
+
continue;
|
|
5380
|
+
}
|
|
5400
5381
|
if (!resource.enabled || resource.stock === 0) {
|
|
5401
|
-
|
|
5402
|
-
|
|
5382
|
+
if (cell.classList.contains("ks-stock-above") || cell.classList.contains("ks-stock-below")) {
|
|
5383
|
+
cell.classList.remove("ks-stock-above", "ks-stock-below");
|
|
5403
5384
|
}
|
|
5404
5385
|
continue;
|
|
5405
5386
|
}
|
|
5406
5387
|
const isBelow = this._host.game.resPool.get(name).value < resource.stock;
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
resourceCell.classList.remove(isBelow ? "ks-stock-above" : "ks-stock-below");
|
|
5410
|
-
}
|
|
5388
|
+
cell.classList.add(isBelow ? "ks-stock-below" : "ks-stock-above");
|
|
5389
|
+
cell.classList.remove(isBelow ? "ks-stock-above" : "ks-stock-below");
|
|
5411
5390
|
}
|
|
5412
5391
|
}
|
|
5413
5392
|
}
|
|
@@ -5470,11 +5449,12 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5470
5449
|
}
|
|
5471
5450
|
}
|
|
5472
5451
|
class EngineSettings extends Setting {
|
|
5473
|
-
constructor(enabled = false, filters = new LogFilterSettings(), resources = new ResourcesSettings(), states = new StateSettings(), language = FallbackLocale, ksColumn = new Setting()) {
|
|
5452
|
+
constructor(enabled = false, filters = new LogFilterSettings(), resources = new ResourcesSettings(), states = new StateSettings(), language = FallbackLocale, ksColumn = new Setting(), highlightStock = new Setting()) {
|
|
5474
5453
|
super(enabled);
|
|
5475
5454
|
__publicField(this, "interval", 2e3);
|
|
5476
5455
|
__publicField(this, "locale");
|
|
5477
5456
|
__publicField(this, "ksColumn");
|
|
5457
|
+
__publicField(this, "highlighStock");
|
|
5478
5458
|
__publicField(this, "filters");
|
|
5479
5459
|
__publicField(this, "resources");
|
|
5480
5460
|
__publicField(this, "states");
|
|
@@ -5488,6 +5468,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5488
5468
|
{ label: "中文", value: "zh-CN" }
|
|
5489
5469
|
]);
|
|
5490
5470
|
this.ksColumn = ksColumn;
|
|
5471
|
+
this.highlighStock = highlightStock;
|
|
5491
5472
|
}
|
|
5492
5473
|
load(settings, retainMetaBehavior = false) {
|
|
5493
5474
|
if (isNil(settings)) {
|
|
@@ -5499,6 +5480,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5499
5480
|
this.states.load(settings.states);
|
|
5500
5481
|
this.locale.load(settings.locale);
|
|
5501
5482
|
this.ksColumn.load(settings.ksColumn);
|
|
5483
|
+
this.highlighStock.load(settings.highlighStock);
|
|
5502
5484
|
}
|
|
5503
5485
|
this.filters.load(settings.filters);
|
|
5504
5486
|
this.resources.load(settings.resources);
|
|
@@ -6117,14 +6099,12 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6117
6099
|
constructor(host, bonfireManager, religionManager, spaceManager, workshopManager, settings = new TimeControlSettings()) {
|
|
6118
6100
|
__publicField(this, "_host");
|
|
6119
6101
|
__publicField(this, "settings");
|
|
6120
|
-
__publicField(this, "manager");
|
|
6121
6102
|
__publicField(this, "_bonfireManager");
|
|
6122
6103
|
__publicField(this, "_religionManager");
|
|
6123
6104
|
__publicField(this, "_spaceManager");
|
|
6124
6105
|
__publicField(this, "_workshopManager");
|
|
6125
6106
|
this._host = host;
|
|
6126
6107
|
this.settings = settings;
|
|
6127
|
-
this.manager = new TabManager(this._host, "Time");
|
|
6128
6108
|
this._bonfireManager = bonfireManager;
|
|
6129
6109
|
this._religionManager = religionManager;
|
|
6130
6110
|
this._spaceManager = spaceManager;
|
|
@@ -6238,7 +6218,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6238
6218
|
}
|
|
6239
6219
|
}
|
|
6240
6220
|
if (checkList.length === 0) {
|
|
6241
|
-
const panels = mustExist(this.
|
|
6221
|
+
const panels = mustExist(this._host.game.spaceTab.planetPanels);
|
|
6242
6222
|
for (const panel of panels) {
|
|
6243
6223
|
for (const panelButton of panel.children) {
|
|
6244
6224
|
const model = mustExist(panelButton.model);
|
|
@@ -6263,7 +6243,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6263
6243
|
if (entry.trigger < 0) {
|
|
6264
6244
|
return;
|
|
6265
6245
|
}
|
|
6266
|
-
const bld = mustExist(this._religionManager.
|
|
6246
|
+
const bld = mustExist(this._religionManager.getUpgradeMeta(name, entry.variant));
|
|
6267
6247
|
checkedList.push({ name: bld.label, trigger: entry.trigger, val: bld.val });
|
|
6268
6248
|
if (0 < entry.trigger) {
|
|
6269
6249
|
if (bld.val < entry.trigger) {
|
|
@@ -6519,12 +6499,10 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6519
6499
|
constructor(host, workshopManager, settings = new TimeSettings()) {
|
|
6520
6500
|
__publicField(this, "_host");
|
|
6521
6501
|
__publicField(this, "settings");
|
|
6522
|
-
__publicField(this, "manager");
|
|
6523
6502
|
__publicField(this, "_bulkManager");
|
|
6524
6503
|
__publicField(this, "_workshopManager");
|
|
6525
6504
|
this._host = host;
|
|
6526
6505
|
this.settings = settings;
|
|
6527
|
-
this.manager = new TabManager(this._host, "Time");
|
|
6528
6506
|
this._bulkManager = new BulkPurchaseHelper(this._host, workshopManager);
|
|
6529
6507
|
this._workshopManager = workshopManager;
|
|
6530
6508
|
}
|
|
@@ -6532,7 +6510,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6532
6510
|
if (!this.settings.enabled) {
|
|
6533
6511
|
return;
|
|
6534
6512
|
}
|
|
6535
|
-
this.manager.render();
|
|
6536
6513
|
this.autoBuild(context);
|
|
6537
6514
|
if (this.settings.fixCryochambers.enabled) {
|
|
6538
6515
|
this.fixCryochambers();
|
|
@@ -6545,12 +6522,15 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6545
6522
|
for (const build of Object.values(builds)) {
|
|
6546
6523
|
const buildMeta = this.getBuild(build.building, build.variant);
|
|
6547
6524
|
metaData[build.building] = mustExist(buildMeta);
|
|
6548
|
-
const buildButton = build.variant === TimeItemVariant.Chronoforge ? this.
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
}
|
|
6525
|
+
const buildButton = build.variant === TimeItemVariant.Chronoforge ? this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
6526
|
+
name: build.building,
|
|
6527
|
+
type: "chronoforge"
|
|
6528
|
+
}) : this._host.game.time.queue.getQueueElementControllerAndModel({
|
|
6529
|
+
name: build.building,
|
|
6530
|
+
type: "voidSpace"
|
|
6531
|
+
});
|
|
6552
6532
|
const model = buildButton.model;
|
|
6553
|
-
const panel = build.variant === TimeItemVariant.Chronoforge ? this.
|
|
6533
|
+
const panel = build.variant === TimeItemVariant.Chronoforge ? this._host.game.timeTab.cfPanel : this._host.game.timeTab.vsPanel;
|
|
6554
6534
|
const buildingMetaData = mustExist(metaData[build.building]);
|
|
6555
6535
|
buildingMetaData.tHidden = !(model == null ? void 0 : model.visible) || !model.enabled || !panel.visible;
|
|
6556
6536
|
}
|
|
@@ -6612,12 +6592,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6612
6592
|
}
|
|
6613
6593
|
return this._host.game.time.getVSU(name);
|
|
6614
6594
|
}
|
|
6615
|
-
_getBuildButtonCF(name) {
|
|
6616
|
-
return this.manager.tab.children[2].children[0].children.find((button2) => button2.id === name) ?? null;
|
|
6617
|
-
}
|
|
6618
|
-
_getBuildButtonVS(name) {
|
|
6619
|
-
return this.manager.tab.children[3].children[0].children.find((button2) => button2.id === name) ?? null;
|
|
6620
|
-
}
|
|
6621
6595
|
fixCryochambers() {
|
|
6622
6596
|
if (this._host.game.time.getVSU("usedCryochambers").val < 1) {
|
|
6623
6597
|
return;
|
|
@@ -6629,12 +6603,13 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6629
6603
|
return;
|
|
6630
6604
|
}
|
|
6631
6605
|
}
|
|
6632
|
-
const
|
|
6606
|
+
const controller = new classes.ui.time.FixCryochamberBtnController(this._host.game);
|
|
6607
|
+
const model = controller.fetchModel({});
|
|
6633
6608
|
let fixed = 0;
|
|
6634
6609
|
let fixHappened;
|
|
6635
6610
|
do {
|
|
6636
6611
|
fixHappened = false;
|
|
6637
|
-
const buyResult =
|
|
6612
|
+
const buyResult = controller.buyItem(model);
|
|
6638
6613
|
fixHappened = buyResult.itemBought;
|
|
6639
6614
|
fixed += fixHappened ? 1 : 0;
|
|
6640
6615
|
} while (fixHappened);
|
|
@@ -6648,18 +6623,15 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6648
6623
|
constructor(host, workshopManager, settings = new TradeSettings()) {
|
|
6649
6624
|
__publicField(this, "_host");
|
|
6650
6625
|
__publicField(this, "settings");
|
|
6651
|
-
__publicField(this, "manager");
|
|
6652
6626
|
__publicField(this, "_workshopManager");
|
|
6653
6627
|
this._host = host;
|
|
6654
6628
|
this.settings = settings;
|
|
6655
|
-
this.manager = new TabManager(this._host, "Trade");
|
|
6656
6629
|
this._workshopManager = workshopManager;
|
|
6657
6630
|
}
|
|
6658
6631
|
tick(context) {
|
|
6659
6632
|
if (!this.settings.enabled) {
|
|
6660
6633
|
return;
|
|
6661
6634
|
}
|
|
6662
|
-
this.manager.render();
|
|
6663
6635
|
this.autoTrade();
|
|
6664
6636
|
if (this.settings.unlockRaces.enabled) {
|
|
6665
6637
|
this.autoUnlock(context);
|
|
@@ -6675,7 +6647,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6675
6647
|
}
|
|
6676
6648
|
}
|
|
6677
6649
|
autoTrade(cacheManager) {
|
|
6678
|
-
var _a2;
|
|
6679
6650
|
const catpower = this._workshopManager.getResource("manpower");
|
|
6680
6651
|
const gold = this._workshopManager.getResource("gold");
|
|
6681
6652
|
const sectionTrigger = this.settings.trigger;
|
|
@@ -6687,10 +6658,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6687
6658
|
if (trigger < 0 || !trade.enabled || !trade.seasons[season].enabled || !race.unlocked || !this.singleTradePossible(sectionTrigger, catpower, gold, trade)) {
|
|
6688
6659
|
continue;
|
|
6689
6660
|
}
|
|
6690
|
-
const button2 = this.getTradeButton(race.name);
|
|
6691
|
-
if (!((_a2 = button2 == null ? void 0 : button2.model) == null ? void 0 : _a2.enabled)) {
|
|
6692
|
-
continue;
|
|
6693
|
-
}
|
|
6694
6661
|
const require2 = trade.require ? this._workshopManager.getResource(trade.require) : false;
|
|
6695
6662
|
const profitable = this.getProfitability(trade.race);
|
|
6696
6663
|
if (trade.limited && profitable) {
|
|
@@ -6982,16 +6949,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
6982
6949
|
}
|
|
6983
6950
|
}
|
|
6984
6951
|
trade(name, amount) {
|
|
6985
|
-
var _a2;
|
|
6986
6952
|
const race = this.getRace(name);
|
|
6987
|
-
const button2 = this.getTradeButton(race.name);
|
|
6988
|
-
if (!((_a2 = button2 == null ? void 0 : button2.model) == null ? void 0 : _a2.enabled) || !this.settings.races[name].enabled) {
|
|
6989
|
-
console.warn(
|
|
6990
|
-
...cl(
|
|
6991
|
-
"KS trade checks are not functioning properly, please create an issue on the github page."
|
|
6992
|
-
)
|
|
6993
|
-
);
|
|
6994
|
-
}
|
|
6995
6953
|
this._host.game.diplomacy.tradeMultiple(race, amount);
|
|
6996
6954
|
this._host.engine.storeForSummary(race.title, amount, "trade");
|
|
6997
6955
|
this._host.engine.iactivity(
|
|
@@ -7136,10 +7094,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7136
7094
|
}
|
|
7137
7095
|
return raceInfo;
|
|
7138
7096
|
}
|
|
7139
|
-
getTradeButton(race) {
|
|
7140
|
-
const panel = this.manager.tab.racePanels.find((subject) => subject.race.name === race);
|
|
7141
|
-
return (panel == null ? void 0 : panel.tradeBtn) ?? null;
|
|
7142
|
-
}
|
|
7143
7097
|
singleTradePossible(sectionTrigger, catpower, gold, trade) {
|
|
7144
7098
|
const trigger = trade ? Engine.evaluateSubSectionTrigger(sectionTrigger, trade.trigger) : sectionTrigger;
|
|
7145
7099
|
if (trigger < 0 && trade === void 0) {
|
|
@@ -7205,20 +7159,18 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7205
7159
|
constructor(host, workshopManager, settings = new VillageSettings()) {
|
|
7206
7160
|
__publicField(this, "_host");
|
|
7207
7161
|
__publicField(this, "settings");
|
|
7208
|
-
__publicField(this, "manager");
|
|
7209
7162
|
__publicField(this, "_cacheManager");
|
|
7210
7163
|
__publicField(this, "_workshopManager");
|
|
7211
7164
|
this._host = host;
|
|
7212
7165
|
this.settings = settings;
|
|
7213
|
-
this.manager = new TabManager(this._host, "Village");
|
|
7214
7166
|
this._cacheManager = new MaterialsCache(this._host);
|
|
7215
7167
|
this._workshopManager = workshopManager;
|
|
7216
7168
|
}
|
|
7217
|
-
tick(
|
|
7169
|
+
tick(context) {
|
|
7218
7170
|
if (!this.settings.enabled) {
|
|
7219
7171
|
return;
|
|
7220
7172
|
}
|
|
7221
|
-
this.autoDistributeKittens();
|
|
7173
|
+
this.autoDistributeKittens(context);
|
|
7222
7174
|
if (this.settings.hunt.enabled) {
|
|
7223
7175
|
this.autoHunt(this._cacheManager);
|
|
7224
7176
|
}
|
|
@@ -7235,7 +7187,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7235
7187
|
this.autoPromoteKittens();
|
|
7236
7188
|
}
|
|
7237
7189
|
}
|
|
7238
|
-
autoDistributeKittens() {
|
|
7190
|
+
autoDistributeKittens(context) {
|
|
7239
7191
|
const freeKittens = this._host.game.village.getFreeKittens();
|
|
7240
7192
|
if (!freeKittens) {
|
|
7241
7193
|
return;
|
|
@@ -7264,7 +7216,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7264
7216
|
jobsNotCapped.sort((a, b) => a.count - b.count);
|
|
7265
7217
|
const jobName = noFarmersAssigned ? "farmer" : jobsNotCapped[0].job.name;
|
|
7266
7218
|
this._host.game.village.assignJob(this._host.game.village.getJob(jobName), 1);
|
|
7267
|
-
|
|
7219
|
+
context.requestGameUiRefresh = true;
|
|
7268
7220
|
this._host.engine.iactivity(
|
|
7269
7221
|
"act.distribute",
|
|
7270
7222
|
[this._host.engine.i18n(`$village.job.${jobName}`)],
|
|
@@ -7387,16 +7339,27 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7387
7339
|
if (!catpowProfitable && !cultureProfitable && !parchProfitable) {
|
|
7388
7340
|
return;
|
|
7389
7341
|
}
|
|
7390
|
-
this.
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
this._host.
|
|
7397
|
-
}
|
|
7398
|
-
|
|
7399
|
-
|
|
7342
|
+
const beforeDays = this._host.game.calendar.festivalDays;
|
|
7343
|
+
const controller = new classes.village.ui.FestivalButtonController(this._host.game);
|
|
7344
|
+
const model = controller.fetchModel({
|
|
7345
|
+
controller,
|
|
7346
|
+
description: "",
|
|
7347
|
+
handler: () => {
|
|
7348
|
+
this._host.game.village.holdFestival(1);
|
|
7349
|
+
},
|
|
7350
|
+
name: "",
|
|
7351
|
+
prices: [
|
|
7352
|
+
{ name: "manpower", val: 1500 },
|
|
7353
|
+
{ name: "culture", val: 5e3 },
|
|
7354
|
+
{ name: "parchment", val: 2500 }
|
|
7355
|
+
]
|
|
7356
|
+
});
|
|
7357
|
+
controller.buyItem(model);
|
|
7358
|
+
this._host.engine.storeForSummary("festival");
|
|
7359
|
+
if (beforeDays > 0) {
|
|
7360
|
+
this._host.engine.iactivity("festival.extend", [], "ks-festival");
|
|
7361
|
+
} else {
|
|
7362
|
+
this._host.engine.iactivity("festival.hold", [], "ks-festival");
|
|
7400
7363
|
}
|
|
7401
7364
|
}
|
|
7402
7365
|
}
|
|
@@ -7592,6 +7555,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7592
7555
|
entry: Date.now(),
|
|
7593
7556
|
exit: 0,
|
|
7594
7557
|
measurements: {},
|
|
7558
|
+
purchaseOrders: [],
|
|
7595
7559
|
requestGameUiRefresh: false
|
|
7596
7560
|
};
|
|
7597
7561
|
this._iterate(context).then(() => {
|
|
@@ -7662,7 +7626,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7662
7626
|
[, duration] = await measureAsync(() => this.timeControlManager.tick(context));
|
|
7663
7627
|
context.measurements.timeControlManager = duration;
|
|
7664
7628
|
[, duration] = measure(() => {
|
|
7665
|
-
if (context.requestGameUiRefresh) {
|
|
7629
|
+
if (context.requestGameUiRefresh && !document.hidden) {
|
|
7666
7630
|
this._host.game.ui.render();
|
|
7667
7631
|
}
|
|
7668
7632
|
});
|
|
@@ -7718,13 +7682,13 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7718
7682
|
const text = this.i18n(i18nLiteral, i18nArgs);
|
|
7719
7683
|
if (logStyle) {
|
|
7720
7684
|
const activityClass = `type_${logStyle}`;
|
|
7721
|
-
this.
|
|
7685
|
+
this.printOutput(`ks-activity ${activityClass}`, "#e65C00", text);
|
|
7722
7686
|
} else {
|
|
7723
|
-
this.
|
|
7687
|
+
this.printOutput("ks-activity", "#e65C00", text);
|
|
7724
7688
|
}
|
|
7725
7689
|
}
|
|
7726
7690
|
imessage(i18nLiteral, i18nArgs = []) {
|
|
7727
|
-
this.
|
|
7691
|
+
this.printOutput("ks-default", "#aa50fe", this.i18n(i18nLiteral, i18nArgs));
|
|
7728
7692
|
}
|
|
7729
7693
|
storeForSummary(name, amount = 1, section = "other") {
|
|
7730
7694
|
this._activitySummary.storeActivity(name, amount, section);
|
|
@@ -7735,14 +7699,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7735
7699
|
displayActivitySummary() {
|
|
7736
7700
|
const summary = this.getSummary();
|
|
7737
7701
|
for (const summaryLine of summary) {
|
|
7738
|
-
this.
|
|
7702
|
+
this.printOutput("ks-summary", "#009933", summaryLine);
|
|
7739
7703
|
}
|
|
7740
7704
|
this.resetActivitySummary();
|
|
7741
7705
|
}
|
|
7742
7706
|
resetActivitySummary() {
|
|
7743
7707
|
this._activitySummary.resetActivity();
|
|
7744
7708
|
}
|
|
7745
|
-
|
|
7709
|
+
printOutput(cssClasses, color, message) {
|
|
7746
7710
|
if (this.settings.filters.enabled) {
|
|
7747
7711
|
for (const filterItem of Object.values(this.settings.filters.filters)) {
|
|
7748
7712
|
if (filterItem.variant === cssClasses && !filterItem.enabled) {
|
|
@@ -7752,7 +7716,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7752
7716
|
}
|
|
7753
7717
|
const msg = this._host.game.msg(message, cssClasses);
|
|
7754
7718
|
$(msg.span).css("color", color);
|
|
7755
|
-
console.debug(...cl(message));
|
|
7756
7719
|
}
|
|
7757
7720
|
static evaluateSubSectionTrigger(sectionTrigger, subSectionTrigger) {
|
|
7758
7721
|
return sectionTrigger < 0 ? subSectionTrigger : subSectionTrigger < 0 ? sectionTrigger : subSectionTrigger;
|
|
@@ -8676,8 +8639,8 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
8676
8639
|
return `[${Delimiter.name}#${this.componentId}]`;
|
|
8677
8640
|
}
|
|
8678
8641
|
}
|
|
8679
|
-
const dialog = "
|
|
8680
|
-
const close = "
|
|
8642
|
+
const dialog = "_dialog_b4vj0_1";
|
|
8643
|
+
const close = "_close_b4vj0_7";
|
|
8681
8644
|
const styles$a = {
|
|
8682
8645
|
dialog,
|
|
8683
8646
|
close
|
|
@@ -9502,6 +9465,11 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
9502
9465
|
parent.host.rebuildUi();
|
|
9503
9466
|
}
|
|
9504
9467
|
}),
|
|
9468
|
+
new SettingListItem(
|
|
9469
|
+
parent,
|
|
9470
|
+
settings.highlighStock,
|
|
9471
|
+
parent.host.engine.i18n("ui.highlightStock")
|
|
9472
|
+
),
|
|
9505
9473
|
new Delimiter(parent),
|
|
9506
9474
|
new OptionsListItem(parent, parent.host.engine.i18n("ui.language"), settings.locale, {
|
|
9507
9475
|
onCheck: () => {
|
|
@@ -15247,7 +15215,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
15247
15215
|
console.warn(...cl("Kitten Scientists have been unloaded!"));
|
|
15248
15216
|
}
|
|
15249
15217
|
run() {
|
|
15250
|
-
this.game.console.maxMessages = 1e3;
|
|
15251
15218
|
this.refreshEntireUserInterface();
|
|
15252
15219
|
if (this.engine.settings.enabled) {
|
|
15253
15220
|
this.engine.start(true);
|
|
@@ -15415,7 +15382,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
15415
15382
|
if (typeof document != "undefined") {
|
|
15416
15383
|
var elementStyle = document.createElement("style");
|
|
15417
15384
|
elementStyle.id = "ks-styles";
|
|
15418
|
-
elementStyle.appendChild(document.createTextNode('._label_1nlev_1 {\n align-content: center;\n display: inline-block;\n flex: 0 1 fit-content;\n opacity: 0.8;\n\n white-space: nowrap;\n\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n}\n\n._splitter_1nlev_16 ._label_1nlev_1::first-letter {\n font-weight: bold;\n}\n\n._iconLabel_1nlev_20 {\n display: inline-block;\n margin-right: 4px;\n margin-left: 2px;\n vertical-align: middle;\n}\n._fillSpace_1nlev_26 {\n flex: 1;\n}\n._delimiter_16hnh_1 {\n margin-bottom: 10px;\n}\n._head_wr1pj_1 {\n display: flex;\n align-items: stretch;\n flex-direction: row;\n justify-content: flex-start;\n width: 100%;\n\n transition: 0.3s;\n\n > ._headFlexItem_wr1pj_10 {\n flex: 1;\n margin-right: 8px;\n }\n}\n._setting_1ndg5_1 {\n border-bottom: 1px solid transparent;\n\n transition: border-bottom 0.3s;\n\n ._checkbox_1ndg5_6 {\n margin: 1px 5px 2px 2px;\n }\n\n ._panelContent_1ndg5_10 {\n border-left: 1px dashed grey;\n padding-left: 16px;\n margin-left: 8px;\n margin-top: 1px;\n opacity: 0.5;\n\n &._hidden_1ndg5_17 {\n display: none;\n }\n }\n\n &._checked_1ndg5_22 > ._panelContent_1ndg5_10 {\n opacity: 1;\n }\n\n &._expanded_1ndg5_26 {\n margin-bottom: 10px;\n }\n\n &:not(._expanded_1ndg5_26):hover {\n border-bottom: 1px dashed rgba(160, 160, 160, 0.2);\n }\n\n &._readonly_1ndg5_34 {\n cursor: default;\n pointer-events: none;\n }\n}\n@keyframes _hail-rainbow_q7zpt_1 {\n 0%,\n 100% {\n color: red;\n text-shadow: 0 0 10px red;\n }\n 33% {\n color: #888;\n text-shadow: 0 0 10px yellow;\n }\n 66% {\n color: white;\n text-shadow: 0 0 10px black;\n }\n}\n\n._iconButton_q7zpt_17 {\n cursor: pointer;\n display: block;\n padding-right: 3px;\n line-height: 0;\n opacity: 0.8;\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n\n &._inactive_q7zpt_29 {\n opacity: 0.4;\n\n &:hover {\n opacity: 0.6;\n }\n }\n\n &._ineffective_q7zpt_37 {\n color: red;\n animation: _hail-rainbow_q7zpt_1 5s linear infinite;\n }\n}\n\n._button_q7zpt_43 {\n align-items: end;\n cursor: pointer;\n display: flex;\n opacity: 0.8;\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n\n &._inactive_q7zpt_29 {\n opacity: 0.4;\n\n &:hover {\n opacity: 0.6;\n }\n }\n\n &._ineffective_q7zpt_37 {\n color: red;\n animation: _hail-rainbow_q7zpt_1 5s linear infinite;\n }\n\n &._readonly_q7zpt_67 {\n cursor: default;\n pointer-events: none;\n }\n\n ._buttonIcon_q7zpt_72 {\n margin: 0 2px 0 0;\n vertical-align: sub;\n }\n\n &._alignRight_q7zpt_77 {\n justify-content: end;\n }\n\n &._large_q7zpt_81 {\n padding: 5px 10px;\n }\n\n &._bordered_q7zpt_85 {\n border: 1px solid rgba(180, 180, 180, 0.2);\n\n &:not(._large_q7zpt_81) {\n padding: 0 2px;\n }\n\n &:hover {\n border: 1px solid rgba(180, 180, 180, 1);\n }\n }\n\n &._headAction_q7zpt_97 {\n min-width: 50px;\n }\n &._lastHeadAction_q7zpt_100 {\n padding-right: 20px;\n }\n\n &._consumeButton_q7zpt_104 {\n border: 1px solid transparent;\n }\n &._stockButton_q7zpt_107 {\n border: 1px solid transparent;\n }\n}\n\n._button_q7zpt_43:not(._bordered_q7zpt_85) + ._button_q7zpt_43:not(._bordered_q7zpt_85):before {\n content: "";\n display: inline-block;\n height: 1em;\n border-left: 1px solid transparent;\n}\n._button_q7zpt_43:not(._bordered_q7zpt_85):not(._inactive_q7zpt_29)._alignRight_q7zpt_77 + ._button_q7zpt_43:not(._bordered_q7zpt_85):not(._inactive_q7zpt_29):before {\n content: "";\n display: inline-block;\n height: 1em;\n border-left: 1px solid rgba(180, 180, 180, 0.4);\n}\n._listContainer_1kxbq_1 {\n margin-bottom: 4px;\n}\n\n._itemsList_1kxbq_5 {\n user-select: none;\n}\n\n._list_1kxbq_1 ~ ._listTools_1kxbq_9 {\n border-top: 1px dotted rgba(128, 128, 128, 0.3);\n margin-left: 0px;\n padding-top: 2px;\n}\n._list_1kxbq_1 ~ ._listTools_1kxbq_9 * {\n display: inline-block;\n}\n._expandoButton_l1ukp_1:not(._expanded_l1ukp_1) ._up_l1ukp_1 {\n display: none;\n}\n._expandoButton_l1ukp_1:not(._expanded_l1ukp_1) ._down_l1ukp_4 {\n opacity: 0.6;\n\n &:hover {\n opacity: 1;\n }\n}\n._expandoButton_l1ukp_1._expanded_l1ukp_1 ._down_l1ukp_4 {\n display: none;\n}\n#gamePageContainer .dialog.help
|
|
15385
|
+
elementStyle.appendChild(document.createTextNode('._label_1nlev_1 {\n align-content: center;\n display: inline-block;\n flex: 0 1 fit-content;\n opacity: 0.8;\n\n white-space: nowrap;\n\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n}\n\n._splitter_1nlev_16 ._label_1nlev_1::first-letter {\n font-weight: bold;\n}\n\n._iconLabel_1nlev_20 {\n display: inline-block;\n margin-right: 4px;\n margin-left: 2px;\n vertical-align: middle;\n}\n._fillSpace_1nlev_26 {\n flex: 1;\n}\n._delimiter_16hnh_1 {\n margin-bottom: 10px;\n}\n._head_wr1pj_1 {\n display: flex;\n align-items: stretch;\n flex-direction: row;\n justify-content: flex-start;\n width: 100%;\n\n transition: 0.3s;\n\n > ._headFlexItem_wr1pj_10 {\n flex: 1;\n margin-right: 8px;\n }\n}\n._setting_1ndg5_1 {\n border-bottom: 1px solid transparent;\n\n transition: border-bottom 0.3s;\n\n ._checkbox_1ndg5_6 {\n margin: 1px 5px 2px 2px;\n }\n\n ._panelContent_1ndg5_10 {\n border-left: 1px dashed grey;\n padding-left: 16px;\n margin-left: 8px;\n margin-top: 1px;\n opacity: 0.5;\n\n &._hidden_1ndg5_17 {\n display: none;\n }\n }\n\n &._checked_1ndg5_22 > ._panelContent_1ndg5_10 {\n opacity: 1;\n }\n\n &._expanded_1ndg5_26 {\n margin-bottom: 10px;\n }\n\n &:not(._expanded_1ndg5_26):hover {\n border-bottom: 1px dashed rgba(160, 160, 160, 0.2);\n }\n\n &._readonly_1ndg5_34 {\n cursor: default;\n pointer-events: none;\n }\n}\n@keyframes _hail-rainbow_q7zpt_1 {\n 0%,\n 100% {\n color: red;\n text-shadow: 0 0 10px red;\n }\n 33% {\n color: #888;\n text-shadow: 0 0 10px yellow;\n }\n 66% {\n color: white;\n text-shadow: 0 0 10px black;\n }\n}\n\n._iconButton_q7zpt_17 {\n cursor: pointer;\n display: block;\n padding-right: 3px;\n line-height: 0;\n opacity: 0.8;\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n\n &._inactive_q7zpt_29 {\n opacity: 0.4;\n\n &:hover {\n opacity: 0.6;\n }\n }\n\n &._ineffective_q7zpt_37 {\n color: red;\n animation: _hail-rainbow_q7zpt_1 5s linear infinite;\n }\n}\n\n._button_q7zpt_43 {\n align-items: end;\n cursor: pointer;\n display: flex;\n opacity: 0.8;\n transition: 0.3s;\n\n &:hover {\n opacity: 1;\n }\n\n &._inactive_q7zpt_29 {\n opacity: 0.4;\n\n &:hover {\n opacity: 0.6;\n }\n }\n\n &._ineffective_q7zpt_37 {\n color: red;\n animation: _hail-rainbow_q7zpt_1 5s linear infinite;\n }\n\n &._readonly_q7zpt_67 {\n cursor: default;\n pointer-events: none;\n }\n\n ._buttonIcon_q7zpt_72 {\n margin: 0 2px 0 0;\n vertical-align: sub;\n }\n\n &._alignRight_q7zpt_77 {\n justify-content: end;\n }\n\n &._large_q7zpt_81 {\n padding: 5px 10px;\n }\n\n &._bordered_q7zpt_85 {\n border: 1px solid rgba(180, 180, 180, 0.2);\n\n &:not(._large_q7zpt_81) {\n padding: 0 2px;\n }\n\n &:hover {\n border: 1px solid rgba(180, 180, 180, 1);\n }\n }\n\n &._headAction_q7zpt_97 {\n min-width: 50px;\n }\n &._lastHeadAction_q7zpt_100 {\n padding-right: 20px;\n }\n\n &._consumeButton_q7zpt_104 {\n border: 1px solid transparent;\n }\n &._stockButton_q7zpt_107 {\n border: 1px solid transparent;\n }\n}\n\n._button_q7zpt_43:not(._bordered_q7zpt_85) + ._button_q7zpt_43:not(._bordered_q7zpt_85):before {\n content: "";\n display: inline-block;\n height: 1em;\n border-left: 1px solid transparent;\n}\n._button_q7zpt_43:not(._bordered_q7zpt_85):not(._inactive_q7zpt_29)._alignRight_q7zpt_77 + ._button_q7zpt_43:not(._bordered_q7zpt_85):not(._inactive_q7zpt_29):before {\n content: "";\n display: inline-block;\n height: 1em;\n border-left: 1px solid rgba(180, 180, 180, 0.4);\n}\n._listContainer_1kxbq_1 {\n margin-bottom: 4px;\n}\n\n._itemsList_1kxbq_5 {\n user-select: none;\n}\n\n._list_1kxbq_1 ~ ._listTools_1kxbq_9 {\n border-top: 1px dotted rgba(128, 128, 128, 0.3);\n margin-left: 0px;\n padding-top: 2px;\n}\n._list_1kxbq_1 ~ ._listTools_1kxbq_9 * {\n display: inline-block;\n}\n._expandoButton_l1ukp_1:not(._expanded_l1ukp_1) ._up_l1ukp_1 {\n display: none;\n}\n._expandoButton_l1ukp_1:not(._expanded_l1ukp_1) ._down_l1ukp_4 {\n opacity: 0.6;\n\n &:hover {\n opacity: 1;\n }\n}\n._expandoButton_l1ukp_1._expanded_l1ukp_1 ._down_l1ukp_4 {\n display: none;\n}\n#gamePageContainer .dialog.help._dialog_b4vj0_1 {\n display: flex;\n flex-direction: column;\n height: fit-content !important;\n box-shadow: none !important;\n\n ._close_b4vj0_7 {\n position: absolute;\n top: 10px;\n right: 15px;\n }\n}\n._explainer_1idu3_1 {\n color: #888;\n display: inline-block;\n min-width: 100px;\n user-select: none;\n padding: 4px;\n white-space: break-spaces;\n}\n._explainer_1idu3_1 p {\n margin: 0;\n}\n._header_19ql8_1 {\n display: block;\n margin-bottom: 3px;\n min-width: 100px;\n\n border-bottom: 1px dashed rgba(255, 255, 255, 0.1);\n\n font-weight: bold;\n user-select: none;\n}\n._toolbar_1654f_1 {\n display: flex;\n flex-direction: row;\n\n padding: 0 0 2px 0;\n margin: 0 0 3px 0;\n}\n._toolbar_1654f_1 > * {\n margin: 0 3px 0 0;\n}\n._maxButton_133h2_1 {\n padding-right: 5px;\n padding-top: 2px;\n}\n._fieldset_tfwil_1 {\n border-bottom: none;\n border-right: none;\n border-top: none;\n}\n._textButton_1mv97_1 {\n display: inline-block;\n white-space: nowrap;\n opacity: 0.8;\n\n cursor: pointer;\n user-select: none;\n}\n._textButton_1mv97_1:hover {\n opacity: 1;\n}\n@keyframes _scale_6c09s_1 {\n 0% {\n scale: 0.5;\n opacity: 0;\n }\n 50% {\n scale: 1;\n opacity: 1;\n }\n 100% {\n scale: 2;\n opacity: 0;\n }\n}\n\n._active_6c09s_16 {\n text-shadow: rgba(128, 128, 128, 0.8) 0 0 15px;\n position: relative;\n\n &::after,\n &::before {\n display: inline-block;\n width: 1em;\n height: 100%;\n position: absolute;\n right: -1.5em;\n scale: 0;\n text-align: center;\n transform-origin: center;\n }\n\n &::after {\n content: attr(data-ks-active-from);\n animation: _scale_6c09s_1 8s linear infinite;\n }\n\n &::before {\n content: attr(data-ks-active-to);\n animation: _scale_6c09s_1 8s linear infinite;\n animation-delay: 4s;\n }\n}\n._buyButton_10eul_1 {\n display: inline-block;\n padding-right: 10px;\n min-width: 86px;\n}\n._sellButton_1tmvd_1 {\n display: inline-block;\n padding-right: 10px;\n min-width: 86px;\n}\n#ksColumn {\n min-width: 250px;\n max-width: 440px;\n vertical-align: top;\n padding-left: 8px;\n top: 20px;\n position: relative;\n overflow-y: auto;\n}\n\n#footerLinks {\n display: flex;\n flex-direction: column;\n position: fixed;\n text-align: right;\n line-height: 0;\n right: -5px !important;\n margin-bottom: 1em;\n\n a {\n line-height: 1;\n padding-right: 10px;\n opacity: 0.5;\n transition: 0.3s;\n text-decoration: none;\n text-transform: lowercase;\n\n &:hover {\n opacity: 1;\n }\n }\n}\n#crowdjet-expand-container {\n position: fixed !important;\n bottom: 10px !important;\n right: -10px !important;\n opacity: 0.5;\n\n &:hover {\n opacity: 1;\n }\n}\n\n._spacer_auis8_44 {\n display: block;\n margin-bottom: 100px;\n}\n\n._ui_auis8_49 {\n margin: 5px 0 10px 0;\n padding-right: 10px;\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n /* Rules needed to enable stock warning. */\n #_toggle-list-resources_auis8_1 ._stockWarn_auis8_60 *,\n #_toggle-reset-list-resources_auis8_1 ._stockWarn_auis8_60 * {\n color: #dd1e00;\n }\n}\n\n._showActivity_auis8_66 {\n cursor: pointer;\n display: inline-block;\n vertical-align: middle;\n}\n\n/* Ensure the right column gets a scrollbar, when our content extends it too far down. */\n#game #rightColumn {\n overflow-y: auto;\n\n /* Fix some double-scrollbar issues in the right column, when KS is loaded. */\n #rightTabLog {\n overflow-y: visible;\n\n #gameLog {\n height: auto;\n min-height: auto;\n overflow-y: visible;\n }\n }\n}\n\n#game .res-row .res-cell.ks-stock-above {\n color: green;\n}\n#game .res-row .res-cell.ks-stock-below {\n color: red;\n}'));
|
|
15419
15386
|
document.head.appendChild(elementStyle);
|
|
15420
15387
|
}
|
|
15421
15388
|
} catch (e) {
|