Utiliser perception/reve pour les créatures
Ces caractéristiques remplacent toutes les autres
This commit is contained in:
parent
1b75decb18
commit
57c41a0218
@ -346,7 +346,6 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
callbackAction: r => this.$onRollCaracResult(r)
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCarac(caracName, options = {}) {
|
||||
if (Grammar.equalsInsensitive(caracName, 'taille')) {
|
||||
|
@ -81,7 +81,6 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static getRealActor(actorId, tokenId) {
|
||||
if (tokenId) {
|
||||
let token = canvas.tokens.get(tokenId)
|
||||
@ -161,8 +160,11 @@ export class RdDBaseActor extends Actor {
|
||||
return RdDBaseActor.$findCaracByName(carac, name);
|
||||
}
|
||||
|
||||
mapCarac(caracCode) { return caracCode }
|
||||
|
||||
getCaracByName(name) {
|
||||
switch (Grammar.toLowerCaseNoAccent(name)) {
|
||||
name = this.mapCarac(Grammar.toLowerCaseNoAccent(name))
|
||||
switch (name) {
|
||||
case 'reve-actuel': case 'reve actuel':
|
||||
return this.getCaracReveActuel();
|
||||
case 'chance-actuelle': case 'chance-actuelle':
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { LIST_CARAC_AUTRES } from "../rdd-carac.js";
|
||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||
|
||||
export class RdDCreature extends RdDBaseActorSang {
|
||||
@ -32,4 +34,14 @@ export class RdDCreature extends RdDBaseActorSang {
|
||||
}
|
||||
}
|
||||
|
||||
mapCarac(caracCode) {
|
||||
switch (caracCode) {
|
||||
case 'vue': case 'ouie':
|
||||
case 'odoratgout':
|
||||
case 'empathie':
|
||||
return 'perception'
|
||||
}
|
||||
return caracCode
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,4 +117,13 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
super.setEntiteReveAccordee(actor)
|
||||
}
|
||||
}
|
||||
|
||||
mapCarac(caracCode) {
|
||||
switch (caracCode) {
|
||||
case 'taille':
|
||||
return caracCode
|
||||
}
|
||||
return 'reve'
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,14 +28,12 @@ class TextRollCaracCompetence {
|
||||
if (caracCode) {
|
||||
const competence = event.currentTarget.attributes['data-competence']?.value
|
||||
const diff = event.currentTarget.attributes['data-diff']?.value
|
||||
|
||||
const path = RdDCarac.caracDetails(caracCode)?.path
|
||||
const actors = TextRollCaracCompetence.getSelectedActors(actor)
|
||||
actors.filter(it => foundry.utils.getProperty(it, path) != undefined)
|
||||
.forEach(it => TextRollCaracCompetence.doRoll(it, caracCode, competence, diff))
|
||||
actors.forEach(it => TextRollCaracCompetence.doRoll(it, caracCode, competence, diff))
|
||||
}
|
||||
}
|
||||
static async doRoll(actor, caracCode, competence, diff) {
|
||||
caracCode = actor.mapCarac(caracCode)
|
||||
if (competence) {
|
||||
if (actor.type == ACTOR_TYPES.personnage) {
|
||||
actor.rollCaracCompetence(caracCode, competence, diff)
|
||||
|
Loading…
x
Reference in New Issue
Block a user