libram 0.3.2 → 0.4.2

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.
Files changed (99) hide show
  1. package/dist/Clan.js +268 -485
  2. package/dist/Copier.js +11 -48
  3. package/dist/Dungeon.js +77 -157
  4. package/dist/Kmail.d.ts +13 -7
  5. package/dist/Kmail.js +92 -233
  6. package/dist/Path.js +68 -120
  7. package/dist/ascend.js +153 -172
  8. package/dist/combat.d.ts +86 -1
  9. package/dist/combat.js +295 -387
  10. package/dist/console.js +13 -36
  11. package/dist/diet/index.d.ts +31 -0
  12. package/dist/diet/index.js +333 -0
  13. package/dist/diet/knapsack.d.ts +7 -0
  14. package/dist/diet/knapsack.js +106 -0
  15. package/dist/dungeons/Dreadsylvania.d.ts +4 -0
  16. package/dist/dungeons/Dreadsylvania.js +14 -0
  17. package/dist/dungeons/Dungeon.d.ts +28 -0
  18. package/dist/dungeons/Dungeon.js +99 -0
  19. package/dist/dungeons/Hobopolis.d.ts +4 -0
  20. package/dist/dungeons/Hobopolis.js +14 -0
  21. package/dist/dungeons/SlimeTube.d.ts +4 -0
  22. package/dist/dungeons/SlimeTube.js +14 -0
  23. package/dist/freerun.d.ts +23 -0
  24. package/dist/freerun.js +92 -0
  25. package/dist/index.d.ts +6 -1
  26. package/dist/index.js +21 -263
  27. package/dist/lib.d.ts +43 -0
  28. package/dist/lib.js +296 -405
  29. package/dist/logger.js +23 -63
  30. package/dist/maximize.d.ts +29 -12
  31. package/dist/maximize.js +318 -421
  32. package/dist/modifier.d.ts +13 -0
  33. package/dist/modifier.js +35 -0
  34. package/dist/modifierTypes.d.ts +16 -0
  35. package/dist/modifierTypes.js +9 -0
  36. package/dist/mood.js +220 -531
  37. package/dist/property.d.ts +2 -0
  38. package/dist/property.js +96 -242
  39. package/dist/propertyTypes.d.ts +9 -0
  40. package/dist/propertyTypes.js +1 -0
  41. package/dist/propertyTyping.d.ts +2 -9
  42. package/dist/propertyTyping.js +42 -53
  43. package/dist/resources/2007/CandyHearts.d.ts +9 -0
  44. package/dist/resources/2007/CandyHearts.js +24 -0
  45. package/dist/resources/2008/DivineFavors.d.ts +9 -0
  46. package/dist/resources/2008/DivineFavors.js +27 -0
  47. package/dist/resources/2009/Bandersnatch.js +37 -112
  48. package/dist/resources/2009/LoveSongs.d.ts +9 -0
  49. package/dist/resources/2009/LoveSongs.js +24 -0
  50. package/dist/resources/2009/SpookyPutty.js +20 -46
  51. package/dist/resources/2010/Brickos.d.ts +9 -0
  52. package/dist/resources/2010/Brickos.js +21 -0
  53. package/dist/resources/2010/CrownOfThrones.d.ts +18 -0
  54. package/dist/resources/2010/CrownOfThrones.js +550 -0
  55. package/dist/resources/2011/Gygaxian.d.ts +9 -0
  56. package/dist/resources/2011/Gygaxian.js +24 -0
  57. package/dist/resources/2011/ObtuseAngel.js +21 -63
  58. package/dist/resources/2012/RainDoh.js +14 -40
  59. package/dist/resources/2012/Resolutions.d.ts +9 -0
  60. package/dist/resources/2012/Resolutions.js +28 -0
  61. package/dist/resources/2013/Florist.d.ts +61 -0
  62. package/dist/resources/2013/Florist.js +149 -0
  63. package/dist/resources/2013/PulledTaffy.d.ts +9 -0
  64. package/dist/resources/2013/PulledTaffy.js +33 -0
  65. package/dist/resources/2014/WinterGarden.js +15 -43
  66. package/dist/resources/2015/ChateauMantegna.js +52 -86
  67. package/dist/resources/2015/MayoClinic.d.ts +13 -0
  68. package/dist/resources/2015/MayoClinic.js +36 -0
  69. package/dist/resources/2016/SourceTerminal.d.ts +1 -0
  70. package/dist/resources/2016/SourceTerminal.js +114 -237
  71. package/dist/resources/2016/Witchess.js +33 -59
  72. package/dist/resources/2017/TunnelOfLove.js +62 -111
  73. package/dist/resources/2018/SongBoom.js +32 -68
  74. package/dist/resources/2019/BeachComb.d.ts +2 -0
  75. package/dist/resources/2019/BeachComb.js +26 -0
  76. package/dist/resources/2019/Snapper.d.ts +28 -0
  77. package/dist/resources/2019/Snapper.js +70 -0
  78. package/dist/resources/2020/Guzzlr.js +79 -163
  79. package/dist/resources/LibramSummon.d.ts +12 -0
  80. package/dist/resources/LibramSummon.js +66 -0
  81. package/dist/resources/index.d.ts +18 -11
  82. package/dist/resources/index.js +19 -85
  83. package/dist/resources/putty-likes.js +15 -30
  84. package/dist/ring-buffer.d.ts +24 -0
  85. package/dist/ring-buffer.js +135 -0
  86. package/dist/since.d.ts +1 -0
  87. package/dist/since.js +56 -112
  88. package/dist/template-string.js +40 -132
  89. package/dist/utils.d.ts +14 -0
  90. package/dist/utils.js +50 -114
  91. package/package.json +5 -3
  92. package/dist/libram-example-briefcase.js +0 -16073
  93. package/dist/libram-example-clan.js +0 -8898
  94. package/dist/libram-example-consult.js +0 -6179
  95. package/dist/libram-example-item.js +0 -3248
  96. package/dist/libram-example-kmail.js +0 -2065
  97. package/dist/libram-example-lib.js +0 -7608
  98. package/dist/libram-example-props.js +0 -4770
  99. package/dist/libram-example-resources.js +0 -12226
@@ -1,87 +1,53 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.array.slice.js");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.have = have;
9
- exports.paintingMonster = paintingMonster;
10
- exports.paintingFought = paintingFought;
11
- exports.fightPainting = fightPainting;
12
- exports.getDesk = getDesk;
13
- exports.getCeiling = getCeiling;
14
- exports.getNightstand = getNightstand;
15
- exports.changeDesk = changeDesk;
16
- exports.changeCeiling = changeCeiling;
17
- exports.changeNightstand = changeNightstand;
18
-
19
- require("core-js/modules/es.array.find.js");
20
-
21
- require("core-js/modules/es.array.includes.js");
22
-
23
- require("core-js/modules/es.string.includes.js");
24
-
25
- var _kolmafia = require("kolmafia");
26
-
27
- var _templateString = require("../../template-string");
28
-
29
- var _property = require("../../property");
30
-
31
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
32
-
33
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
34
-
35
- function have() {
36
- return (0, _property.get)("chateauAvailable");
1
+ import { buy, getChateau, runCombat, visitUrl } from "kolmafia";
2
+ import { $item, $items } from "../../template-string";
3
+ import { get } from "../../property";
4
+ export function have() {
5
+ return get("chateauAvailable");
6
+ }
7
+ export function paintingMonster() {
8
+ return get("chateauMonster");
9
+ }
10
+ export function paintingFought() {
11
+ return get("_chateauMonsterFought");
12
+ }
13
+ export function fightPainting() {
14
+ visitUrl("place.php?whichplace=chateau&action=chateau_painting", false);
15
+ return runCombat();
16
+ }
17
+ const desks = $items `fancy stationery set, Swiss piggy bank, continental juice bar`;
18
+ const ceilings = $items `antler chandelier, ceiling fan, artificial skylight`;
19
+ const nightstands = $items `foreign language tapes, bowl of potpourri, electric muscle stimulator`;
20
+ export function getDesk() {
21
+ return (desks.find((desk) => Object.keys(getChateau()).includes(desk.name)) ||
22
+ $item `none`);
23
+ }
24
+ export function getCeiling() {
25
+ return (ceilings.find((ceiling) => Object.keys(getChateau()).includes(ceiling.name)) || $item `none`);
26
+ }
27
+ export function getNightstand() {
28
+ return (nightstands.find((nightstand) => Object.keys(getChateau()).includes(nightstand.name)) || $item `none`);
29
+ }
30
+ export function changeDesk(desk) {
31
+ if (getDesk() === desk)
32
+ return true;
33
+ if (!desks.includes(desk))
34
+ return false;
35
+ buy(desk);
36
+ return getDesk() === desk;
37
+ }
38
+ export function changeCeiling(ceiling) {
39
+ if (getCeiling() === ceiling)
40
+ return true;
41
+ if (!ceilings.includes(ceiling))
42
+ return false;
43
+ buy(ceiling);
44
+ return getCeiling() === ceiling;
45
+ }
46
+ export function changeNightstand(nightstand) {
47
+ if (getNightstand() === nightstand)
48
+ return true;
49
+ if (!nightstands.includes(nightstand))
50
+ return false;
51
+ buy(nightstand);
52
+ return getNightstand() === nightstand;
37
53
  }
38
-
39
- function paintingMonster() {
40
- return (0, _property.get)("chateauMonster");
41
- }
42
-
43
- function paintingFought() {
44
- return (0, _property.get)("_chateauMonsterFought");
45
- }
46
-
47
- function fightPainting() {
48
- (0, _kolmafia.visitUrl)("place.php?whichplace=chateau&action=chateau_painting", false);
49
- return (0, _kolmafia.runCombat)();
50
- }
51
-
52
- var desks = (0, _templateString.$items)(_templateObject || (_templateObject = _taggedTemplateLiteral(["fancy stationery set, Swiss piggy bank, continental juice bar"])));
53
- var ceilings = (0, _templateString.$items)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["antler chandelier, ceiling fan, artificial skylight"])));
54
- var nightstands = (0, _templateString.$items)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["foreign language tapes, bowl of potpourri, electric muscle stimulator"])));
55
-
56
- function getDesk() {
57
- return desks.find(desk => Object.keys((0, _kolmafia.getChateau)()).includes(desk.name)) || (0, _templateString.$item)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["none"])));
58
- }
59
-
60
- function getCeiling() {
61
- return ceilings.find(ceiling => Object.keys((0, _kolmafia.getChateau)()).includes(ceiling.name)) || (0, _templateString.$item)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["none"])));
62
- }
63
-
64
- function getNightstand() {
65
- return nightstands.find(nightstand => Object.keys((0, _kolmafia.getChateau)()).includes(nightstand.name)) || (0, _templateString.$item)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["none"])));
66
- }
67
-
68
- function changeDesk(desk) {
69
- if (getDesk() === desk) return true;
70
- if (!desks.includes(desk)) return false;
71
- (0, _kolmafia.buy)(desk);
72
- return getDesk() === desk;
73
- }
74
-
75
- function changeCeiling(ceiling) {
76
- if (getCeiling() === ceiling) return true;
77
- if (!ceilings.includes(ceiling)) return false;
78
- (0, _kolmafia.buy)(ceiling);
79
- return getCeiling() === ceiling;
80
- }
81
-
82
- function changeNightstand(nightstand) {
83
- if (getNightstand() === nightstand) return true;
84
- if (!nightstands.includes(nightstand)) return false;
85
- (0, _kolmafia.buy)(nightstand);
86
- return getNightstand() === nightstand;
87
- }
@@ -0,0 +1,13 @@
1
+ import "core-js/modules/es.object.values";
2
+ export declare const Mayo: {
3
+ nex: Item;
4
+ diol: Item;
5
+ zapine: Item;
6
+ flex: Item;
7
+ };
8
+ /**
9
+ * Sets mayo minder to a particular mayo, and ensures you have enough of it.
10
+ * @param mayo Mayo to use
11
+ * @param quantity Quantity to ensure
12
+ */
13
+ export declare function setMayoMinder(mayo: Item, quantity?: number): boolean;
@@ -0,0 +1,36 @@
1
+ import "core-js/modules/es.object.values";
2
+ import { buy, getWorkshed, retrieveItem, toInt, use } from "kolmafia";
3
+ import { have } from "../../lib";
4
+ import logger from "../../logger";
5
+ import { get, withChoice } from "../../property";
6
+ import { $item } from "../../template-string";
7
+ export const Mayo = {
8
+ nex: $item `Mayonex`,
9
+ diol: $item `Mayodiol`,
10
+ zapine: $item `Mayozapine`,
11
+ flex: $item `Mayoflex`,
12
+ };
13
+ /**
14
+ * Sets mayo minder to a particular mayo, and ensures you have enough of it.
15
+ * @param mayo Mayo to use
16
+ * @param quantity Quantity to ensure
17
+ */
18
+ export function setMayoMinder(mayo, quantity = 1) {
19
+ if (getWorkshed() !== $item `portable Mayo Clinic`)
20
+ return false;
21
+ if (!Object.values(Mayo).includes(mayo)) {
22
+ logger.error("Invalid mayo selected");
23
+ return false;
24
+ }
25
+ if (get("mayoInMouth") && get("mayoInMouth") !== mayo.name) {
26
+ logger.error("Currently have incorrect mayo in mouth");
27
+ return false;
28
+ }
29
+ retrieveItem(quantity, mayo);
30
+ if (!have($item `Mayo Minder™`))
31
+ buy($item `Mayo Minder™`);
32
+ if (get("mayoMinderSetting") !== mayo.name) {
33
+ withChoice(1076, toInt(mayo) - 8260, () => use($item `Mayo Minder™`));
34
+ }
35
+ return get("mayoMinderSetting") === mayo.name;
36
+ }
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.object.values";
1
2
  import { Copier } from "../../Copier";
