diff --git a/src/lang/en.json b/src/lang/en.json index be33de5..a016068 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -38,6 +38,7 @@ "OSE.RetainerWage": "Wage", "OSE.RetainerUpkeep": "Upkeep", "OSE.Appearing": "NA", + "OSE.AppearingCheck": "Appearing Check", "OSE.Attack": "Attack", "OSE.Encumbrance": "Encumbrance", diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index 46a097a..d988539 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -244,6 +244,37 @@ export class OseActor extends Actor { }); } + rollAppearing(options = {}) { + const rollParts = []; + let label = ""; + if (options.check == "wilderness") { + rollParts.push(this.data.data.details.appearing.w); + label = "(2)"; + } else { + rollParts.push(this.data.data.details.appearing.d); + label = "(1)"; + } + const data = { + ...this.data, + ...{ + rollData: { + type: "Appearing", + }, + }, + }; + + // Roll and return + return OseDice.Roll({ + event: options.event, + parts: rollParts, + data: data, + skipDialog: true, + speaker: ChatMessage.getSpeaker({ actor: this }), + flavor: `${game.i18n.localize('OSE.AppearingCheck')} ${label}`, + title: `${game.i18n.localize('OSE.AppearingCheck')} ${label}`, + }); + } + rollExploration(expl, options = {}) { const label = game.i18n.localize(`OSE.exploration.${expl}.long`); const rollParts = ["1d6"]; diff --git a/src/module/actor/monster-sheet.js b/src/module/actor/monster-sheet.js index 3e30843..941b0de 100644 --- a/src/module/actor/monster-sheet.js +++ b/src/module/actor/monster-sheet.js @@ -179,6 +179,12 @@ export class OseActorSheetMonster extends OseActorSheet { actorObject.rollReaction({ event: event }); }); + html.find(".appearing-check a").click((ev) => { + let actorObject = this.actor; + let check = $(ev.currentTarget).closest('.check-field').data('check'); + actorObject.rollAppearing({ event: event, check: check }); + }); + html .find(".counter input") .click((ev) => ev.target.select()) diff --git a/src/scss/monster.scss b/src/scss/monster.scss index 19a51aa..524b8ac 100644 --- a/src/scss/monster.scss +++ b/src/scss/monster.scss @@ -3,11 +3,21 @@ min-width: 460px; .header-details { .summary { - .morale-check,.reaction-check { - line-height: 35px; - flex: 0 0 20px; + .check-field { &:hover { - color: $colorDark; + .check { + display: block; + } + } + .check { + display: none; + line-height: 35px; + flex: 0 0 20px; + position: absolute; + font-size: 12px; + &:hover { + color: $colorDark; + } } } } @@ -21,6 +31,11 @@ justify-content: space-around; flex-direction: column; height: 100%; + .attribute-row { + .attributes { + justify-content: space-between; + } + } .attribute-row { .attribute-group { margin: 5px; @@ -32,7 +47,7 @@ flex: 0 0 85px; } &.saving-throw { - flex: 1; + flex: 0 0 40px; } } } diff --git a/src/template.json b/src/template.json index 943c0a6..9abaadc 100644 --- a/src/template.json +++ b/src/template.json @@ -149,7 +149,10 @@ "table": "", "type": "" }, - "appearing": "", + "appearing": { + "d": 0, + "w": 0 + }, "morale": 0 }, "attacks": "" diff --git a/src/templates/actors/partials/monster-header.html b/src/templates/actors/partials/monster-header.html index be885ff..ab5d449 100644 --- a/src/templates/actors/partials/monster-header.html +++ b/src/templates/actors/partials/monster-header.html @@ -4,22 +4,34 @@