Various fixes

This commit is contained in:
sladecraven 2022-05-14 17:28:27 +02:00
parent 0a65f767dd
commit fd32c21297
16 changed files with 164 additions and 82 deletions

View File

@ -40,7 +40,8 @@
"TypeQueue": "Queue de Dragon", "TypeQueue": "Queue de Dragon",
"TypeOmbre": "Ombre de Thanatos", "TypeOmbre": "Ombre de Thanatos",
"TypeSouffle": "Souffle de Dragon", "TypeSouffle": "Souffle de Dragon",
"TypeTete": "Tête de Dragon" "TypeTete": "Tête de Dragon",
"TypePossession": "Possession"
}, },
"EFFECT": { "EFFECT": {
"StatusStunned": "Sonné", "StatusStunned": "Sonné",

View File

@ -171,9 +171,10 @@ export class RdDActorSheet extends ActorSheet {
RdDSheetUtility.splitItem(item, this.actor); RdDSheetUtility.splitItem(item, this.actor);
}); });
html.find('.item-edit').click(async event => { html.find('.item-edit').click(async event => {
const item = RdDSheetUtility.getItem(event, this.actor); const item = RdDSheetUtility.getItem(event, this.actor)
item.sheet.render(true); console.log("ITEM :", item)
}); item.sheet.render(true)
})
html.find('.display-label a').click(async event => { html.find('.display-label a').click(async event => {
const item = RdDSheetUtility.getItem(event, this.actor); const item = RdDSheetUtility.getItem(event, this.actor);
item.sheet.render(true); item.sheet.render(true);
@ -195,7 +196,7 @@ export class RdDActorSheet extends ActorSheet {
}); });
html.find('.item-action').click(async event => { html.find('.item-action').click(async event => {
const item = RdDSheetUtility.getItem(event, this.actor); const item = RdDSheetUtility.getItem(event, this.actor)
this.actor.actionItem(item); this.actor.actionItem(item);
}); });
html.find('.subacteur-delete').click(async event => { html.find('.subacteur-delete').click(async event => {
@ -205,8 +206,11 @@ export class RdDActorSheet extends ActorSheet {
html.find('.encaisser-direct').click(async event => { html.find('.encaisser-direct').click(async event => {
this.actor.encaisser(); this.actor.encaisser();
}); })
html.find('.sheet-possession-attack').click(async event => {
const poss = RdDSheetUtility.getItem(event, this.actor)
this.actor.conjurerPossession(poss)
})
html.find('.remise-a-neuf').click(async event => { html.find('.remise-a-neuf').click(async event => {
if (game.user.isGM) { if (game.user.isGM) {
this.actor.remiseANeuf(); this.actor.remiseANeuf();

View File

@ -2537,18 +2537,19 @@ export class RdDActor extends Actor {
async rollCompetence(idOrName) { async rollCompetence(idOrName) {
let rollData = { competence: Misc.data(this.getCompetence(idOrName)) } let rollData = { competence: Misc.data(this.getCompetence(idOrName)) }
//console.log("COMP CREATURE", name, rollData, name);
if (rollData.competence.type == 'competencecreature') { if (rollData.competence.type == 'competencecreature') {
if (rollData.competence.data.iscombat) { if (rollData.competence.data.iscombat) {
const arme = RdDItemCompetenceCreature.toArme(rollData.competence); if (rollData.competence.data.ispossession) {
RdDCombat.createUsingTarget(this).attaque(rollData.competence, arme); RdDPossession.managePossession(this, rollData.competence)
return; } else {
const arme = RdDItemCompetenceCreature.toArme(rollData.competence)
RdDCombat.createUsingTarget(this)?.attaque(competence, arme)
}
return
} }
//console.log("COMP CREATURE2");
// Fake competence pour créature // Fake competence pour créature
RdDItemCompetenceCreature.setRollDataCreature(rollData); RdDItemCompetenceCreature.setRollDataCreature(rollData)
} } else {
else {
rollData.carac = Misc.templateData(this).carac; rollData.carac = Misc.templateData(this).carac;
} }
console.log("rollCompetence !!!", rollData); console.log("rollCompetence !!!", rollData);
@ -2565,6 +2566,12 @@ export class RdDActor extends Actor {
dialog.render(true); dialog.render(true);
} }
/* -------------------------------------------- */
conjurerPossession(possession) {
let draconic = this.getBestDraconic()
RdDPossession.managePossession(this, draconic, possession)
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async _competenceResult(rollData) { async _competenceResult(rollData) {
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html') await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html')
@ -2599,8 +2606,8 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollTache(id) { async rollTache(id) {
const actorData = Misc.data(this); const actorData = Misc.data(this);
const tacheData = Misc.data(this.getTache(id)); const tacheData = Misc.data(this.getTache(id))
const compData = Misc.data(this.getCompetence(tacheData.data.competence)); const compData = Misc.data(this.getCompetence(tacheData.data.competence))
compData.data.defaut_carac = tacheData.data.carac; // Patch ! compData.data.defaut_carac = tacheData.data.carac; // Patch !
let rollData = { let rollData = {
@ -3202,7 +3209,7 @@ export class RdDActor extends Actor {
let competence = Misc.data(this.getCompetence(arme.data.competence)); let competence = Misc.data(this.getCompetence(arme.data.competence));
if (arme || (competence.type == 'competencecreature' && competence.data.iscombat)) { if (arme || (competence.type == 'competencecreature' && competence.data.iscombat)) {
if (competence.data.ispossession) { if (competence.data.ispossession) {
RdDPossession.managePosession(this, competence); RdDPossession.managePossession(this, competence);
} else { } else {
RdDCombat.createUsingTarget(this)?.attaque(competence, arme); RdDCombat.createUsingTarget(this)?.attaque(competence, arme);
} }

View File

@ -7,9 +7,9 @@ export class RdDItemCompetenceCreature extends Item {
static setRollDataCreature(rollData) { static setRollDataCreature(rollData) {
rollData.competence = Misc.data(rollData.competence); rollData.competence = Misc.data(rollData.competence);
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } }; rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
rollData.competence.data.defaut_carac = "carac_creature"; rollData.competence.data.defaut_carac = "carac_creature"
rollData.competence.data.categorie = "creature"; rollData.competence.data.categorie = "creature"
rollData.selectedCarac = rollData.carac.carac_creature; rollData.selectedCarac = rollData.carac.carac_creature
if (rollData.competence.data.iscombat) { if (rollData.competence.data.iscombat) {
rollData.arme = RdDItemCompetenceCreature.toArme(rollData.competence); rollData.arme = RdDItemCompetenceCreature.toArme(rollData.competence);
} }

View File

@ -60,7 +60,7 @@ export class RdDItemSheet extends ItemSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
async getData() { async getData() {
const objectData = Misc.data(this.object); const objectData = Misc.data(this.object)
let formData = { let formData = {
id: this.object.id, id: this.object.id,
title: objectData.name, title: objectData.name,
@ -82,14 +82,15 @@ export class RdDItemSheet extends ItemSheet {
} }
} }
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences(); formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences()
if (formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') { if (formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') {
formData.caracList = duplicate(game.system.model.Actor.personnage.carac); formData.caracList = duplicate(game.system.model.Actor.personnage.carac)
formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences'); formData.caracList["reve-actuel"] = duplicate(game.system.model.Actor.personnage.reve.reve)
formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences')
} }
if (formData.type == 'arme') { if (formData.type == 'arme') {
formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it)); formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
console.log(formData.competences); console.log(formData.competences)
} }
if (formData.type == 'recettealchimique') { if (formData.type == 'recettealchimique') {
RdDAlchimie.processManipulation(objectData, this.actor && this.actor.id); RdDAlchimie.processManipulation(objectData, this.actor && this.actor.id);
@ -113,6 +114,7 @@ export class RdDItemSheet extends ItemSheet {
return formData; return formData;
} }
/* -------------------------------------------- */
prepareConteneurData(formData) { prepareConteneurData(formData) {
formData.itemsByType = Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i.data))); formData.itemsByType = Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i.data)));
RdDUtility.filterEquipementParType(formData); RdDUtility.filterEquipementParType(formData);

View File

@ -3,8 +3,8 @@ import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js"; import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js"; import { RdDUtility } from "./rdd-utility.js";
const typesObjetsEquipement = ["objet", "arme", "armure", "gemme", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"]; const typesObjetsEquipement = ["objet", "arme", "armure", "gemme", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"]
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]; const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]
const encBrin = 0.00005;// un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc const encBrin = 0.00005;// un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
export const defaultItemImg = { export const defaultItemImg = {
@ -34,7 +34,8 @@ export const defaultItemImg = {
oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp", oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp",
nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp", nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp",
signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp", signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp",
gemme: "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp" gemme: "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp",
possession: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp"
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -48,11 +49,11 @@ export class RdDItem extends Item {
} }
static getTypeObjetsEquipement() { static getTypeObjetsEquipement() {
return typesObjetsEquipement; return typesObjetsEquipement
} }
static getTypesOeuvres() { static getTypesOeuvres() {
return typesObjetsOeuvres; return typesObjetsOeuvres
} }
isCompetence() { isCompetence() {

View File

@ -183,7 +183,7 @@ Hooks.once("init", async function () {
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, { Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
types: ["arme", "armure", "objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle", types: ["arme", "armure", "objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle",
"tete", "competencecreature", "tarot", "monnaie", "nombreastral", "tache", "meditation", "casetmr", "recettealchimique", "gemme", "tete", "competencecreature", "tarot", "monnaie", "nombreastral", "tache", "meditation", "casetmr", "recettealchimique", "gemme",
"musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson"], makeDefault: true "musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson", "possession"], makeDefault: true
}); });
CONFIG.Combat.documentClass = RdDCombatManager; CONFIG.Combat.documentClass = RdDCombatManager;

View File

@ -5,7 +5,6 @@ import { RdDUtility } from "./rdd-utility.js";
import { RdDCombat } from "./rdd-combat.js"; import { RdDCombat } from "./rdd-combat.js";
import { RdDResolutionTable } from "./rdd-resolution-table.js"; import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDRoll } from "./rdd-roll.js"; import { RdDRoll } from "./rdd-roll.js";
import { RdDRollTables } from "./rdd-rolltables.js";
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -35,10 +34,10 @@ export class RdDPossession {
possession.ptsConjuration = 0; possession.ptsConjuration = 0;
possession.ptsPossession = 0; possession.ptsPossession = 0;
if ( possession.data.compteur > 0) { if ( possession.data.compteur > 0) {
possession.ptsPossession = possession.data.compteur; possession.ptsPossession = possession.data.compteur
} }
if ( possession.data.compteur < 0) { if ( possession.data.compteur < 0) {
possession.ptsConjuration = Math.abs(possession.data.compteur); possession.ptsConjuration = Math.abs(possession.data.compteur)
} }
if (possession.ptsPossession >= 2 ) { if (possession.ptsPossession >= 2 ) {
// Possede // Possede
@ -51,33 +50,61 @@ export class RdDPossession {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async resultConjuration( rollData) { static async resultConjuration( rollData) {
console.log("RollData!!!", rollData); console.log("RollData!!!", rollData)
if ( !rollData.rolled.isSuccess ) { if ( !rollData.rolled.isSuccess ) {
rollData.possession.data.compteur++; if( rollData.isECNIDefender) {
rollData.possession.data.compteur--
} else {
rollData.possession.data.compteur++
} }
this.updateEtatPossession(rollData.possession); let actor = game.actors.get(rollData.possession.data.possedeid)
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-possession.html'); let update = { _id: rollData.possession._id, "data.compteur": rollData.possession.data.compteur }
await this.updateEmbeddedDocuments('Item', [update])
}
this.updateEtatPossession(rollData.possession)
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-possession.html')
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async onDefensePossession( actorId, possessionId) { static async onDefensePossession( attackerId, defenderId, possessionId) {
let actor = game.actors.get(actorId); let attacker = game.actors.get(attackerId)
console.log("onDefensePossession", actor, possessionId); let defender = game.actors.get(defenderId)
let possession = duplicate(actor.items.find( item => item.type =='possession' && item.data.data.possessionid == possessionId));
let attacker = game.actors.get(possession.data.possesseurid); let possession = attacker.items.find( item => item.type =='possession' && item.data.data.possessionid == possessionId)
if ( !possession ) {
possession = defender.items.find( item => item.type =='possession' && item.data.data.possessionid == possessionId)
if ( !possession) {
ui.notifications.warn("Une erreur s'est produite : Aucune possession trouvée !!")
return
}
}
possession = duplicate(possession)
// Update for draconic roll // Update for draconic roll
let rollData = { let rollData = {
possession: possession possession: possession
} }
rollData.actor = actor; rollData.actor = defender
rollData.competence = duplicate(actor.getDraconicOrZero()); if ( defender.type == "personnage") {
rollData.competence.data.defaut_carac = 'reve-actuel'; rollData.competence = duplicate(defender.getDraconicOrZero())
rollData.competence.data.defaut_carac = 'reve-actuel'
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: actor.getReveActuel() } } rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: actor.getReveActuel() } }
rollData.mode = "conjuration"; rollData.selectedCarac = defender.data.data.carac.reve
rollData.possesseur = attacker.name; rollData.isECNIDefender = false
} else {
rollData.competence = duplicate(defender.getCompetence("Possession"))
rollData.competence.data.defaut_carac = "reve"
rollData.forceCarac = { 'reve': { label: "Rêve", value: defender.data.data.carac.reve.value } }
rollData.selectedCarac = defender.data.data.carac.reve
rollData.isECNIDefender = true
//RdDItemCompetenceCreature.setRollDataCreature( rollData )
}
rollData.mode = "conjuration"
rollData.possesseur = attacker.name
console.log("onDefensePossession", rollData)
const dialog = await RdDRoll.create(actor, rollData, const dialog = await RdDRoll.create(defender, rollData,
{ {
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-possession.html', html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-possession.html',
options: { height: 400 } options: { height: 400 }
@ -90,21 +117,21 @@ export class RdDPossession {
] ]
} }
); );
dialog.render(true); dialog.render(true)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async _onRollPossession( rollData, isSuccess ) { static async _onRollPossession( rollData, isSuccess ) {
let possession = rollData.possession; let possession = rollData.possession
possession.isSuccess = isSuccess; possession.isSuccess = isSuccess
this.updateEtatPossession( possession); this.updateEtatPossession( possession)
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-possession.html'); await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-possession.html');
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async managePosession(attacker, competence ) { static async managePossession(attacker, competence, possession=undefined) {
const target = RdDCombat.getTarget(); const target = RdDCombat.getTarget()
if (target == undefined) { if (target == undefined) {
ui.notifications.warn((game.user.targets?.size ?? 0) > 1 ui.notifications.warn((game.user.targets?.size ?? 0) > 1
? "Vous devez choisir <strong>une seule</strong> cible à posséder!" ? "Vous devez choisir <strong>une seule</strong> cible à posséder!"
@ -112,13 +139,16 @@ export class RdDPossession {
return; return;
} }
const defender = target.actor; const defender = target.actor
let possession = this.searchPossessionFromEntite( attacker, defender);
if ( !possession) { if ( !possession) {
possession = this.createPossession(attacker, defender); possession = this.searchPossessionFromEntite( attacker, defender)
if ( !possession) {
possession = this.createPossession(attacker, defender)
} }
}
possession = duplicate(possession)
this.updateEtatPossession(possession); this.updateEtatPossession(possession)
let rollData = { let rollData = {
competence: competence, competence: competence,
possession: possession, possession: possession,
@ -129,9 +159,9 @@ export class RdDPossession {
mode: "possession" mode: "possession"
}; };
if ( attacker.isCreature()) { if ( attacker.isCreature()) {
RdDItemCompetenceCreature.setRollDataCreature(rollData); RdDItemCompetenceCreature.setRollDataCreature(rollData)
} }
console.log("Creation de possession2", attacker, rollData); console.log("Creation de possession2", attacker, rollData)
const dialog = await RdDRoll.create( attacker, rollData, const dialog = await RdDRoll.create( attacker, rollData,
{ {
@ -145,19 +175,19 @@ export class RdDPossession {
{ condition: r => (r.rolled.isEchec), action: async r => await this._onRollPossession(r, false) }, { condition: r => (r.rolled.isEchec), action: async r => await this._onRollPossession(r, false) },
] ]
}); });
dialog.render(true); dialog.render(true)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async createPossession( attacker, defender ) { static async createPossession( attacker, defender ) {
let posessionData = { let possessionData = {
name: "Possession en cours", type: 'possession', name: "Possession en cours de " + attacker.name, type: 'possession',
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp", img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
data: { description: "", possede: false, possessionid: randomID(16), possesseurid: attacker.data._id, possedeid: defender.data._id, date: 0 } data: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.data._id, possedeid: defender.data._id, date: 0, compteur: 0 }
} }
await attacker.createEmbeddedDocuments('Item', [posessionData]) // Creates only the possession on the personnage side
let poss = await defender.createEmbeddedDocuments('Item', [posessionData]) let poss = await defender.createEmbeddedDocuments('Item', [possessionData])
return duplicate(poss[0]); return duplicate(poss[0])
} }
} }

View File

@ -64,7 +64,11 @@ export class RdDRoll extends Dialog {
canClose: true, canClose: true,
isGM: game.user.isGM, isGM: game.user.isGM,
forceDiceResult: -1 forceDiceResult: -1
}; }
// Mini patch :Ajout du rêve actuel
if ( actorData.type == "personnage") {
defaultRollData.carac["reve-actuel"] = actorData.data.reve.reve
}
mergeObject(rollData, defaultRollData, { recursive: true, overwrite: false }); mergeObject(rollData, defaultRollData, { recursive: true, overwrite: false });
if (rollData.forceCarac) { if (rollData.forceCarac) {
@ -298,8 +302,8 @@ export class RdDRoll extends Dialog {
async updateRollResult() { async updateRollResult() {
let rollData = this.rollData; let rollData = this.rollData;
rollData.dmg = rollData.attackerRoll?.dmg ?? RdDBonus.dmg(rollData, this.actor.getBonusDegat()); rollData.dmg = rollData.attackerRoll?.dmg ?? RdDBonus.dmg(rollData, this.actor.getBonusDegat())
rollData.caracValue = parseInt(rollData.selectedCarac.value); rollData.caracValue = parseInt(rollData.selectedCarac.value)
rollData.mortalite = rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite ?? 'mortel'; rollData.mortalite = rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite ?? 'mortel';
rollData.coupsNonMortels = (rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite) == 'non-mortel'; rollData.coupsNonMortels = (rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite) == 'non-mortel';
rollData.use.appelAuMoral = this.actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac); rollData.use.appelAuMoral = this.actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac);

View File

@ -4,7 +4,7 @@ import { Misc } from "./misc.js";
export class RdDSheetUtility { export class RdDSheetUtility {
static getItem(event, actor) { static getItem(event, actor) {
return actor.items.get(RdDSheetUtility.getItemId(event)); return actor.items.get(RdDSheetUtility.getItemId(event))
} }
static getItemId(event) { static getItemId(event) {

View File

@ -147,6 +147,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/item-meditation-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-meditation-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-nourritureboisson-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-nourritureboisson-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-possession-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html',
'systems/foundryvtt-reve-de-dragon/templates/competence-base.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-base.html',
'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html',
@ -473,6 +474,7 @@ export class RdDUtility {
return str; return str;
} }
/* -------------------------------------------- */
static buildContenu(objet, niveau, afficherContenu) { static buildContenu(objet, niveau, afficherContenu) {
if (!niveau) niveau = 1; if (!niveau) niveau = 1;
objet.niveau = niveau; objet.niveau = niveau;
@ -692,9 +694,10 @@ export class RdDUtility {
// gestion bouton tchat Acheter // gestion bouton tchat Acheter
html.on("click", '.defense-possession', event => { html.on("click", '.defense-possession', event => {
let actorId = event.currentTarget.attributes['data-defenderId'].value; let attackerId = event.currentTarget.attributes['data-attackerId'].value
let possessionId = event.currentTarget.attributes['data-possessionId'].value; let defenderId = event.currentTarget.attributes['data-defenderId'].value
RdDPossession.onDefensePossession(actorId, possessionId); let possessionId = event.currentTarget.attributes['data-possessionId'].value
RdDPossession.onDefensePossession(attackerId, defenderId, possessionId)
}); });
// gestion bouton tchat Acheter // gestion bouton tchat Acheter

View File

@ -29,7 +29,7 @@
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/", "url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"flags": {}, "flags": {},
"version": "1.5.69", "version": "1.5.71",
"minimumCoreVersion": "0.8.0", "minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "9", "compatibleCoreVersion": "9",
"scripts": [], "scripts": [],

View File

@ -578,7 +578,7 @@
"musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson", "signedraconique", "gemme", "musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson", "signedraconique", "gemme",
"possession" ], "possession" ],
"possession": { "possession": {
"type": "", "typepossession": "",
"possede": false, "possede": false,
"possessionid": "", "possessionid": "",
"possesseurid": "", "possesseurid": "",

View File

@ -366,7 +366,7 @@
{{#each possessions as |possession key|}} {{#each possessions as |possession key|}}
<li class="item flexrow list-item" data-item-id="{{possession._id}}"> <li class="item flexrow list-item" data-item-id="{{possession._id}}">
<span class="competence-label"> <span class="competence-label">
{{possession.name}} <a class="sheet-possession-attack">{{possession.name}} (Conjurer)</a>
</span> </span>
<span class="competence-label">{{possession.data.type}}</span> <span class="competence-label">{{possession.data.type}}</span>
<div class="item-controls"> <div class="item-controls">

View File

@ -15,3 +15,4 @@
<option value="tir">Tir</option> <option value="tir">Tir</option>
<option value="lancer">Lancer</option> <option value="lancer">Lancer</option>
<option value="derobee">Dérobée</option> <option value="derobee">Dérobée</option>
<option value="reve-actuel">Rêve Actuel</option>

View File

@ -0,0 +1,29 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="form-group">
<label for="xp">Type de possession </label>
<input class="attribute-value" type="text" name="data.typepossession" value="{{data.typepossession}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Possédé ? </label>
<input class="attribute-value" type="checkbox" name="data.istrue" {{#if data.istrue}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Compteur </label>
<input class="attribute-value" type="text" name="data.compteur" value="{{data.compteur}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
</section>
</form>