fix export Corps à Corps
This commit is contained in:
parent
e71088fe2f
commit
62dfa8a580
@ -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");
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user