2
3
  export declare const item: Item;
3
4
  export declare function have(): boolean;
@@ -1,82 +1,13 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.symbol.js");
4
-
5
- require("core-js/modules/es.symbol.description.js");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.have = have;
11
- exports.enhance = enhance;
12
- exports.enquiry = enquiry;
13
- exports.educate = educate;
14
- exports.getSkills = getSkills;
15
- exports.isCurrentSkill = isCurrentSkill;
16
- exports.extrude = extrude;
17
- exports.getChips = getChips;
18
- exports.getDigitizeUses = getDigitizeUses;
19
- exports.getDigitizeMonster = getDigitizeMonster;
20
- exports.getDigitizeMonsterCount = getDigitizeMonsterCount;
21
- exports.getMaximumDigitizeUses = getMaximumDigitizeUses;
22
- exports.getDigitizeUsesRemaining = getDigitizeUsesRemaining;
23
- exports.couldDigitize = couldDigitize;
24
- exports.prepareDigitize = prepareDigitize;
25
- exports.canDigitize = canDigitize;
26
- exports.getDuplicateUses = getDuplicateUses;
27
- exports.getEnhanceUses = getEnhanceUses;
28
- exports.getPortscanUses = getPortscanUses;
29
- exports.Digitize = exports.Items = exports.Skills = exports.RolloverBuffs = exports.Buffs = exports.item = void 0;
30
-
31
- require("core-js/modules/es.array.includes.js");
32
-
33
- require("core-js/modules/es.string.includes.js");
34
-
35
- require("core-js/modules/es.object.values.js");
36
-
37
- require("core-js/modules/es.array.slice.js");
38
-
39
- require("core-js/modules/es.array.map.js");
40
-
41
- require("core-js/modules/es.array.filter.js");
42
-
43
- require("core-js/modules/es.array.iterator.js");
44
-
45
- require("core-js/modules/es.object.to-string.js");
46
-
47
- require("core-js/modules/es.regexp.exec.js");
48
-
49
- require("core-js/modules/es.string.split.js");
50
-
51
- var _kolmafia = require("kolmafia");
52
-
53
- var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
54
-
55
- var _Copier = require("../../Copier");
56
-
57
- var _lib = require("../../lib");
58
-
59
- var _property = require("../../property");
60
-
61
- var _templateString = require("../../template-string");
62
-
63
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27;
64
-
65
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
66
-
67
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
68
-
69
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
70
-
71
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
72
-
73
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
74
-
75
- var item = (0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Source terminal"])));
76
- exports.item = item;
77
-
78
- function have() {
79
- return (0, _lib.haveInCampground)(item);
1
+ import "core-js/modules/es.object.values";
2
+ import { cliExecute } from "kolmafia";
3
+ import isEqual from "lodash/isEqual";
4
+ import { Copier } from "../../Copier";
5
+ import { haveInCampground } from "../../lib";
6
+ import { get } from "../../property";
7
+ import { $effect, $item, $skill } from "../../template-string";
8
+ export const item = $item `Source terminal`;
9
+ export function have() {
10
+ return haveInCampground(item);
80
11
  }
81
12
  /**
82
13
  * Buffs that can be acquired from Enhance
@@ -88,87 +19,65 @@ function have() {
88
19
  * - Damage: +5 Prismatic Damage
89
20
  * - Substats: +3 Stats Per Fight
90
21
  */
91
-
92
-
93
- var Buffs = {
94
- Items: (0, _templateString.$effect)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["items.enh"]))),
95
- Meat: (0, _templateString.$effect)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["meat.enh"]))),
96
- Init: (0, _templateString.$effect)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["init.enh"]))),
97
- Critical: (0, _templateString.$effect)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["critical.enh"]))),
98
- Damage: (0, _templateString.$effect)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["damage.enh"]))),
99
- Substats: (0, _templateString.$effect)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["substats.enh"])))
22
+ export const Buffs = {
23
+ Items: $effect `items.enh`,
24
+ Meat: $effect `meat.enh`,
25
+ Init: $effect `init.enh`,
26
+ Critical: $effect `critical.enh`,
27
+ Damage: $effect `damage.enh`,
28
+ Substats: $effect `substats.enh`,
100
29
  };
101
30
  /**
102
31
  * Acquire a buff from the Source Terminal
103
32
  * @param buff The buff to acquire
104
33
  * @see Buffs
105
34
  */
106
-
107
- exports.Buffs = Buffs;
108
-
109
- function enhance(buff) {
110
- if (!Object.values(Buffs).includes(buff)) {
111
- return false;
112
- }
113
-
114
- return (0, _kolmafia.cliExecute)("terminal enhance ".concat(buff.name));
35
+ export function enhance(buff) {
36
+ if (!Object.values(Buffs).includes(buff)) {
37
+ return false;
38
+ }
39
+ return cliExecute(`terminal enhance ${buff.name}`);
115
40
  }
116
41
  /**
117
42
  * Rollover buffs that can be acquired from Enquiry
118
43
  */
119
-
120
-
121
- var RolloverBuffs = {
122
- /** +5 Familiar Weight */
123
- Familiar: (0, _templateString.$effect)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["familiar.enq"]))),
124
-
125
- /** +25 ML */
126
- Monsters: (0, _templateString.$effect)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["monsters.enq"]))),
127
-
128
- /** +5 Prismatic Resistance */
129
- Protect: (0, _templateString.$effect)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["protect.enq"]))),
130
-
131
- /** +100% Muscle, +100% Mysticality, +100% Moxie */
132
- Stats: (0, _templateString.$effect)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["stats.enq"])))
44
+ export const RolloverBuffs = {
45
+ /** +5 Familiar Weight */
46
+ Familiar: $effect `familiar.enq`,
47
+ /** +25 ML */
48
+ Monsters: $effect `monsters.enq`,
49
+ /** +5 Prismatic Resistance */
50
+ Protect: $effect `protect.enq`,
51
+ /** +100% Muscle, +100% Mysticality, +100% Moxie */
52
+ Stats: $effect `stats.enq`,
133
53
  };
134
54
  /**
135
55
  * Acquire a buff from the Source Terminal
136
56
  * @param buff The buff to acquire
137
57
  * @see RolloverBuffs
138
58
  */
139
-
140
- exports.RolloverBuffs = RolloverBuffs;
141
-
142
- function enquiry(rolloverBuff) {
143
- if (!Object.values(RolloverBuffs).includes(rolloverBuff)) {
144
- return false;
145
- }
146
-
147
- return (0, _kolmafia.cliExecute)("terminal enquiry ".concat(rolloverBuff.name));
59
+ export function enquiry(rolloverBuff) {
60
+ if (!Object.values(RolloverBuffs).includes(rolloverBuff)) {
61
+ return false;
62
+ }
63
+ return cliExecute(`terminal enquiry ${rolloverBuff.name}`);
148
64
  }
149
65
  /**
150
66
  * Skills that can be acquired from Enhance
151
67
  */
152
-
153
-
154
- var Skills = {
155
- /** Collect Source essence from enemies once per combat */
156
- Extract: (0, _templateString.$skill)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["Extract"]))),
157
-
158
- /** Stagger and create a wandering monster 1-3 times per day */
159
- Digitize: (0, _templateString.$skill)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["Digitize"]))),
160
-
161
- /** Stagger and deal 25% of enemy HP in damage once per combat */
162
- Compress: (0, _templateString.$skill)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["Compress"]))),
163
-
164
- /** Double monster's HP, attack, defence, attacks per round and item drops once per fight and once per day (five in The Source) */
165
- Duplicate: (0, _templateString.$skill)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["Duplicate"]))),
166
-
167
- /** Causes government agent/Source Agent wanderer next turn once per combat and three times per day */
168
- Portscan: (0, _templateString.$skill)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["Portscan"]))),
169
-
170
- /** Increase Max MP by 100% and recover 1000 MP once per combat with a 30 turn cooldown */
171
- Turbo: (0, _templateString.$skill)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["Turbo"])))
68
+ export const Skills = {
69
+ /** Collect Source essence from enemies once per combat */
70
+ Extract: $skill `Extract`,
71
+ /** Stagger and create a wandering monster 1-3 times per day */
72
+ Digitize: $skill `Digitize`,
73
+ /** Stagger and deal 25% of enemy HP in damage once per combat */
74
+ Compress: $skill `Compress`,
75
+ /** Double monster's HP, attack, defence, attacks per round and item drops once per fight and once per day (five in The Source) */
76
+ Duplicate: $skill `Duplicate`,
77
+ /** Causes government agent/Source Agent wanderer next turn once per combat and three times per day */
78
+ Portscan: $skill `Portscan`,
79
+ /** Increase Max MP by 100% and recover 1000 MP once per combat with a 30 turn cooldown */
80
+ Turbo: $skill `Turbo`,
172
81
  };
