Gestion des présents des cités
+ fix bug sur conquête cité (pour supprimer la casetmr) + svg couleur plus lisibles
This commit is contained in:
@ -31,60 +31,60 @@ const ajustementsEncaissement = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1,
|
||||
|
||||
const tableCaracDerivee = {
|
||||
// xp: coût pour passer du niveau inférieur à ce niveau
|
||||
1: { xp: 3, poids: "moins de 1kg", plusdom:-5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, poids: "1-5", plusdom:-4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, poids: "6-10", plusdom:-3, sconst: 1, sust: 0.5 , beaute:'hideux'},
|
||||
4: { xp: 4, poids: "11-20", plusdom:-3, sconst: 1, sust: 1 , beaute:'repoussant'},
|
||||
5: { xp: 5, poids: "21-30", plusdom:-2, sconst: 1, sust: 1 , beaute:'franchement très laid'},
|
||||
6: { xp: 5, poids: "31-40", plusdom:-1, sconst: 2, sust: 2 , beaute:'laid'},
|
||||
7: { xp: 6, poids: "41-50", plusdom:-1, sconst: 2, sust: 2 , beaute:'très désavantagé'},
|
||||
8: { xp: 6, poids: "51-60", plusdom:0, sconst: 2, sust: 2 , beaute:'désavantagé'},
|
||||
9: { xp: 7, poids: "61-65", plusdom:0, sconst: 3, sust: 2 , beaute:'pas terrible'},
|
||||
10: { xp: 7, poids: "66-70", plusdom:0, sconst: 3, sust: 3 , beaute:'commun'},
|
||||
11: { xp: 8, poids: "71-75", plusdom:0, sconst: 3, sust: 3 , beaute:'pas mal'},
|
||||
12: { xp: 8, poids: "76-80", plusdom:+1, sconst: 4, sust: 3 , beaute:'avantagé'},
|
||||
13: { xp: 9, poids: "81-90", plusdom:+1, sconst: 4, sust: 3 , beaute:'mignon'},
|
||||
14: { xp: 9, poids: "91-100", plusdom:+2, sconst: 4, sust: 4 , beaute:'beau'},
|
||||
15: { xp: 10, poids: "101-110", plusdom:+2, sconst: 5, sust: 4 , beaute:'très beau'},
|
||||
16: { xp: 20, poids: "111-120", plusdom:+3, sconst: 5, sust: 4 , beaute:'éblouissant'},
|
||||
17: { xp: 30, poids: "121-131", plusdom:+3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, poids: "131-141", plusdom:+4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, poids: "141-150", plusdom:+4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, poids: "151-160", plusdom:+4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, poids: "161-180", plusdom:+5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, poids: "181-200", plusdom:+5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, poids: "201-300", plusdom:+6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, poids: "301-400", plusdom:+6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, poids: "401-500", plusdom:+7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, poids: "501-600", plusdom:+7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, poids: "601-700", plusdom:+8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, poids: "701-800", plusdom:+8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, poids: "801-900", plusdom:+9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, poids: "901-1000", plusdom:+9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, poids: "1001-1500", plusdom:+10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, poids: "1501-2000", plusdom:+11, sconst: 10, sust: 17 }
|
||||
1: { xp: 3, poids: "moins de 1kg", plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, poids: "1-5", plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, poids: "6-10", plusdom: -3, sconst: 1, sust: 0.5, beaute: 'hideux' },
|
||||
4: { xp: 4, poids: "11-20", plusdom: -3, sconst: 1, sust: 1, beaute: 'repoussant' },
|
||||
5: { xp: 5, poids: "21-30", plusdom: -2, sconst: 1, sust: 1, beaute: 'franchement très laid' },
|
||||
6: { xp: 5, poids: "31-40", plusdom: -1, sconst: 2, sust: 2, beaute: 'laid' },
|
||||
7: { xp: 6, poids: "41-50", plusdom: -1, sconst: 2, sust: 2, beaute: 'très désavantagé' },
|
||||
8: { xp: 6, poids: "51-60", plusdom: 0, sconst: 2, sust: 2, beaute: 'désavantagé' },
|
||||
9: { xp: 7, poids: "61-65", plusdom: 0, sconst: 3, sust: 2, beaute: 'pas terrible' },
|
||||
10: { xp: 7, poids: "66-70", plusdom: 0, sconst: 3, sust: 3, beaute: 'commun' },
|
||||
11: { xp: 8, poids: "71-75", plusdom: 0, sconst: 3, sust: 3, beaute: 'pas mal' },
|
||||
12: { xp: 8, poids: "76-80", plusdom: +1, sconst: 4, sust: 3, beaute: 'avantagé' },
|
||||
13: { xp: 9, poids: "81-90", plusdom: +1, sconst: 4, sust: 3, beaute: 'mignon' },
|
||||
14: { xp: 9, poids: "91-100", plusdom: +2, sconst: 4, sust: 4, beaute: 'beau' },
|
||||
15: { xp: 10, poids: "101-110", plusdom: +2, sconst: 5, sust: 4, beaute: 'très beau' },
|
||||
16: { xp: 20, poids: "111-120", plusdom: +3, sconst: 5, sust: 4, beaute: 'éblouissant' },
|
||||
17: { xp: 30, poids: "121-131", plusdom: +3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, poids: "131-141", plusdom: +4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, poids: "141-150", plusdom: +4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, poids: "151-160", plusdom: +4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, poids: "161-180", plusdom: +5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, poids: "181-200", plusdom: +5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, poids: "201-300", plusdom: +6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, poids: "301-400", plusdom: +6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, poids: "401-500", plusdom: +7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, poids: "501-600", plusdom: +7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, poids: "601-700", plusdom: +8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, poids: "701-800", plusdom: +8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, poids: "801-900", plusdom: +9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, poids: "901-1000", plusdom: +9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, poids: "1001-1500", plusdom: +10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, poids: "1501-2000", plusdom: +11, sconst: 10, sust: 17 }
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const premierRoundInit = [
|
||||
{ pattern: 'hast', init: 3.90},
|
||||
{ pattern: 'lance', init: 3.85},
|
||||
{ pattern: 'baton', init: 3.80},
|
||||
{ pattern: 'doubledragonne', init: 3.75},
|
||||
{ pattern: 'esparlongue', init: 3.70},
|
||||
{ pattern: 'epeedragonne', init: 3.65},
|
||||
{ pattern: 'epeebatarde', init: 3.60},
|
||||
{ pattern: 'epeecyane', init: 3.55},
|
||||
{ pattern: 'epeesorde', init: 3.50},
|
||||
{ pattern: 'grandehache', init: 3.45},
|
||||
{ pattern: 'bataille', init: 3.40},
|
||||
{ pattern: 'epeegnome', init: 3.35},
|
||||
{ pattern: 'masse', init: 3.30},
|
||||
{ pattern: 'gourdin', init: 3.25},
|
||||
{ pattern: 'fléau', init: 3.20},
|
||||
{ pattern: 'dague', init: 3.15},
|
||||
{ pattern: 'autre', init: 3.10},
|
||||
];
|
||||
/* -------------------------------------------- */
|
||||
const premierRoundInit = [
|
||||
{ pattern: 'hast', init: 3.90 },
|
||||
{ pattern: 'lance', init: 3.85 },
|
||||
{ pattern: 'baton', init: 3.80 },
|
||||
{ pattern: 'doubledragonne', init: 3.75 },
|
||||
{ pattern: 'esparlongue', init: 3.70 },
|
||||
{ pattern: 'epeedragonne', init: 3.65 },
|
||||
{ pattern: 'epeebatarde', init: 3.60 },
|
||||
{ pattern: 'epeecyane', init: 3.55 },
|
||||
{ pattern: 'epeesorde', init: 3.50 },
|
||||
{ pattern: 'grandehache', init: 3.45 },
|
||||
{ pattern: 'bataille', init: 3.40 },
|
||||
{ pattern: 'epeegnome', init: 3.35 },
|
||||
{ pattern: 'masse', init: 3.30 },
|
||||
{ pattern: 'gourdin', init: 3.25 },
|
||||
{ pattern: 'fléau', init: 3.20 },
|
||||
{ pattern: 'dague', init: 3.15 },
|
||||
{ pattern: 'autre', init: 3.10 },
|
||||
];
|
||||
|
||||
/* -------------------------------------------- */
|
||||
function _buildAllSegmentsFatigue(max) {
|
||||
@ -235,7 +235,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html',
|
||||
// messages tchat
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-demande-defense.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-particuliere.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-etotal.html',
|
||||
@ -254,10 +254,10 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html'
|
||||
];
|
||||
|
||||
Handlebars.registerHelper('upperFirst', str=> Misc.upperFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? 'NULL' );
|
||||
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str) );
|
||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str) );
|
||||
Handlebars.registerHelper('upperFirst', str => Misc.upperFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? 'NULL');
|
||||
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str));
|
||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
||||
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
@ -287,7 +287,7 @@ export class RdDUtility {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getAfficheContenu(conteneurId) {
|
||||
if ( conteneurId )
|
||||
if (conteneurId)
|
||||
return this.afficheContenu[conteneurId];
|
||||
return undefined;
|
||||
}
|
||||
@ -327,8 +327,8 @@ export class RdDUtility {
|
||||
console.log(dragData, actorSheet.actor._id);
|
||||
let dropID = $(event.target).parents(".item").attr("data-item-id"); // Only relevant if container drop
|
||||
let objetId = dragData.id || dragData.data._id;
|
||||
if ( dragData.type == 'Item') {
|
||||
if ( dropID ) { // Dropped over an item !!!
|
||||
if (dragData.type == 'Item') {
|
||||
if (dropID) { // Dropped over an item !!!
|
||||
if (actorSheet.objetVersConteneur[objetId] != dropID && objetId != dropID) {
|
||||
if (actorSheet.actor.validateConteneur(objetId, dropID) && actorSheet.actor.testConteneurCapacite(objetId, dropID)) {
|
||||
await actorSheet.actor.enleverDeConteneur(objetId, actorSheet.objetVersConteneur[objetId]);
|
||||
@ -336,14 +336,14 @@ export class RdDUtility {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dragData.actorId && dragData.actorId != actorSheet.actor._id ) { // Un acteur est à l'origine de l'item -> deplacement
|
||||
if (dragData.actorId && dragData.actorId != actorSheet.actor._id) { // Un acteur est à l'origine de l'item -> deplacement
|
||||
console.log("Moving objects");
|
||||
actorSheet.actor.moveItemsBetweenActors( objetId, dragData.actorId);
|
||||
actorSheet.actor.moveItemsBetweenActors(objetId, dragData.actorId);
|
||||
return false;
|
||||
}
|
||||
actorSheet.actor.computeEncombrementTotalEtMalusArmure();
|
||||
} else if ( dragData.type == "Actor" ) {
|
||||
actorSheet.actor.addSubacteur( objetId );
|
||||
} else if (dragData.type == "Actor") {
|
||||
actorSheet.actor.addSubacteur(objetId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -434,7 +434,7 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
static getCaracXp(targetValue) {
|
||||
return tableCaracDerivee[targetValue]?.xp ?? 200 ;
|
||||
return tableCaracDerivee[targetValue]?.xp ?? 200;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -487,13 +487,13 @@ export class RdDUtility {
|
||||
|
||||
data.carac.derobee.value = Math.floor(parseInt(((21 - data.carac.taille.value)) + parseInt(data.carac.agilite.value)) / 2);
|
||||
let bonusDomKey = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2);
|
||||
bonusDomKey = Math.min( Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
||||
bonusDomKey = Math.min(Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
||||
|
||||
let tailleData = tableCaracDerivee[bonusDomKey];
|
||||
data.attributs.plusdom.value = tailleData.plusdom;
|
||||
|
||||
data.attributs.sconst.value = RdDUtility.calculSConst(data.carac.constitution.value);
|
||||
data.attributs.sust.value = tableCaracDerivee[Number(data.carac.taille.value)].sust;
|
||||
data.attributs.sconst.value = RdDUtility.calculSConst(data.carac.constitution.value);
|
||||
data.attributs.sust.value = tableCaracDerivee[Number(data.carac.taille.value)].sust;
|
||||
|
||||
data.attributs.encombrement.value = (parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2;
|
||||
data.carac.melee.value = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.agilite.value)) / 2);
|
||||
@ -579,10 +579,10 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getLocalisation( type = 'personnage' ) {
|
||||
static getLocalisation(type = 'personnage') {
|
||||
let result = new Roll("1d20").roll().total;
|
||||
let txt = ""
|
||||
if ( type == 'personnage') {
|
||||
if (type == 'personnage') {
|
||||
if (result <= 3) txt = "Jambe, genou, pied, jarret";
|
||||
else if (result <= 7) txt = "Hanche, cuisse, fesse";
|
||||
else if (result <= 9) txt = "Ventre, reins";
|
||||
@ -594,7 +594,7 @@ export class RdDUtility {
|
||||
} else {
|
||||
if (result <= 7) txt = "Jambes/Pattes";
|
||||
else if (result <= 18) txt = "Corps";
|
||||
else if (result <= 20) txt = "Tête";
|
||||
else if (result <= 20) txt = "Tête";
|
||||
}
|
||||
|
||||
return { result: result, label: txt };
|
||||
@ -680,36 +680,36 @@ export class RdDUtility {
|
||||
return game.system.rdd.calendrier.requestNombreAstral(sockmsg.data);
|
||||
case "msg_response_nombre_astral":
|
||||
return RdDUtility.responseNombreAstral(sockmsg.data);
|
||||
case "msg_tmr_move":
|
||||
if ( game.user.isGM ) {
|
||||
let actor = game.actors.get( sockmsg.data.actorId);
|
||||
actor.refreshTMRView( sockmsg.data.tmrPos );
|
||||
}
|
||||
case "msg_tmr_move":
|
||||
if (game.user.isGM) {
|
||||
let actor = game.actors.get(sockmsg.data.actorId);
|
||||
actor.refreshTMRView(sockmsg.data.tmrPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static processPremierRoundInit() {
|
||||
// Check if we have the whole init !
|
||||
if ( game.user.isGM) {
|
||||
if (game.user.isGM) {
|
||||
let initDone = true;
|
||||
for( let combatant of game.combat.data.combatants) {
|
||||
if ( !combatant.initiative ) initDone = false;
|
||||
for (let combatant of game.combat.data.combatants) {
|
||||
if (!combatant.initiative) initDone = false;
|
||||
}
|
||||
if (initDone && game.combat.current.round == 1) { // Premier round !
|
||||
for( let combatant of game.combat.data.combatants) {
|
||||
for (let combatant of game.combat.data.combatants) {
|
||||
let arme = combatant.initiativeData.arme;
|
||||
//console.log("Parsed !!!", combatant, initDone, game.combat.current, arme);
|
||||
if ( arme && arme.type == "arme" ) {
|
||||
if (arme && arme.type == "arme") {
|
||||
for (let initData of premierRoundInit) {
|
||||
if ( arme.data.initpremierround.toLowerCase().includes(initData.pattern) ) {
|
||||
if (arme.data.initpremierround.toLowerCase().includes(initData.pattern)) {
|
||||
let msg = `<h4>L'initiative de ${combatant.actor.name} a été modifiée !</h4>
|
||||
<hr>
|
||||
<div>
|
||||
Etant donné son ${arme.name}, son initative pour ce premier round est désormais de ${initData.init}.
|
||||
</div>`
|
||||
ChatMessage.create( { content: msg } );
|
||||
game.combat.setInitiative(combatant._id, initData.init);
|
||||
ChatMessage.create({ content: msg });
|
||||
game.combat.setInitiative(combatant._id, initData.init);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -717,18 +717,18 @@ export class RdDUtility {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static rollInitiativeCompetence(combatantId, arme) {
|
||||
const combatant = game.combat.getCombatant(combatantId);
|
||||
const actor = combatant.actor;
|
||||
|
||||
let initOffset = 0;
|
||||
|
||||
let initOffset = 0;
|
||||
let caracForInit = 0;
|
||||
let compNiveau = 0;
|
||||
if ( actor.getSurprise() == "totale") {
|
||||
let compNiveau = 0;
|
||||
if (actor.getSurprise() == "totale") {
|
||||
initOffset = -1; // To force 0
|
||||
} else if ( actor.getSurprise() == "demi") {
|
||||
} else if (actor.getSurprise() == "demi") {
|
||||
initOffset = 0;
|
||||
} else if (arme.name == "Autre action") {
|
||||
initOffset = 2;
|
||||
@ -738,10 +738,10 @@ export class RdDUtility {
|
||||
initOffset = 3; // Melée = 3.XX
|
||||
let competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence);
|
||||
compNiveau = competence.data.niveau;
|
||||
|
||||
|
||||
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
||||
caracForInit = competence.data.carac_value;
|
||||
if ( competence.data.categorie == "lancer") {
|
||||
if (competence.data.categorie == "lancer") {
|
||||
initOffset = 5;
|
||||
}
|
||||
} else {
|
||||
@ -759,7 +759,7 @@ export class RdDUtility {
|
||||
}
|
||||
let malus = actor.getEtatGeneral(); // Prise en compte état général
|
||||
// Cas des créatures et entités vs personnages
|
||||
let rollFormula = initOffset + "+ ( (" + RdDUtility.calculInitiative(compNiveau, caracForInit) + " + " + malus + ") /100)";
|
||||
let rollFormula = initOffset + "+ ( (" + RdDUtility.calculInitiative(compNiveau, caracForInit) + " + " + malus + ") /100)";
|
||||
// Garder la trace de l'arme/compétence utilisée pour l'iniative
|
||||
combatant.initiativeData = { arme: arme } // pour reclasser l'init au round 0
|
||||
game.combat.rollInitiative(combatantId, rollFormula);
|
||||
@ -812,41 +812,41 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static incDecInit(combatantId, incDecValue ) {
|
||||
static incDecInit(combatantId, incDecValue) {
|
||||
const combatant = game.combat.getCombatant(combatantId);
|
||||
let initValue = combatant.initiative + incDecValue;
|
||||
game.combat.setInitiative( combatantId, initValue );
|
||||
game.combat.setInitiative(combatantId, initValue);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static pushInitiativeOptions(html, options) {
|
||||
for (let i =0; i<options.length; i++) {
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
let option = options[i];
|
||||
if ( option.name == 'COMBAT.CombatantReroll') { // Replace !
|
||||
if (option.name == 'COMBAT.CombatantReroll') { // Replace !
|
||||
option.name = "Sélectionner l'initiative...";
|
||||
option.condition = true;
|
||||
option.icon = '<i class="far fa-question-circle"></i>';
|
||||
option.callback = target => {
|
||||
option.condition = true;
|
||||
option.icon = '<i class="far fa-question-circle"></i>';
|
||||
option.callback = target => {
|
||||
RdDUtility.displayInitiativeMenu(html, target.data('combatant-id'));
|
||||
}
|
||||
}
|
||||
}
|
||||
options.push( {
|
||||
options.push({
|
||||
name: "Incrémenter initiative",
|
||||
condition: true,
|
||||
icon: '<i class="fas fa-plus"></i>',
|
||||
callback: target => {
|
||||
condition: true,
|
||||
icon: '<i class="fas fa-plus"></i>',
|
||||
callback: target => {
|
||||
RdDUtility.incDecInit(target.data('combatant-id'), +0.01);
|
||||
}
|
||||
} );
|
||||
options.push( {
|
||||
});
|
||||
options.push({
|
||||
name: "Décrémenter initiative",
|
||||
condition: true,
|
||||
icon: '<i class="fas fa-minus"></i>',
|
||||
callback: target => {
|
||||
condition: true,
|
||||
icon: '<i class="fas fa-minus"></i>',
|
||||
callback: target => {
|
||||
RdDUtility.incDecInit(target.data('combatant-id'), -0.01);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -938,96 +938,96 @@ export class RdDUtility {
|
||||
chatData["whisper"] = ChatMessage.getWhisperRecipients(forceWhisper);
|
||||
}
|
||||
|
||||
return chatData;
|
||||
return chatData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static confirmerSuppressionSubacteur(actorSheet, li ) {
|
||||
let actorId = li.data("actor-id");
|
||||
let actor = game.actors.get( actorId );
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer le lien vers ce véhicule/monture/suivant : " + actor.data.name +" ?</p>";
|
||||
let buttons = {
|
||||
/* -------------------------------------------- */
|
||||
static confirmerSuppressionSubacteur(actorSheet, li) {
|
||||
let actorId = li.data("actor-id");
|
||||
let actor = game.actors.get(actorId);
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer le lien vers ce véhicule/monture/suivant : " + actor.data.name + " ?</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression du lien",
|
||||
content: msgTxt,
|
||||
buttons: {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le lien",
|
||||
callback: () => {
|
||||
console.log("Delete : ", actorId);
|
||||
actorSheet.actor.removeSubacteur( actorId );
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler"
|
||||
}
|
||||
}
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression du lien",
|
||||
content: msgTxt,
|
||||
buttons: buttons,
|
||||
default: "cancel"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le lien",
|
||||
callback: () => {
|
||||
console.log("Delete : ", actorId);
|
||||
actorSheet.actor.removeSubacteur(actorId);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler"
|
||||
}
|
||||
},
|
||||
default: "cancel"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmerSuppression(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
let objet = actorSheet.actor.items.find( item => item._id == itemId );
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer cet objet ?";
|
||||
let buttons = { delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer l'objet",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteOwnedItem( itemId );
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler"
|
||||
}
|
||||
}
|
||||
if ( objet.data.type == 'conteneur' && objet.data.data.contenu.length > 0) {
|
||||
msgTxt += "<br>Cet objet est aussi un conteneur avec du contenu : choisissez l'option de suppression";
|
||||
buttons['deleteall'] = {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le conteneur et tout son contenu",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteAllConteneur( itemId );
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
}
|
||||
let itemId = li.data("item-id");
|
||||
let objet = actorSheet.actor.items.find(item => item._id == itemId);
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer cet objet ?";
|
||||
let buttons = {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer l'objet",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteOwnedItem(itemId);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler"
|
||||
}
|
||||
msgTxt += "</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression",
|
||||
content: msgTxt,
|
||||
buttons: buttons,
|
||||
default: "cancel"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
if (objet.data.type == 'conteneur' && objet.data.data.contenu.length > 0) {
|
||||
msgTxt += "<br>Cet objet est aussi un conteneur avec du contenu : choisissez l'option de suppression";
|
||||
buttons['deleteall'] = {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le conteneur et tout son contenu",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteAllConteneur(itemId);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
msgTxt += "</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression",
|
||||
content: msgTxt,
|
||||
buttons: buttons,
|
||||
default: "cancel"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static afficherHeuresChanceMalchance( heureNaissance ) {
|
||||
static afficherHeuresChanceMalchance(heureNaissance) {
|
||||
if (heureNaissance) {
|
||||
let ajustement = game.system.rdd.calendrier.getAjustementAstrologique(heureNaissance);
|
||||
ChatMessage.create( {
|
||||
content: `A l'heure ${game.system.rdd.calendrier.getCurrentHeure()}, le modificateur de Chance/Malchance pour l'heure de naissance ${heureNaissance} est de : ${ajustement}.`,
|
||||
ChatMessage.create({
|
||||
content: `A l'heure ${game.system.rdd.calendrier.getCurrentHeure()}, le modificateur de Chance/Malchance pour l'heure de naissance ${heureNaissance} est de : ${ajustement}.`,
|
||||
whisper: ChatMessage.getWhisperRecipients("MJ")
|
||||
} );
|
||||
});
|
||||
}
|
||||
else{
|
||||
else {
|
||||
ui.notifications.warn("Pas d'heure de naissance selectionnée")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------- */
|
||||
static checkThanatosXP(compName) {
|
||||
if ( compName.includes('Thanatos') ) {
|
||||
if (compName.includes('Thanatos')) {
|
||||
let message = "Vous avez mis des points d'Expérience dans la Voie de Thanatos !<br>Vous devez réduire manuellement d'un même montant d'XP une autre compétence Draconique.";
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name),
|
||||
@ -1037,7 +1037,7 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/*-------------------------------------------- */
|
||||
static async onRenderChatMessage( app, html, msg ) {
|
||||
static async onRenderChatMessage(app, html, msg) {
|
||||
// TODO
|
||||
//console.log(app, html, msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user