Fix sur armes et affichage

This commit is contained in:
LeRatierBretonnien 2023-03-08 23:44:19 +01:00
parent fac6618b74
commit 3fa80b6e57
6 changed files with 106 additions and 41 deletions

View File

@ -43,6 +43,7 @@ export class HeritiersActorSheet extends ActorSheet {
contacts: this.actor.organizeContacts(), contacts: this.actor.organizeContacts(),
armes: duplicate(this.actor.getWeapons()), armes: duplicate(this.actor.getWeapons()),
monnaies: duplicate(this.actor.getMonnaies()), monnaies: duplicate(this.actor.getMonnaies()),
pouvoirs: duplicate(this.actor.getPouvoirs()),
fee: duplicate(this.actor.getFee() || {} ), fee: duplicate(this.actor.getFee() || {} ),
protections: duplicate(this.actor.getArmors()), protections: duplicate(this.actor.getArmors()),
combat: this.actor.getCombatValues(), combat: this.actor.getCombatValues(),

View File

@ -39,7 +39,12 @@ export class HeritiersActor extends Actor {
if (data.type == 'personnage') { if (data.type == 'personnage') {
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences") const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences")
data.items = skills.map(i => i.toObject()) data.items = []
for (let skill of skills) {
if (skill.system.categorie == "utile") {
data.items.push( skill.toObject())
}
}
} }
if (data.type == 'creature') { if (data.type == 'creature') {
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.skills-creatures") const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.skills-creatures")
@ -136,6 +141,9 @@ export class HeritiersActor extends Actor {
getProfils() { getProfils() {
return this.items.filter(item => item.type == "profil") return this.items.filter(item => item.type == "profil")
} }
getPouvoirs() {
return this.items.filter(item => item.type == "pouvoir")
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getSkills() { getSkills() {
let comp = [] let comp = []

View File

@ -8,7 +8,7 @@ export const HERITIERS_CONFIG = {
"prec": "Précision", "prec": "Précision",
"esp": "Esprit", "esp": "Esprit",
"per": "Perception", "per": "Perception",
"pres": "Présence", "pres": "Préstance",
"san": "Sang-Froid" "san": "Sang-Froid"
}, },

File diff suppressed because one or more lines are too long

View File

@ -97,8 +97,8 @@
"max": 1 "max": 1
}, },
"pres": { "pres": {
"label": "Présence", "label": "Prestance",
"labelnorm": "presence", "labelnorm": "prestance",
"abbrev": "pre", "abbrev": "pre",
"kind": "mental", "kind": "mental",
"value": 1, "value": 1,

View File

@ -382,6 +382,44 @@
</ul> </ul>
</div> </div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header item-field-label-long2-img">
<h3><label class="items-title-text">Pouvoirs</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Masque</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Niveau</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
</div>
</li>
{{#each pouvoirs as |pouvoir key|}}
<li class="item flexrow " data-item-id="{{pouvoir._id}}" data-item-type="pouvoir">
<img class="item-name-img" src="{{pouvoir.img}}" />
<span class="item-field-label-long2">{{pouvoir.name}}</span>
<span class="item-field-label-medium">{{upperFirst pouvoir.system.masquetype}}</span>
<span class="item-field-label-medium">{{upperFirst pouvoir.system.pouvoirtype}}</span>
<span class="item-field-label-medium">{{upperFirst pouvoir.system.niveau}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype"> <div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg"> <li class="item flexrow list-item items-title-bg">