173
82
  /**
174
83
  * Make a skill available.
@@ -176,162 +85,130 @@ var Skills = {
176
85
  * @param skill Skill to learn
177
86
  * @see Skills
178
87
  */
179
-
180
- exports.Skills = Skills;
181
-
182
- function educate(skills) {
183
- var skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
184
- if ((0, _isEqual.default)(skillsArray, getSkills())) return true;
185
-
186
- var _iterator = _createForOfIteratorHelper(skillsArray),
187
- _step;
188
-
189
- try {
190
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
191
- var skill = _step.value;
192
- if (!Object.values(Skills).includes(skill)) return false;
193
- (0, _kolmafia.cliExecute)("terminal educate ".concat(skill.name.toLowerCase(), ".edu"));
88
+ export function educate(skills) {
89
+ const skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
90
+ if (isEqual(skillsArray, getSkills()))
91
+ return true;
92
+ for (const skill of skillsArray) {
93
+ if (!Object.values(Skills).includes(skill))
94
+ return false;
95
+ cliExecute(`terminal educate ${skill.name.toLowerCase()}.edu`);
194
96
  }
195
- } catch (err) {
196
- _iterator.e(err);
197
- } finally {
198
- _iterator.f();
199
- }
200
-
201
- return true;
97
+ return true;
202
98
  }
203
99
  /**
204
100
  * Return the Skills currently available from Source Terminal
205
101
  */
206
-
207
-
208
- function getSkills() {
209
- return ["sourceTerminalEducate1", "sourceTerminalEducate2"].map(p => (0, _property.get)(p)).filter(s => s !== "").map(s => Skill.get(s.slice(0, -4)));
102
+ export function getSkills() {
103
+ return ["sourceTerminalEducate1", "sourceTerminalEducate2"]
104
+ .map((p) => get(p))
105
+ .filter((s) => s !== "")
106
+ .map((s) => Skill.get(s.slice(0, -4)));
210
107
  }
211
-
212
- function isCurrentSkill(skills) {
213
- var currentSkills = getSkills();
214
- var skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
215
- return skillsArray.every(skill => currentSkills.includes(skill));
108
+ export function isCurrentSkill(skills) {
109
+ const currentSkills = getSkills();
110
+ const skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
111
+ return skillsArray.every((skill) => currentSkills.includes(skill));
216
112
  }
217
113
  /**
218
114
  * Items that can be generated by the Source Terminal
219
115
  */
220
-
221
-
222
- var Items = new Map([[(0, _templateString.$item)(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["browser cookie"]))), "food.ext"], [(0, _templateString.$item)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["hacked gibson"]))), "booze.ext"], [(0, _templateString.$item)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["Source shades"]))), "goggles.ext"], [(0, _templateString.$item)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["Source terminal GRAM chip"]))), "gram.ext"], [(0, _templateString.$item)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["Source terminal PRAM chip"]))), "pram.ext"], [(0, _templateString.$item)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["Source terminal SPAM chip"]))), "spam.ext"], [(0, _templateString.$item)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["Source terminal CRAM chip"]))), "cram.ext"], [(0, _templateString.$item)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["Source terminal DRAM chip"]))), "dram.ext"], [(0, _templateString.$item)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["Source terminal TRAM chip"]))), "tram.ext"], [(0, _templateString.$item)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["software bug"]))), "familiar.ext"]]);
116
+ export const Items = new Map([
117
+ [$item `browser cookie`, "food.ext"],
118
+ [$item `hacked gibson`, "booze.ext"],
119
+ [$item `Source shades`, "goggles.ext"],
120
+ [$item `Source terminal GRAM chip`, "gram.ext"],
121
+ [$item `Source terminal PRAM chip`, "pram.ext"],
122
+ [$item `Source terminal SPAM chip`, "spam.ext"],
123
+ [$item `Source terminal CRAM chip`, "cram.ext"],
124
+ [$item `Source terminal DRAM chip`, "dram.ext"],
125
+ [$item `Source terminal TRAM chip`, "tram.ext"],
126
+ [$item `software bug`, "familiar.ext"],
127
+ ]);
223
128
  /**
224
129
  * Collect an item from the Source Terminal (up to three times a day)
225
130
  * @param item Item to collect
226
131
  * @see Items
227
132
  */
