Skip to content

Commit 6eccbc4

Browse files
authored
Merge pull request #14517 from FoxRobinHood/Draw-Steel-Updates
[Draw Steel] Updated buttons and attributes
2 parents ec1c22d + 5977b94 commit 6eccbc4

File tree

3 files changed

+145
-32
lines changed

3 files changed

+145
-32
lines changed

Draw Steel/draw-steel.css

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,20 @@ label[for*='minimize']::before {
534534
cursor: pointer;
535535
}
536536

537+
.surges-input-group {
538+
display: flex;
539+
font-size: 0.75em;
540+
justify-content: center;
541+
align-items: center;
542+
gap: 0px;
543+
}
544+
545+
.pipe-separator {
546+
font-weight: bold;
547+
color: var(--color-text-header);
548+
padding: 0 2px;
549+
}
550+
537551
.characteristic-input-group > input {
538552
text-align: center;
539553
}
@@ -989,7 +1003,18 @@ label[for*='minimize']::before {
9891003
margin-right: 4em;
9901004
}
9911005

992-
.kit-input-group > div {
1006+
.other-modifiers {
1007+
display: flex;
1008+
justify-content: space-between;
1009+
flex-wrap: wrap;
1010+
gap: 1em;
1011+
margin-left: 4em;
1012+
margin-right: 4em;
1013+
margin-top: 0.5em;
1014+
}
1015+
1016+
.kit-input-group > div,
1017+
.other-modifiers > div {
9931018
flex: 1;
9941019
display: flex;
9951020
flex-direction: column;
@@ -1001,7 +1026,11 @@ label[for*='minimize']::before {
10011026
.kit-stamina-group input,
10021027
.kit-stability-group input,
10031028
.kit-melee-distance-group input,
1004-
.kit-ranged-distance-group input {
1029+
.kit-ranged-distance-group input,
1030+
.other-modifiers-forcemove-group input,
1031+
.other-modifiers-mag-psi-group input,
1032+
.other-modifiers-fire-dam-group input,
1033+
.other-modifiers-sanct-weap-group input {
10051034
min-width:6em;
10061035
}
10071036

@@ -1014,7 +1043,8 @@ label[for*='minimize']::before {
10141043
box-sizing: border-box;
10151044
}
10161045

1017-
.kit-damage-label {
1046+
.kit-damage-label,
1047+
.other-modifiers-label {
10181048
font-size: 0.75em !important;
10191049
}
10201050

Draw Steel/draw-steel.html

Lines changed: 101 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ <h1 class="title">
77
style="height: 60px"
88
/>
99
</h1>
10-
<label>Initiative:</label><button type="roll" value="@{wtype} &amp;{template:simpleroll} {{rolltitle=1d10}} {{roll=[[ [[1d10]][1d10]]]}} {{name=Initiative}} {{charactername=@{character_name}}}" title="Roll 1d10" class="btn ui-draggable"></button>
11-
<button class="startcombat-button" type="action" data-i18n-title="startcombat" name="act_startcombat">Start Combat</button>
12-
<button class="endcombat-button" type="action" data-i18n-title="endcombat" name="act_endcombat">End Combat</button>
13-
<button class="respite-button" type="action" data-i18n-title="respite" name="act_respite">Respite</button>
1410
<label class="sheet-options-checkbox-label" for="sheet-options-checkbox">y</label>
1511
<input id="sheet-options-checkbox" class="sheet-options-checkbox" type="checkbox" />
1612
<div class="sheet-panel sheet-options-toggle">
@@ -44,6 +40,10 @@ <h5 data-i18n="import"></h5>
4440
<!-- Character Sheet Start -->
4541
<div class="sheet-body">
4642
<!-- Header Panel -->
43+
<label>Initiative:</label><button type="roll" value="@{wtype} &amp;{template:simpleroll} {{rolltitle=1d10}} {{roll=[[ [[1d10]][1d10]]]}} {{name=Initiative}} {{charactername=@{character_name}}}" title="Roll 1d10" class="btn ui-draggable"></button>
44+
<button class="startcombat-button" type="action" data-i18n-title="startcombat" name="act_startcombat">Start Combat</button>
45+
<button class="endcombat-button" type="action" data-i18n-title="endcombat" name="act_endcombat">End Combat</button>
46+
<button class="respite-button" type="action" data-i18n-title="respite" name="act_respite">Respite</button>
4747
<div class="sheet-panel header-panel">
4848
<div class="sheet-panel-box profile-panel">
4949
<div class="name-input-group">
@@ -174,8 +174,13 @@ <h5 data-i18n="level"></h5>
174174
</div>
175175
</div>
176176
<div class="dashboard-surges minimize-ignore">
177-
<div class="dashboard-stat-group surges-input-group">
178-
<label data-characteristic="surges" data-i18n="surges" data-i18n-title="surges-tooltip">Surges</label>
177+
<div class="dashboard-stat-group">
178+
<label data-characteristic="surges" data-i18n="surges">Surges</label>
179+
<div class="surges-input-group">
180+
<label data-characteristic="surges-damage" data-i18n="surges-damage" data-i18n-title="surges-damage-tooltip">Damage</label>
181+
<span class="pipe-separator">|</span>
182+
<label data-characteristic="surges-potency" data-i18n="surges-potency" data-i18n-title="surges-potency-tooltip">Potency</label>
183+
</div>
179184
<input type="number" name="attr_surges" title="Macro: @{NAME|surges}" />
180185
</div>
181186
</div>
@@ -198,10 +203,6 @@ <h5 data-i18n="level"></h5>
198203
<input type="number" class="input-md" name="attr_stability" title="Macro: @{NAME|stability}" />
199204
<label class="sublabel" data-i18n="stability"></label>
200205
</div>
201-
<div class="movement-input-group">
202-
<input type="number" class="input-md" name="attr_forcemove" title="Macro: @{NAME|forcemove}" />
203-
<label class="sublabel" data-i18n="forcemove"></label>
204-
</div>
205206
</div>
206207
<!-- Stamina -->
207208
<div class="stamina-panel">
@@ -415,7 +416,7 @@ <h5 class="panel-title" data-i18n="ancestry-traits"></h5>
415416
<!-- Equipment and Modifiers Panel -->
416417
<div class="sheet-panel-box modifiers-panel">
417418
<div class="modifiers-title">
418-
<h5 class="panel-title" data-i18n="modifiers"></h5>
419+
<h5 class="panel-title" data-i18n="equipment-modifiers"></h5>
419420
<span data-i18n="kit">kit</span>
420421
<label><input type="checkbox" name="attr_kit" /></label>
421422
</div>
@@ -499,6 +500,24 @@ <h5 class="panel-title" data-i18n="modifiers"></h5>
499500
<label class="kit-damage-label" data-i18n="effect"></label>
500501
<textarea name="attr_modifier_description"></textarea>
501502
</div>
503+
<div class="other-modifiers">
504+
<div class="other-modifiers-forcemove-group">
505+
<input type="number" class="other-modifiers-forcemove" name="attr_forcemove" />
506+
<label class="sublabel" data-i18n="forcemove"></label>
507+
</div>
508+
<div class="other-modifiers-mag-psi-group">
509+
<input type="number" class="other-modifiers-mag-psi" name="attr_mag_psi_dam" />
510+
<label class="sublabel" data-i18n="mag-psi-dam"></label>
511+
</div>
512+
<div class="other-modifiers-fire-dam-group">
513+
<input type="number" class="other-modifiers-fire-dam" name="attr_fire_dam" />
514+
<label class="sublabel" data-i18n="fire-dam"></label>
515+
</div>
516+
<div class="other-modifiers-sanct-weap-group">
517+
<input type="number" class="other-modifiers-sanct-weap" name="attr_sanct_weap" />
518+
<label class="sublabel" data-i18n="sanct-weap"></label>
519+
</div>
520+
</div>
502521
</div>
503522
</div>
504523
<!-- Perks Panel -->
@@ -1534,7 +1553,7 @@ <h2 data-i18n="maneuvers"></h2>
15341553
<input type="hidden" class="ability-effect" data-i18n-placeholder="effect" name="attr_consumable_effect" value="Unless otherwise noted in its description, a creature can activate a consumable treasure such as a potion with the Use Consumable maneuver. A creature can use this maneuver to administer a consumable treasure that benefits the user either to themself or to a willing adjacent creature." />
15351554

15361555
<div class="ability-card card-display">
1537-
<button type="action" class="ability-share-button" data-i18n-title="ability-share" name="act_standup_share">
1556+
<button type="action" class="ability-share-button" data-i18n-title="ability-share" name="act_consumable_share">
15381557
<!-- speech balloon -->
15391558
&#128172;
15401559
</button>
@@ -3222,27 +3241,75 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
32223241
**/
32233242
async function rollResource() {
32243243
console.log("~~~ rollResource ~~~");
3225-
// Get the resource name.
3226-
const attrs = await getAttrsAsync(['resource_name']);
3244+
// Get the resource name and resource amount.
3245+
const attrs = await getAttrsAsync(['resource', 'resource_name']);
32273246
const resource_name = attrs.resource_name;
3228-
3229-
buildRoll(ROLLTEMPLATES.SIMPLE, { name: "@{resource_name} Gain", rolltitle: "@{resource_name}", roll: `[[?{Type d3 or number|0}]]` }, {} );
3247+
const resource = parseInt(attrs.resource) || 0;
3248+
3249+
const rollQuery = `[[?{d3 or number|0}]]`;
3250+
3251+
const rollTemplate = `@{wtype}&{template:${ROLLTEMPLATES.SIMPLE}} {{charactername=@{character_name}}} {{name=${resource_name} Gain}} {{rolltitle=${resource_name}}} {{roll=${rollQuery}}}`;
3252+
3253+
startRoll(rollTemplate, ({ rollId, results }) => {
3254+
const resource_gain = results.roll.result || 0;
3255+
const resource_updated = resource + resource_gain;
3256+
3257+
setAttrs({ "resource": resource_updated });
3258+
3259+
finishRoll(rollId);
3260+
});
32303261
}
32313262

32323263
/**
3233-
** Simple Roll to apply Surges
3264+
** Simple Roll to apply Damage Surges
32343265
** And adjust automatically in sheet
32353266
**/
3236-
async function rollSurges() {
3237-
console.log("~~~ rollSurges ~~~");
3267+
async function rollDamageSurges() {
3268+
console.log("~~~ rollDamageSurges ~~~");
3269+
// Get the necessary attributes.
32383270
const attrs = await getAttrsAsync(["might", "agility", "reason", "intuition", "presence"]);
32393271
let highest = 0;
32403272
for(const val of Object.values(attrs)) {
32413273
const num = parseInt(val) || 0;
32423274
highest = Math.max(highest, num);
32433275
}
3244-
3245-
buildRoll(ROLLTEMPLATES.SIMPLE, { name: "Using Surges", rolltitle: "Surges", roll: `?{Choose|Damage,&quest;{How many&quest;&verbar;1&comma;[[1*${highest}]] additional damage&verbar;2&comma;[[2*${highest}]] additional damage&verbar;3&comma;[[3*${highest}]] additional damage&rcub;|Potency,2 surges used to increase potency by 1}` }, {} );
3276+
const attr_surges = await getAttrsAsync(["surges"]);
3277+
const surges = parseInt(attr_surges.surges) || 0;
3278+
3279+
const rollQuery = `[[?{How many?|1|2|3}]]`;
3280+
3281+
const rollTemplate = `@{wtype}&{template:${ROLLTEMPLATES.SIMPLE}} {{charactername=@{character_name}}} {{name=Using Surges for Damage}} {{rolltitle=${rollQuery}}} {{roll=Surges used for [[${rollQuery}*${highest}]] damage}}`;
3282+
3283+
startRoll(rollTemplate, ({ rollId, results }) => {
3284+
const surges_lose = results.rolltitle.result || 0;
3285+
const surges_updated = surges - surges_lose;
3286+
3287+
setAttrs({ "surges": surges_updated });
3288+
3289+
finishRoll(rollId);
3290+
});
3291+
}
3292+
3293+
/**
3294+
** Simple Roll to apply Potency Surges
3295+
** And adjust automatically in sheet
3296+
**/
3297+
async function rollPotencySurges() {
3298+
console.log("~~~ rollPotencySurges ~~~");
3299+
// Get the necessary attributes.
3300+
const attrs = await getAttrsAsync(["surges", "agility", "reason", "intuition", "presence"]);
3301+
const surges = parseInt(attrs.surges) || 0;
3302+
3303+
const rollTemplate = `@{wtype}&{template:${ROLLTEMPLATES.SIMPLE}} {{charactername=@{character_name}}} {{name=Using Surges for Potency Increase}} {{rolltitle=[[2]]}} {{roll=Surges used to increase potency by 1}}`;
3304+
3305+
startRoll(rollTemplate, ({ rollId, results }) => {
3306+
const surges_lose = results.rolltitle.result || 0;
3307+
const surges_updated = surges - surges_lose;
3308+
3309+
setAttrs({ "surges": surges_updated });
3310+
3311+
finishRoll(rollId);
3312+
});
32463313
}
32473314

32483315
/**
@@ -3629,10 +3696,16 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
36293696
rollResource();
36303697
});
36313698

3632-
// Surges Simple Roll
3699+
// Damage Surges Simple Roll
3700+
3701+
$20('.surges-input-group > label[data-characteristic="surges-damage"]').on('click', (e) => {
3702+
rollDamageSurges();
3703+
});
3704+
3705+
// Potency Surges Simple Roll
36333706

3634-
$20('.surges-input-group > label').on('click', (e) => {
3635-
rollSurges();
3707+
$20('.surges-input-group > label[data-characteristic="surges-potency"]').on('click', (e) => {
3708+
rollPotencySurges();
36363709
});
36373710

36383711
// Configuration map for feature sharing
@@ -3751,12 +3824,14 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
37513824

37523825
function calculateEndCombat() {
37533826
console.log('~~~ calculateEndCombat ~~~');
3754-
getAttrs(["resource", "surges"], function(values) {
3827+
getAttrs(["resource", "surges", "stamina_temporary"], function(values) {
37553828
let resource = parseInt(values.resource)||0;
37563829
let surges = parseInt(values.surges)||0;
3830+
let stamina_temporary = parseInt(values.stamina_temporary)||0;
37573831
setAttrs({
37583832
"resource": 0,
3759-
"surges": 0
3833+
"surges": 0,
3834+
"stamina_temporary": 0
37603835
});
37613836
});
37623837
}

Draw Steel/translation.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"disengage": "Disengage",
3030
"stability": "Stability",
3131
"forcemove": "Forced Movement",
32+
"mag-psi-dam": "Magic/Psionic Damage",
33+
"fire-dam": "Fire Damage",
34+
"sanct-weap": "Sanctified Weapon",
3235
"melee-dist": "Melee Dist.",
3336
"ranged-dist": "Ranged Dist.",
3437
"stamina": "Stamina",
@@ -50,7 +53,10 @@
5053
"surges": "Surges",
5154
"surge-damage": "1 Surge = Damage",
5255
"surge-potency": "2 Surges = Potency + 1",
53-
"surges-tooltip": "Click to apply Surges",
56+
"surges-damage": "Damage",
57+
"surges-potency": "Potency",
58+
"surges-damage-tooltip": "Click to spend Surges for damage",
59+
"surges-potency-tooltip": "Click to spend Surges for potency increase",
5460
"conditions": "Conditions",
5561
"condition": "Condition",
5662
"savethrow-placeholder": "6",
@@ -85,10 +91,12 @@
8591
"ancestry-traits": "Ancestry Traits",
8692
"perks": "Perks",
8793
"titles": "Titles",
88-
"modifiers": "Equipment and Modifiers",
94+
"equipment-modifiers": "Equipment and Modifiers",
95+
"modifiers": "Modifiers",
8996
"modifier-basic": "Basic",
9097
"kit": "Kit",
9198
"modifier-name": "Kit/Enchantment/Augmentation/Ward Name",
99+
"other-modifiers": "Other Modifiers",
92100
"weapon-implement": "Weapon/Implement",
93101
"weapon": "Weapon",
94102
"armor": "Armor",
@@ -210,7 +218,7 @@
210218
"characteristic-roll-tooltip": "Click to make a power roll with this characteristic.",
211219
"roll-d3-tooltip": "Roll 1d3",
212220
"startcombat": "Set Heroic Resource to Victories",
213-
"endcombat": "Reset Heroic Resource and Surges",
221+
"endcombat": "Reset Heroic Resource, Surges and Temporary Stamina",
214222
"respite": "Reset Stamina, Recoveries and Victories",
215223
"potency": "Potency",
216224
"M": "M",

0 commit comments

Comments
 (0)