Merge branch 'Archonoir-main-patch' into 'main'

Update template.json

See merge request LeRatierBretonnien/fvtt-yggdrasill!1
This commit is contained in:
Leratier Bretonnien 2022-02-21 22:25:35 +00:00
commit 6b42e9dc3f
6 changed files with 99 additions and 13 deletions

View File

@ -48,12 +48,14 @@ export class YggdrasillActorSheet extends ActorSheet {
blessures: this.actor.getBlessures(),
armes: this.actor.getArmes(),
armures: this.actor.getArmures(),
boucliers: this.actor.getBoucliers(),
prouessesMartiales: this.actor.getProuessesMartiales(),
equipements: this.actor.getToutEquipements(),
effetsmagiques: this.actor.getEffetsMagiques(),
effetsRunes: this.actor.getEffetsDeRunes(),
encTotal: this.actor.getEncTotal(),
protectionTotal: this.actor.getProtectionTotal(),
dpBouclier: this.actor.getDpBouclier(),
monnaies: this.actor.getMonnaies(),
sortsSejdr:this.actor.getSortsSejdr(),
sortsGaldr:this.actor.getSortsGaldr(),
@ -81,10 +83,10 @@ export class YggdrasillActorSheet extends ActorSheet {
dm.total = dm.max + Number(dm.bonusmalus);
}
/* -------------------------------------------- */
updateDP( data ) {
updateDP( data ) {
let dp = data.caracsecondaire.defensephy;
dp.total = dp.max + Number(dp.bonusmalus);
dp.total += (dp.bouclierequipe) ? 3 : 0;
dp.total += this.actor.getDpBouclier();
}
/* -------------------------------------------- */

View File

@ -280,7 +280,7 @@ export class YggdrasillActor extends Actor {
}
/* -------------------------------------------- */
getToutEquipements() {
return this.data.items.filter( item => item.type == 'equipement' || item.type == 'armure' || item.type == 'armecc' || item.type == 'armedist');
return this.data.items.filter( item => item.type == 'equipement' || item.type == 'armure' || item.type == 'armecc' || item.type == 'armedist' || item.type == 'bouclier');
}
/* -------------------------------------------- */
getArmes() {
@ -289,6 +289,9 @@ export class YggdrasillActor extends Actor {
/* -------------------------------------------- */
getArmures() {
return this.data.items.filter( item => item.type == 'armure' && item.data.data.equipe );
}
getBoucliers() {
return this.data.items.filter( item => item.type == 'bouclier' && item.data.data.equipe );
}
getProuessesMartiales() {
let prouesse = this.data.items.filter( item => item.type == 'prouesse' );
@ -738,13 +741,19 @@ export class YggdrasillActor extends Actor {
getEncTotal( ) {
let encTotal = 0;
for( let item of this.data.items) {
if (item.type == "equipement" || item.type == "armecc"
|| item.type == "armedist" || item.type == "armure" || item.type == "monnaie") {
encTotal += item.data.data.enc;
if (item.type == "equipement" || item.type == "armecc"
|| item.type == "armedist" || item.type == "armure" || item.type == "monnaie" || item.type == "bouclier") {
encTotal += (item.data.data.enc * item.data.data.quantite);
}
}
for( let item of this.data.items) {
if (item.type == "bouclier" && item.data.data.equipe) {
encTotal -= (item.data.data.enc * item.data.data.quantite);
encTotal += (item.data.data.enccomb * item.data.data.quantite);
}
}
return encTotal;
}
}
/* -------------------------------------------- */
getProtectionTotal( ) {
@ -756,6 +765,16 @@ export class YggdrasillActor extends Actor {
}
return protectionTotal;
}
/* -------------------------------------------- */
getDpBouclier( ) {
let dpBouclier = 0;
for( let item of this.data.items) {
if (item.type == "bouclier" && item.data.data.equipe) {
dpBouclier += Number(item.data.data.defensebonus);
}
}
return dpBouclier;
}
/* -------------------------------------------- */
async incrementeQuantite( objetId ) {

View File

@ -2,7 +2,7 @@
"name": "fvtt-yggdrasill",
"title": "Yggdrasill",
"description": "Système non-officiel Yggdrasill (7ième Cercle) pour FoundryVTT",
"version": "1.2.0",
"version": "1.2.1",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "9",

View File

@ -128,7 +128,6 @@
"defensephy": {
"value": 0,
"bonusmalus": 0,
"bouclierequipe": false,
"max": 0,
"label": "Défense Physique",
"abbrev": "dp"
@ -330,6 +329,16 @@
"enc": 0,
"valeur": 0,
"description": ""
},
"bouclier": {
"categorie": "",
"equipe": false,
"defensebonus": 0,
"enc": 0,
"enccomb": 0,
"solidite": 0,
"valeur": 0,
"description": ""
},
"equipement": {
"equipe": false,

View File

@ -156,10 +156,6 @@
{{/select}}
</select>
</li>
<li class="item flexrow list-item">
<span>Bouclier ?</span>
<span class="attribute-value checkbox"><input type="checkbox" name="data.caracsecondaire.{{key}}.bouclierequipe" {{checked caracsec.bouclierequipe}}/></span>
</li>
<li class="item flexrow list-item">
<span class="stat-label flexrow tooltip tooltip-nobottom" name="{{key}}-total">Total : {{caracsec.total}}</span>
</li>
@ -372,6 +368,31 @@
</li>
{{/each}}
</ul>
<div><h4>Bouclier (Bonus de défense physique : {{dpBouclier}}) </h4></div>
<ul class="item-list alternate-list">
<li class="stat flexrow" >
<span class="stat-label flexrow">Nom</span>
<span class="stat-label flexrow">Catégorie</span>
<span class="stat-label flexrow">Bonus DP</span>
<div class="item-controls">
</div>
</li>
{{#each bouclier as |bouclier key|}}
<li class="item stat flexrow list-item" data-armure-id="{{bouclier.id}}" data-item-id="{{bouclier.id}}">
<img class="sheet-competence-img" src="{{bouclier.img}}"/>
<span class="stat-label combat-label flexrow tooltip tooltip-nobottom"><a name="{{bouclier.name}}">{{bouclier.name}}</a></span>
<span class="stat-label combat-label">&nbsp;{{bouclier.data.data.categorie}}</span>
<span class="stat-label combat-label">&nbsp;{{bouclier.data.data.defensebonus}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if bouclier.data.data.equipe}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<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>

View File

@ -0,0 +1,35 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Catégorie</label>
<select class="competence-base flexrow" type="text" name="data.categorie" value="{{data.categorie}}" data-dtype="String">
{{#select data.categorie}}
<option value="bouclier">bouclier</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipée ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.equipe" {{checked data.equipe}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Bonus DP</label><input type="text" name="data.defensebonus" value="{{data.defensebonus}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Encombrement en combat</label><input type="text" name="data.enccomb" value="{{data.enccomb}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Solidité</label><input type="text" name="data.solidite" value="{{data.solidite}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Valeur</label><input type="text" name="data.valeur" value="{{data.valeur}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</section>
</form>