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

View File

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

View File

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

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