ENH: Movement rates order, and speed rolls

master
U~man 2020-07-07 22:07:51 +02:00
parent c94807c9ae
commit cb583d9154
3 changed files with 13 additions and 14 deletions

View File

@ -114,7 +114,7 @@ export class OseActorSheet extends ActorSheet {
html.find(".item-image").click(async (ev) => { html.find(".item-image").click(async (ev) => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("itemId")); const item = this.actor.getOwnedItem(li.data("itemId"));
item.roll(); item.roll({skipDialog: event.ctrlKey});
}); });

View File

@ -49,15 +49,14 @@ export class OseItem extends Item {
return data; return data;
} }
rollWeapon() { rollWeapon(skipDialog) {
console.log(this);
let isNPC = this.actor.data.type != 'character'; let isNPC = this.actor.data.type != 'character';
if (this.data.data.missile && !isNPC) { if (this.data.data.missile && !isNPC) {
this.actor.rollAttack({type: 'missile', label: this.name, dmg: this.data.data.damage}); this.actor.rollAttack({type: 'missile', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}});
} else if (this.data.data.melee && !isNPC) { } else if (this.data.data.melee && !isNPC) {
this.actor.rollAttack({type: 'melee', label: this.name, dmg: this.data.data.damage}); this.actor.rollAttack({type: 'melee', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}});
} else { } else {
this.actor.rollAttack({type: 'raw', label: this.name, dmg: this.data.data.damage}); this.actor.rollAttack({type: 'raw', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}});
} }
return true; return true;
} }
@ -96,9 +95,9 @@ export class OseItem extends Item {
* Roll the item to Chat, creating a chat card which contains follow up attack or damage roll options * Roll the item to Chat, creating a chat card which contains follow up attack or damage roll options
* @return {Promise} * @return {Promise}
*/ */
async roll({ configureDialog = true } = {}) { async roll({ skipDialog = false } = {}) {
if (this.data.type == 'weapon') { if (this.data.type == 'weapon') {
if (this.rollWeapon()) return; if (this.rollWeapon(skipDialog)) return;
} }
// Basic template rendering data // Basic template rendering data
const token = this.actor.token; const token = this.actor.token;

View File

@ -211,11 +211,11 @@
<div class="flexrow"> <div class="flexrow">
<ul class="attributes flexrow"> <ul class="attributes flexrow">
<li class="attribute attribute-secondaries"> <li class="attribute attribute-secondaries">
<h4 class="attribute-name box-title" title="{{localize 'OSE.MovementEncounter'}}"> <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementOverland'}}">
{{localize 'OSE.MovementEncounterShort'}}</h4> {{localize 'OSE.MovementOverlandShort'}}</h4>
<div class="flexrow"> <div class="flexrow">
<div class="attribute-value"> <div class="attribute-value">
{{divide data.movement.base 3}} {{divide data.movement.base 5}}
</div> </div>
</div> </div>
</li> </li>
@ -228,11 +228,11 @@
</div> </div>
</li> </li>
<li class="attribute attribute-secondaries"> <li class="attribute attribute-secondaries">
<h4 class="attribute-name box-title" title="{{localize 'OSE.MovementOverland'}}"> <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementEncounter'}}">
{{localize 'OSE.MovementOverlandShort'}}</h4> {{localize 'OSE.MovementEncounterShort'}}</h4>
<div class="flexrow"> <div class="flexrow">
<div class="attribute-value"> <div class="attribute-value">
{{divide data.movement.base 5}} {{divide data.movement.base 3}}
</div> </div>
</div> </div>
</li> </li>