Merge pull request '## 13.0.19 - L'introspection d'Illysis' (#784) from feature/v13-combats-v2 into v13
All checks were successful
Release Creation / build (release) Successful in 2m10s
All checks were successful
Release Creation / build (release) Successful in 2m10s
Reviewed-on: https, #784
This commit was merged in pull request #784.
This commit is contained in:
1
assets/actions/arme-brisee.svg
Normal file
1
assets/actions/arme-brisee.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><defs><linearGradient x1="0" x2="1" y1="1" y2="0" id="lorc-shattered-sword-gradient-4"><stop offset="0%" stop-color="#4a4a4a" stop-opacity="1"></stop><stop offset="100%" stop-color="#c9c9c9" stop-opacity="1"></stop></linearGradient><radialGradient id="lorc-shattered-sword-gradient-5"><stop offset="0%" stop-color="#9013fe" stop-opacity="1"></stop><stop offset="100%" stop-color="#85562c" stop-opacity="1"></stop></radialGradient><radialGradient id="lorc-shattered-sword-gradient-7"><stop offset="0%" stop-color="#9013fe" stop-opacity="1"></stop><stop offset="100%" stop-color="#85562c" stop-opacity="1"></stop></radialGradient></defs><g class="" transform="translate(1,-2)" style=""><path d="m496.223 16.818-48.475 44.205 48.475 4.575v-48.78zm-41.55 1.22-68.91 11.28-7.04 65.547 75.95-76.828zM352.26 77.907l-87.887 50.3 15.447 41.026 82.662-16.87-10.222-74.456zm64.34 25.022-32.967 67.443 24.842 70.684 54.314-134.19-46.19-3.937zm-271.362 72.808c-10.02.155-20.714 3.165-30.79 9.057 4.143 8.863 3.382 18.708-2.776 24.873-6.158 6.165-15.993 6.927-24.846 2.78-12.923 22.167-11.88 47.34 2.485 61.73l29.84-29.87c58.655 42.87 109.37 92.94 150.57 151.24l-36.19 36.23 6.61-6.604c14.283 14.298 39.192 15.42 61.23 2.732-4.88-9.197-4.366-19.74 2.107-26.22 6.47-6.478 17-6.993 26.185-2.112 12.66-22.062 11.54-47-2.732-61.3l-28.248 28.28c-57.035-42.41-107.91-92.665-151.426-150.386l35.455-35.492-6.61 6.603c-7.834-7.843-18.863-11.726-30.862-11.542zm108.45 4.512c-17.61 17.41-39.674 39.21-62.22 61.375a728.952 728.952 0 0 0 27.407 30.094l59.063-59.126-24.25-32.344zm78.28 32.688L297 219.968l-65 65.063a728.12 728.12 0 0 0 35 32.376c22.02-23.134 43.764-46.41 64.97-69.406v-35.063zM173.47 313.25c-31.146 40.858-67.877 74.323-108.905 101.875 4.13 13.708 16.394 26.374 30.624 30.563 29.466-41.26 61.113-79.902 100.97-109.97a637.777 637.777 0 0 0-22.688-22.468zM44.5 410.28l-20.844 20.845c7.133 24.65 27.843 44.912 53.72 53.438l19.28-19.313c-26.948-4.28-48.314-26.91-51.875-52.938l-.28-2.03z" fill="#fff" fill-opacity="1" transform="translate(51.2, 51.2) scale(0.8, 0.8) rotate(0, 256, 256) skewX(0) skewY(0)"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
1
assets/actions/magique.svg
Normal file
1
assets/actions/magique.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><defs><linearGradient x1="0" x2="1" y1="1" y2="0" id="delapouite-sparkles-gradient-4"><stop offset="0%" stop-color="#4a4a4a" stop-opacity="1"></stop><stop offset="100%" stop-color="#c9c9c9" stop-opacity="1"></stop></linearGradient><radialGradient id="delapouite-sparkles-gradient-5"><stop offset="0%" stop-color="#9013fe" stop-opacity="1"></stop><stop offset="100%" stop-color="#85562c" stop-opacity="1"></stop></radialGradient><radialGradient id="delapouite-sparkles-gradient-7"><stop offset="0%" stop-color="#9013fe" stop-opacity="1"></stop><stop offset="100%" stop-color="#85562c" stop-opacity="1"></stop></radialGradient></defs><g class="" transform="translate(1,-2)" style=""><path d="M237.4 20.73c-6.1 42.1-26.8 64.2-63.9 64 31.6 4.5 63.8 8 63.9 64.07-.6-46.1 24.5-63.07 64.1-64.07-38-1.5-64.9-16.3-64.1-64zm127.8 11.58c-9.1 14.25-20.8 21.29-38.9 10.28 14.9 11.79 18.6 24.76 10.2 38.97 8.9-11.18 17.5-22.73 39-10.27-17.8-10.06-18.8-23.57-10.3-38.98zM59.68 41.69c-2.7 18.8-12 28.6-28.5 28.5 14.1 2 28.4 3.6 28.5 28.52-.3-20.5 10.9-28.12 28.5-28.52-16.9-.7-28.9-7.3-28.5-28.5zM431 66.28c-2.7 18.8-12 28.6-28.5 28.5 14.1 2 28.4 3.6 28.5 28.52-.3-20.5 10.9-28.12 28.5-28.52-16.9-.7-28.9-7.3-28.5-28.5zM120.3 116.4c-15.8 53.7-47.76 48-79.35 43.4C76.6 170 90.3 197.1 84.28 239.2c12.66-46 42.62-52.6 79.42-43.4-37.6-12.1-56.9-35.4-43.4-79.4zm187 5c-8.8 61.6-39.3 94-93.6 93.7 46.2 6.5 93.6 11.7 93.6 93.7-.8-67.3 35.9-92.2 93.8-93.7-55.5-2.2-94.9-23.9-93.8-93.7zm136.8 38.3c-13.1 21.6-29.5 28.8-49.7 20.1 16.3 9.7 33 19.1 20.1 49.6 10.3-25.2 27.9-28.7 49.7-20-20.3-9.7-31.6-23.9-20.1-49.7zM50.7 243.2c9.16 16.7 7.63 30.1-5.61 40 12.46-6.9 24.85-14.3 39.91 5.6-12.57-16.2-8.2-29 5.61-40-13.92 9.7-27.47 11.6-39.91-5.6zm137.2.3c11.4 26.8-.5 41.3-21.7 50.9 22.7-8.5 40.8-4.5 50.9 21.7-12.7-31.8 4.8-41.2 21.7-50.9-21 8.5-37.8.9-50.9-21.7zm228 12.6c-26.6 64.7-68.7 91.7-127.8 76.4 48.6 19.8 98.8 38.5 76.4 127.9 17.5-73.7 64.4-90.7 127.9-76.5-59.9-17.5-96.9-52-76.5-127.8zM99.94 295.5c15.66 57.8.86 98.1-47.32 118.5 43.46-11.8 87.38-25.2 118.68 47.4-26.4-59.3-3.4-95.4 47.3-118.8-50 19.2-93.1 15-118.66-47.1zm169.36 61c-21.8 20.6-43 23.6-63.2 7.3 15.5 16.3 31.6 32.4 7.2 63.3 19.8-25.6 41.2-24.1 63.3-7.3-20.2-17.4-28.6-37.5-7.3-63.3zM443.2 404c-2.7 18.8-12 28.6-28.5 28.5 14.1 2 28.4 3.6 28.5 28.5-.3-20.5 10.9-28.1 28.5-28.5-16.9-.7-28.9-7.3-28.5-28.5zm-169.7 36c-2.7 18.8-12 28.6-28.5 28.5 14.1 2 28.4 3.6 28.5 28.5-.3-20.5 10.9-28.1 28.5-28.5-16.9-.7-28.9-7.3-28.5-28.5z" fill="#fff" transform="translate(51.2, 51.2) scale(0.8, 0.8) rotate(0, 256, 256) skewX(0) skewY(0)" fill-opacity="1"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
110
assets/ui/resistance.svg
Normal file
110
assets/ui/resistance.svg
Normal file
@@ -0,0 +1,110 @@
|
||||
<?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 378.00079 384.97681"
|
||||
version="1.1"
|
||||
id="svg23"
|
||||
sodipodi:docname="resistance.svg"
|
||||
width="378.00079"
|
||||
height="384.97681"
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||
<metadata
|
||||
id="metadata27">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1875"
|
||||
inkscape:window-height="1352"
|
||||
id="namedview25"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="1.4355469"
|
||||
inkscape:cx="186.7504"
|
||||
inkscape:cy="196.1768"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg23" />
|
||||
<defs
|
||||
id="defs17">
|
||||
<linearGradient
|
||||
x1="0"
|
||||
x2="1"
|
||||
y1="1"
|
||||
y2="0"
|
||||
id="lorc-aura-gradient-4">
|
||||
<stop
|
||||
offset="0%"
|
||||
stop-color="#4a4a4a"
|
||||
stop-opacity="1"
|
||||
id="stop2" />
|
||||
<stop
|
||||
offset="100%"
|
||||
stop-color="#c9c9c9"
|
||||
stop-opacity="1"
|
||||
id="stop4" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
id="lorc-aura-gradient-5">
|
||||
<stop
|
||||
offset="0%"
|
||||
stop-color="#9013fe"
|
||||
stop-opacity="1"
|
||||
id="stop7" />
|
||||
<stop
|
||||
offset="100%"
|
||||
stop-color="#85562c"
|
||||
stop-opacity="1"
|
||||
id="stop9" />
|
||||
</radialGradient>
|
||||
<radialGradient
|
||||
id="lorc-aura-gradient-7">
|
||||
<stop
|
||||
offset="0%"
|
||||
stop-color="#9013fe"
|
||||
stop-opacity="1"
|
||||
id="stop12" />
|
||||
<stop
|
||||
offset="100%"
|
||||
stop-color="#85562c"
|
||||
stop-opacity="1"
|
||||
id="stop14" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
<g
|
||||
class=""
|
||||
transform="translate(-68.2496,-61.8232)"
|
||||
id="g21">
|
||||
<path
|
||||
d="m 320.938,13.28 c -16.646,34.584 -38.466,60.157 -63.094,60.157 -24.522,0 -47.035,-25.275 -63.656,-59.593 0.366,39.358 -9.71,90.884 -30.938,105.125 -21.228,14.24 -49.64,-12.002 -78.844,-32.126 17.455,34.04 42.095,67.5 29.78,92.28 -12.21,24.576 -59.172,35.96 -92.874,35.626 29.338,19.29 78.842,45.803 78.844,74.188 0.002,28.384 -49.504,53.71 -78.844,73 33.702,-0.333 80.663,11.612 92.876,36.187 12.227,24.61 -9.03,56.31 -33.75,85.563 44.826,-15.413 65.142,-5.735 85.374,10.812 h 31.75 C 154.822,459.086 125.5,386.671 125.5,302.936 125.498,184.316 184.42,88.03 256.906,88.03 c 72.488,0 131.406,96.29 131.406,214.907 0,83.74 -29.317,156.153 -72.062,191.563 h 27.313 c 19.847,-14.62 39.796,-25.65 89.687,-9.28 -26.233,-30.264 -42.2,-62.484 -29.97,-87.095 12.257,-24.665 56.658,-36.612 90.533,-36.188 -29.4,-19.297 -75.344,-44.584 -75.344,-73 0,-28.415 45.943,-54.89 75.342,-74.187 -33.874,0.424 -78.273,-10.962 -90.53,-35.625 -12.315,-24.78 9.982,-58.24 27.437,-92.28 -29.202,20.12 -57.583,46.385 -78.845,32.124 -21.262,-14.263 -31.382,-66.13 -30.938,-105.69 z m -68.97,93.75 c -19.56,2.543 -37.343,25.564 -37.343,55.407 0,16.447 5.67,30.986 14,41.032 l 10.156,12.218 -15.593,2.937 c -10.815,2.035 -18.743,7.737 -25.53,17.063 -6.79,9.325 -11.984,22.344 -15.626,37.343 -6.585,27.128 -8.078,60.24 -8.31,89.47 h 36.093 l 0.656,8.656 9.124,122.563 h 76.187 l 8.095,-122.5 0.563,-8.72 h 34.375 c -0.026,-29.592 -0.44,-63.166 -6.407,-90.5 -3.295,-15.095 -8.287,-28.096 -15.156,-37.313 -6.87,-9.216 -15.133,-14.897 -27.28,-16.78 l -15.94,-2.47 10.064,-12.593 c 7.97,-9.996 13.375,-24.36 13.375,-40.406 -0.002,-31.817 -19.884,-55.313 -41.44,-55.313 -2.54,0 -3.96,-0.103 -4.03,-0.094 h -0.03 z"
|
||||
fill="#ffffff"
|
||||
fill-opacity="1"
|
||||
transform="matrix(0.8,0,0,0.8,51.2,51.2)"
|
||||
id="path19" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.4 KiB |
20
changelog.md
20
changelog.md
@@ -1,5 +1,25 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.19 - L'introspection d'Illysis
|
||||
|
||||
- Ajout d'un bouton pour les jets de résistance sous rêve actuel
|
||||
- Fenêtre de jet v2
|
||||
- restrictions au propriétaire du personnage
|
||||
- ouverture de la fenêtre de jets
|
||||
- appel à la chance
|
||||
- appel à la destinée
|
||||
- fermeture par défaut selon le type de jets:
|
||||
- jets d'attaque
|
||||
- jets de défense
|
||||
- jets imposés par un choix d'action
|
||||
- lancer de sorts
|
||||
- jets suite à appel à la chance
|
||||
- gestion des écailles d'efficacité sur les armes
|
||||
- permettre de faire une attaque même si l'initiative n'est pas faite
|
||||
- les messages de défense s'affichent correctement avec plusieurs joueurs
|
||||
- les particulières en force/rapidité sont correctement affichées dans le tchat
|
||||
- l'expérience sur jet de résistance est limitée à 1 point
|
||||
|
||||
## 13.0.18 - Le reflet d'Illysis
|
||||
|
||||
- Mise à jour de la feuille de personnage pdf template (avec police correcte)
|
||||
|
||||
@@ -593,6 +593,9 @@ select,
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-action roll-section[name="resistance"] {
|
||||
align-items: flex-end;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-action roll-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -607,6 +610,12 @@ select,
|
||||
margin: 0 1rem;
|
||||
padding: 0;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-action roll-section img.flag-resistance {
|
||||
max-width: 1.5rem;
|
||||
max-height: 1.5rem;
|
||||
text-align: right;
|
||||
filter: invert(0.6);
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-conditions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -160,6 +160,9 @@
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
|
||||
roll-section[name="resistance"] {
|
||||
align-items: flex-end;
|
||||
}
|
||||
roll-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -174,6 +177,12 @@
|
||||
margin: 0 1rem;
|
||||
padding: 0;
|
||||
}
|
||||
img.flag-resistance {
|
||||
max-width: 1.5rem;
|
||||
max-height: 1.5rem;
|
||||
text-align: right;
|
||||
filter: invert(0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,8 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
}
|
||||
|
||||
// Points de reve actuel
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollCarac(CARACS.REVE_ACTUEL, { resistance: true }))
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollReveActuel({ resistance: false }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveActuel({ diff: -8, resistance: true }))
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => {
|
||||
|
||||
@@ -52,7 +52,6 @@ import { PART_TACHE } from "./roll/roll-part-tache.mjs";
|
||||
import { PART_COMP } from "./roll/roll-part-comp.mjs";
|
||||
import { PART_OEUVRE } from "./roll/roll-part-oeuvre.mjs";
|
||||
import { PART_CUISINE } from "./roll/roll-part-cuisine.mjs";
|
||||
import { PART_SORT } from "./roll/roll-part-sort.mjs";
|
||||
|
||||
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
||||
|
||||
@@ -1637,7 +1636,8 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
return
|
||||
}
|
||||
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence, rollData.jetResistance);
|
||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence,
|
||||
rollData.v2 ? rollData.type.resistance : rollData.jetResistance);
|
||||
if (xpData.length) {
|
||||
const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.hbs`, {
|
||||
actor: this,
|
||||
@@ -1945,8 +1945,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
diff: { value: diff ?? 0 }
|
||||
}
|
||||
}
|
||||
RollDialog.create(rollData, foundry.utils.mergeObject(options, { onRollDone: RollDialog.onRollDoneClose }))
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
@@ -1980,8 +1979,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
selected: { tache: { key: tache.id, forced: options.forced } },
|
||||
type: { allowed: [PART_TACHE], current: PART_TACHE }
|
||||
}
|
||||
RollDialog.create(rollData, options)
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
const compData = this.getCompetence(tache.system.competence)
|
||||
@@ -2040,8 +2038,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
selected: { jeu: { key: jeu.id } },
|
||||
type: { allowed: [ROLL_TYPE_JEU], current: ROLL_TYPE_JEU }
|
||||
}
|
||||
await RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
const listCarac = jeu.system.caraccomp.toLowerCase().split(/[.,:\/-]/).map(it => it.trim());
|
||||
@@ -2069,8 +2066,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
selected: { meditation: { key: id } },
|
||||
type: { allowed: [ROLL_TYPE_MEDITATION], current: ROLL_TYPE_MEDITATION }
|
||||
}
|
||||
await RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
const competence = foundry.utils.duplicate(this.getCompetence(meditation.system.competence));
|
||||
@@ -2269,7 +2265,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
const xpCompetence = competence ? xp - xpCarac : 0;
|
||||
if (jetResistance) {
|
||||
const message = `Jet de résistance ${jetResistance}, l'expérience est limitée à 1`;
|
||||
const message = `Jet de résistance, l'expérience est limitée à 1`;
|
||||
ui.notifications.info(message);
|
||||
console.log(message)
|
||||
// max 1 xp sur jets de résistance
|
||||
@@ -3149,7 +3145,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
selected: { oeuvre: { key: oeuvre.id } },
|
||||
type: { allowed: [PART_OEUVRE], current: PART_OEUVRE, },
|
||||
}
|
||||
await RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -3254,8 +3250,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
cuisine: { key: recette.id }
|
||||
}
|
||||
}
|
||||
RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
const artData = {
|
||||
@@ -3305,8 +3300,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
cuisine: { key: item.id }
|
||||
}
|
||||
}
|
||||
RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
return
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
|
||||
if (item.getUtilisationCuisine() == 'brut') {
|
||||
|
||||
@@ -26,7 +26,7 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../i
|
||||
import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
import RollDialog from "../roll/roll-dialog.mjs";
|
||||
import { ATTAQUE_ROLL_TYPES, DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_TACHE } from "../roll/roll-constants.mjs";
|
||||
import { ATTAQUE_ROLL_TYPES, DEFAULT_ROLL_TYPES, DIFF, DIFFS, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_TACHE } from "../roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs";
|
||||
|
||||
@@ -284,8 +284,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
diff: { value: diff }
|
||||
}
|
||||
}
|
||||
RollDialog.create(rollData, options)
|
||||
return
|
||||
return await RollDialog.create(rollData, options)
|
||||
}
|
||||
|
||||
const competence = this.getCompetence(compName);
|
||||
@@ -359,6 +358,26 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
})
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollReveActuel({ diff = 0, resistance = false }) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [PART_COMP],
|
||||
current: PART_COMP,
|
||||
resistance: resistance
|
||||
},
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
comp: resistance ? { key: undefined, forced: true } : undefined,
|
||||
diff: { type: DIFF.DEFAUT, value: diff }
|
||||
}
|
||||
}
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
return this.rollCarac(CARACS.REVE_ACTUEL, { diff, resistance })
|
||||
}
|
||||
|
||||
async rollCarac(caracName, options = {}) {
|
||||
if (Grammar.equalsInsensitive(caracName, CARACS.TAILLE)) {
|
||||
return
|
||||
@@ -366,14 +385,18 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: PART_COMP },
|
||||
type: {
|
||||
allowed: options.resistance ? [PART_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
resistance: options.resistance
|
||||
},
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: options.resistance ? { key: undefined, forced: true } : undefined
|
||||
comp: options.resistance ? { key: undefined, forced: true } : undefined,
|
||||
diff: { type: DIFF.DEFAUT, value: options.diff ?? 0 }
|
||||
}
|
||||
}
|
||||
RollDialog.create(rollData, options)
|
||||
return
|
||||
return await RollDialog.create(rollData, options)
|
||||
}
|
||||
|
||||
foundry.utils.mergeObject(options, { resistance: false, diff: 0 }, { overwrite: false })
|
||||
@@ -487,7 +510,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
allowed: [ROLL_TYPE_ATTAQUE], current: ROLL_TYPE_ATTAQUE
|
||||
}
|
||||
};
|
||||
return await RollDialog.create(rollData)
|
||||
return await RollDialog.create(rollData, { onRollDone: RollDialog.onRollDoneClose })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -279,11 +279,22 @@ export class RdDBaseActor extends Actor {
|
||||
|
||||
async removeEffects(filter = e => true) {
|
||||
if (game.user.isGM) {
|
||||
const effectsToRemove = this.getEffects(filter);
|
||||
const ids = effectsToRemove.map(it => it.id);
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', ids);
|
||||
const effectsToRemove = this.getEffects(filter)
|
||||
if (this.canRemoveEffect(effectsToRemove)) {
|
||||
const ids = effectsToRemove.map(it => it.id)
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', ids)
|
||||
}
|
||||
}
|
||||
}
|
||||
canRemoveEffect(effect) {
|
||||
if (effect.statuses.has(STATUSES.StatusSurEnc)) {
|
||||
return !this.isSurenc()
|
||||
}
|
||||
if (effect.statuses.has(STATUSES.StatusDemiReve)) {
|
||||
return !this.tmrApp
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateCarac(caracName, to) {
|
||||
|
||||
@@ -63,6 +63,8 @@ export const RDD_CONFIG = {
|
||||
empoignade: 'systems/foundryvtt-reve-de-dragon/assets/actions/empoignade.svg',
|
||||
forceWeak: 'systems/foundryvtt-reve-de-dragon/assets/actions/weak.svg',
|
||||
surenc: 'systems/foundryvtt-reve-de-dragon/assets/actions/surenc.svg',
|
||||
magique: 'systems/foundryvtt-reve-de-dragon/assets/actions/magique.svg',
|
||||
armebrisee: 'systems/foundryvtt-reve-de-dragon/assets/actions/arme-brisee.svg',
|
||||
},
|
||||
encaissement: {
|
||||
mortel: 'mortel',
|
||||
|
||||
@@ -229,6 +229,14 @@ export class Misc {
|
||||
return undefined
|
||||
}
|
||||
|
||||
static async doIfOwner(document, action, orElse = async it => { ui.notifications.warn(`Vous n'avez pas le droit d'agir pour ${it.name}`) }) {
|
||||
if (Misc.isOwnerPlayer(document)) {
|
||||
return await action(document)
|
||||
} else {
|
||||
return await orElse(document)
|
||||
}
|
||||
}
|
||||
|
||||
static isOwnerPlayer(document) {
|
||||
return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class RdDBonus {
|
||||
const dmg = {
|
||||
total: 0,
|
||||
dmgArme: dmgArme,
|
||||
penetration: arme?.penetration() ?? 0,
|
||||
penetration: arme?.system.penetration ?? 0,
|
||||
diff: attaque.diff,
|
||||
dmgTactique: attaque.tactique?.dmg ?? 0,
|
||||
dmgParticuliere: RdDBonus._dmgParticuliere(rollData),
|
||||
|
||||
@@ -315,6 +315,7 @@ export class RdDCombat {
|
||||
switch (sockmsg.msg) {
|
||||
case "msg_encaisser": return RdDCombat.onMsgEncaisser(sockmsg.data);
|
||||
case "msg_defense": return RdDCombat.onMsgDefense(sockmsg.data);
|
||||
case "msg_defense_v2": return RdDCombat.onMsgDefenseV2(sockmsg.data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,6 +368,19 @@ export class RdDCombat {
|
||||
return new RdDCombat(attacker, attackerTokenId, defender, defenderTokenId, target)
|
||||
}
|
||||
|
||||
static rddCombatForAttackV2(attackerRoll) {
|
||||
const defenderRoll = RollBasicParts.prepareDefense(attackerRoll)
|
||||
return RdDCombat.rddCombatForDefenseV2(defenderRoll)
|
||||
}
|
||||
|
||||
static rddCombatForDefenseV2(defenderRoll) {
|
||||
let defenderToken = canvas.tokens.get(defenderRoll.active.tokenId)
|
||||
if (defenderToken) {
|
||||
return RdDCombat.rddCombatForAttackerAndDefender(defenderRoll.opponent.id, defenderRoll.opponent.tokenId, defenderRoll.active.tokenId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onMsgEncaisser(msg) {
|
||||
let defender = canvas.tokens.get(msg.defenderToken.id).actor;
|
||||
@@ -687,7 +701,7 @@ export class RdDCombat {
|
||||
|
||||
async doRollAttaque(rollData, callbacks = []) {
|
||||
// TODO V2 await this.proposerAjustementTirLancer(rollData)
|
||||
await RollDialog.create(rollData, {
|
||||
return await RollDialog.create(rollData, {
|
||||
onRollDone: RollDialog.onRollDoneClose,
|
||||
callbacks: [
|
||||
async (roll) => await this.onAttaqueV2(roll),
|
||||
@@ -722,9 +736,24 @@ export class RdDCombat {
|
||||
await this._chatMessageDefenseV2(paramChatDefense);
|
||||
}
|
||||
else {
|
||||
this._socketSendMessageDefense(paramChatDefense, {});
|
||||
this._socketSendMessageDefenseV2(paramChatDefense);
|
||||
}
|
||||
}
|
||||
|
||||
_socketSendMessageDefenseV2(paramChatDefense) {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_defense_v2", data: {paramChatDefense} })
|
||||
}
|
||||
|
||||
static async onMsgDefenseV2(msg) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
const paramChatDefense = msg.paramChatDefense
|
||||
RollBasicParts.restore(paramChatDefense.attackerRoll)
|
||||
const rddCombat = RdDCombat.rddCombatForAttackV2(paramChatDefense.attackerRoll)
|
||||
rddCombat?.removeChatMessageActionsPasseArme(paramChatDefense.attackerRoll.passeArme)
|
||||
await rddCombat?._chatMessageDefenseV2(paramChatDefense)
|
||||
}
|
||||
}
|
||||
|
||||
async _chatMessageDefenseV2(paramDemandeDefense) {
|
||||
const attackerRoll = paramDemandeDefense.attackerRoll;
|
||||
RollBasicParts.loadSurprises(attackerRoll)
|
||||
@@ -1072,7 +1101,7 @@ export class RdDCombat {
|
||||
}
|
||||
|
||||
async doRollDefense(rollData, callbacks = []) {
|
||||
await RollDialog.create(rollData, {
|
||||
return await RollDialog.create(rollData, {
|
||||
onRollDone: RollDialog.onRollDoneClose,
|
||||
callbacks: [
|
||||
async (roll) => {
|
||||
|
||||
@@ -17,7 +17,7 @@ export class RdDEmpoignade {
|
||||
/* -------------------------------------------- */
|
||||
static isCombatantEmpoignade(actorId, tokenId) {
|
||||
const combatant = RdDCombatManager.getCombatant(actorId, tokenId)
|
||||
return MAP_PHASE.empoignade.rang == combatant?.system.init.rang
|
||||
return MAP_PHASE.empoignade.rang == combatant?.system.init?.rang
|
||||
}
|
||||
|
||||
static async ajustementEmpoignade(attacker, defender, adjust = 1) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import { PART_DEFENSE } from "./roll-part-defense.mjs"
|
||||
import { PART_ATTAQUE } from "./roll-part-attaque.mjs"
|
||||
import { RdDRollTables } from "../rdd-rolltables.js"
|
||||
import { RdDEmpoignade } from "../rdd-empoignade.js"
|
||||
import { Misc } from "../misc.js"
|
||||
|
||||
export default class ChatRollResult {
|
||||
static init() {
|
||||
@@ -171,13 +172,14 @@ export default class ChatRollResult {
|
||||
}
|
||||
|
||||
onClickAppelChance(event) {
|
||||
event.preventDefault()
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
const actor = game.actors.get(savedRoll.ids.actorId)
|
||||
actor.rollAppelChance(
|
||||
Misc.doIfOwner(actor, it => it.rollAppelChance(
|
||||
() => this.onAppelChanceSuccess(savedRoll, chatMessage),
|
||||
() => this.onAppelChanceEchec(savedRoll, chatMessage))
|
||||
event.preventDefault()
|
||||
)
|
||||
}
|
||||
|
||||
async onAppelChanceSuccess(savedRoll, chatMessage) {
|
||||
@@ -197,7 +199,7 @@ export default class ChatRollResult {
|
||||
this.getCombat(reRoll)?.doRollAttaque(reRoll, callbacks)
|
||||
break
|
||||
default: {
|
||||
RollDialog.create(reRoll, { callbacks: callbacks })
|
||||
await RollDialog.create(reRoll, { onRollDone: RollDialog.onRollDoneClose, callbacks })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,16 +210,18 @@ export default class ChatRollResult {
|
||||
}
|
||||
|
||||
onClickAppelDestinee(event) {
|
||||
event.preventDefault()
|
||||
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
const actor = game.actors.get(savedRoll.ids.actorId)
|
||||
|
||||
actor.appelDestinee(async () => {
|
||||
Misc.doIfOwner(actor, it => it.appelDestinee(async () => {
|
||||
const reRoll = foundry.utils.duplicate(savedRoll)
|
||||
reRoll.type.retry = true
|
||||
RdDResolutionTable.significativeRequise(reRoll.rolled)
|
||||
await this.updateChatMessage(chatMessage, reRoll)
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
async onClickDefense(event) {
|
||||
@@ -235,36 +239,40 @@ export default class ChatRollResult {
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
const attaque = savedRoll.attackerRoll
|
||||
const defenderToken = savedRoll.ids.actorTokenId ? canvas.tokens.get(savedRoll.ids.actorTokenId) : undefined
|
||||
const attackerToken = savedRoll.ids.opponentTokenId ? canvas.tokens.get(savedRoll.ids.opponentTokenId) : undefined
|
||||
switch (attaque.dmg.mortalite) {
|
||||
case RDD_CONFIG.encaissement.empoignade:
|
||||
savedRoll.done = savedRoll.done ?? {}
|
||||
savedRoll.done.empoignade = await RdDEmpoignade.ajustementEmpoignade(attackerToken.actor, defenderToken.actor)
|
||||
break
|
||||
case RDD_CONFIG.encaissement.entiteincarnee:
|
||||
case RDD_CONFIG.encaissement.nonmortel:
|
||||
case RDD_CONFIG.encaissement.mortel:
|
||||
const defender = defenderToken?.actor ?? game.actors.get(savedRoll.ids.actorId)
|
||||
const attacker = attackerToken?.actor ?? game.actors.get(savedRoll.ids.opponentId)
|
||||
await defender?.encaisserDommages(attaque.dmg, attacker, undefined, attackerToken, defenderToken)
|
||||
break
|
||||
}
|
||||
if (isMessageDemande) {
|
||||
ChatUtility.removeChatMessageId(chatMessage.id)
|
||||
} else {
|
||||
savedRoll.done.encaissement = true
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
}
|
||||
const defender = defenderToken?.actor ?? game.actors.get(savedRoll.ids.actorId)
|
||||
Misc.doIfOwner(defender, async defender => {
|
||||
const attackerToken = savedRoll.ids.opponentTokenId ? canvas.tokens.get(savedRoll.ids.opponentTokenId) : undefined
|
||||
const attacker = attackerToken?.actor ?? game.actors.get(savedRoll.ids.opponentId)
|
||||
switch (attaque.dmg.mortalite) {
|
||||
case RDD_CONFIG.encaissement.empoignade:
|
||||
savedRoll.done = savedRoll.done ?? {}
|
||||
savedRoll.done.empoignade = await RdDEmpoignade.ajustementEmpoignade(attackerToken.actor, defenderToken.actor)
|
||||
break
|
||||
case RDD_CONFIG.encaissement.entiteincarnee:
|
||||
case RDD_CONFIG.encaissement.nonmortel:
|
||||
case RDD_CONFIG.encaissement.mortel:
|
||||
await defender?.encaisserDommages(attaque.dmg, attacker, undefined, attackerToken, defenderToken)
|
||||
break
|
||||
}
|
||||
if (isMessageDemande) {
|
||||
ChatUtility.removeChatMessageId(chatMessage.id)
|
||||
} else {
|
||||
savedRoll.done.encaissement = true
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async onClickRecul(event) {
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
// TODO: gestion sur token non liés?
|
||||
const defender = game.actors.get(savedRoll.ids.actorId)
|
||||
const attacker = game.actors.get(savedRoll.ids.opponentId)
|
||||
savedRoll.done.recul = await defender.encaisserRecul(attacker.getForce(), savedRoll.attackerRoll.dmg.dmgArme)
|
||||
// const reculChoc = this.getReculChoc(savedRoll, defender, attacker)
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
Misc.doIfOwner(defender, async defender => {
|
||||
const attacker = game.actors.get(savedRoll.ids.opponentId)
|
||||
savedRoll.done.recul = await defender.encaisserRecul(attacker.getForce(), savedRoll.attackerRoll.dmg.dmgArme)
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
})
|
||||
}
|
||||
|
||||
async onClickChoixParticuliere(event) {
|
||||
@@ -295,6 +303,7 @@ export default class ChatRollResult {
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
}
|
||||
}
|
||||
|
||||
async onClickTirerMaladresse(event) {
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const typeMaladresse = event.currentTarget.attributes['data-maladresse'].value
|
||||
@@ -303,4 +312,4 @@ export default class ChatRollResult {
|
||||
savedRoll.type.retry = true
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class RollDialogAdapter {
|
||||
const compKey = rollData.current.comp?.key
|
||||
if (compKey) {
|
||||
rollData.competence = rollData.refs[PART_COMP].all.find(it => it.key == compKey)?.comp
|
||||
rollData.jetResistance = rollData.type.jetResistance
|
||||
rollData.jetResistance = rollData.type.resistance
|
||||
}
|
||||
if (rollData.type.current == ROLL_TYPE_OEUVRE) {
|
||||
const oeuvreKey = rollData.current.oeuvre?.key
|
||||
|
||||
@@ -46,6 +46,8 @@ import { OptionsAvancees, ROLL_DIALOG_V2_TEST } from "../settings/options-avance
|
||||
import { ActorImpacts } from "../technical/actor-impacts.mjs";
|
||||
import { RollPartEmpoignade } from "./roll-part-empoignade.mjs";
|
||||
import { RollPartEmpoignadeTaille } from "./roll-part-empoignade-taille.mjs";
|
||||
import { RollPartEcailles } from "./roll-part-ecailles.mjs";
|
||||
import { RollPartResistance } from "./roll-part-resistance.mjs";
|
||||
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
||||
@@ -68,6 +70,7 @@ const ROLL_PARTS = [
|
||||
new RollPartActor(),
|
||||
new RollPartAction(),
|
||||
new RollPartOpponent(),
|
||||
new RollPartResistance(),
|
||||
new RollPartCarac(),
|
||||
new RollPartComp(),
|
||||
|
||||
@@ -83,6 +86,7 @@ const ROLL_PARTS = [
|
||||
|
||||
new RollPartSign(),
|
||||
|
||||
new RollPartEcailles(),
|
||||
new RollPartEtat(),
|
||||
new RollPartConditions(),
|
||||
new RollPartEthylisme(),
|
||||
@@ -177,19 +181,25 @@ const ROLL_PARTS = [
|
||||
/* -------------------------------------------- */
|
||||
export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2)
|
||||
{
|
||||
static onCloseDoNothing() {
|
||||
}
|
||||
static onCloseDoNothing() { }
|
||||
|
||||
static onRollDoneDoNothing(dialog, roll) {
|
||||
dialog.render()
|
||||
}
|
||||
static onRollDoneClose(dialog, roll) {
|
||||
if (roll.type.retry || !OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST))
|
||||
if (roll.type.retry) {
|
||||
dialog.close()
|
||||
}
|
||||
else {
|
||||
dialog.render()
|
||||
}
|
||||
}
|
||||
|
||||
static init() {
|
||||
static onRollDoneClose(dialog, roll) {
|
||||
if (roll.type.retry || !OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST)) {
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
static init() { }
|
||||
|
||||
static onReady() {
|
||||
|
||||
foundry.applications.handlebars.loadTemplates({
|
||||
@@ -239,9 +249,14 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
|
||||
|
||||
static async create(rollData, rollOptions = {}) {
|
||||
const rollDialog = new RollDialog(rollData, rollOptions)
|
||||
rollDialog.render(true)
|
||||
return rollDialog
|
||||
rollData = RollDialog.$prepareRollData(rollData)
|
||||
return Misc.doIfOwner(rollData.active.actor,
|
||||
actor => {
|
||||
const rollDialog = new RollDialog(rollData, rollOptions)
|
||||
rollDialog.render(true)
|
||||
return rollDialog
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
static get PARTS() {
|
||||
@@ -321,7 +336,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
super()
|
||||
|
||||
this.hooks = []
|
||||
this.rollData = RollDialog.$prepareRollData(rollData)
|
||||
this.rollData = rollData
|
||||
this.rollOptions = {
|
||||
callbacks: [
|
||||
async r => await r.active.actor.appliquerAjoutExperience(r),
|
||||
|
||||
@@ -142,7 +142,8 @@ export class RollPartAttaque extends RollPartSelect {
|
||||
comp: { key: 'Dague', forced: true },
|
||||
diff: { type: DIFF.IMPOSEE, value: -4 }
|
||||
}
|
||||
})
|
||||
},
|
||||
{ onRollDone: RollDialog.onRollDoneClose })
|
||||
}
|
||||
|
||||
impactOtherPart(part, rollData) {
|
||||
|
||||
@@ -16,11 +16,9 @@ export class RollPartCarac extends RollPartSelect {
|
||||
const selected = this.getSelected(rollData)
|
||||
const actor = rollData.active.actor
|
||||
refs.all = [...this.$getActorCaracs(actor), ...this.$getCaracCompetenceCreature(actor)]
|
||||
.filter(c => !selected.forced ||
|
||||
(selected.key ?
|
||||
Grammar.includesLowerCaseNoAccent(c.label, selected.key)
|
||||
: c.key == '')
|
||||
)
|
||||
if (selected.forced && selected.key) {
|
||||
refs.all = refs.all.filter(c => c.key == selected.key || Grammar.includesLowerCaseNoAccent(c.label, selected.key))
|
||||
}
|
||||
refs.caracs = refs.all
|
||||
this.$selectCarac(rollData)
|
||||
}
|
||||
|
||||
53
module/roll/roll-part-ecailles.mjs
Normal file
53
module/roll/roll-part-ecailles.mjs
Normal file
@@ -0,0 +1,53 @@
|
||||
import { RDD_CONFIG } from "../constants.js"
|
||||
import { ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE } from "./roll-constants.mjs"
|
||||
import { PART_ATTAQUE } from "./roll-part-attaque.mjs"
|
||||
import { RollPartCheckbox } from "./roll-part-checkbox.mjs"
|
||||
import { PART_DEFENSE } from "./roll-part-defense.mjs"
|
||||
|
||||
const ECAILLES = "ecailles"
|
||||
|
||||
export class RollPartEcailles extends RollPartCheckbox {
|
||||
|
||||
get code() { return ECAILLES }
|
||||
|
||||
isValid(rollData) {
|
||||
return this.isRollType(rollData, ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE)
|
||||
}
|
||||
|
||||
visible(rollData) {
|
||||
return this.getEcailles(rollData) != 0
|
||||
|
||||
}
|
||||
|
||||
getEcailles(rollData) {
|
||||
const arme = this.getArme(rollData)
|
||||
return arme?.system.magique ? arme?.system.ecaille_efficacite : 0
|
||||
}
|
||||
|
||||
getArme(rollData) {
|
||||
return this.isRollType(rollData, ROLL_TYPE_ATTAQUE)
|
||||
? rollData.current[PART_ATTAQUE]?.arme
|
||||
: this.isRollType(rollData, ROLL_TYPE_DEFENSE)
|
||||
? rollData.current[PART_DEFENSE]?.arme
|
||||
: undefined
|
||||
}
|
||||
|
||||
prepareContext(rollData) {
|
||||
this.loadRefs(rollData)
|
||||
super.prepareContext(rollData)
|
||||
}
|
||||
|
||||
getCheckboxIcon(rollData) {
|
||||
return this.getEcailles(rollData) > 0
|
||||
? `<img src="${RDD_CONFIG.icons.magique}">`
|
||||
: `<img src="${RDD_CONFIG.icons.armebrisee}">`
|
||||
}
|
||||
|
||||
getCheckboxLabel(rollData) {
|
||||
return this.getEcailles(rollData) > 0
|
||||
? "Efficacité"
|
||||
: "Défauts"
|
||||
}
|
||||
|
||||
getCheckboxValue(rollData) { return this.getEcailles(rollData) }
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import { RDD_CONFIG } from "../constants.js"
|
||||
import { ATTAQUE_TYPE_MELEE } from "../item/arme.js"
|
||||
import { RdDEmpoignade } from "../rdd-empoignade.js"
|
||||
import { COMBAT_ROLL_TYPES } from "./roll-constants.mjs"
|
||||
import { PART_ATTAQUE } from "./roll-part-attaque.mjs"
|
||||
import { RollPartCheckbox } from "./roll-part-checkbox.mjs"
|
||||
|
||||
const EMPOIGNADE_TAILLE = "empoignade-taille"
|
||||
|
||||
12
module/roll/roll-part-resistance.mjs
Normal file
12
module/roll/roll-part-resistance.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
|
||||
|
||||
export const PART_RESISTANCE = "resistance"
|
||||
|
||||
export class RollPartResistance extends RollPart {
|
||||
|
||||
get code() { return PART_RESISTANCE }
|
||||
get section() { return ROLLDIALOG_SECTION.ACTION }
|
||||
|
||||
isValid(rollData) { return rollData.type.resistance == true }
|
||||
title(rollData) { return "de résistance" }
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export class RollPart {
|
||||
* @returns une chaîne vide si rien ne doit être affiché
|
||||
*/
|
||||
title() { return '' }
|
||||
isRollType(rollData, type) { return rollData.type.current == type }
|
||||
isRollType(rollData, ...type) { return type.includes(rollData.type.current)}
|
||||
|
||||
isActive(rollData) { return this.isValid(rollData) && this.visible(rollData) }
|
||||
isValid(rollData) { return true }
|
||||
|
||||
@@ -23,7 +23,6 @@ export class RollType {
|
||||
|
||||
setRollDataType(rollData) {
|
||||
rollData.type.opposed = rollData.opponent != undefined
|
||||
rollData.type.resistance = false /** TODO */
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<li>
|
||||
<div class="compteur">
|
||||
<label for="system.reve.reve.value">
|
||||
<span>
|
||||
<a class="button-reve-resistance"><img class="button-effect-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg" data-tooltip="Résistance"/></a>
|
||||
</span>
|
||||
<a class="roll-reve-actuel" data-tooltip="Faire un jet de Rêve actuel (ou jet de résistance)">Rêve</a>
|
||||
</label>
|
||||
<a class="ptreve-actuel-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
{{~#if (eq active.surprise.key 'demi')}} avec une significative {{/if}} d'une attaque
|
||||
{{~#if attackerRoll.particuliere}} <strong>particulière en
|
||||
{{~#if (eq attackerRoll.particuliere 'finesse')}} finesse
|
||||
{{else if (eq particuliere 'force')}} force
|
||||
{{else if (eq particuliere 'rapidite')}} rapidité
|
||||
{{else if (eq attackerRoll.particuliere 'force')}} force
|
||||
{{else if (eq attackerRoll.particuliere 'rapidite')}} rapidité
|
||||
{{/if~}}</strong>
|
||||
{{/if}} de {{opponent.name}} ({{attackerRoll.current.attaque.label}}):
|
||||
</span>
|
||||
|
||||
4
templates/roll/roll-part-resistance.hbs
Normal file
4
templates/roll/roll-part-resistance.hbs
Normal file
@@ -0,0 +1,4 @@
|
||||
<span>de résistance</span>
|
||||
<img src="systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg"
|
||||
class="flag-resistance"
|
||||
data-tooltip="Résistance" />
|
||||
Reference in New Issue
Block a user