ENH: Rework attack roll
parent
b78de8fffc
commit
0c9282b8a5
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"OSE.Edit": "Edit",
|
||||
"OSE.Delete": "Delete",
|
||||
"OSE.Show": "Show",
|
||||
"OSE.Add": "Add",
|
||||
"OSE.Ok": "Ok",
|
||||
"OSE.Cancel": "Cancel",
|
||||
|
@ -150,6 +151,7 @@
|
|||
"OSE.items.Slow": "Slow",
|
||||
"OSE.items.ArmorAC": "AC",
|
||||
"OSE.items.ArmorAAC": "AAC",
|
||||
"OSE.items.Bonus": "Bonus",
|
||||
|
||||
"OSE.armor.type": "Armor Type",
|
||||
"OSE.armor.unarmored": "Unarmored",
|
||||
|
@ -185,6 +187,7 @@
|
|||
|
||||
"OSE.messages.GetExperience": "{name} gained {value} experience points!",
|
||||
"OSE.messages.AttackSuccess": "<b>Hits AC {result}!</b> ({bonus})",
|
||||
"OSE.messages.AttackAscendingSuccess": "<b>Hits AC {result}!</b>",
|
||||
"OSE.messages.AttackFailure": "<b>Attack fails</b> ({bonus})",
|
||||
"OSE.messages.InflictsDamage": "Inflicts damage!",
|
||||
"OSE.ChatContextDamage": "Apply Damage",
|
||||
|
|
|
@ -127,7 +127,9 @@ export class OseActor extends Actor {
|
|||
rollData: {
|
||||
type: "Check",
|
||||
target: this.data.data.scores[score].value,
|
||||
details: game.i18n.format("OSE.AttributeCheckDetails", {score: label}),
|
||||
details: game.i18n.format("OSE.AttributeCheckDetails", {
|
||||
score: label,
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -181,7 +183,9 @@ export class OseActor extends Actor {
|
|||
rollData: {
|
||||
type: "Below",
|
||||
target: this.data.data.exploration[expl],
|
||||
details: game.i18n.format("OSE.ExplorationCheckDetails", {expl: label}),
|
||||
details: game.i18n.format("OSE.ExplorationCheckDetails", {
|
||||
expl: label,
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -215,7 +219,10 @@ export class OseActor extends Actor {
|
|||
};
|
||||
|
||||
let dmgParts = [];
|
||||
if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && this.type == "character") {
|
||||
if (
|
||||
(!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) &&
|
||||
this.type == "character"
|
||||
) {
|
||||
dmgParts.push("1d6");
|
||||
} else {
|
||||
dmgParts.push(attData.dmg);
|
||||
|
@ -244,16 +251,17 @@ export class OseActor extends Actor {
|
|||
const rollParts = ["1d20"];
|
||||
const dmgParts = [];
|
||||
|
||||
if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && this.data.type == "character") {
|
||||
if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) &&
|
||||
this.data.type == "character") {
|
||||
dmgParts.push("1d6");
|
||||
} else {
|
||||
dmgParts.push(attData.dmg);
|
||||
}
|
||||
|
||||
|
||||
let ascending = game.settings.get("ose", "ascendingAC");
|
||||
if (ascending) {
|
||||
rollParts.push(data.thac0.bba.toString());
|
||||
}
|
||||
if (attData.type == "missile") {
|
||||
rollParts.push(
|
||||
data.scores.dex.mod.toString(),
|
||||
|
@ -265,16 +273,12 @@ export class OseActor extends Actor {
|
|||
data.thac0.mod.melee.toString()
|
||||
);
|
||||
}
|
||||
if (attData.bonus) {
|
||||
rollParts.push(attData.bonus);
|
||||
}
|
||||
|
||||
let thac0 = 0;
|
||||
let thac0 = data.thac0.value;
|
||||
if (attData.type == "melee") {
|
||||
dmgParts.push(data.scores.str.mod);
|
||||
thac0 = data.thac0.melee;
|
||||
} else if (attData.type == "missile") {
|
||||
thac0 = data.thac0.missile;
|
||||
} else {
|
||||
thac0 = data.thac0.value;
|
||||
}
|
||||
|
||||
const rollData = {
|
||||
|
@ -312,7 +316,7 @@ export class OseActor extends Actor {
|
|||
|
||||
// Update the Actor
|
||||
return this.update({
|
||||
"data.hp.value": dh
|
||||
"data.hp.value": dh,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ export class OseDice {
|
|||
};
|
||||
result.target = data.rollData.thac0;
|
||||
if (game.settings.get("ose", "ascendingAC")) {
|
||||
result.details = game.i18n.format('OSE.messages.AttackSuccess', {result: roll.total, bonus: result.target});
|
||||
result.details = game.i18n.format('OSE.messages.AttackAscendingSuccess', {result: roll.total});
|
||||
result.isSuccess = true;
|
||||
} else {
|
||||
// B/X Historic THAC0 Calculation
|
||||
|
|
|
@ -53,14 +53,19 @@ export class OseItem extends Item {
|
|||
// Dialog
|
||||
new Dialog({
|
||||
title: "Choose Attack Range",
|
||||
content: '',
|
||||
content: "",
|
||||
buttons: {
|
||||
melee: {
|
||||
icon: '<i class="fas fa-fist-raised"></i>',
|
||||
label: "Melee",
|
||||
callback: () => {
|
||||
this.actor.rollAttack(
|
||||
{ type: "melee", label: this.name, dmg: this.data.data.damage },
|
||||
{
|
||||
type: "melee",
|
||||
label: this.name,
|
||||
dmg: this.data.data.damage,
|
||||
bonus: data.bonus,
|
||||
},
|
||||
{ event: { ctrlKey: skipDialog } }
|
||||
);
|
||||
},
|
||||
|
@ -89,7 +94,7 @@ export class OseItem extends Item {
|
|||
type = "melee";
|
||||
}
|
||||
this.actor.rollAttack(
|
||||
{ type: type, label: this.name, dmg: this.data.data.damage },
|
||||
{ type: type, label: this.name, dmg: data.damage, bonus: data.bonus },
|
||||
{ event: { ctrlKey: skipDialog } }
|
||||
);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
padding-right: 2px;
|
||||
font-size: 13px;
|
||||
.form-group {
|
||||
margin: 2px;
|
||||
margin: 1px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
label {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
|
|
|
@ -166,6 +166,7 @@
|
|||
"weapon": {
|
||||
"description": "",
|
||||
"damage": "1d6",
|
||||
"bonus": 0,
|
||||
"qualities": "",
|
||||
"slow": false,
|
||||
"missile": true,
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
</div>
|
||||
<div class="item-controls">
|
||||
{{#if ../owner}}
|
||||
<a class="item-control item-edit" title='{{localize "Ose.Edit"}}'><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title='{{localize "Ose.Delete"}}'><i class="fas fa-trash"></i></a>
|
||||
<a class="item-control item-edit" title='{{localize "OSE.Edit"}}'><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title='{{localize "OSE.Delete"}}'><i class="fas fa-trash"></i></a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -160,8 +160,8 @@
|
|||
</div>
|
||||
{{else}}
|
||||
<div class="attribute-value"
|
||||
title="{{localize 'OSE.Thac0'}}({{data.thac0.value}}) - {{localize 'OSE.scores.str.long'}}({{data.scores.str.mod}}) - {{localize 'OSE.Modifier'}}({{data.thac0.mod.melee}})">
|
||||
{{data.thac0.melee}}
|
||||
title="{{localize 'OSE.scores.str.long'}}({{data.scores.str.mod}}) + {{localize 'OSE.Modifier'}}({{data.thac0.mod.melee}})">
|
||||
{{add data.scores.str.mod data.thac0.mod.melee}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -200,8 +200,8 @@
|
|||
</div>
|
||||
{{else}}
|
||||
<div class="attribute-value"
|
||||
title="{{localize 'OSE.Thac0'}}({{data.thac0.value}}) - {{localize 'OSE.scores.dex.long'}}({{data.scores.dex.mod}}) - {{localize 'OSE.Modifier'}}({{data.thac0.mod.missile}})">
|
||||
{{data.thac0.missile}}
|
||||
title="{{localize 'OSE.scores.dex.long'}}({{data.scores.dex.mod}}) + {{localize 'OSE.Modifier'}}({{data.thac0.mod.missile}})">
|
||||
{{add data.scores.dex.mod data.thac0.mod.missile}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -19,6 +19,12 @@
|
|||
<input type="text" name="data.damage" value="{{data.damage}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'OSE.items.Bonus'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.bonus" value="{{data.bonus}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'OSE.items.Slow'}}</label>
|
||||
<div class="form-fields">
|
||||
|
|
Loading…
Reference in New Issue