Compare commits
2 Commits
bol-v10.5.
...
bol-v10.5.
Author | SHA1 | Date | |
---|---|---|---|
268ac0a25a | |||
59ee6684ab |
@ -156,6 +156,7 @@
|
||||
"BOL.ui.armorAgiMalus": "Rüschtung+Schild-Malus (Geschick)",
|
||||
"BOL.ui.armorInitMalus": "Rüstungsmalus (Init)",
|
||||
"BOL.ui.attackValue": "Angriffswert",
|
||||
"BOL.ui.initMalus": "Init malus",
|
||||
|
||||
"BOL.featureCategory.origins": "Herkünfte",
|
||||
"BOL.featureCategory.races": "Rassen",
|
||||
|
@ -154,6 +154,7 @@
|
||||
"BOL.ui.armorInitMalus": "Armor Modifier (Init)",
|
||||
"BOL.ui.attackValue": "Attack Value",
|
||||
"BOL.ui.weaponbonus": "Cette arme bénéficie déja d'un Dé de Bonus (Arme Favorite prise en compte, par exemple)",
|
||||
"BOL.ui.initMalus": "Init malus",
|
||||
|
||||
"BOL.featureCategory.origins": "Origins",
|
||||
"BOL.featureCategory.races": "Races",
|
||||
|
@ -132,6 +132,7 @@
|
||||
"BOL.ui.concentrate": "Concentration à maintenir ?",
|
||||
"BOL.ui.aggressive": "Sort aggressif ?",
|
||||
"BOL.ui.registerInit": "Enregistrer comme Init. de combat",
|
||||
"BOL.ui.initMalus": "Malus d'initiative",
|
||||
"BOL.ui.magicnewrules": "Règles supplémentaires (cf. supplément fan-made Sorcellerie!)",
|
||||
|
||||
"BOL.ui.isSorcerer": "Carrière de Sorcier ?",
|
||||
@ -475,6 +476,7 @@
|
||||
"BOL.chat.applydamagetotarget": "Appliquer les dommages à la cible",
|
||||
"BOL.chat.fightoption": "Option de combat",
|
||||
"BOL.chat.reroll": "Relancer (1 P. Heroisme)",
|
||||
"BOL.chat.heroicreminder": "En plus des actions indiquées sur les boutons ci-dessous, vous pouvez : <ul><li>Carnage : Attaquer une seconde fois le même adversaire</li><li>Coup précis : Un dé de malus à votre adversaire sur une localisation choisie</li><li>Désarmement</li><li>Massacrer la piétaille</li><li>Renversement : Renversez votre adversaire (1 taille de plus max)</li></ul>Si vous dépensez un Point dh'Eheoisme en plus, tout ces effets peuvent être doublés",
|
||||
"BOL.chat.toheroic": "Transformer en succés Héroïque (1 P. Héroisme/Vilainie)",
|
||||
"BOL.chat.tolegend": "Transformer en succes Légendaire (1 P. Heroisme/Vilainie)",
|
||||
"BOL.chat.hurttitle": "{name} va encaisser {damageTotal} dégats !",
|
||||
@ -518,8 +520,8 @@
|
||||
"BOL.chat.horoscopepoints": "Coût : {points} Points d'Astrologie",
|
||||
"BOL.chat.horoscopeminorsuccess": "Votre horoscope mineur est un succès : éditez le nom de l'horoscope sur votre fiche. Vous bénéficiez d'1 dé Bonus pour cette situation.",
|
||||
"BOL.chat.horoscopeminorfailure": "Votre horoscope mineur est un échec : éditez le nom de l'horoscope sur votre fiche. Vous souffrez d'1 dé Malus pour cette situation.",
|
||||
"BOL.chat.horoscopemajorsuccess": "Votre horoscope majeur est un succès : vous bénéficiez d'1 point d'Héroisme pour cette aventure. Ce point a été ajouté automatiquement.",
|
||||
"BOL.chat.horoscopemajorfailure": "Votre horoscope majeur est un échec : vous perdez 1 point d'Héroisme pour cette aventure. Ce point a été enlevé automatiquement.",
|
||||
"BOL.chat.horoscopemajorsuccess": "Votre horoscope majeur est un succès : {horoscopeName} bénéficie d'1 point d'Héroisme de plus pour cette aventure. Ce point a été ajouté automatiquement.",
|
||||
"BOL.chat.horoscopemajorfailure": "Votre horoscope majeur est un échec : {horoscopeName} a perdu 1 point d'Héroisme pour cette aventure. Ce point a été enlevé automatiquement.",
|
||||
"BOL.chat.horoscopemajorgroupsuccess": "Votre horoscope majeur de groupe est un succès. Vous et vos amis bénéficiez de {careerBonus} dés bonus pendant cette aventure.",
|
||||
"BOL.chat.horoscopemajorgroupfailure": "Votre horoscope majeur de groupe est un échec. Vous et vos amis souffrez de {careerBonus} dés malus pendant cette aventure.",
|
||||
"BOL.chat.usedhoroscope": "Horoscope utilisé",
|
||||
@ -535,7 +537,7 @@
|
||||
"BOL.chat.criticalinfo": "C'est un succès Héroïque ou Légendaire ! Choisissez vos options et effets !",
|
||||
"BOL.chat.criticalbuttonjournal": "Succès Héroïque/Légendaire",
|
||||
|
||||
"BOL.chat.losshp": "{name}} a perdu {lossHP} points de Vitalité. Si il se repose quelques minutes, il peut récupérer {recupHP} points de Vitalité.",
|
||||
"BOL.chat.losshp": "{{name}} a perdu {lossHP} points de Vitalité. Si il se repose quelques minutes, il peut récupérer {recupHP} points de Vitalité.",
|
||||
"BOL.chat.applyrecup": "Récupérer pendant quelques minutes (+{recupHP} Vitalité)",
|
||||
"BOL.chat.inforecup": "{name} vient de récupérer {recupHP} points de Vitalité après quelques minutes de repos.",
|
||||
|
||||
|
@ -48,7 +48,13 @@ export class BoLActor extends Actor {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getInitiativeMalus() {
|
||||
if ( this.type === 'encounter' && (this.chartype == "adversary" || this.chartype == "tough")) {
|
||||
return this.system.aptitudes.init.value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getBougette() {
|
||||
if (this.type == "character") {
|
||||
@ -505,11 +511,17 @@ export class BoLActor extends Actor {
|
||||
this.createEmbeddedDocuments('Item', [horoscope])
|
||||
}
|
||||
if (rollData.horoscopeType == "major") {
|
||||
if (rollData.isSuccess) {
|
||||
this.subHeroPoints(1)
|
||||
} else {
|
||||
this.addHeroPoints(1)
|
||||
let actorHoroscope = this
|
||||
if(rollData.targetId) {
|
||||
let token = game.scenes.current.tokens.get(rollData.targetId)
|
||||
actorHoroscope = token.actor
|
||||
}
|
||||
if (rollData.isSuccess) {
|
||||
actorHoroscope.addHeroPoints(1)
|
||||
} else {
|
||||
actorHoroscope.subHeroPoints(1)
|
||||
}
|
||||
rollData.horoscopeName = actorHoroscope.name
|
||||
}
|
||||
if (rollData.horoscopeType == "majorgroup") {
|
||||
let rID = randomID(16)
|
||||
@ -800,6 +812,7 @@ export class BoLActor extends Actor {
|
||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate('systems/bol/templates/chat/chat-recup-information.hbs', {
|
||||
name: this.name,
|
||||
img: this.img,
|
||||
actorId: this.id,
|
||||
lossHP: lossHP,
|
||||
recupHP: Math.ceil(lossHP / 2)
|
||||
@ -811,7 +824,8 @@ export class BoLActor extends Actor {
|
||||
/*-------------------------------------------- */
|
||||
async applyRecuperation(recupHP) {
|
||||
let hp = duplicate(this.system.resources.hp)
|
||||
hp.value += recupHP
|
||||
//console.log("RECUP !!!!", hp, recupHP)
|
||||
hp.value += Number(recupHP)
|
||||
hp.value = Math.min(hp.value, hp.max)
|
||||
this.update({ 'system.resources.hp': hp })
|
||||
let msg = await ChatMessage.create({
|
||||
@ -863,17 +877,17 @@ export class BoLActor extends Actor {
|
||||
|
||||
/*-------------------------------------------- */
|
||||
getInitiativeRank(rollData = undefined, isCombat = false, combatData) {
|
||||
if (!rollData) {
|
||||
rollData = this.getFlag("world", "last-initiative")
|
||||
}
|
||||
let fvttInit = 4 // Pietaille par defaut
|
||||
if (this.type == 'character') {
|
||||
fvttInit = 5
|
||||
fvttInit = -1
|
||||
if (!rollData) {
|
||||
if (isCombat) {
|
||||
if (game.user.isGM ) {
|
||||
game.socket.emit("system.bol", { name: "msg_request_init_roll", data: { actorId: this.id, combatData : combatData } })
|
||||
if (this.hasPlayerOwner) {
|
||||
game.socket.emit("system.bol", { name: "msg_request_init_roll", data: { actorId: this.id, combatData } })
|
||||
} else {
|
||||
BoLRoll.aptitudeCheck(this, "init", undefined, combatData);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -122,7 +122,7 @@ Hooks.once('ready', async function () {
|
||||
BoLUtility.ready()
|
||||
BoLCharacterSummary.ready()
|
||||
|
||||
registerUsageCount('bol')
|
||||
registerUsageCount(game.system.id)
|
||||
|
||||
|
||||
welcomeMessage()
|
||||
|
@ -220,6 +220,9 @@ export class BoLRoll {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static horoscopeCheck(actor, event, horoscopeType) {
|
||||
|
||||
let target = BoLUtility.getTarget()
|
||||
|
||||
let cost = (horoscopeType == "minor") ? 1 : 2
|
||||
if (cost > actor.getAstrologyPoints()) {
|
||||
ui.notifications.warn(game.i18n.localize("BOL.ui.astrologyNoPoints"))
|
||||
@ -233,6 +236,7 @@ export class BoLRoll {
|
||||
rollData.astrologyPointsCost = cost
|
||||
rollData.label = game.i18n.localize('BOL.ui.makeHoroscope')
|
||||
rollData.description = game.i18n.localize('BOL.ui.makeHoroscope') + " " + game.i18n.localize(rollData.horoscopeTypeLabel)
|
||||
rollData.targetId = target?.id
|
||||
|
||||
console.log("HOROSCOPE!", rollData);
|
||||
return this.displayRollDialog(rollData);
|
||||
@ -580,7 +584,8 @@ export class BoLRoll {
|
||||
}
|
||||
|
||||
let diceData = BoLUtility.getDiceData()
|
||||
const modifiers = rollbase + rollData.careerBonus + rollData.mod + rollData.weaponModifier - rollData.defence - rollData.modArmorMalus + rollData.shieldMalus + rollData.attackModifier + rollData.appliedArmorMalus + rollData.effectModifier
|
||||
let malusInit = rollData.combatData?.malusInit || 0
|
||||
const modifiers = rollbase + rollData.careerBonus + rollData.mod + rollData.weaponModifier - rollData.defence - rollData.modArmorMalus + rollData.shieldMalus + rollData.attackModifier + rollData.appliedArmorMalus + rollData.effectModifier - malusInit
|
||||
const formula = (isMalus) ? rollData.nbDice + "d" + diceData.diceFormula + "kl2 + " + modifiers : rollData.nbDice + "d" + diceData.diceFormula + "kh2 + " + modifiers
|
||||
rollData.formula = formula
|
||||
rollData.modifiers = modifiers
|
||||
@ -643,10 +648,11 @@ export class BoLDefaultRoll {
|
||||
this.rollData.reroll = actor.heroReroll()
|
||||
}
|
||||
if (this.rollData.registerInit) {
|
||||
actor.registerInit(this.rollData)
|
||||
await actor.registerInit(this.rollData)
|
||||
this.rollData.initiativeRank = actor.getInitiativeRank(this.rollData)
|
||||
if (this.rollData.combatData) { // If combatData present
|
||||
let combat = game.combats.get(this.rollData.combatData.combatId)
|
||||
console.log("SET INIT!!!!!", this.rollData.initiativeRank)
|
||||
combat.setInitiative(this.rollData.combatData.combatantId, this.rollData.initiativeRank)
|
||||
}
|
||||
}
|
||||
@ -685,6 +691,7 @@ export class BoLDefaultRoll {
|
||||
flavor: msgFlavor,
|
||||
speaker: ChatMessage.getSpeaker({ actor: actor }),
|
||||
})
|
||||
this.rollData.roll = duplicate(this.rollData.roll) // Remove object, keep data (v111 ready)
|
||||
msg.setFlag("world", "bol-roll-data", this.rollData)
|
||||
})
|
||||
}
|
||||
|
@ -20,12 +20,15 @@ export class BoLCombatManager extends Combat {
|
||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
// Structure input data
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
//const currentId = this.combatant.id;
|
||||
|
||||
// Get initiative malus from tough/adversary
|
||||
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 })
|
||||
let fvttInit = combatant.actor.getInitiativeRank(false, true, { combatId: this.id, combatantId: combatant.id, malusInit })
|
||||
fvttInit += (cId / 100)
|
||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: ids[cId], initiative: fvttInit }]);
|
||||
}
|
||||
@ -33,18 +36,20 @@ export class BoLCombatManager extends Combat {
|
||||
|
||||
/************************************************************************************/
|
||||
nextRound() {
|
||||
let combatants = this.combatants.contents
|
||||
let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char.
|
||||
for (let c of combatants) {
|
||||
//let actor = game.actors.get(c.actorId)
|
||||
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) {
|
||||
toRemove.push( c.id || c._id)
|
||||
}
|
||||
//console.log("REM", autoRemoveDead, toRemove, c.actor)
|
||||
if (toRemove.length>0) {
|
||||
this.deleteEmbeddedDocuments('Combatant', toRemove)
|
||||
if (game.user.isGM) {
|
||||
let combatants = this.combatants.contents
|
||||
let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char.
|
||||
for (let c of combatants) {
|
||||
//let actor = game.actors.get(c.actorId)
|
||||
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) {
|
||||
toRemove.push(c.id || c._id)
|
||||
}
|
||||
//console.log("REM", autoRemoveDead, toRemove, c.actor)
|
||||
if (toRemove.length > 0) {
|
||||
this.deleteEmbeddedDocuments('Combatant', toRemove)
|
||||
}
|
||||
}
|
||||
}
|
||||
super.nextRound()
|
||||
@ -52,21 +57,25 @@ export class BoLCombatManager extends Combat {
|
||||
|
||||
/************************************************************************************/
|
||||
startCombat() {
|
||||
let combatants = this.combatants.contents
|
||||
for (let c of combatants) {
|
||||
let actor = game.actors.get(c.actorId)
|
||||
actor.storeVitaliteCombat()
|
||||
if (game.user.isGM) {
|
||||
let combatants = this.combatants.contents
|
||||
for (let c of combatants) {
|
||||
let actor = game.actors.get(c.actorId)
|
||||
actor.storeVitaliteCombat()
|
||||
}
|
||||
}
|
||||
return super.startCombat()
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
/*-***********************************************************************************/
|
||||
_onDelete() {
|
||||
let combatants = this.combatants.contents
|
||||
for (let c of combatants) {
|
||||
let actor = game.actors.get(c.actorId)
|
||||
actor.clearInitiative()
|
||||
actor.displayRecuperation()
|
||||
if (game.user.isGM) {
|
||||
let combatants = this.combatants.contents
|
||||
for (let c of combatants) {
|
||||
let actor = game.actors.get(c.actorId)
|
||||
actor.clearInitiative()
|
||||
actor.displayRecuperation()
|
||||
}
|
||||
}
|
||||
super._onDelete()
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ export class BoLUtility {
|
||||
onChange: lang => window.location.reload()
|
||||
})
|
||||
game.settings.register("bol", "auto-remove-dead", {
|
||||
name: "Enlever les PNJs morts automatiquement",
|
||||
hint: "Supprime les PNJ (piétaille, créatures, coriaces) automatiquement du combat lorsqu'ils sont à 0 Vitalité ou moins",
|
||||
name: "Enlever les PNJs morts automatiquement au round suivant",
|
||||
hint: "Supprime les PNJ (piétaille, créatures, coriaces) automatiquement du combat lorsqu'ils sont à 0 Vitalité ou moins, lors du passage au round suivant",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: false,
|
||||
|
@ -14,7 +14,7 @@
|
||||
],
|
||||
"url": "https://www.uberwald.me/gitea/public/bol",
|
||||
"license": "LICENSE.txt",
|
||||
"version": "10.5.14",
|
||||
"version": "10.5.16",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10"
|
||||
@ -202,7 +202,7 @@
|
||||
],
|
||||
"socket": true,
|
||||
"manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json",
|
||||
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.14.zip",
|
||||
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.16.zip",
|
||||
"background": "systems/bol/ui/page_accueil.webp",
|
||||
"gridDistance": 1.5,
|
||||
"gridUnits": "m",
|
||||
|
@ -3,5 +3,7 @@
|
||||
|
||||
{{#if isCritical}}
|
||||
<button class="chat-damage-roll bol-margin-tb-2 " data-damage-mode="damage-plus-6" data-attack-id="{{id}}">{{localize "BOL.chat.rolldamage6"}}</button>
|
||||
<button class="chat-damage-roll bol-margin-tb-2" data-damage-mode="damage-plus-12" data-attack-id="{{id}}">{{localize "BOL.chat.rolldamage12"}}</button>
|
||||
{{/if}}
|
||||
{{#if isRealCritical}}
|
||||
<button class="chat-damage-roll bol-margin-tb-2" data-damage-mode="damage-plus-12" data-attack-id="{{id}}">{{localize "BOL.chat.rolldamage12"}}</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -60,11 +60,17 @@
|
||||
<a class="content-link" draggable="true" data-uuid="Compendium.bol.aides-de-jeu.Yl1RKQb0BjVUtilk" data-id="Yl1RKQb0BjVUtilk" data-type="JournalEntry" data-pack="bol.aides-de-jeu" data-tooltip="un journal">
|
||||
<i class="fas fa-book-open"></i>{{localize "BOL.chat.criticalbuttonjournal"}}</a>
|
||||
</div>
|
||||
{{#if (and isCritical weapon)}}
|
||||
<div>
|
||||
{{{localize "BOL.chat.heroicreminder"}}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (and isSuccess weapon)}}
|
||||
{{> "systems/bol/templates/chat/rolls/attack-damage-card.hbs"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (and isSuccess spell)}}
|
||||
{{> "systems/bol/templates/chat/rolls/spell-roll-card.hbs"}}
|
||||
{{/if}}
|
||||
|
@ -11,9 +11,9 @@
|
||||
|
||||
{{#if (eq horoscopeType "major")}}
|
||||
{{#if isSuccess}}
|
||||
{{localize "BOL.chat.horoscopemajorsuccess"}}
|
||||
{{localize "BOL.chat.horoscopemajorsuccess" horoscopeName=horoscopeName}}
|
||||
{{else}}
|
||||
{{localize "BOL.chat.horoscopemajorfailure"}}
|
||||
{{localize "BOL.chat.horoscopemajorfailure" horoscopeName=horoscopeName}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
@ -22,8 +22,13 @@
|
||||
<input class="field-value" type="checkbox" name="register-init" id="register-init" checked />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flexrow" style="margin-bottom: 1px;">
|
||||
<div class="flex1 center bg-darkred">
|
||||
<label for="mod">{{localize 'BOL.ui.initMalus'}}</label>
|
||||
</div>
|
||||
<div class="flex1 center cell">{{combatData.malusInit}}</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{> "systems/bol/templates/dialogs/career-roll-part.hbs"}}
|
||||
|
Reference in New Issue
Block a user