Version 12.0.23 - La bibliothèque d'Astrobazzarh #723

Merged
uberwald merged 14 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-11-27 10:12:27 +01:00
6 changed files with 11 additions and 15 deletions
Showing only changes of commit 62dfa8a580 - Show all commits

View File

@ -80,7 +80,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
const actor = this.actor;
formData.combat = foundry.utils.duplicate(formData.armes);
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
formData.combat.push(RdDItemArme.mainsNues(actor));
formData.combat.push(RdDItemArme.corpsACorps(actor));
formData.combat.push(RdDItemArme.empoignade(actor));
formData.esquives = this.actor.getCompetences("Esquive");

View File

@ -137,8 +137,8 @@ export class RdDActor extends RdDBaseActorSang {
const actions = RdDCombatManager.listActionsArmes(
this.itemTypes[ITEM_TYPES.arme]
.filter(it => RdDItemArme.isAttaque(it))
.concat(RdDItemArme.corpsACorps(this))
.concat(RdDItemArme.empoignade(this))
.concat(RdDItemArme.mainsNues(this))
,
this.itemTypes[ITEM_TYPES.competence],
this.system.carac)

View File

@ -140,7 +140,8 @@ export class Mapping {
static prepareArmes(actor) {
const armes = actor.items.filter(it => it.type == ITEM_TYPES.arme)
RdDItemArme.ajoutCorpsACorps(armes, actor)
armes.push(RdDItemArme.corpsACorps(actor));
armes.push(RdDItemArme.empoignade(actor));
return armes.map(arme => [
arme.system.unemain ? Mapping.prepareArme(actor, arme, 'unemain') : undefined,
arme.system.deuxmains ? Mapping.prepareArme(actor, arme, 'deuxmains') : undefined,

View File

@ -31,7 +31,7 @@ export class RdDItemArme extends Item {
case ITEM_TYPES.competencecreature:
return RdDItemCompetenceCreature.armeCreature(arme);
}
return RdDItemArme.mainsNues();
return RdDItemArme.corpsACorps();
}
static getCompetenceArme(arme, maniement) {
@ -235,11 +235,6 @@ export class RdDItemArme extends Item {
return false
}
static ajoutCorpsACorps(armes, actor) {
armes.push(RdDItemArme.mainsNues(actor));
armes.push(RdDItemArme.empoignade(actor));
}
static corpsACorps(actor) {
let competence = actor?.getCompetenceCorpsACorps() ?? { system: { niveau: -6 } };
let melee = actor ? actor.system.carac['melee'].value : 0
@ -258,6 +253,8 @@ export class RdDItemArme extends Item {
mortalite: 'non-mortel',
competence: 'Corps à corps',
resistance: 1,
baseInit: 4,
cac: 'pugilat',
deuxmains: true,
categorie_parade: 'sans-armes'
}
@ -267,8 +264,6 @@ export class RdDItemArme extends Item {
static mainsNues(actor) {
const mainsNues = RdDItemArme.corpsACorps(actor)
mainsNues.name = 'Mains nues'
mainsNues.system.cac = 'pugilat'
mainsNues.system.baseInit = 4
return mainsNues;
}

View File

@ -773,9 +773,9 @@ export class RdDCombat {
}
else {
// sans armes: à mains nues
const niveau = competence.system.niveau;
const init = RdDCombatManager.calculInitiative(niveau, this.attacker.system.carac['melee'].value);
rollData.arme = RdDItemArme.mainsNues({ niveau: niveau, initiative: init });
rollData.arme = RdDItemArme.corpsACorps(this.attacker)
rollData.arme.system.niveau = competence.system.niveau
rollData.arme.system.initiative = RdDCombatManager.calculInitiative(competence.system.niveau, this.attacker.system.carac['melee'].value);
}
return rollData;
}

View File

@ -121,7 +121,7 @@ export class RdDHotbar {
if (item.isCorpsACorps()) {
switch (categorieArme) {
case 'pugilat':
return actor.rollArme(RdDItemArme.mainsNues(actor), 'competence');
return actor.rollArme(RdDItemArme.corpsACorps(actor), 'competence');
case 'empoignade':
return actor.rollArme(RdDItemArme.empoignade(actor), 'competence');
}