Fix armes naturelles/corps à corps

This commit is contained in:
sladecraven 2022-11-20 16:08:48 +01:00
parent 5ba86f12df
commit 3543ce60cb
3 changed files with 53 additions and 52 deletions

View File

@ -156,12 +156,14 @@ export class RdDCombatManager extends Combat {
let actions = [];
for (const arme of armes) {
if (arme.system.equipe) {
const dommages = arme.system.dommages;
const dommages = arme.system.dommages.toString();
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 && arme.system.competence) {
console.log(">>>>", arme)
if ((arme.system.unemain && arme.system.competence) ||
(arme.system.competence.toLowerCase().includes("corps à corps"))) {
actions.push(RdDCombatManager.$prepareAttaqueArme({
arme: arme,
infoMain: "(1 main)",
@ -224,8 +226,7 @@ export class RdDCombatManager extends Combat {
}
static listActionsPossessions(actor) {
return RdDCombatManager._indexActions(actor.getPossessions().map(p =>
{
return RdDCombatManager._indexActions(actor.getPossessions().map(p => {
return {
name: p.name,
action: 'conjurer',
@ -714,7 +715,8 @@ export class RdDCombat {
if (this.defender.isEntite([ENTITE_BLURETTE])) {
ChatMessage.create({
content: `<strong>La cible est une blurette, l'arme à distance sera perdue dans le blurêve`,
whisper: ChatMessage.getWhisperRecipients("GM")})
whisper: ChatMessage.getWhisperRecipients("GM")
})
}
else {
const defenderToken = canvas.tokens.get(this.defenderTokenId);
@ -1057,8 +1059,7 @@ export class RdDCombat {
const arme = this.defender.getArmeParade(armeParadeId);
console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme);
const competence = arme?.system?.competence;
if (competence == undefined)
{
if (competence == undefined) {
console.error("Pas de compétence de parade associée à ", arme?.name, armeParadeId);
return;
}

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "10.2.5",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.2.5.zip",
"version": "10.2.6",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.2.6.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
"compatibility": {
"minimum": "10",