ENH: Appearing rolls
parent
5946fbf804
commit
13f4e9ac7d
|
@ -38,6 +38,7 @@
|
||||||
"OSE.RetainerWage": "Wage",
|
"OSE.RetainerWage": "Wage",
|
||||||
"OSE.RetainerUpkeep": "Upkeep",
|
"OSE.RetainerUpkeep": "Upkeep",
|
||||||
"OSE.Appearing": "NA",
|
"OSE.Appearing": "NA",
|
||||||
|
"OSE.AppearingCheck": "Appearing Check",
|
||||||
"OSE.Attack": "Attack",
|
"OSE.Attack": "Attack",
|
||||||
"OSE.Encumbrance": "Encumbrance",
|
"OSE.Encumbrance": "Encumbrance",
|
||||||
|
|
||||||
|
|
|
@ -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 = {}) {
|
rollExploration(expl, options = {}) {
|
||||||
const label = game.i18n.localize(`OSE.exploration.${expl}.long`);
|
const label = game.i18n.localize(`OSE.exploration.${expl}.long`);
|
||||||
const rollParts = ["1d6"];
|
const rollParts = ["1d6"];
|
||||||
|
|
|
@ -179,6 +179,12 @@ export class OseActorSheetMonster extends OseActorSheet {
|
||||||
actorObject.rollReaction({ event: event });
|
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
|
html
|
||||||
.find(".counter input")
|
.find(".counter input")
|
||||||
.click((ev) => ev.target.select())
|
.click((ev) => ev.target.select())
|
||||||
|
|
|
@ -3,11 +3,21 @@
|
||||||
min-width: 460px;
|
min-width: 460px;
|
||||||
.header-details {
|
.header-details {
|
||||||
.summary {
|
.summary {
|
||||||
.morale-check,.reaction-check {
|
.check-field {
|
||||||
line-height: 35px;
|
|
||||||
flex: 0 0 20px;
|
|
||||||
&:hover {
|
&: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;
|
justify-content: space-around;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
.attribute-row {
|
||||||
|
.attributes {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
.attribute-row {
|
.attribute-row {
|
||||||
.attribute-group {
|
.attribute-group {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
|
@ -32,7 +47,7 @@
|
||||||
flex: 0 0 85px;
|
flex: 0 0 85px;
|
||||||
}
|
}
|
||||||
&.saving-throw {
|
&.saving-throw {
|
||||||
flex: 1;
|
flex: 0 0 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,10 @@
|
||||||
"table": "",
|
"table": "",
|
||||||
"type": ""
|
"type": ""
|
||||||
},
|
},
|
||||||
"appearing": "",
|
"appearing": {
|
||||||
|
"d": 0,
|
||||||
|
"w": 0
|
||||||
|
},
|
||||||
"morale": 0
|
"morale": 0
|
||||||
},
|
},
|
||||||
"attacks": ""
|
"attacks": ""
|
||||||
|
|
|
@ -4,22 +4,34 @@
|
||||||
<input name="name" type="text" value="{{actor.name}}" placeholder="{{localize 'OSE.Name'}}" />
|
<input name="name" type="text" value="{{actor.name}}" placeholder="{{localize 'OSE.Name'}}" />
|
||||||
</h1>
|
</h1>
|
||||||
<ul class="summary flexrow">
|
<ul class="summary flexrow">
|
||||||
<li class="flex">
|
<li class="flex2 flexrow check-field">
|
||||||
<input type="text" name="data.details.alignment" value="{{data.details.alignment}}" />
|
<div>
|
||||||
<label>{{localize 'OSE.Alignment'}}</label>
|
<input type="text" name="data.details.alignment" value="{{data.details.alignment}}" />
|
||||||
|
<label>{{localize 'OSE.Alignment'}}</label>
|
||||||
|
</div>
|
||||||
|
<div class="check reaction-check" title="{{localize 'OSE.ReactionCheck'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||||
</li>
|
</li>
|
||||||
<li class="reaction-check" title="{{localize 'OSE.ReactionCheck'}}"><a><i class="fas fa-dice"></i></a></li>
|
<li class="flexrow check-field" data-check="dungeon">
|
||||||
<li>
|
<div>
|
||||||
<input type="text" name="data.details.appearing" value="{{data.details.appearing}}" />
|
<input type="text" name="data.details.appearing.d" value="{{data.details.appearing.d}}" />
|
||||||
<label>{{localize 'OSE.Appearing'}}</label>
|
<label>{{localize 'OSE.Appearing'}}</label>
|
||||||
|
</div>
|
||||||
|
<div class="check appearing-check" title="{{localize 'OSE.AppearingCheck'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||||
|
</li>
|
||||||
|
<li class="flexrow check-field" data-check="wilderness">
|
||||||
|
<div>
|
||||||
|
(<input type="text" name="data.details.appearing.w" value="{{data.details.appearing.w}}" />)
|
||||||
|
<label>{{localize 'OSE.Appearing'}}</label>
|
||||||
|
</div>
|
||||||
|
<div class="check appearing-check" title="{{localize 'OSE.AppearingCheck'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||||
</li>
|
</li>
|
||||||
{{#if config.morale}}
|
{{#if config.morale}}
|
||||||
<li class="flexrow">
|
<li class="flexrow check-field">
|
||||||
<div>
|
<div>
|
||||||
<input type="text" name="data.details.morale" value="{{data.details.morale}}" />
|
<input type="text" name="data.details.morale" value="{{data.details.morale}}" />
|
||||||
<label>{{localize 'OSE.Morale'}}</label>
|
<label>{{localize 'OSE.Morale'}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="morale-check" title="{{localize 'OSE.MoraleCheck'}}"><a><i class="fas fa-dice"></i></a></div>
|
<div class="check morale-check" title="{{localize 'OSE.MoraleCheck'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue