Possession start
This commit is contained in:
parent
2e83cbd366
commit
fb03f7a719
@ -32,6 +32,8 @@ import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js";
|
||||
import { RollDataAjustements } from "./rolldata-ajustements.js";
|
||||
import { DialogItemAchat } from "./dialog-item-achat.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDPossession } from "./rdd-possession.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
||||
@ -3148,7 +3150,11 @@ export class RdDActor extends Actor {
|
||||
rollArme(arme) {
|
||||
let competence = Misc.data(this.getCompetence(arme.data.competence));
|
||||
if (arme || (competence.type == 'competencecreature' && competence.data.iscombat)) {
|
||||
if ( competence.data.ispossession ) {
|
||||
RdDPossession.managePosession(this, competence);
|
||||
} else {
|
||||
RdDCombat.createUsingTarget(this)?.attaque(competence, arme);
|
||||
}
|
||||
} else {
|
||||
this.rollCompetence(competence.name);
|
||||
}
|
||||
|
@ -434,7 +434,6 @@ export class RdDCombat {
|
||||
else {
|
||||
const defender = target?.actor;
|
||||
const defenderTokenId = target?.data._id;
|
||||
console.log("Defender: ", defender);
|
||||
if ( defender.data._id == attacker.data._id) {
|
||||
ui.notifications.warn("Vous vous attaquez vous-même !!!!");
|
||||
} else if ( defender.type == 'entite' && defender.data.data.definition.typeentite == 'nonincarne') {
|
||||
@ -455,11 +454,13 @@ export class RdDCombat {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static messagePasseArme(data) {
|
||||
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_combat_passearme", data: data });
|
||||
RdDCombat.onMsgPasseArme(data);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onMsgPasseArme(data) {
|
||||
switch (data.actionPasseArme) {
|
||||
case "store-attaque":
|
||||
|
@ -31,6 +31,7 @@ import { EffetsDraconiques } from "./tmr/effets-draconiques.js";
|
||||
import { RdDHerbes } from "./rdd-herbes.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDDice } from "./rdd-dice.js";
|
||||
import { RdDPossession } from "./rdd-possession.js";
|
||||
import { RdDSigneDraconiqueItemSheet } from "./item-signedraconique-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -49,7 +50,8 @@ Hooks.once("init", async function () {
|
||||
game.system.rdd = {
|
||||
TMRUtility,
|
||||
RdDUtility,
|
||||
RdDHotbar
|
||||
RdDHotbar,
|
||||
RdDPossession,
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -197,6 +199,7 @@ Hooks.once("init", async function () {
|
||||
TMRUtility.init();
|
||||
TMRRencontres.init();
|
||||
RdDHotbar.initDropbar();
|
||||
RdDPossession.init();
|
||||
});
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user