implements fighting with a shield. This closes #87.
parent
8972f3e0dd
commit
6bd901f583
|
|
@ -172,6 +172,44 @@ export class DefenseActionDialog extends HandlebarsApplicationMixin(ApplicationV
|
|||
// TODO: also do this for combatAction
|
||||
const links = this._actor.system.heldenausruestung[this._actor.system.setEquipped].links
|
||||
const rechts = this._actor.system.heldenausruestung[this._actor.system.setEquipped].rechts
|
||||
const linkeWaffe = this._actor.itemTypes["Equipment"].find(p => p._id === links)
|
||||
if (linkeWaffe && linkeWaffe.system.meleeSkills.indexOf("Schilde") !== -1) {
|
||||
const skillAt = 0
|
||||
const skillPa = 0
|
||||
|
||||
weapons.push({
|
||||
isSelected: this._skillId === "Schilde" && this._weaponId === linkeWaffe._id,
|
||||
weaponId: linkeWaffe._id,
|
||||
skillId: "Schilde",
|
||||
name: linkeWaffe.name,
|
||||
skillName: "Schilde",
|
||||
img: linkeWaffe.img,
|
||||
combatStatistics: {
|
||||
at: baseAt["links"] + linkeWaffe.system.attackModifier + skillAt,
|
||||
pa: basePa["links"] + linkeWaffe.system.parryModifier + skillPa
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const rechteWaffe = this._actor.itemTypes["Equipment"].find(p => p._id === rechts)
|
||||
if (rechteWaffe && rechteWaffe.system.meleeSkills.indexOf("Schilde") !== -1) {
|
||||
const skillAt = 0
|
||||
const skillPa = 0
|
||||
|
||||
weapons.push({
|
||||
isSelected: this._skillId === "Schilde" && this._weaponId === rechteWaffe._id,
|
||||
weaponId: rechteWaffe._id,
|
||||
skillId: "Schilde",
|
||||
name: rechteWaffe.name,
|
||||
skillName: "Schilde",
|
||||
img: rechteWaffe.img,
|
||||
combatStatistics: {
|
||||
at: baseAt["rechts"] + rechteWaffe.system.attackModifier + skillAt,
|
||||
pa: basePa["rechts"] + rechteWaffe.system.parryModifier + skillPa
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!links && !rechts) {
|
||||
const unarmedSkills = [this._actor.itemTypes["Skill"].find(p => p.name === "Ringen"), this._actor.itemTypes["Skill"].find(p => p.name === "Raufen")]
|
||||
|
||||
|
|
|
|||
|
|
@ -605,10 +605,20 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
}
|
||||
if (links) {
|
||||
const meitems = []
|
||||
|
||||
links.system.meleeSkills.forEach((skillInQuestion) => {
|
||||
const item = actorData.items.find(p => p.name === skillInQuestion)
|
||||
if (item) {
|
||||
meitems.push(item)
|
||||
} else if (skillInQuestion === "Schilde") {
|
||||
meitems.push({
|
||||
_id: "Schilde",
|
||||
name: "Schildkampf",
|
||||
system: {
|
||||
at: 0,
|
||||
pa: 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
meitems?.forEach(skill => {
|
||||
|
|
@ -632,6 +642,15 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
const item = actorData.items.find(p => p.name === skillInQuestion)
|
||||
if (item) {
|
||||
meitems.push(item)
|
||||
} else if (skillInQuestion === "Schilde") {
|
||||
meitems.push({
|
||||
_id: "Schilde",
|
||||
name: "Schildkampf",
|
||||
system: {
|
||||
at: 0,
|
||||
pa: 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
meitems?.forEach(skill => {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
.attack {
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: 32px 32px 1fr 1fr;
|
||||
grid-template-columns: 32px 32px 1fr 1fr;
|
||||
grid-template-rows: 18px 30px;
|
||||
grid-template-areas: "name name name name" "at pa tp ini";
|
||||
height: 64px;
|
||||
|
|
@ -116,6 +116,10 @@
|
|||
h3 {
|
||||
grid-area: name;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
margin-bottom: -8px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
label {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
{{#each attacks}}
|
||||
<div class="attack">
|
||||
<h3>{{this.using}} ({{this.name}})</h3>
|
||||
<h3 data-tooltip="{{this.using}} ({{this.name}})">{{this.using}} ({{this.name}})</h3>
|
||||
|
||||
{{#if this.at}}
|
||||
<div data-tooltip="{{localize "WEAPON.attack" weapon=this.name}}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue