ENH: Save roll ok

master
U~man 2020-07-25 23:49:47 +02:00
parent 24c6ab547a
commit 57652479ee
4 changed files with 13 additions and 12 deletions

View File

@ -373,7 +373,6 @@ export class OseActor extends Actor {
}
rollAttack(attData, options = {}) {
console.log("ACTOR", attData);
const data = this.data.data;
const rollParts = ["1d20"];
const dmgParts = [];
@ -418,6 +417,7 @@ export class OseActor extends Actor {
type: options.type,
thac0: thac0,
dmg: dmgParts,
save: attData.roll.save,
},
};

View File

@ -243,7 +243,6 @@ export class OseDice {
title = null,
} = {}) {
let rolled = false;
console.log(data);
const template = "systems/ose/templates/chat/roll-dialog.html";
let dialogData = {
formula: parts.join(" "),
@ -272,7 +271,6 @@ export class OseDice {
callback: (html) => {
rolled = true;
rollData.form = html[0].children[0];
console.log(data);
roll = ["melee", "missile"].includes(data.roll.type)
? OseDice.sendAttackRoll(rollData)
: OseDice.sendRoll(rollData);

View File

@ -83,10 +83,10 @@ export class OseItem extends Item {
item: this.data,
actor: this.actor.data,
roll: {
type: "melee",
save: this.data.data.save,
},
},
options
{ type: "melee" }
);
},
},
@ -97,12 +97,12 @@ export class OseItem extends Item {
this.actor.rollAttack(
{
roll: {
type: "missile",
save: this.data.data.save,
},
actor: this.actor.data,
item: this.data,
},
options
{ type: "missile" }
);
},
},
@ -117,8 +117,11 @@ export class OseItem extends Item {
{
actor: this.actor.data,
item: this.data,
roll: {
save: this.data.data.save,
},
},
{type: type}
{ type: type }
);
return true;

View File

@ -1,4 +1,4 @@
<div class="ose chat-card item-card" data-actor-id="{{actor._id}}" data-item-id="{{item._id}}"
<div class="ose chat-card item-card" data-actor-id="{{data.actor._id}}" data-item-id="{{data.item._id}}"
{{#if tokenId}}data-token-id="{{tokenId}}"{{/if}}>
<div class="ose chat-block">
<div class="flexrow chat-header">
@ -16,10 +16,10 @@
<div class="roll-result"><b>{{localize 'OSE.messages.InflictsDamage'}}</b></div>
</div>
<div class="damage-roll">{{{rollDamage}}}</div>
{{#if data.rollData.save}}
{{#if data.roll.save}}
<div class="card-buttons">
<button data-action="save" data-save="{{data.rollData.save}}" disabled>
{{lookup config.saves_long data.rollData.save}} - {{localize "OSE.spells.Save"}}
<button data-action="save" data-save="{{data.roll.save}}" disabled>
{{lookup config.saves_long data.roll.save}} - {{localize "OSE.spells.Save"}}
</button>
</div>
{{/if}}