Gestion des hordes et divers améliorations + traduction espagnole

This commit is contained in:
2024-09-05 20:14:17 +02:00
parent e6bdc427f2
commit ed68c17304
111 changed files with 1443 additions and 343 deletions

View File

@ -21,12 +21,12 @@ export class BoLCombatManager extends Combat {
// Structure input data
ids = typeof ids === "string" ? [ids] : ids;
// Get initiative malus from tough/adversary
let malusInit = 0
let malusInit = 0
for (let combatant of this.combatants) {
malusInit = Math.max(malusInit, combatant.actor.getInitiativeMalus())
}
// calculate initiative
for (let cId = 0; cId < ids.length; cId++) {
for (let cId = 0; cId < ids.length; cId++) {
const combatant = this.combatants.get(ids[cId])
let fvttInit = combatant.actor.getInitiativeRank(false, true, { combatId: this.id, combatantId: combatant.id, malusInit })
fvttInit += (cId / 100)
@ -39,17 +39,25 @@ export class BoLCombatManager extends Combat {
if (game.user.isGM) {
let combatants = this.combatants.contents
let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char.
let updates = []
for (let c of combatants) {
//let actor = game.actors.get(c.actorId)
if (c.actor.type == "horde") {
let actor = game.actors.get(c.actorId)
updates.push({ _id: c.id, name: actor.name + " (" + actor.system.hordesize + ")" })
}
c.actor.clearRoundModifiers()
let toRemove = []
if (autoRemoveDead && c.actor.type == "encounter" && (c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) {
if (autoRemoveDead && c.actor.type == "encounter" &&
(c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) {
toRemove.push(c.id || c._id)
}
//console.log("REM", autoRemoveDead, toRemove, c.actor)
if (toRemove.length > 0) {
this.deleteEmbeddedDocuments('Combatant', toRemove)
}
if (updates.length > 0) {
this.updateEmbeddedDocuments('Combatant', updates)
}
}
}
super.nextRound()
@ -58,11 +66,19 @@ export class BoLCombatManager extends Combat {
/************************************************************************************/
startCombat() {
if (game.user.isGM) {
let updates = []
let combatants = this.combatants.contents
for (let c of combatants) {
let actor = game.actors.get(c.actorId)
actor.storeVitaliteCombat()
if (c.actor.type == "horde") {
let actor = game.actors.get(c.actorId)
updates.push({ _id: c.id, name: actor.name + " (" + actor.system.hordesize + ")" })
}
}
if (updates.length > 0) {
this.updateEmbeddedDocuments('Combatant', updates)
}
}
return super.startCombat()
}

View File

@ -238,7 +238,7 @@ export class BoLUtility {
renderTemplate('systems/bol/templates/item/post-item.hbs', chatData).then(html => {
let chatOptions = BoLUtility.chatDataSetup(html);
ChatMessage.create(chatOptions, "selfroll")
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */

View File

@ -555,7 +555,50 @@ BOL.defaultNaturalWeapon = {
"attackModifiers": 1,
"weaponSize": "unarmed",
"damage": "d6B",
"damageAttribute": "vigor",
"damageAttribute": "",
"damageModifiers": null,
"damageMultiplier": "1",
"damageReroll1": false
},
"quantity": 1,
"weight": 0,
"price": 0,
"worn": false
}
BOL.defaultHordeAttack = {
"category": "equipment",
"subtype": "weapon",
"description": "",
"properties": {
"ranged": false,
"melee": true,
"spell": false,
"protection": false,
"weapon": true,
"armor": false,
"helm": false,
"shield": false,
"equipable": false,
"consumable": false,
"magical": false,
"2H": false,
"reloadable": false,
"bow": false,
"crossbow": false,
"throwing": false,
"stackable": false,
"natural": true,
"concealable": false,
"ignoreshield": false,
"attackBonusDice": false,
"onlymodifier": true,
"attackAttribute": "vigor",
"attackAptitude": "melee",
"attackModifiers": 1,
"weaponSize": "unarmed",
"damage": "d6M",
"damageAttribute": "",
"damageModifiers": null,
"damageMultiplier": "1",
"damageReroll1": false

View File

@ -22,6 +22,7 @@ export const preloadHandlebarsTemplates = async function () {
"systems/bol/templates/actor/parts/tabs/vehicle-stats.hbs",
"systems/bol/templates/actor/parts/tabs/vehicle-description.hbs",
"systems/bol/templates/actor/parts/tabs/vehicle-weapons.hbs",
"systems/bol/templates/actor/parts/tabs/horde-description.hbs",
// ITEMS
"systems/bol/templates/item/parts/item-header.hbs",
"systems/bol/templates/item/parts/properties/feature-properties.hbs",