-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHoldfastHelperV2.html
286 lines (270 loc) · 18.4 KB
/
HoldfastHelperV2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Holdfast Helper</title>
<link rel="stylesheet" href="css/HoldfastHelperV2.css" type="text/css" media="all">
<script type="text/javascript" src="js/HoldfastHelperV2.js" defer></script>
</head>
<body>
<header>
<h3 style="text-align: center;">Holdfast Helper</h3>
<div>
<p>This unofficial tool lets you track your character stats and equipment, roll dice and resolve combat faster and more easily in Holdfast. You can save this HTML file locally to use it offline, but values are <b>not</b> stored within the file. To save your progress, you can either:</p>
<ul style="margin-top: -5px;">
<li style="margin-bottom: 5px;">Use local storage with the <em>Save</em> and <em>Load</em> buttons, which is specific to this browser on this device/user account. Note that only one save can exist in local storage, and it may accidentally get deleted if you clear your browser’s cache or history. This feature is disabled when browsing in incognito mode.</li>
<li>Export it to a JSON file that can be re-imported from any other device/browser.</li>
</ul>
<noscript><p class="warning">This tool requires JavaScript, which is not currently enabled in your browser!</p></noscript>
</div>
<p class="center">
<button onclick="saveToStorage('storage')">Save</button>
<button onclick="loadFromStorage()">Load</button>
<button onclick="saveToStorage('clipboard')">Export to clipboard</button>
<button onclick="saveToStorage('download')">Export to file</button>
<button onclick="document.getElementById('file-selector').click()">Import JSON file</button><input type="file" id="file-selector" accept=".json" style="display: none;">
<button onclick="toggleInstructions()">Toggle instructions</button>
</p>
</header>
<main>
<section id="character">
<h4>Character</h4>
<p class="info">Click <em>Create Character</em> to clear your character sheet and get new Defense and Skill values, as well as your starting Copper and equipment. Click <em>Take Wound</em> to adjust your Defense scores and Glory when your Defense reaches 0.</p>
<p class="center">
<button onclick="createCharacter()">Create Character</button>
<button onclick="createCharacter(true)">Easy mode (max values)</button>
<button onclick="applyWound()">Take Wound</button>
</p>
<output id="WoundFeedback" class="center"></output>
<section class="char-stats-grid">
<p>Defense:</p>
<input type="number" id="CurrentDefense" value="0" />
<p>Max Defense:</p>
<input type="number" id="MaxDefense" value="0" />
<p>Armor:</p>
<input type="number" id="Armor" value="0" />
<p>Skill:</p>
<input type="number" id="Skill" value="0" />
<p>Morale:</p>
<input type="number" id="Morale" value="0" />
<p>Glory:</p>
<input type="number" id="Glory" value="0" />
</section>
<details>
<summary>Backgrounds</summary>
<input type="checkbox" id="Bardsong"> <label for="Bardsong">Bardsong</label><br />
<p class="background-desc">Gain a d6 boon after each adventure</p>
<input type="checkbox" id="DarkBreaker"> <label for="DarkBreaker">Dark-breaker</label><br />
<input type="checkbox" id="Forgecraft"> <label for="Forgecraft">Forgecraft</label><br />
<p class="background-desc">May use Forgecrafting rules from Setting Guide, Appendix 8</p>
<input type="checkbox" id="Healing"> <label for="Healing">Healing</label><br />
<p class="background-desc">Heal 2 Defense after every combat</p>
<input type="checkbox" id="KroachKin"> <label for="KroachKin">Kroach-kin</label><br />
<p class="background-desc">+1 Skill & Damage against orcs</p>
<input type="checkbox" id="Leadership"> <label for="Leadership">Leadership</label><br />
<p class="background-desc">+1 Morale at game start</p>
<input type="checkbox" id="Mechanics"> <label for="Mechanics">Mechanics</label><br />
<p class="background-desc">Gain a d4 boon each time you equip an item slot for the first time</p>
<input type="checkbox" id="Pathfinding"> <label for="Pathfinding">Pathfinding</label><br />
<input type="checkbox" id="Scrounging"> <label for="Scrounging">Scrounging</label><br />
<p class="background-desc">+1 gold/silver gained whenever you <em>find</em> gold/silver</p>
<input type="checkbox" id="Skullduggery"> <label for="Skullduggery">Skullduggery</label><br />
<p class="background-desc">Test your luck (3) for a free Gambit before combat begins</p>
<input type="checkbox" id="WeaponExpert"> <label for="WeaponExpert">Weapon Expert</label> <input type="text" id="WeaponExpertise" value="allo" placeholder="Axe, Dagger, Fists, Mace, Spear, Sword, Warhammer" size="34" /><br />
<p class="background-desc">+2 Skill when using your weapon of choice</p>
</details>
</section>
<section id="combat">
<h4>Combat Tracker</h4>
<p class="info">Enter your Initiative and enemy info, then click <em>Start Combat</em> to calculate your current Defense including Armor. Click <em>Roll Initiative</em> each round to see the resulting base damage and available actions. After combat ends, remember to update your current Defense above.</p>
<section class="combat-grid">
<h5>Enemy</h5>
<p class="enemy-defense">Defense:</p> <input type="number" id="EnemyDefense" value="0" />
<p class="enemy-skill">Skill:</p> <input type="number" id="EnemySkill" value="0" />
<p class="enemy-claw">Claw: <input id="ClawText" type="text" /></p>
<h5>Player</h5>
<p class="player-defense">Defense:</p> <input type="number" id="CombatDefense" value="0" />
<p class="player-ini">Initiative:</p> <input type="number" id="Initiative" value="0" />
<p class="player-notes">Notes: <input id="CombatNotes" type="text" /></p>
<button class="start-combat" onclick="CombatStart()">Start Combat</button>
<button class="roll-ini" onclick="rollCombatDie()">Roll Initiative</button>
<p id="CombatRoll"></p>
<p class="enemy-damage">Base <b>Enemy</b> damage: <b id="EnemyDamage"></b></p>
<p class="player-damage">Base <b>Player</b> damage: <b id="PlayerDamage"></b></p>
<p class="available-actions">Available actions: <b id="AvailableActions"></b></p>
</section>
</section>
<section id="boons">
<h4>Boons & Dice</h4>
<p class="info">Track your boons below, and use them or roll generic dice with the following buttons.</p>
<section>
<p>d4 boons: <input type="number" id="d4Boons" value="0" /> <button onclick="rollD(4, true)">Use</button> <button onclick="rollD(4)">Roll d4</button></p>
<p>d6 boons: <input type="number" id="d6Boons" value="0" /> <button onclick="rollD(6, true)">Use</button> <button onclick="rollD(6)">Roll d6</button></p>
<p>d8 boons: <input type="number" id="d8Boons" value="0" /> <button onclick="rollD(8, true)">Use</button> <button onclick="rollD(8)">Roll d8</button></p>
<p>d10 boons: <input type="number" id="d10Boons" value="0" /> <button onclick="rollD(10, true)">Use</button> <button onclick="rollD(10)">Roll d10</button></p>
<p>d12 boons: <input type="number" id="d12Boons" value="0" /> <button onclick="rollD(12, true)">Use</button> <button onclick="rollD(12)">Roll d12</button></p>
<p>d20 boons: <input type="number" id="d20Boons" value="0" /> <button onclick="rollD(20, true)">Use</button> <button onclick="rollD(20)">Roll d20</button></p>
</section>
<div id="dieroll"></div>
<details>
<summary>Combat Boons</summary>
1: <abbr title=\"Cancel Claw actions for x rounds\">Prevent</abbr>/4 Rounds<br>
2: +2 Initiative<br>
3: +3 Damage<br>
4: +1d4 <abbr title=\"Regain x Defense\">Heal</abbr><br>
5: +1 Damage, +1d4 <abbr title=\"Regain x Defense\">Heal</abbr><br>
6: +1 <abbr title=\"Optionally use an item in your bag in the current combat phase\">Item</abbr><br>
7: +1d6 Damage, +1d6 <abbr title=\"Regain x Defense\">Heal</abbr><br>
8: +1d6 Damage, +1d6 <abbr title=\"Regain x Defense\">Heal</abbr>, +1d6 Initiative<br>
9: +4 <abbr title=\"Cancel x damage this round\">Guard</abbr><br>
10: <abbr title="You may use the specified action immediately">Select</abbr> Any/1 Round<br>
11: +1d8 <abbr title=\"Regain x Defense\">Heal</abbr>, +3 <abbr title=\"Inflicts x damage per round, at the start of the round\">Bleed</abbr>/3 Rounds<br>
12: +1d8 Initiative, +1d8 Damage<br>
13: +4 <abbr title=\"Cancel x damage this round\">Guard</abbr>, <abbr title=\"Cancel Claw actions for x rounds\">Prevent</abbr>/4 Rounds<br>
14: +1d8 Initiative, +1d8 Damage, +1d8 <abbr title=\"Regain x Defense\">Heal</abbr><br>
15: +1d10 Initiative, +4 <abbr title=\"Cancel x damage this round\">Guard</abbr><br>
16: +1d10 Damage, <abbr title=\"Cancel Claw actions for x rounds\">Prevent</abbr>/4 Rounds<br>
17: +1d12 Initiative, +1d12 Damage, +1d12 <abbr title=\"Regain x Defense\">Heal</abbr><br>
18: <abbr title="You may use the specified action immediately">Select</abbr> Any/2 Rounds<br>
19: +1d12 Damage, Full Defense Restored<br>
20: Victory
</details>
</section>
<section id="adventures">
<h4>Act II Adventures</h4>
<p class="info">Keep track of which adventures you’ve started or completed during Act II. <em>Tip: There are 23 adventures, and you may only do 5 before starting Act III. If you want to try more without cheating or starting over, consider exporting a save file and naming it something like "Start of Act II" so you can start a future playthrough from this point.</em></p>
<details>
<summary>Adventures</summary>
<p><strong>Equipment, Treasure and Supplies</strong></p>
<input type="checkbox" id="Adv_DrownedKing"> <label for="Adv_DrownedKing">Axe of the Drowned King</label><br />
<input type="checkbox" id="Adv_GrayLords"> <label for="Adv_GrayLords">Death Devices of the Gray Lords</label><br />
<input type="checkbox" id="Adv_GoblinHoard"> <label for="Adv_GoblinHoard">Goblin Hoard</label><br />
<input type="checkbox" id="Adv_ShipDamned"> <label for="Adv_ShipDamned">Ship of the Damned <em>(bonus PDF)</em></label><br />
<input type="checkbox" id="Adv_Shipments"> <label for="Adv_Shipments">Shipments to the Hold</label><br />
<input type="checkbox" id="Adv_Armorsmith"> <label for="Adv_Armorsmith">The Work of the Armorsmith</label><br />
<p><strong>Allies</strong></p>
<input type="checkbox" id="Adv_Dicemakers"> <label for="Adv_Dicemakers">Deal with the Dicemakers</label><br />
<input type="checkbox" id="Adv_ZorunBan"> <label for="Adv_ZorunBan">King of Zorun Ban</label><br />
<input type="checkbox" id="Adv_Shieldrest"> <label for="Adv_Shieldrest">Mercenaries of Shieldrest</label><br />
<input type="checkbox" id="Adv_MerchantKings"> <label for="Adv_MerchantKings">Merchant Kings of the Deeps</label><br />
<input type="checkbox" id="Adv_PitFighters"> <label for="Adv_PitFighters">Pit-Fighters</label><br />
<input type="checkbox" id="Adv_Refugees"> <label for="Adv_Refugees">Refugees at the Hold</label><br />
<input type="checkbox" id="Adv_Ssahaa"> <label for="Adv_Ssahaa">Trog City of Ssahaa</label><br />
<input type="checkbox" id="Adv_BattlePriests1"> <label for="Adv_BattlePriests1">Wandering Battle Priests I</label><br />
<input type="checkbox" id="Adv_BattlePriests2"> <label for="Adv_BattlePriests2">Wandering Battle Priests II</label><br />
<p><strong>Local Threats and Mysteries</strong></p>
<input type="checkbox" id="Adv_BlackGate"> <label for="Adv_BlackGate">Cavern of the Black Gate</label><br />
<input type="checkbox" id="Adv_RoofCrawlers"> <label for="Adv_RoofCrawlers">Labyrinth of the Roof-Crawlers</label><br />
<input type="checkbox" id="Adv_SecretCrossroadsHold"> <label for="Adv_SecretCrossroadsHold">Secret of Crossroads Hold</label><br />
<input type="checkbox" id="Adv_SpiralDelve"> <label for="Adv_SpiralDelve">Spiral Delve</label><br />
<input type="checkbox" id="Adv_SteelbackMine"> <label for="Adv_SteelbackMine">Terror at Steelback Mine</label><br />
<input type="checkbox" id="Adv_Tumbledown"> <label for="Adv_Tumbledown">Tumbledown</label><br />
<p><strong>Final Duty</strong></p>
<input type="checkbox" id="Adv_FinalDuty1"> <label for="Adv_FinalDuty1">Final Duty I</label><br />
<input type="checkbox" id="Adv_FinalDuty2"> <label for="Adv_FinalDuty2">Final Duty II <em>(go to 521)</em></label><br />
</details>
</section>
<section id="inventory">
<h4>Inventory</h4>
<p class="info">Select your equipped and carried items to display their effects.</p>
<p id="InventoryWarning" style="display: none;">The items equipped to your Left Hand and Right Hand slots require more than 2 hands total!</p>
<section class="inventory-grid">
<h5>Left Hand:</h5>
<select id="LeftHand" data-slots='["1H", "2H"]' onchange="itemDetails(this.id), validateHands()"></select>
<output id="LeftHandOutput"><b>Type:</b> Fist <b>Slot:</b> 1H <b>Attack:</b> +1 Damage <b>Defense:</b> +1 Initiative <b>Maneuver:</b> +2 Initiative <b>Gambit:</b> <abbr title="Cancel Claw actions for x rounds">Prevent</abbr>/2 Rounds</output>
<h5>Right Hand:</h5>
<select id="RightHand" data-slots='["1H", "2H"]' onchange="itemDetails(this.id), validateHands()"></select>
<output id="RightHandOutput"><b>Type:</b> Fist <b>Slot:</b> 1H <b>Attack:</b> +2 Damage <b>Defense:</b> +1 Damage <b>Maneuver:</b> +1 Damage <b>Gambit:</b> <abbr title="Choose one or more actions to apply immediately">Action Choice</abbr>/1 Round</output>
<h5>Spare:</h5>
<select id="Spare" data-slots='["1H", "2H"]' onchange="itemDetails(this.id)"></select>
<output id="SpareOutput" style="color: #333;"></output>
<h5>Body:</h5>
<select id="Body" data-slots='["Chest"]' onchange="itemDetails(this.id)"></select>
<output id="BodyOutput"></output>
<h5>Helmet:</h5>
<select id="Helmet" data-slots='["Head"]' onchange="itemDetails(this.id)"></select>
<output id="HelmetOutput"></output>
<h5>Boots:</h5>
<select id="Boots" data-slots='["Boots"]' onchange="itemDetails(this.id)"></select>
<output id="BootsOutput"></output>
<h5>Gloves:</h5>
<select id="Gloves" data-slots='["Hands"]' onchange="itemDetails(this.id)"></select>
<output id="GlovesOutput"></output>
<h5>Belt:</h5>
<select id="Belt" data-slots='["Belt"]' onchange="itemDetails(this.id)"></select>
<output id="BeltOutput"></output>
<h5>Amulet:</h5>
<select id="Amulet" data-slots='["Amulet"]' onchange="itemDetails(this.id)"></select>
<output id="AmuletOutput"></output>
<h5>Ring 1:</h5>
<select id="Ring1" data-slots='["Ring"]' onchange="itemDetails(this.id)"></select>
<output id="Ring1Output"></output>
<h5>Ring 2:</h5>
<select id="Ring2" data-slots='["Ring"]' onchange="itemDetails(this.id)"></select>
<output id="Ring2Output"></output>
<h5>Cloak:</h5>
<select id="Cloak" data-slots='["Cloak"]' onchange="itemDetails(this.id)"></select>
<output id="CloakOutput"></output>
<h5>Bag 1:</h5>
<select id="Bag1" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag1Output"></output>
<h5>Bag 2:</h5>
<select id="Bag2" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag2Output"></output>
<h5>Bag 3:</h5>
<select id="Bag3" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag3Output"></output>
<h5>Bag 4:</h5>
<select id="Bag4" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag4Output"></output>
<h5>Bag 5:</h5>
<select id="Bag5" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag5Output"></output>
<h5>Bag 6:</h5>
<select id="Bag6" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag6Output"></output>
<h5>Bag 7:</h5>
<select id="Bag7" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag7Output"></output>
<h5>Bag 8:</h5>
<select id="Bag8" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag8Output"></output>
<h5>Bag 9:</h5>
<select id="Bag9" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag9Output"></output>
<h5>Bag 10:</h5>
<select id="Bag10" data-slots='[""]' onchange="itemDetails(this.id)"></select>
<output id="Bag10Output"></output>
<h5>Unequippable<br />reference:</h5>
<select id="NonEquipItem" data-slots='[""]' onchange="itemDetails(this.id)" style="height: min-content;"></select>
<output id="NonEquipItemOutput"></output>
</section>
<h5>Coins: <output id="Coinage"></output> <span class="note">(can be converted 10:1 while in your hold or a city)</span></h5>
<section class="coinage-grid">
<h5>Copper:</h5> <input type="number" id="Copper" value="0" onchange="coinLimit()" onselectionchange="coinLimit()"/>
<h5>Silver:</h5> <input type="number" id="Silver" value="0" onchange="coinLimit()" onselectionchange="coinLimit()" />
<h5>Gold:</h5> <input type="number" id="Gold" value="0" onchange="coinLimit()" onselectionchange="coinLimit()" />
</section>
<h5>Outer Vault: <span class="note">(items and coinage kept at Crossroads Hold)</span></h5> <textarea id="Storage"></textarea>
</section>
<section id="player-notes">
<h4>Notes <span class="note">(current paragraph, available merchants and structures, stored artifacts, etc.)</span></h4>
<textarea id="Notes"></textarea>
</section>
<section id="custom-items">
<h4>Custom Items</h4>
<p class="info">Use this section to create custom items, for example to apply Enchantments to base items. Names are mandatory and must be unique. Click <em>Update</em> to make them available in the appropriate inventory slots (and remove deleted custom items from the dropdowns).</p>
<p class="center">
<button onclick="addCustomItem()">Add item</button>
<button onclick="deleteNamelessItems()">Delete nameless items</button>
<button onclick="updateCustomItems()">Update inventory dropdowns</button>
</p>
<section id="CustomItems"></section>
</section>
</main>
<footer>
<p title="New in this update: equipped custom items are now properly loaded from save files; adventure tracker added; buttons change color slightly when activated, so you know they’re properly activated">Holdfast Helper v.<b>2.03</b> (February 28, 2023) designed by <a href="https://github.com/Salvatos/Brewnity" title="Github">Salvatos</a> – <em><a href="https://ko-fi.com/salvatos" title="Tip me on Ko-fi">Tips</a> motivate me to make more tools like this ❤</em></p>
</footer>
</body>
</html>