Montrer les armes cassées

Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
This commit is contained in:
Vincent Vandemeulebrouck 2023-11-20 17:19:52 +01:00
parent b07a3e18df
commit b1b56c13bf
10 changed files with 32 additions and 10 deletions

View File

@ -362,6 +362,10 @@ export class RdDBaseActorReve extends RdDBaseActor {
*/
rollArme(arme, categorieArme = "competence") {
let compToUse = this.$getCompetenceArme(arme, categorieArme)
if (!RdDItemArme.isArmeUtilisable(arme)) {
ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`)
return
}
if (!Targets.hasTargets()) {
RdDConfirm.confirmer({
settingConfirmer: "confirmer-combat-sans-cible",
@ -374,17 +378,16 @@ export class RdDBaseActorReve extends RdDBaseActor {
this.rollCompetence(compToUse, { tryTarget: false })
}
});
return;
return
}
Targets.selectOneToken(target => {
if (Targets.isTargetEntite(target)) {
ui.notifications.warn(`Vous ne pouvez pas attaquer une entité non incarnée avec votre ${arme.name}!!!!`);
return;
return
}
const competence = this.getCompetence(compToUse)
//console.log("RollArme", competence, arme)
if (competence.isCompetencePossession()) {
return RdDPossession.onAttaquePossession(target, this, competence);
}

View File

@ -754,11 +754,11 @@ export class RdDCombat {
/* -------------------------------------------- */
async attaque(competence, arme) {
if (!await this.attacker.accorder(this.defender, 'avant-attaque')) {
return;
return
}
if (arme.system.cac == 'empoignade') {
RdDEmpoignade.onAttaqueEmpoignade(this.attacker, this.defender)
return;
return
}
RdDEmpoignade.checkEmpoignadeEnCours(this.attacker)

View File

@ -174,6 +174,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
'systems/foundryvtt-reve-de-dragon/templates/item/boutons-comestible.html',
'systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs',
'systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs',
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html',
'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.html',

1
styles/img/ui/broken.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><defs><filter id="shadow-1" height="300%" width="300%" x="-100%" y="-100%"><feFlood flood-color="rgba(248, 231, 28, 1)" result="flood"></feFlood><feComposite in="flood" in2="SourceGraphic" operator="atop" result="composite"></feComposite><feGaussianBlur in="composite" stdDeviation="40" result="blur"></feGaussianBlur><feOffset dx="0" dy="10" result="offset"></feOffset><feComposite in="SourceGraphic" in2="offset" operator="over"></feComposite></filter><filter id="shadow-3" height="300%" width="300%" x="-100%" y="-100%"><feFlood flood-color="rgba(248, 231, 28, 1)" result="flood"></feFlood><feComposite in="flood" in2="SourceGraphic" operator="atop" result="composite"></feComposite><feGaussianBlur in="composite" stdDeviation="40" result="blur"></feGaussianBlur><feOffset dx="0" dy="0" result="offset"></feOffset><feComposite in="SourceGraphic" in2="offset" operator="over"></feComposite></filter><filter id="shadow-6" height="300%" width="300%" x="-100%" y="-100%"><feFlood flood-color="rgba(72, 186, 255, 1)" result="flood"></feFlood><feComposite in="flood" in2="SourceGraphic" operator="atop" result="composite"></feComposite><feGaussianBlur in="composite" stdDeviation="8" result="blur"></feGaussianBlur><feOffset dx="5" dy="15" result="offset"></feOffset><feComposite in="SourceGraphic" in2="offset" operator="over"></feComposite></filter><filter id="shadow-7" height="300%" width="300%" x="-100%" y="-100%"><feFlood flood-color="rgba(72, 186, 255, 1)" result="flood"></feFlood><feComposite in="flood" in2="SourceGraphic" operator="atop" result="composite"></feComposite><feGaussianBlur in="composite" stdDeviation="8" result="blur"></feGaussianBlur><feOffset dx="5" dy="15" result="offset"></feOffset><feComposite in="SourceGraphic" in2="offset" operator="over"></feComposite></filter></defs><g class="" transform="translate(0,0)" style=""><path d="M496.223 16.818l-48.475 44.205 48.475 4.575v-48.78zm-41.55 1.22l-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.022l-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.375 8.873 10.318 18.02 20.337 27.407 30.094l59.063-59.126-24.25-32.344zm78.28 32.688L297 219.968l-65 65.063c11.33 11.185 22.99 21.98 35 32.376 22.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.97-7.368-7.662-14.914-15.154-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="#9e0417" fill-opacity="1" transform="translate(25.6, 25.6) scale(0.9, 0.9) rotate(0, 256, 256) skewX(0) skewY(0)" filter="url(#shadow-1)"></path></g></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -211,6 +211,13 @@ i:is(.fas, .far) {
margin-right: 5px;
object-position: 50% 0;
}
.system-foundryvtt-reve-de-dragon img.equipement-inutilisable {
vertical-align: bottom ;
max-width: 1.4rem;
max-height: 1.4rem;
border: 1px;
background: center / contain no-repeat url('img/ui/icone_parchement_vierge.webp');
}
.system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs {
width: calc(60% - 110px - 1rem);

View File

@ -19,6 +19,7 @@
<span>{{arme.name}}</span>
</a>
({{arme.system.competence}})
{{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs" arme}}
</span>
<span class="competence-value">{{plusMoins arme.system.niveau}}</span>
<span class="competence-value">{{plusMoins arme.system.dommagesReels}}</span>

View File

@ -8,11 +8,16 @@
{{else if ouvert}}far fa-minus-square
{{else}}far fa-plus-square
{{/if~}}"></i>
{{/if}}
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
<span>{{item.name}}</span>
{{#if (eq item.type 'conteneur')}}
</a>
{{else}}
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
<span>{{item.name}}
{{#if (eq item.type 'arme')}}
{{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs" item}}
{{/if}}
</span>
{{/if}}
</span>
<span class="equipement-detail">

View File

@ -46,7 +46,8 @@
</select>
</div>
<div class="form-group">
<label for="system.resistance">Résistance </label>
<label for="system.resistance">Résistance</label>
{{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs"}}
<input class="attribute-value" type="text" name="system.resistance" value="{{system.resistance}}" data-dtype="Number"/>
</div>
<div class="form-group">

View File

@ -0,0 +1,3 @@
{{#if (lte system.resistance 0)}}
<img class="equipement-inutilisable" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/broken.svg"/>
{{/if}}