diff --git a/module/rdd-utility.js b/module/rdd-utility.js index dfe8fb23..0e55b7f5 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -443,21 +443,30 @@ export class RdDUtility { let comp = competenceList.find(c => c.name == arme.data.competence); arme.data.initiative = RdDUtility.calculInitiative(arme.data.niveau, carac[comp.data.defaut_carac].value); // Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence - if (arme.data.unemain && arme.data.deuxmains) { + if (arme.data.unemain && !arme.data.deuxmains ) { + arme.data.mainInfo = "(1m)"; + } else if ( !arme.data.unemain && arme.data.deuxmains ) { + arme.data.mainInfo = "(2m)"; + } else if (arme.data.unemain && arme.data.deuxmains) { + arme.data.mainInfo = "(1m)"; let arme2main = duplicate(arme); + arme2main.data.mainInfo = "(2m)"; arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace ! let comp = competenceList.find(c => c.name == arme2main.data.competence); arme2main.data.niveau = comp.data.niveau; arme2main.data.initiative = RdDUtility.calculInitiative(arme2main.data.niveau, carac[comp.data.defaut_carac].value); arme2mains.push(arme2main); + } else { } + } armeList = armeList.concat(arme2mains); // Merge all cases armeList = armeList.sort((a, b) => { if ( a.name > b.name) return 1; else return -1; } ); return armeList } + /* -------------------------------------------- */ static calculInitiative(niveau, caracValue) { let base = niveau + Math.floor(caracValue/2); return "1d6" + (base >= 0 ? "+" : "") + base; @@ -816,6 +825,7 @@ export class RdDUtility { // Recupération des items 'arme' let itemsByType = RdDUtility.buildItemsClassification( combatant.actor.data.items ); armesList = itemsByType['arme']; + armesList = this.finalizeArmeList( armesList, itemsByType['competence'], actor.data.data.carac ); // Force corps à corps et Draconic let cc = RdDUtility.findCompetence( combatant.actor.data.items, "Corps à corps"); armesList.push( { name: "Corps à corps", data: { niveau: cc.data.niveau, description: "", force: 6, competence: "Corps à corps", dommages: combatant.actor.data.data.attributs.plusdom.value } } ); diff --git a/packs/equipement.db b/packs/equipement.db index 3d9e964d..47f7196b 100644 --- a/packs/equipement.db +++ b/packs/equipement.db @@ -210,3 +210,8 @@ {"_id":"iCvphbPdxUcfqetd","name":"Aumônière","permission":{"default":0,"jOzRscDxoXZWpGS6":3},"type":"conteneur","data":{"description":"

Comme une bourse, mais sous forme d'une coque en cuir rigide.

","capacite":0.25,"encombrement":0,"equipe":false,"qualite":0,"cout":0.2,"contenu":[]},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/aumoniere.webp","effects":[]} {"_id":"iGHudg5kBOfYWgwV","name":"Arc","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"

Nie jusqu'à 2 points d'armure.

\n

Rechargement 1/2 round (s'il tire en début de round, il pourra recharger durant le reste du round pour tirer de nouveau au début du round suivant).

","quantite":1,"encombrement":1,"equipe":false,"dommages":"2","force":"0","resistance":0,"competence":"Arc","cout":10,"portee_courte":10,"portee_moyenne":20,"portee_extreme":50,"penetration":2,"rapide":false,"deuxmains":false,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/arc.webp","effects":[]} {"_id":"1Dc4KzZageae7lhI","name":"Balles de jongleur","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":4,"encombrement":0.1,"equipe":false,"resistance":0,"qualite":0,"cout":0.32},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/balle_jongleur.webp","effects":[]} +{"_id":"U6qli6TPbzj8tUdH","name":"Arme d’hast","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"","quantite":1,"encombrement":4,"equipe":false,"dommages":"4","force":"12","resistance":8,"competence":"Dague","cout":10,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":false,"penetration":null},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/hast.webp","effects":[]} +{"_id":"cFnFQrQIPgyZRWdo","name":"Épée sorde","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"

C’est une épée plus courte que la dragonne, mais plus large. Elle peut s’utiliser à une ou deux mains. Sa grande solidité en fait l’épée de prédilection des gardes et des soldats.

\n

C’est probablement à elle que le Guerrier Sorde doit son nom (à moins que ce ne soit l’inverse).

","quantite":1,"encombrement":2,"equipe":false,"dommages":"3/4","force":"12/11","resistance":15,"competence":"Epée à 1 main","cout":20,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":true,"penetration":null},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_sord.webp","effects":[]} +{"_id":"KmfftnkUsPQD6fV0","name":"Épée bâtarde","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"

Comme son nom l’indique, c’est une bâtarde de l'épée longue et de l'épée sorde, à la fois longue et large, pouvant s’utiliser à une ou deux mains.

","quantite":1,"encombrement":3,"equipe":false,"dommages":"4/5","force":"13/12","resistance":14,"competence":"Epée à 1 main","cout":30,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":true,"penetration":null},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_batarde.webp","effects":[]} +{"_id":"9jbjDpbddL2Ep09s","name":"Hache de bataille","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"","quantite":1,"encombrement":2,"equipe":false,"dommages":"3/4","force":"12/11","resistance":8,"competence":"Hache à 1 main","cout":15,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":true,"penetration":null},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/hache_bataille.webp","effects":[]} +{"_id":"7xFe41JZIVNMLv1U","name":"Masse lourde","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"","quantite":1,"encombrement":3,"equipe":false,"dommages":"3/4","force":"12/11","resistance":10,"competence":"Masse à 1 main","cout":4,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":true,"penetration":null},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/masse_lourde.webp","effects":[]} diff --git a/templates/hud-actor-attaque.html b/templates/hud-actor-attaque.html index ca06f62e..a25d2238 100644 --- a/templates/hud-actor-attaque.html +++ b/templates/hud-actor-attaque.html @@ -5,7 +5,7 @@ {{#unless arme.data.initOnly}}
+ data-arme-id="{{arme.index}}">C:{{arme.name}} {{arme.data.mainInfo}}
{{/unless}} {{/each}} diff --git a/templates/hud-actor-init.html b/templates/hud-actor-init.html index 5b021581..11b40a22 100644 --- a/templates/hud-actor-init.html +++ b/templates/hud-actor-init.html @@ -4,7 +4,7 @@ {{#each armes as |arme key|}}
+ data-arme-id="{{arme.index}}">I:{{arme.name}} {{arme.data.mainInfo}}
{{/each}}