Bouton Ajout de compétence créature

This commit is contained in:
Vincent Vandemeulebrouck 2024-12-09 22:04:47 +01:00
parent 4dd6e1c3ff
commit 12e5c94aba
4 changed files with 93 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- Ajout de la liste des armures dans l'onglet caractéristiques - Ajout de la liste des armures dans l'onglet caractéristiques
- Ajout d'une option pour choisir une carte des TMR alternatives - Ajout d'une option pour choisir une carte des TMR alternatives
- Le Gardien peut créer des sorts en réserve parmi les sorts d'un personnage - Le Gardien peut créer des sorts en réserve parmi les sorts d'un personnage
- Bouton pour ajouter des compétences aux créatures/entités
- Correction du choix d'une cible parmi toutes les cibles pour les combats - Correction du choix d'une cible parmi toutes les cibles pour les combats
- Correction des ajouts de blessures (prise en compte de l'endurance et des contusions) - Correction des ajouts de blessures (prise en compte de l'endurance et des contusions)
- Correction des rituels de Détection et Lecture d'Aura des personnages prétirés - Correction des rituels de Détection et Lecture d'Aura des personnages prétirés

View File

@ -1,4 +1,5 @@
import { Grammar } from "../grammar.js"; import { Grammar } from "../grammar.js";
import { ITEM_TYPES } from "../item.js";
import { RdDSheetUtility } from "../rdd-sheet-utility.js"; import { RdDSheetUtility } from "../rdd-sheet-utility.js";
import { RdDBaseActorSheet } from "./base-actor-sheet.js"; import { RdDBaseActorSheet } from "./base-actor-sheet.js";
@ -36,6 +37,16 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
this.html.find('.delete-active-effect').click(async event => this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect'))); this.html.find('.delete-active-effect').click(async event => this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect')));
this.html.find('.enlever-tous-effets').click(async event => await this.actor.removeEffects()); this.html.find('.enlever-tous-effets').click(async event => await this.actor.removeEffects());
} }
this.html.find('.competence-add').click(async event =>
await this.actor.createEmbeddedDocuments("Item", [{
type: ITEM_TYPES.competencecreature,
name: 'Nouvelle competence',
img: 'systems/foundryvtt-reve-de-dragon/icons/compcreature-serres.webp',
system: {
carac_value: this.actor.getForce(),
}
}], { renderSheet: true })
)
} }

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 512 512"
style="height: 256px; width: 256px;"
version="1.1"
id="svg8"
sodipodi:docname="add-skill.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2138"
inkscape:window-height="1465"
id="namedview10"
showgrid="false"
inkscape:zoom="1.0150849"
inkscape:cx="466.02267"
inkscape:cy="44.586362"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg8" />
<path
d="M0 0h512v512H0z"
fill="url(#pattern)"
fill-opacity="0.5"
id="path2" />
<g
class=""
transform="translate(-81.40366,-2.6174234)"
id="g6">
<path
d="m 119.1,25 v 0.1 c -25,3.2 -47.1,32 -47.1,68.8 0,20.4 7.1,38.4 17.5,50.9 L 99.7,157 84,159.9 c -13.7,2.6 -23.8,9.9 -32.2,21.5 -8.5,11.5 -14.9,27.5 -19.4,45.8 -8.2,33.6 -9.9,74.7 -10.1,110.5 h 44 l 11.9,158.4 h 96.3 L 185,337.7 h 41.9 c 0,-36.2 -0.3,-77.8 -7.8,-111.7 -4,-18.5 -10.2,-34.4 -18.7,-45.9 -8.6,-11.4 -19.2,-18.7 -34.5,-21 l -16,-2.5 L 160,144 c 10,-12.5 16.7,-30.2 16.7,-50.1 0,-39.2 -24.8,-68.8 -52.4,-68.8 -2.9,0 -4.7,-0.1 -5.2,-0.1 z M 311,55 v 48 H 208 v 18 h 103 v 158 h -55 v 18 h 55 V 407 H 208 v 18 h 103 v 32 h 80.8 c -0.5,-2.9 -0.8,-5.9 -0.8,-9 0,-3.1 0.3,-6.1 0.8,-9 H 329 V 297 h 62.8 c -0.5,-2.9 -0.8,-5.9 -0.8,-9 0,-3.1 0.3,-6.1 0.8,-9 H 329 V 73 h 62.8 c -0.5,-2.92 -0.8,-5.93 -0.8,-9 0,-3.07 0.3,-6.08 0.8,-9 z m 129,202 c -17.2,0 -31,13.8 -31,31 0,17.2 13.8,31 31,31 17.2,0 31,-13.8 31,-31 0,-17.2 -13.8,-31 -31,-31 z m 0,160 c -17.2,0 -31,13.8 -31,31 0,17.2 13.8,31 31,31 17.2,0 31,-13.8 31,-31 0,-17.2 -13.8,-31 -31,-31 z"
fill="#000000"
fill-opacity="0.8"
transform="matrix(0.6,0,0,0.6,102.4,102.4)"
id="path4"
sodipodi:nodetypes="ccsccccccccccccccccssccccccccccccccccsccccsccccsccssssssssss" />
</g>
<g
class=""
transform="translate(124.63542,-119.78046)"
id="g6-1">
<path
d="m 158.81777,136.77499 c -9.48,32.22 -28.656,28.8 -47.61,26.04 21.39,6.12 29.61,22.38 25.998,47.64 7.596,-27.6 25.572,-31.56 47.652,-26.04 -22.56,-7.26 -34.14,-21.24 -26.04,-47.64 z m -41.76,76.08 c 5.496,10.02 4.578,18.06 -3.366,24 7.476,-4.14 14.91,-8.58 23.946,3.36 -7.542,-9.72 -4.92,-17.4 3.366,-24 -8.352,5.82 -16.482,6.96 -23.946,-3.36 z m 82.32,0.18 c 6.84,16.08 -0.3,24.78 -13.02,30.54 13.62,-5.1 24.48,-2.7 30.54,13.02 -7.62,-19.08 2.88,-24.72 13.02,-30.54 -12.6,5.1 -22.68,0.54 -30.54,-13.02 z m -52.776,31.2 c 9.396,34.68 0.516,58.86 -28.392,71.1 26.076,-7.08 52.428,-15.12 71.208,28.44 -15.84,-35.58 -2.04,-57.24 28.38,-71.28 -30,11.52 -55.86,9 -71.196,-28.26 z"
fill="#000000"
fill-opacity="0.8"
id="path4-2"
sodipodi:nodetypes="cccccccccccccccccccc"
style="stroke-width:0.6" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -1,3 +1,6 @@
<h4>Compétences{{#if @root.options.vueDetaillee}} <a class="competence-add" data-tooltip="Ajouter une compétence">
<i class="fa-solid fa-books-medical"></i>
</a>{{/if}}</h4>
<ol class="item-list alterne-list"> <ol class="item-list alterne-list">
{{#each (trier competences) as |comp key|}} {{#each (trier competences) as |comp key|}}
<li class="item flexrow list-item" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">