v10 #576
@ -3199,11 +3199,12 @@ export class RdDActor extends Actor {
|
|||||||
signes: this.listItemsData("signedraconique"),
|
signes: this.listItemsData("signedraconique"),
|
||||||
caracReve: this.system.carac.reve.value,
|
caracReve: this.system.carac.reve.value,
|
||||||
pointsReve: this.getReveActuel(),
|
pointsReve: this.getReveActuel(),
|
||||||
isRapide: isRapide
|
isRapide: isRapide,
|
||||||
|
isGM: game.user.isGM,
|
||||||
|
hasPlayerOwner: this.hasPlayerOwner
|
||||||
}
|
}
|
||||||
|
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrFormData);
|
this.currentTMR = await RdDTMRDialog.create(this, tmrFormData);
|
||||||
this.currentTMR = await RdDTMRDialog.create(html, this, tmrFormData);
|
|
||||||
this.currentTMR.render(true);
|
this.currentTMR.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ export class RdDItemArme extends Item {
|
|||||||
equipe: true,
|
equipe: true,
|
||||||
rapide: true,
|
rapide: true,
|
||||||
force: 0,
|
force: 0,
|
||||||
dommages: 0,
|
dommages: "0",
|
||||||
dommagesReels: 0,
|
dommagesReels: 0,
|
||||||
mortalite: 'non-mortel',
|
mortalite: 'non-mortel',
|
||||||
competence: 'Corps à corps',
|
competence: 'Corps à corps',
|
||||||
|
@ -151,50 +151,61 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** Retourne une liste triée d'actions d'armes avec le split arme1 main / arme 2 main */
|
/** Retourne une liste triée d'actions d'armes avec le split arme1 main / arme 2 main / lancer */
|
||||||
static listActionsArmes(armes, competences, carac) {
|
static listActionsArmes(armes, competences, carac) {
|
||||||
// Gestion des armes 1/2 mains
|
let actions = [];
|
||||||
let actionsArme = [];
|
|
||||||
for (const arme of armes) {
|
for (const arme of armes) {
|
||||||
let action = duplicate(arme)
|
if (arme.system.equipe) {
|
||||||
if (action.system.equipe) {
|
const dommages = arme.system.dommages;
|
||||||
let compData = competences.find(c => c.name == action.system.competence)
|
const tableauDommages = dommages.includes("/") ? dommages.split("/") : [dommages, dommages] ;
|
||||||
|
if (arme.system.unemain && arme.system.deuxmains && !dommages.includes("/")) {
|
||||||
|
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + arme.name + " ne sont pas corrects (ie sous la forme X/Y)");
|
||||||
|
}
|
||||||
|
if (arme.system.unemain) {
|
||||||
|
actions.push(RdDCombatManager.$prepareAttaqueArme({
|
||||||
|
arme: arme,
|
||||||
|
infoMain: "(1 main)",
|
||||||
|
dommagesReel: Number(tableauDommages[0]),
|
||||||
|
competence: arme.system.competence,
|
||||||
|
carac: carac,
|
||||||
|
competences: competences
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if (arme.system.deuxmains) {
|
||||||
|
actions.push(RdDCombatManager.$prepareAttaqueArme({
|
||||||
|
arme: arme,
|
||||||
|
infoMain: "(2 mains)",
|
||||||
|
dommagesReel: Number(tableauDommages[1]),
|
||||||
|
competence: arme.system.competence.replace(" 1 main", " 2 mains"),
|
||||||
|
carac: carac,
|
||||||
|
competences: competences
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if (arme.system.lancer) {
|
||||||
|
actions.push(RdDCombatManager.$prepareAttaqueArme({
|
||||||
|
arme: arme,
|
||||||
|
infoMain: "(lancer)",
|
||||||
|
dommagesReel: Number(tableauDommages[0]),
|
||||||
|
competence: arme.system.lancer,
|
||||||
|
carac: carac,
|
||||||
|
competences: competences
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return actions.sort(Misc.ascending(action => action.name + (action.system.infoMain ?? '')));
|
||||||
|
}
|
||||||
|
|
||||||
actionsArme.push(action);
|
static $prepareAttaqueArme(infoAttaque) {
|
||||||
action.action = 'attaque';
|
const comp = infoAttaque.competences.find(c => c.name == infoAttaque.competence);
|
||||||
action.system.dommagesReels = Number(action.system.dommages);
|
const attaque = duplicate(infoAttaque.arme);
|
||||||
action.system.niveau = compData.system.niveau;
|
attaque.action = 'attaque';
|
||||||
action.system.initiative = RdDCombatManager.calculInitiative(compData.system.niveau, carac[compData.system.defaut_carac].value);
|
attaque.system.competence = infoAttaque.competence;
|
||||||
// Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence
|
attaque.system.dommagesReels = infoAttaque.dommagesReel;
|
||||||
if (action.system.unemain && !action.system.deuxmains) {
|
attaque.system.infoMain = infoAttaque.infoMain;
|
||||||
action.system.mainInfo = "(1m)";
|
attaque.system.niveau = comp.system.niveau;
|
||||||
} else if (!action.system.unemain && action.system.deuxmains) {
|
attaque.system.initiative = RdDCombatManager.calculInitiative(comp.system.niveau, infoAttaque.carac[comp.system.defaut_carac].value);
|
||||||
action.system.mainInfo = "(2m)";
|
return attaque;
|
||||||
} else if (action.system.unemain && action.system.deuxmains) {
|
|
||||||
action.system.mainInfo = "(1m)";
|
|
||||||
|
|
||||||
const comp2m = action.system.competence.replace(" 1 main", " 2 mains"); // Replace !
|
|
||||||
const comp = competences.find(c => c.name == comp2m)
|
|
||||||
|
|
||||||
const arme2main = duplicate(action);
|
|
||||||
arme2main.system.mainInfo = "(2m)";
|
|
||||||
arme2main.system.niveau = comp.system.niveau;
|
|
||||||
arme2main.system.competence = comp2m;
|
|
||||||
arme2main.system.initiative = RdDCombatManager.calculInitiative(arme2main.system.niveau, carac[comp.system.defaut_carac].value);
|
|
||||||
actionsArme.push(arme2main);
|
|
||||||
const containsSlash = action.system.dommages.includes("/");
|
|
||||||
if (containsSlash) {
|
|
||||||
const tableauDegats = action.system.dommages.split("/");
|
|
||||||
action.system.dommagesReels = Number(tableauDegats[0]);
|
|
||||||
arme2main.system.dommagesReels = Number(tableauDegats[1]);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + action.name + " ne sont pas corrects (ie sous la forme X/Y)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return actionsArme.sort(Misc.ascending(armeData => armeData.name + (armeData.system.mainInfo ?? '')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static listActionsCreature(competences) {
|
static listActionsCreature(competences) {
|
||||||
|
@ -23,7 +23,8 @@ import { RdDCalendrier } from "./rdd-calendrier.js";
|
|||||||
|
|
||||||
export class RdDTMRDialog extends Dialog {
|
export class RdDTMRDialog extends Dialog {
|
||||||
|
|
||||||
static async create(html, actor, tmrData) {
|
static async create(actor, tmrData) {
|
||||||
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrData);
|
||||||
|
|
||||||
if (tmrData.mode != 'visu') {
|
if (tmrData.mode != 'visu') {
|
||||||
// Notification au MJ
|
// Notification au MJ
|
||||||
|
@ -203,6 +203,7 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/enum-competence-lancer.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-herbesoin-ingredient.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-herbesoin-ingredient.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-heures.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-heures.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html',
|
||||||
|
@ -644,6 +644,7 @@
|
|||||||
"force": "0",
|
"force": "0",
|
||||||
"resistance": 0,
|
"resistance": 0,
|
||||||
"competence": "",
|
"competence": "",
|
||||||
|
"lancer": "",
|
||||||
"cout": 0,
|
"cout": 0,
|
||||||
"portee_courte": 0,
|
"portee_courte": 0,
|
||||||
"magique": false,
|
"magique": false,
|
||||||
|
@ -5,7 +5,15 @@
|
|||||||
<tr id="tmrrow1">
|
<tr id="tmrrow1">
|
||||||
<td>
|
<td>
|
||||||
{{#if (eq mode "visu")}}
|
{{#if (eq mode "visu")}}
|
||||||
|
<div class="flex-group-center">
|
||||||
|
<h4>Visualisation!</h4>
|
||||||
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
{{#if (and isGM hasPlayerOwner)}}
|
||||||
|
<div class="flex-group-center">
|
||||||
|
<h4>Le gardien gére les TMR du joueur, le joueur ne peut pas monter dans les TMR!</h4>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="flex-group-center">
|
<div class="flex-group-center">
|
||||||
<img class="small-button-direction" id='dir-top-left' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-top-left.svg'>
|
<img class="small-button-direction" id='dir-top-left' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-top-left.svg'>
|
||||||
<img class="small-button-direction" id='dir-top' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-top.svg'>
|
<img class="small-button-direction" id='dir-top' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-top.svg'>
|
||||||
@ -16,7 +24,6 @@
|
|||||||
<img class="small-button-direction" id='dir-bottom' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-bottom.svg'>
|
<img class="small-button-direction" id='dir-bottom' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-bottom.svg'>
|
||||||
<img class="small-button-direction" id='dir-bottom-right' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-bottom-right.svg'>
|
<img class="small-button-direction" id='dir-bottom-right' src='systems/foundryvtt-reve-de-dragon/styles/img/ui/dir-bottom-right.svg'>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
<div class="flex-group-center lire-signe-draconique">
|
<div class="flex-group-center lire-signe-draconique">
|
||||||
<a>Lire un signe draconique</a>
|
<a>Lire un signe draconique</a>
|
||||||
</div>
|
</div>
|
||||||
@ -43,6 +50,7 @@
|
|||||||
Fatigue
|
Fatigue
|
||||||
<span id="tmr-fatigue-table">{{{fatigue.html}}}</span>
|
<span id="tmr-fatigue-table">{{{fatigue.html}}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
5
templates/enum-competence-lancer.html
Normal file
5
templates/enum-competence-lancer.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{{#each (trier @root.competences) as |competence key|}}
|
||||||
|
{{#if (eq competence.system.categorie 'lancer')}}
|
||||||
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
|
{{/if}}
|
||||||
|
{{/each}}
|
@ -7,7 +7,7 @@
|
|||||||
data-combatant-id="{{../combatant.id}}"
|
data-combatant-id="{{../combatant.id}}"
|
||||||
data-action-index="{{action.index}}"
|
data-action-index="{{action.index}}"
|
||||||
title="{{action.name}}">
|
title="{{action.name}}">
|
||||||
<label>{{action.name}} {{action.system.mainInfo}}</label>
|
<label>{{action.name}} {{action.system.infoMain}}</label>
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
data-combatant-id="{{../combatant.id}}"
|
data-combatant-id="{{../combatant.id}}"
|
||||||
data-action-index="{{action.index}}"
|
data-action-index="{{action.index}}"
|
||||||
title="{{action.name}}">
|
title="{{action.name}}">
|
||||||
<label>init: {{action.name}} {{action.system.mainInfo}}</label>
|
<label>init: {{action.name}} {{action.system.infoMain}}</label>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each commandes as |commande key|}}
|
{{#each commandes as |commande key|}}
|
||||||
|
@ -11,6 +11,15 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="system.lancer">Compétence de lancer</label>
|
||||||
|
<select name="system.lancer" data-dtype="String">
|
||||||
|
{{#select system.lancer}}
|
||||||
|
<option value="">- lancer impossible -</option>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence-lancer.html"}}
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="system.dommages">Dommages </label>
|
<label for="system.dommages">Dommages </label>
|
||||||
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="String"/>
|
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="String"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user