FIX: attacks, raw attacks
parent
8af8a0f635
commit
6459321493
|
@ -164,7 +164,11 @@ export class OseActorSheet extends ActorSheet {
|
||||||
let actorObject = this.actor;
|
let actorObject = this.actor;
|
||||||
let element = event.currentTarget;
|
let element = event.currentTarget;
|
||||||
let attack = element.parentElement.parentElement.dataset.attack;
|
let attack = element.parentElement.parentElement.dataset.attack;
|
||||||
actorObject.rollAttack({roll: {}}, { type: attack, skipDialog: ev.ctrlKey });
|
const rollData = {
|
||||||
|
actor: this.data,
|
||||||
|
roll: {}
|
||||||
|
}
|
||||||
|
actorObject.targetAttack(rollData, attack, {type: attack, skipDialog: ev.ctrlKey});
|
||||||
});
|
});
|
||||||
|
|
||||||
html.find(".spells .item-reset").click((ev) => {
|
html.find(".spells .item-reset").click((ev) => {
|
||||||
|
|
|
@ -105,6 +105,7 @@ export class OseActor extends Actor {
|
||||||
let roll = new Roll(this.data.data.hp.hd).roll();
|
let roll = new Roll(this.data.data.hp.hd).roll();
|
||||||
return this.update({
|
return this.update({
|
||||||
data: {
|
data: {
|
||||||
|
actor: this.data,
|
||||||
hp: {
|
hp: {
|
||||||
max: roll.total,
|
max: roll.total,
|
||||||
value: roll.total,
|
value: roll.total,
|
||||||
|
@ -144,6 +145,7 @@ export class OseActor extends Actor {
|
||||||
const rollParts = ["2d6"];
|
const rollParts = ["2d6"];
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "below",
|
type: "below",
|
||||||
target: this.data.data.details.morale,
|
target: this.data.data.details.morale,
|
||||||
|
@ -167,6 +169,7 @@ export class OseActor extends Actor {
|
||||||
const rollParts = ["2d6"];
|
const rollParts = ["2d6"];
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "below",
|
type: "below",
|
||||||
target: this.data.data.retainer.loyalty,
|
target: this.data.data.retainer.loyalty,
|
||||||
|
@ -189,6 +192,7 @@ export class OseActor extends Actor {
|
||||||
const rollParts = ["2d6"];
|
const rollParts = ["2d6"];
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "table",
|
type: "table",
|
||||||
table: {
|
table: {
|
||||||
|
@ -230,6 +234,7 @@ export class OseActor extends Actor {
|
||||||
const rollParts = ["1d20"];
|
const rollParts = ["1d20"];
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "check",
|
type: "check",
|
||||||
target: this.data.data.scores[score].value,
|
target: this.data.data.scores[score].value,
|
||||||
|
@ -262,6 +267,7 @@ export class OseActor extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "hitdice",
|
type: "hitdice",
|
||||||
},
|
},
|
||||||
|
@ -290,6 +296,7 @@ export class OseActor extends Actor {
|
||||||
label = "(1)";
|
label = "(1)";
|
||||||
}
|
}
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: {
|
type: {
|
||||||
type: "appearing",
|
type: "appearing",
|
||||||
|
@ -314,6 +321,7 @@ export class OseActor extends Actor {
|
||||||
const rollParts = ["1d6"];
|
const rollParts = ["1d6"];
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
actor: this.data,
|
||||||
roll: {
|
roll: {
|
||||||
type: "below",
|
type: "below",
|
||||||
target: this.data.data.exploration[expl],
|
target: this.data.data.exploration[expl],
|
||||||
|
@ -372,6 +380,17 @@ export class OseActor extends Actor {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async targetAttack(data, type, options) {
|
||||||
|
if (game.user.targets.size > 0) {
|
||||||
|
for (let t of game.user.targets.values()) {
|
||||||
|
data.roll.target = t;
|
||||||
|
await this.rollAttack(data, { type: type, skipDialog: options.skipDialog });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.rollAttack(data, { type: type, skipDialog: options.skipDialog });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rollAttack(attData, options = {}) {
|
rollAttack(attData, options = {}) {
|
||||||
const data = this.data.data;
|
const data = this.data.data;
|
||||||
const rollParts = ["1d20"];
|
const rollParts = ["1d20"];
|
||||||
|
|
|
@ -79,18 +79,6 @@ export class OseItem extends Item {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// rollAttack to target helper
|
|
||||||
const rollAttack = async (type) => {
|
|
||||||
if (game.user.targets.size > 0) {
|
|
||||||
for (let t of game.user.targets.values()) {
|
|
||||||
rollData.roll.target = t;
|
|
||||||
await this.actor.rollAttack(rollData, { type: type, skipDialog: options.skipDialog });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.actor.rollAttack(rollData, { type: type, skipDialog: options.skipDialog });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (data.missile && data.melee && !isNPC) {
|
if (data.missile && data.melee && !isNPC) {
|
||||||
// Dialog
|
// Dialog
|
||||||
new Dialog({
|
new Dialog({
|
||||||
|
@ -101,14 +89,14 @@ export class OseItem extends Item {
|
||||||
icon: '<i class="fas fa-fist-raised"></i>',
|
icon: '<i class="fas fa-fist-raised"></i>',
|
||||||
label: "Melee",
|
label: "Melee",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
rollAttack("melee");
|
this.targetAttack(rollData, "melee", options);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
missile: {
|
missile: {
|
||||||
icon: '<i class="fas fa-bullseye"></i>',
|
icon: '<i class="fas fa-bullseye"></i>',
|
||||||
label: "Missile",
|
label: "Missile",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
rollAttack("missile");
|
this.targetAttack(rollData, "missile", options);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -118,7 +106,7 @@ export class OseItem extends Item {
|
||||||
} else if (data.missile && !isNPC) {
|
} else if (data.missile && !isNPC) {
|
||||||
type = "missile";
|
type = "missile";
|
||||||
}
|
}
|
||||||
rollAttack(type);
|
this.targetAttack(rollData, type, options);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,11 @@
|
||||||
<div class="chat-title">
|
<div class="chat-title">
|
||||||
<h2>{{title}}</h2>
|
<h2>{{title}}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-img" style="background-image:url('{{data.img}}')"></div>
|
{{#if data.item}}
|
||||||
|
<div class="chat-img" style="background-image:url('{{data.item.img}}')"></div>
|
||||||
|
{{else}}
|
||||||
|
<div class="chat-img" style="background-image:url('{{data.actor.img}}')"></div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if result.victim}}
|
{{#if result.victim}}
|
||||||
<div class="chat-target">
|
<div class="chat-target">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="ose chat-block">
|
<div class="ose chat-block">
|
||||||
<div class="flexrow chat-header">
|
<div class="flexrow chat-header">
|
||||||
<div class="chat-title"><h2>{{title}}</h2></div>
|
<div class="chat-title"><h2>{{title}}</h2></div>
|
||||||
<div class="chat-img" style="background-image:url('{{data.img}}')"></div>
|
<div class="chat-img" style="background-image:url('{{data.actor.img}}')"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<ol class="flex2">
|
<ol class="flex2">
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
<div class="ose chat-block">
|
<div class="ose chat-block">
|
||||||
<div class="flexrow chat-header">
|
<div class="flexrow chat-header">
|
||||||
<div class="chat-title"><h2>{{title}}</h2></div>
|
<div class="chat-title"><h2>{{title}}</h2></div>
|
||||||
<div class="chat-img" style="background-image:url('{{data.img}}')"></div>
|
{{#if data.item}}
|
||||||
|
<div class="chat-img" style="background-image:url('{{data.item.img}}')"></div>
|
||||||
|
{{else}}
|
||||||
|
<div class="chat-img" style="background-image:url('{{data.actor.img}}')"></div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if result.details}}<div class="chat-details">{{{result.details}}}</div>{{/if}}
|
{{#if result.details}}<div class="chat-details">{{{result.details}}}</div>{{/if}}
|
||||||
{{#if result.isFailure}}<div class='roll-result roll-fail'><b>{{localize 'OSE.Failure'}}</b> ({{result.target}})
|
{{#if result.isFailure}}<div class='roll-result roll-fail'><b>{{localize 'OSE.Failure'}}</b> ({{result.target}})
|
||||||
|
|
Loading…
Reference in New Issue