Ajout types de fee

This commit is contained in:
LeRatierBretonnien 2023-03-01 22:12:27 +01:00
parent 301eead11f
commit c1e9fe37dc
9 changed files with 130 additions and 23 deletions

View File

@ -122,7 +122,7 @@ export class HeritiersActorSheet extends ActorSheet {
}) })
html.find('.roll-initiative').click((event) => { html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("pre", true) this.actor.rollInitiative()
}) })
html.find('.roll-carac').click((event) => { html.find('.roll-carac').click((event) => {

View File

@ -473,6 +473,19 @@ export class HeritiersActor extends Actor {
} }
return rollData return rollData
} }
/* -------------------------------------------- */
async rollInitiative() {
let rollData = this.getCommonRollData(undefined, "Art de la guerre")
rollData.mode = "init"
if (this.system.caracteristiques["san"].value > this.system.caracteristiques["per"].value) {
rollData.caracKey = "san"
} else {
rollData.caracKey = "per"
}
rollData.carac = this.system.caracteristiques[rollData.caracKey]
let rollDialog = await HeritiersRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollCarac(key, isInit = false) { async rollCarac(key, isInit = false) {

View File

@ -109,6 +109,10 @@ export const HERITIERS_CONFIG = {
"balle": "Protège ds balles", "balle": "Protège ds balles",
"melee": "Protège en mélée", "melee": "Protège en mélée",
"tout": "Tout type de dégats" "tout": "Tout type de dégats"
},
typeFee: {
"traditionnelle": "Traditionnelle",
"moderne": "Moderne"
} }

View File

@ -362,7 +362,7 @@ export class HeritiersUtility {
rollData.finalResult = myRoll.total rollData.finalResult = myRoll.total
this.computeResult(actor, rollData) this.computeResult(actor, rollData)
if (rollData.isInit) { if (rollData.mode == "init") {
actor.setFlag("world", "last-initiative", rollData.finalResult) actor.setFlag("world", "last-initiative", rollData.finalResult)
} }

View File

@ -1,7 +1,7 @@
{ {
"id": "fvtt-les-heritiers", "id": "fvtt-les-heritiers",
"description": "Les Héritiers pour FoundryVTT", "description": "Les Héritiers pour FoundryVTT",
"version": "10.0.9", "version": "10.0.10",
"authors": [ "authors": [
{ {
"name": "Uberwald/LeRatierBretonnien", "name": "Uberwald/LeRatierBretonnien",
@ -19,7 +19,7 @@
"gridUnits": "m", "gridUnits": "m",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json", "manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.9.zip", "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.10.zip",
"languages": [ "languages": [
{ {
"lang": "fr", "lang": "fr",

View File

@ -244,6 +244,7 @@
"feetype": 0, "feetype": 0,
"avantages": "", "avantages": "",
"desavantages": "", "desavantages": "",
"pouvoirsfeeriques": "",
"atoutsfeeriques": "", "atoutsfeeriques": "",
"competences": "", "competences": "",
"capacitenaturelles": "", "capacitenaturelles": "",

View File

@ -157,6 +157,43 @@
<li class="item flexrow"> <li class="item flexrow">
<button class="chat-card-button roll-initiative">Initiative (actuelle : {{initiative}} )</button> <button class="chat-card-button roll-initiative">Initiative (actuelle : {{initiative}} )</button>
</li> </li>
<li class="item flexrow list-item items-title-bg">
<label class="item-field-label-medium"><strong>Esquive</strong></label>
<label class="item-field-label-medium">Masquée</label>
<input type="text" class="item-field-label-short" name="system.combat.esquive.masquee" value="{{system.combat.esquive.masquee}}" data-dtype="Number" />
<label class="item-field-label-medium">Démasquée</label>
<input type="text" class="item-field-label-short" name="system.combat.esquive.demasquee" value="{{system.combat.esquive.demasquee}}" data-dtype="Number" />
<label class="item-field-label-medium"><strong>Parade</strong></label>
<input type="text" class="item-field-label-short" name="system.combat.parade.value" value="{{system.combat.parade.value}}" data-dtype="Number" />
</li>
<li class="item flexrow list-item items-title-bg">
<label class="item-field-label-long">Rés. physique</label>
<input type="text" class="item-field-label-short" name="system.combat.resistancephysique.value" value="{{system.combat.resistancephysique.value}}" data-dtype="Number" />
<label class="item-field-label-long">Rés. psychique</label>
<input type="text" class="item-field-label-short" name="system.combat.resistancepsychique.value" value="{{system.combat.resistancepsychique.value}}" data-dtype="Number" />
<label class="item-field-label-medium">Protection : </label>
<input type="text" class="item-field-label-short" name="system.combat.protection.value" value="{{system.combat.protection.value}}" data-dtype="Number" />
</li>
<li class="item flexrow list-item items-title-bg">
<label class="item-field-label-long">Effets secondaires</label>
<input type="text" class="item-field-label-short" name="system.combat.effetssecondaires" value="{{system.combat.effetssecondaires}}" data-dtype="String" />
<label class="item-field-label-long">Dissimulation : </label>
<input type="text" class="item-field-label-short" name="system.combat.dissimulation.value" value="{{system.combat.dissimulation.value}}" data-dtype="Number" />
</li>
<li class="item flexrow list-item items-title-bg">
<label class="item-field-label-long"><strong>Corps à Corps</strong></label>
<label class="item-field-label-medium">Masqué</label>
<input type="text" class="item-field-label-short" name="system.combat.corpsacorps.masquee" value="{{system.combat.corpsacorps.masquee}}" data-dtype="Number" />
<label class="item-field-label-medium">Démasqué</label>
<input type="text" class="item-field-label-short" name="system.combat.corpsacorps.demasquee" value="{{system.combat.corpsacorps.demasquee}}" data-dtype="Number" />
</li>
<li class="item flexrow list-item items-title-bg">
<label class="item-field-label-long"><strong>A distance</strong></label>
<label class="item-field-label-medium">Masqué</label>
<input type="text" class="item-field-label-short" name="system.combat.tir.masquee" value="{{system.combat.tir.masquee}}" data-dtype="Number" />
<label class="item-field-label-medium">Démasqué</label>
<input type="text" class="item-field-label-short" name="system.combat.tir.demasquee" value="{{system.combat.tir.demasquee}}" data-dtype="Number" />
</li>
</ul> </ul>
<div class="flexcol"> <div class="flexcol">
@ -188,27 +225,11 @@
<span class="item-name-label competence-name">{{arme.name}}</span> <span class="item-name-label competence-name">{{arme.name}}</span>
<span class="item-field-label-short"> <span class="item-field-label-short">
{{#if arme.system.equipped}} <button class="roll-arme-offensif button-sheet-roll">Attaquer</button>
<button class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{else}}
<button disabled class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{/if}}
</span> </span>
{{#if arme.system.isdefense}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">{{arme.system.totalDefensif}}</label></span>
{{else}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">N/A</label></span>
{{/if}}
<span class="item-field-label-short"> <span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button> <button class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{else}}
<button disabled class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{/if}}
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>

View File

@ -0,0 +1,68 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-long">Type de féé</label>
<select class="item-field-label-long" type="text" name="system.feetype"
value="{{system.feetype}}" data-dtype="string">
{{#select system.feetype}}
{{#each config.typeFee as |type key|}}
<option value="{{key}}">{{type}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="item-field-label-long">Avantages</label>
</li>
<li class="flexrow item">
<textarea rows="5" cols="60" name="system.avantages" data-dtype="String">{{system.avantages}}</textarea>
</li>
<li class="flexrow item">
<label class="item-field-label-long">Désavantages</label>
</li>
<li class="flexrow item">
<textarea rows="5" cols="60" name="system.desavantages" data-dtype="String">{{system.desavantages}}</textarea>
</li>
<li class="flexrow item">
<label class="item-field-label-long">Atouts féériques</label>
</li>
<li class="flexrow item">
<textarea rows="5" cols="60" name="system.desavantages" data-dtype="String">{{system.desavantages}}</textarea>
</li>
<li class="flexrow item">
<label class="item-field-label-long">Compétences</label>
</li>
<li class="flexrow item">
<textarea rows="5" cols="60" name="system.competences" data-dtype="String">{{system.competences}}</textarea>
</li>
<li class="flexrow item">
<label class="item-field-label-long">Capacités naturelles</label>
</li>
<li class="flexrow item">
<textarea rows="5" cols="60" name="system.capacitenaturelles" data-dtype="String">{{system.capacitenaturelles}}</textarea>
</li>
</ul>
</div>
</section>
</form>

View File

@ -54,7 +54,7 @@
<input type="text" class="item-field-label-short" name="system.prix" <input type="text" class="item-field-label-short" name="system.prix"
value="{{system.prix}}" data-dtype="Number" /> value="{{system.prix}}" data-dtype="Number" />
</li> </li>
<li class="flexrow item"> c <li class="flexrow item">
<label class="generic-label item-field-label-long">Quantité : </label> <label class="generic-label item-field-label-long">Quantité : </label>
<input type="text" class="item-field-label-short" name="system.quantite" <input type="text" class="item-field-label-short" name="system.quantite"
value="{{system.quantite}}" data-dtype="Number" /> value="{{system.quantite}}" data-dtype="Number" />