228
-
229
- exports.Items = Items;
230
-
231
- function extrude(item) {
232
- var fileName = Items.get(item);
233
- if (!fileName) return false;
234
- return (0, _kolmafia.cliExecute)("terminal extrude ".concat(fileName));
133
+ export function extrude(item) {
134
+ const fileName = Items.get(item);
135
+ if (!fileName)
136
+ return false;
137
+ return cliExecute(`terminal extrude ${fileName}`);
235
138
  }
236
139
  /**
237
140
  * Return chips currently installed to player's Source Terminal
238
141
  */
239
-
240
-
241
- function getChips() {
242
- return (0, _property.get)("sourceTerminalChips").split(",");
142
+ export function getChips() {
143
+ return get("sourceTerminalChips").split(",");
243
144
  }
244
145
  /**
245
146
  * Return number of times digitize was cast today
246
147
  */
247
-
248
-
249
- function getDigitizeUses() {
250
- return (0, _property.get)("_sourceTerminalDigitizeUses");
148
+ export function getDigitizeUses() {
149
+ return get("_sourceTerminalDigitizeUses");
251
150
  }
252
151
  /**
253
152
  * Return Monster that is currently digitized, else null
254
153
  */
255
-
256
-
257
- function getDigitizeMonster() {
258
- return (0, _property.get)("_sourceTerminalDigitizeMonster");
154
+ export function getDigitizeMonster() {
155
+ return get("_sourceTerminalDigitizeMonster");
259
156
  }
260
157
  /**
261
158
  * Return number of digitized monsters encountered since it was last cast
262
159
  */
263
-
264
-
265
- function getDigitizeMonsterCount() {
266
- return (0, _property.get)("_sourceTerminalDigitizeMonsterCount");
160
+ export function getDigitizeMonsterCount() {
161
+ return get("_sourceTerminalDigitizeMonsterCount");
267
162
  }
268
163
  /**
269
164
  * Return maximum number of digitizes player can cast
270
165
  */
271
-
272
-
273
- function getMaximumDigitizeUses() {
274
- var chips = getChips();
275
- return 1 + (chips.includes("TRAM") ? 1 : 0) + (chips.includes("TRIGRAM") ? 1 : 0);
166
+ export function getMaximumDigitizeUses() {
167
+ const chips = getChips();
168
+ return (1 + (chips.includes("TRAM") ? 1 : 0) + (chips.includes("TRIGRAM") ? 1 : 0));
276
169
  }
277
170
  /**
278
171
  * Returns the current day's number of remaining digitize uses
279
172
  */
280
-
281
-
282
- function getDigitizeUsesRemaining() {
283
- return getMaximumDigitizeUses() - getDigitizeUses();
173
+ export function getDigitizeUsesRemaining() {
174
+ return getMaximumDigitizeUses() - getDigitizeUses();
284
175
  }
285
176
  /**
286
177
  * Returns whether the player could theoretically cast Digitize
287
178
  */
288
-
289
-
290
- function couldDigitize() {
291
- return getDigitizeUses() < getMaximumDigitizeUses();
179
+ export function couldDigitize() {
180
+ return getDigitizeUses() < getMaximumDigitizeUses();
292
181
  }
293
-
294
- function prepareDigitize() {
295
- if (!isCurrentSkill(Skills.Digitize)) {
296
- return educate(Skills.Digitize);
297
- }
298
-
299
- return true;
182
+ export function prepareDigitize() {
183
+ if (!isCurrentSkill(Skills.Digitize)) {
184
+ return educate(Skills.Digitize);
185
+ }
186
+ return true;
300
187
  }
301
188
  /**
302
189
  * Returns whether the player can cast Digitize immediately
303
190
  * This only considers whether the player has learned the skill
304
191
  * and has sufficient daily casts remaining, not whether they have sufficient MP
305
192
  */
306
-
307
-
308
- function canDigitize() {
309
- return couldDigitize() && getSkills().includes(Skills.Digitize);
193
+ export function canDigitize() {
194
+ return couldDigitize() && getSkills().includes(Skills.Digitize);
310
195
  }
311
-
312
- var Digitize = new _Copier.Copier(() => couldDigitize(), () => prepareDigitize(), () => canDigitize(), () => getDigitizeMonster());
196
+ export const Digitize = new Copier(() => couldDigitize(), () => prepareDigitize(), () => canDigitize(), () => getDigitizeMonster());
313
197
  /**
314
198
  * Return number of times duplicate was cast today
315
199
  */
316
-
317
- exports.Digitize = Digitize;
318
-
319
- function getDuplicateUses() {
320
- return (0, _property.get)("_sourceTerminalDuplicateUses");
200
+ export function getDuplicateUses() {
201
+ return get("_sourceTerminalDuplicateUses");
321
202
  }
322
203
  /**
323
204
  * Return number of times enhance was cast today
324
205
  */
325
-
326
-
327
- function getEnhanceUses() {
328
- return (0, _property.get)("_sourceTerminalEnhanceUses");
206
+ export function getEnhanceUses() {
207
+ return get("_sourceTerminalEnhanceUses");
329
208
  }
330
209
  /**
331
210
  * Return number of times portscan was cast today
332
211
  */
333
-
334
-
335
- function getPortscanUses() {
336
- return (0, _property.get)("_sourceTerminalPortscanUses");
337
- }
212
+ export function getPortscanUses() {
213
+ return get("_sourceTerminalPortscanUses");
214
+ }