Compare commits
5 Commits
bol-v10.5.
...
bol-v10.5.
Author | SHA1 | Date | |
---|---|---|---|
59ee6684ab | |||
41fbc094bb | |||
5b91041a3f | |||
e7f3851daa | |||
75d562f922 |
31
lang/fr.json
31
lang/fr.json
@ -459,10 +459,10 @@
|
|||||||
"BOL.chat.isdead": "{name} est mort !",
|
"BOL.chat.isdead": "{name} est mort !",
|
||||||
"BOL.chat.epitaph": "Que son nom soit honoré sur les champs de batailles de Lémurie !",
|
"BOL.chat.epitaph": "Que son nom soit honoré sur les champs de batailles de Lémurie !",
|
||||||
"BOL.chat.vitalityzero": "La Vitalité de {name} est {hp} : il va s'écrouler au sol et sombrer dans l'inconscience !",
|
"BOL.chat.vitalityzero": "La Vitalité de {name} est {hp} : il va s'écrouler au sol et sombrer dans l'inconscience !",
|
||||||
"BOL.chat.vitalityheroism": "Vous pouvez dépenser 1 Point d'Héroisme pour reprendre vos esprits pendant 1 round.",
|
"BOL.chat.vitalityheroism": "Vous pouvez dépenser 1 Point d'Héroisme/Vilainie pour reprendre vos esprits pendant 1 round.",
|
||||||
"BOL.chat.vitalityheroismhint": "Dans ce cas votre vitalité remonte à son maximum divisé par 2 (arrondi au supérieur).",
|
"BOL.chat.vitalityheroismhint": "Dans ce cas votre vitalité remonte à son maximum divisé par 2 (arrondi au supérieur).",
|
||||||
"BOL.chat.vitalitydying": "La Vitalité de {name} est de {hp} ! Il est mourant ...",
|
"BOL.chat.vitalitydying": "La Vitalité de {name} est de {hp} ! Il est mourant ...",
|
||||||
"BOL.chat.vitalitydyingheroism": "Vous pouvez cependant dépenser 1 Point d'Héroisme pour Défier la Mort (cf. page 58).",
|
"BOL.chat.vitalitydyingheroism": "Vous pouvez cependant dépenser 1 Point d'Héroisme/Vilainie pour Défier la Mort (cf. page 58).",
|
||||||
"BOL.chat.alchemytitle": "Préparation Alchimique : {name}",
|
"BOL.chat.alchemytitle": "Préparation Alchimique : {name}",
|
||||||
"BOL.chat.alchemypoints": "Points de Création Investis : {pcCostCurrent}",
|
"BOL.chat.alchemypoints": "Points de Création Investis : {pcCostCurrent}",
|
||||||
"BOL.chat.alchemysuccess": "La préparation alchimique a été réalisée avec succès !<br>Créez l'item ou l'effet correspondant dans votre Inventaire.<br>L'avancement dans la préparation a été remis à 0.",
|
"BOL.chat.alchemysuccess": "La préparation alchimique a été réalisée avec succès !<br>Créez l'item ou l'effet correspondant dans votre Inventaire.<br>L'avancement dans la préparation a été remis à 0.",
|
||||||
@ -475,19 +475,20 @@
|
|||||||
"BOL.chat.applydamagetotarget": "Appliquer les dommages à la cible",
|
"BOL.chat.applydamagetotarget": "Appliquer les dommages à la cible",
|
||||||
"BOL.chat.fightoption": "Option de combat",
|
"BOL.chat.fightoption": "Option de combat",
|
||||||
"BOL.chat.reroll": "Relancer (1 P. Heroisme)",
|
"BOL.chat.reroll": "Relancer (1 P. Heroisme)",
|
||||||
"BOL.chat.toheroic": "Transformer en succés Héroïque (1 P. Héroisme)",
|
"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.tolegend": "Transformer en succes Légendaire (1 P. Heroisme)",
|
"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 !",
|
"BOL.chat.hurttitle": "{name} va encaisser {damageTotal} dégats !",
|
||||||
"BOL.chat.armordefault": "C'est une attaque au défaut de l'armure : vous devez encaisser SANS la protection de l'armure !",
|
"BOL.chat.armordefault": "C'est une attaque au défaut de l'armure : vous devez encaisser SANS la protection de l'armure !",
|
||||||
"BOL.chat.witharmor": "Encaisser avec la protection de l'armure",
|
"BOL.chat.witharmor": "Encaisser avec la protection de l'armure",
|
||||||
"BOL.chat.withoutarmor": "Encaisser sans la protection de l'armure",
|
"BOL.chat.withoutarmor": "Encaisser sans la protection de l'armure",
|
||||||
"BOL.chat.shakeoff": "Juste une égratignure (1 Point d'Héroisme)",
|
"BOL.chat.shakeoff": "Juste une égratignure (1 Point d'Héroisme/Vilainie)",
|
||||||
"BOL.chat.splinteredshield": "Parade in Extremis avec {name} (1 Point d'Héroisme)",
|
"BOL.chat.splinteredshield": "Parade in Extremis avec {name} (1 Point d'Héroisme/Vilainie)",
|
||||||
"BOL.chat.damagesummary": "Dégats subis par {name}",
|
"BOL.chat.damagesummary": "Dégats subis par {name}",
|
||||||
"BOL.chat.protectvalue": "Protection de l'armure",
|
"BOL.chat.protectvalue": "Protection de l'armure",
|
||||||
"BOL.chat.noprotectvalue": "Aucune protection d'armure !",
|
"BOL.chat.noprotectvalue": "Aucune protection d'armure !",
|
||||||
"BOL.chat.heroreducedamage": "Un point d'héroisme dépensé, pour une réduction des dommages supplémentaire de {total}.",
|
"BOL.chat.heroreducedamage": "Un point d'héroisme/vilainie dépensé, pour une réduction des dommages supplémentaire de {total}.",
|
||||||
"BOL.chat.herosplintered": "Aucun dommage encaissé, grâce à la parade in-extremis avec {weaponHero.name}. L'arme a été détruite pendant cette parade ! Un point d'héroisme a également été dépensé.",
|
"BOL.chat.herosplintered": "Aucun dommage encaissé, grâce à la parade in-extremis avec {weaponHero.name}. L'arme a été détruite pendant cette parade ! Un point d'héroisme/vilainie a également été dépensé.",
|
||||||
"BOL.chat.finaldamage": "Encaissement final : {finalDamage} dégats !",
|
"BOL.chat.finaldamage": "Encaissement final : {finalDamage} dégats !",
|
||||||
"BOL.chat.spell": "Sort",
|
"BOL.chat.spell": "Sort",
|
||||||
"BOL.chat.spellcost": "Cout en Points de Pouvoir",
|
"BOL.chat.spellcost": "Cout en Points de Pouvoir",
|
||||||
@ -518,24 +519,24 @@
|
|||||||
"BOL.chat.horoscopepoints": "Coût : {points} Points d'Astrologie",
|
"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.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.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.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 : vous perdez 1 point d'Héroisme pour cette aventure. Ce point a été enlevé 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.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.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é",
|
"BOL.chat.usedhoroscope": "Horoscope utilisé",
|
||||||
"BOL.chat.horoscopedeleted": "Le(s) Horoscopes utilisé(s) a/ont été supprimé(s) automatiquement.",
|
"BOL.chat.horoscopedeleted": "Le(s) Horoscopes utilisé(s) a/ont été supprimé(s) automatiquement.",
|
||||||
"BOL.chat.criticaloptions": "Succès critique !! Vous pouvez faire (1 option au choix) :",
|
"BOL.chat.criticaloptions": "Succès critique !! Vous pouvez faire (1 option au choix) :",
|
||||||
"BOL.chat.criticalcarnage": "Faire un Carnage : vous avez une attaque gratuite supplémentaire. Cette seconde attaque ne peut bénéficier d'un Point d'Héroisme.",
|
"BOL.chat.criticalcarnage": "Faire un Carnage : vous avez une attaque gratuite supplémentaire. Cette seconde attaque ne peut bénéficier d'un Point d'Héroisme/vilainie.",
|
||||||
"BOL.chat.criticalplus6": "Coup Dévastateur : +6 aux dommages (cf bouton ci-dessous).",
|
"BOL.chat.criticalplus6": "Coup Dévastateur : +6 aux dommages (cf bouton ci-dessous).",
|
||||||
"BOL.chat.criticalprecise": "Coup Précis : Vous frappez pour diminuer les capacités de votre adversaire. Décrivez ce que vous faites, et si le MJ l'accepte, votre opposant subira un Dé de Malus pour les actions concernées.",
|
"BOL.chat.criticalprecise": "Coup Précis : Vous frappez pour diminuer les capacités de votre adversaire. Décrivez ce que vous faites, et si le MJ l'accepte, votre opposant subira un Dé de Malus pour les actions concernées.",
|
||||||
"BOL.chat.criticalunarm": "Désarmement : Si votre adversaire a une arme en main, vous le désarmez.",
|
"BOL.chat.criticalunarm": "Désarmement : Si votre adversaire a une arme en main, vous le désarmez.",
|
||||||
"BOL.chat.criticalrabble": "Massacrer la piétaille : Si vous combattez de la Piétaille, les résultats des dommages indiquent le nombre d'adversaires mis hors de combat.",
|
"BOL.chat.criticalrabble": "Massacrer la piétaille : Si vous combattez de la Piétaille, les résultats des dommages indiquent le nombre d'adversaires mis hors de combat.",
|
||||||
"BOL.chat.criticalpush": "Renversement : Si la taille le permet, vous poussez votre adversaire au sol, il souffrira d'1 Dé de Malus pour toutes ses actions au round suivant.",
|
"BOL.chat.criticalpush": "Renversement : Si la taille le permet, vous poussez votre adversaire au sol, il souffrira d'1 Dé de Malus pour toutes ses actions au round suivant.",
|
||||||
"BOL.chat.criticalup": "Transformer en Légendaire : En dépensant 1 point d'Héroisme, vous pouvez transformer ce Succès Héroïque en Légendaire, qui vous permet de prendre 2 options dans la liste ci-dessus (cf. bouton pour un +12 aux dommages par exemple).",
|
"BOL.chat.criticalup": "Transformer en Légendaire : En dépensant 1 point d'Héroisme/Vilainie, vous pouvez transformer ce Succès Héroïque en Légendaire, qui vous permet de prendre 2 options dans la liste ci-dessus (cf. bouton pour un +12 aux dommages par exemple).",
|
||||||
"BOL.chat.criticalinfo": "C'est un succès Héroïque ou Légendaire ! Choisissez vos options et effets !",
|
"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.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.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.",
|
"BOL.chat.inforecup": "{name} vient de récupérer {recupHP} points de Vitalité après quelques minutes de repos.",
|
||||||
|
|
||||||
@ -577,6 +578,6 @@
|
|||||||
"BOL.chat.welcome3": "Les cartes intégrées au système le sont grace à l'aimable autorisation de leur auteur Guillaume Tavernier et des éditions Ludospherik. Merci à eux !.",
|
"BOL.chat.welcome3": "Les cartes intégrées au système le sont grace à l'aimable autorisation de leur auteur Guillaume Tavernier et des éditions Ludospherik. Merci à eux !.",
|
||||||
"BOL.chat.welcome4": "Tout le support et le suivi de ce système est disponible via le <a href='https://discord.gg/pPSDNJk'>Discord Foundry FR</a>.",
|
"BOL.chat.welcome4": "Tout le support et le suivi de ce système est disponible via le <a href='https://discord.gg/pPSDNJk'>Discord Foundry FR</a>.",
|
||||||
"BOL.chat.welcome5": "Consulter l'aide en ligne pour plus d'informations : @UUID[Compendium.bol.aides-de-jeu.97rugQOtiwt8zPfQ]{Aide du Jeu}.",
|
"BOL.chat.welcome5": "Consulter l'aide en ligne pour plus d'informations : @UUID[Compendium.bol.aides-de-jeu.97rugQOtiwt8zPfQ]{Aide du Jeu}.",
|
||||||
"BOL.chat.welcome6": "Bon jeu en Lemurie !"
|
"BOL.chat.welcome6": "Bon jeu en Lemurie !",
|
||||||
|
"BOL.chat.nodamage": "Ne pas appliquer les dommages"
|
||||||
}
|
}
|
@ -22,6 +22,17 @@ export class BoLActor extends Actor {
|
|||||||
super.prepareData()
|
super.prepareData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
isHeroAdversary() {
|
||||||
|
if (this.type === 'character') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.type === 'encounter' && this.chartype == "adversary") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getCharType() {
|
getCharType() {
|
||||||
if (this.type === 'character') {
|
if (this.type === 'character') {
|
||||||
@ -32,10 +43,10 @@ export class BoLActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getVillainy() {
|
getVillainy() {
|
||||||
if (this.type === 'character') {
|
if (this.type === 'encounter' && this.chartype == "adversary") {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -74,11 +85,13 @@ export class BoLActor extends Actor {
|
|||||||
if (this.type == 'character') {
|
if (this.type == 'character') {
|
||||||
let newVitality = 10 + this.system.attributes.vigor.value + this.system.resources.hp.bonus
|
let newVitality = 10 + this.system.attributes.vigor.value + this.system.resources.hp.bonus
|
||||||
if (this.system.resources.hp.max != newVitality) {
|
if (this.system.resources.hp.max != newVitality) {
|
||||||
this.update({ 'system.resources.hp.max': newVitality })
|
let actor = this
|
||||||
|
setTimeout( function() { actor.update({ 'system.resources.hp.max': newVitality }) }, 800 )
|
||||||
}
|
}
|
||||||
let newPower = 10 + this.system.attributes.mind.value + this.system.resources.power.bonus
|
let newPower = 10 + this.system.attributes.mind.value + this.system.resources.power.bonus
|
||||||
if (this.system.resources.power.max != newPower) {
|
if (this.system.resources.power.max != newPower) {
|
||||||
this.update({ 'system.resources.power.max': newPower })
|
let actor = this
|
||||||
|
setTimeout( function() { actor.update({ 'system.resources.power.max': newPower }) }, 800 )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,8 +102,10 @@ export class BoLActor extends Actor {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
super.prepareDerivedData()
|
super.prepareDerivedData()
|
||||||
this.updateResourcesData()
|
if (this.id) {
|
||||||
this.manageHealthState();
|
this.updateResourcesData()
|
||||||
|
this.manageHealthState()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,11 +113,29 @@ export class BoLActor extends Actor {
|
|||||||
get details() {
|
get details() {
|
||||||
return this.system.details
|
return this.system.details
|
||||||
}
|
}
|
||||||
|
addEffectModifiers( myList, dataPath) {
|
||||||
|
for (let attr of myList) {
|
||||||
|
attr.numModifier = 0
|
||||||
|
attr.diceModifier = ""
|
||||||
|
let effects = this.items.filter( i => i.type === "feature" && i.system.subtype === "boleffect" && i.system.properties.identifier == dataPath+attr.key)
|
||||||
|
for (let effect of effects) {
|
||||||
|
if ( Number(effect.system.properties.modifier)) {
|
||||||
|
attr.numModifier += Number(effect.system.properties.modifier)
|
||||||
|
} else {
|
||||||
|
attr.diceModifier += "+"+effect.system.properties.modifier
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
get attributes() {
|
get attributes() {
|
||||||
return Object.values(this.system.attributes)
|
let attrList = duplicate(Object.values(this.system.attributes))
|
||||||
|
this.addEffectModifiers(attrList, "system.attributes.")
|
||||||
|
return attrList
|
||||||
}
|
}
|
||||||
get aptitudes() {
|
get aptitudes() {
|
||||||
return Object.values(this.system.aptitudes)
|
let aptList = Object.values(this.system.aptitudes)
|
||||||
|
this.addEffectModifiers(aptList, "system.aptitudes.")
|
||||||
|
return aptList
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -230,19 +263,18 @@ export class BoLActor extends Actor {
|
|||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
get armorMalusValue() { // used for Fight Options
|
get armorMalusValue() { // used for Fight Options
|
||||||
for (let armor of this.armors) {
|
for (let armor of this.armors) {
|
||||||
if (armor.system.properties.armorQuality.includes("light")) {
|
if (armor.system.properties.armorQuality?.includes("light")) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
if (armor.system.properties.armorQuality.includes("medium")) {
|
if (armor.system.properties.armorQuality?.includes("medium")) {
|
||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
if (armor.system.properties.armorQuality.includes("heavy")) {
|
if (armor.system.properties.armorQuality?.includes("heavy")) {
|
||||||
return 3
|
return 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
get resources() {
|
get resources() {
|
||||||
return Object.values(this.system.resources)
|
return Object.values(this.system.resources)
|
||||||
}
|
}
|
||||||
@ -473,11 +505,17 @@ export class BoLActor extends Actor {
|
|||||||
this.createEmbeddedDocuments('Item', [horoscope])
|
this.createEmbeddedDocuments('Item', [horoscope])
|
||||||
}
|
}
|
||||||
if (rollData.horoscopeType == "major") {
|
if (rollData.horoscopeType == "major") {
|
||||||
if (rollData.isSuccess) {
|
let actorHoroscope = this
|
||||||
this.subHeroPoints(1)
|
if(rollData.targetId) {
|
||||||
} else {
|
let token = game.scenes.current.tokens.get(rollData.targetId)
|
||||||
this.addHeroPoints(1)
|
actorHoroscope = token.actor
|
||||||
}
|
}
|
||||||
|
if (rollData.isSuccess) {
|
||||||
|
actorHoroscope.addHeroPoints(1)
|
||||||
|
} else {
|
||||||
|
actorHoroscope.subHeroPoints(1)
|
||||||
|
}
|
||||||
|
rollData.horoscopeName = actorHoroscope.name
|
||||||
}
|
}
|
||||||
if (rollData.horoscopeType == "majorgroup") {
|
if (rollData.horoscopeType == "majorgroup") {
|
||||||
let rID = randomID(16)
|
let rID = randomID(16)
|
||||||
@ -734,7 +772,7 @@ export class BoLActor extends Actor {
|
|||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
|
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
|
||||||
content: await renderTemplate('systems/bol/templates/chat/chat-vitality-zero.hbs', { name: this.name, img: this.img, hp: this.system.resources.hp.value })
|
content: await renderTemplate('systems/bol/templates/chat/chat-vitality-zero.hbs', { name: this.name, img: this.img, hp: this.system.resources.hp.value, isHeroAdversary: this.isHeroAdversary() })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (prone) {
|
if (prone) {
|
||||||
@ -768,6 +806,7 @@ export class BoLActor extends Actor {
|
|||||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
|
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
|
||||||
content: await renderTemplate('systems/bol/templates/chat/chat-recup-information.hbs', {
|
content: await renderTemplate('systems/bol/templates/chat/chat-recup-information.hbs', {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
img: this.img,
|
||||||
actorId: this.id,
|
actorId: this.id,
|
||||||
lossHP: lossHP,
|
lossHP: lossHP,
|
||||||
recupHP: Math.ceil(lossHP / 2)
|
recupHP: Math.ceil(lossHP / 2)
|
||||||
@ -779,7 +818,8 @@ export class BoLActor extends Actor {
|
|||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
async applyRecuperation(recupHP) {
|
async applyRecuperation(recupHP) {
|
||||||
let hp = duplicate(this.system.resources.hp)
|
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)
|
hp.value = Math.min(hp.value, hp.max)
|
||||||
this.update({ 'system.resources.hp': hp })
|
this.update({ 'system.resources.hp': hp })
|
||||||
let msg = await ChatMessage.create({
|
let msg = await ChatMessage.create({
|
||||||
@ -801,6 +841,33 @@ export class BoLActor extends Actor {
|
|||||||
}
|
}
|
||||||
return game.bol.config.creatureSize["medium"].order // Medium size per default
|
return game.bol.config.creatureSize["medium"].order // Medium size per default
|
||||||
}
|
}
|
||||||
|
/*-------------------------------------------- */
|
||||||
|
checkNumeric(myObject) {
|
||||||
|
if ( myObject) {
|
||||||
|
for (let key in myObject) {
|
||||||
|
if ( myObject[key].value === null ) {
|
||||||
|
myObject[key].value = 0
|
||||||
|
}
|
||||||
|
if ( myObject[key].value === NaN ) {
|
||||||
|
myObject[key].value = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-------------------------------------------- */
|
||||||
|
_preUpdate(data, options, userId) {
|
||||||
|
if (data.system?.attributes) {
|
||||||
|
this.checkNumeric(data.system.attributes)
|
||||||
|
}
|
||||||
|
if (data.system?.aptitudes) {
|
||||||
|
this.checkNumeric(data.system.aptitudes)
|
||||||
|
}
|
||||||
|
if (data.system?.resources) {
|
||||||
|
this.checkNumeric(data.system.resources)
|
||||||
|
}
|
||||||
|
super._preUpdate(data, options, userId)
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
getInitiativeRank(rollData = undefined, isCombat = false, combatData) {
|
getInitiativeRank(rollData = undefined, isCombat = false, combatData) {
|
||||||
@ -810,11 +877,12 @@ export class BoLActor extends Actor {
|
|||||||
let fvttInit = 4 // Pietaille par defaut
|
let fvttInit = 4 // Pietaille par defaut
|
||||||
if (this.type == 'character') {
|
if (this.type == 'character') {
|
||||||
fvttInit = 5
|
fvttInit = 5
|
||||||
if (!rollData) {
|
|
||||||
fvttInit = -1
|
fvttInit = -1
|
||||||
|
if (!rollData) {
|
||||||
if (isCombat) {
|
if (isCombat) {
|
||||||
ui.notifications.info(game.i18n.localize("BOL.ui.warninitiative"))
|
if (game.user.isGM ) {
|
||||||
BoLRoll.aptitudeCheck(this, "init", undefined, combatData)
|
game.socket.emit("system.bol", { name: "msg_request_init_roll", data: { actorId: this.id, combatData : combatData } })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (rollData.isLegendary) {
|
if (rollData.isLegendary) {
|
||||||
|
@ -122,7 +122,7 @@ Hooks.once('ready', async function () {
|
|||||||
BoLUtility.ready()
|
BoLUtility.ready()
|
||||||
BoLCharacterSummary.ready()
|
BoLCharacterSummary.ready()
|
||||||
|
|
||||||
registerUsageCount('bol')
|
registerUsageCount(game.system.id)
|
||||||
|
|
||||||
|
|
||||||
welcomeMessage()
|
welcomeMessage()
|
||||||
|
@ -220,6 +220,9 @@ export class BoLRoll {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static horoscopeCheck(actor, event, horoscopeType) {
|
static horoscopeCheck(actor, event, horoscopeType) {
|
||||||
|
|
||||||
|
let target = BoLUtility.getTarget()
|
||||||
|
|
||||||
let cost = (horoscopeType == "minor") ? 1 : 2
|
let cost = (horoscopeType == "minor") ? 1 : 2
|
||||||
if (cost > actor.getAstrologyPoints()) {
|
if (cost > actor.getAstrologyPoints()) {
|
||||||
ui.notifications.warn(game.i18n.localize("BOL.ui.astrologyNoPoints"))
|
ui.notifications.warn(game.i18n.localize("BOL.ui.astrologyNoPoints"))
|
||||||
@ -233,6 +236,7 @@ export class BoLRoll {
|
|||||||
rollData.astrologyPointsCost = cost
|
rollData.astrologyPointsCost = cost
|
||||||
rollData.label = game.i18n.localize('BOL.ui.makeHoroscope')
|
rollData.label = game.i18n.localize('BOL.ui.makeHoroscope')
|
||||||
rollData.description = game.i18n.localize('BOL.ui.makeHoroscope') + " " + game.i18n.localize(rollData.horoscopeTypeLabel)
|
rollData.description = game.i18n.localize('BOL.ui.makeHoroscope') + " " + game.i18n.localize(rollData.horoscopeTypeLabel)
|
||||||
|
rollData.targetId = target?.id
|
||||||
|
|
||||||
console.log("HOROSCOPE!", rollData);
|
console.log("HOROSCOPE!", rollData);
|
||||||
return this.displayRollDialog(rollData);
|
return this.displayRollDialog(rollData);
|
||||||
@ -284,7 +288,7 @@ export class BoLRoll {
|
|||||||
for (let effect of this.rollData.bolApplicableEffects) {
|
for (let effect of this.rollData.bolApplicableEffects) {
|
||||||
if (effect.system.properties.modifier == "1B") {
|
if (effect.system.properties.modifier == "1B") {
|
||||||
this.rollData.bmDice++;
|
this.rollData.bmDice++;
|
||||||
} else if (effect.system.properties.modifier == "1B") {
|
} else if (effect.system.properties.modifier == "2B") {
|
||||||
this.rollData.bmDice += 2;
|
this.rollData.bmDice += 2;
|
||||||
} else if (effect.system.properties.modifier == "1M") {
|
} else if (effect.system.properties.modifier == "1M") {
|
||||||
this.rollData.bmDice--;
|
this.rollData.bmDice--;
|
||||||
@ -523,6 +527,7 @@ export class BoLRoll {
|
|||||||
rollData.nbBoons = 0
|
rollData.nbBoons = 0
|
||||||
rollData.nbFlaws = 0
|
rollData.nbFlaws = 0
|
||||||
rollData.nbDice = 0
|
rollData.nbDice = 0
|
||||||
|
rollData.isHeroAdversary = actor.isHeroAdversary()
|
||||||
if (rollData.shieldBlock == 'blockall') {
|
if (rollData.shieldBlock == 'blockall') {
|
||||||
rollData.shieldMalus = rollData.shieldAttackMalus;
|
rollData.shieldMalus = rollData.shieldAttackMalus;
|
||||||
} else {
|
} else {
|
||||||
@ -677,13 +682,14 @@ export class BoLDefaultRoll {
|
|||||||
async sendChatMessage() {
|
async sendChatMessage() {
|
||||||
let actor = BoLUtility.getActorFromRollData(this.rollData)
|
let actor = BoLUtility.getActorFromRollData(this.rollData)
|
||||||
this._buildChatMessage(this.rollData).then(async msgFlavor => {
|
this._buildChatMessage(this.rollData).then(async msgFlavor => {
|
||||||
|
//console.log("MSG", msgFlavor )
|
||||||
let msg = await this.rollData.roll.toMessage({
|
let msg = await this.rollData.roll.toMessage({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
rollMode: game.settings.get("core", "rollMode"),
|
rollMode: game.settings.get("core", "rollMode"),
|
||||||
//whisper: BoLUtility.getWhisperRecipientsAndGMs(this.rollData.actor.name),
|
|
||||||
flavor: msgFlavor,
|
flavor: msgFlavor,
|
||||||
speaker: ChatMessage.getSpeaker({ actor: actor }),
|
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)
|
msg.setFlag("world", "bol-roll-data", this.rollData)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export class BoLCombatManager extends Combat {
|
|||||||
// calculate initiative
|
// 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])
|
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 })
|
||||||
fvttInit += (cId / 100)
|
fvttInit += (cId / 100)
|
||||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: ids[cId], initiative: fvttInit }]);
|
await this.updateEmbeddedDocuments("Combatant", [{ _id: ids[cId], initiative: fvttInit }]);
|
||||||
}
|
}
|
||||||
@ -33,34 +33,49 @@ export class BoLCombatManager extends Combat {
|
|||||||
|
|
||||||
/************************************************************************************/
|
/************************************************************************************/
|
||||||
nextRound() {
|
nextRound() {
|
||||||
let combatants = this.combatants.contents
|
if (game.user.isGM) {
|
||||||
for (let c of combatants) {
|
let combatants = this.combatants.contents
|
||||||
let actor = game.actors.get( c.actorId )
|
let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char.
|
||||||
actor.clearRoundModifiers()
|
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()
|
super.nextRound()
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************/
|
/************************************************************************************/
|
||||||
startCombat() {
|
startCombat() {
|
||||||
let combatants = this.combatants.contents
|
if (game.user.isGM) {
|
||||||
for (let c of combatants) {
|
let combatants = this.combatants.contents
|
||||||
let actor = game.actors.get( c.actorId )
|
for (let c of combatants) {
|
||||||
actor.storeVitaliteCombat()
|
let actor = game.actors.get(c.actorId)
|
||||||
|
actor.storeVitaliteCombat()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.startCombat()
|
return super.startCombat()
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************/
|
/************************************************************************************/
|
||||||
_onDelete() {
|
_onDelete() {
|
||||||
let combatants = this.combatants.contents
|
if (game.user.isGM) {
|
||||||
for (let c of combatants) {
|
let combatants = this.combatants.contents
|
||||||
let actor = game.actors.get(c.actorId)
|
for (let c of combatants) {
|
||||||
actor.clearInitiative()
|
let actor = game.actors.get(c.actorId)
|
||||||
actor.displayRecuperation()
|
actor.clearInitiative()
|
||||||
|
actor.displayRecuperation()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super._onDelete()
|
super._onDelete()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
|
import { BoLRoll, BoLDefaultRoll } from "../controllers/bol-rolls.js";
|
||||||
|
|
||||||
// Spell circle to min PP cost
|
// Spell circle to min PP cost
|
||||||
const __circle2minpp = { 0: 0, 1: 2, 2: 6, 3: 11 }
|
const __circle2minpp = { 0: 0, 1: 2, 2: 6, 3: 11 }
|
||||||
@ -26,12 +26,20 @@ export class BoLUtility {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
onChange: lang => window.location.reload()
|
onChange: lang => window.location.reload()
|
||||||
})
|
})
|
||||||
|
game.settings.register("bol", "auto-remove-dead", {
|
||||||
|
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,
|
||||||
|
type: Boolean
|
||||||
|
})
|
||||||
game.settings.register("bol", "dice-formula", {
|
game.settings.register("bol", "dice-formula", {
|
||||||
name: "Formule de dés",
|
name: "Formule de dés",
|
||||||
hint: "Sélectionne la formule de dés (par défaut 2d6)",
|
hint: "Sélectionne la formule de dés (par défaut 2d6)",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
config: true,
|
config: true,
|
||||||
default: "2d6",
|
default: "6",
|
||||||
type: String,
|
type: String,
|
||||||
choices: { "6": "2d6", "8":"2d8", "10":"2d10", "12":"2d12", "20":"2d20"},
|
choices: { "6": "2d6", "8":"2d8", "10":"2d10", "12":"2d12", "20":"2d20"},
|
||||||
onChange: value => {
|
onChange: value => {
|
||||||
@ -149,7 +157,7 @@ export class BoLUtility {
|
|||||||
df = "6"
|
df = "6"
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
diceFormula: this.diceFormula,
|
diceFormula: df,
|
||||||
successValue : this.successValue,
|
successValue : this.successValue,
|
||||||
criticalSuccessValue: this.criticalSuccessValue,
|
criticalSuccessValue: this.criticalSuccessValue,
|
||||||
criticalFailureValue: this.criticalFailureValue
|
criticalFailureValue: this.criticalFailureValue
|
||||||
@ -191,29 +199,6 @@ export class BoLUtility {
|
|||||||
CONFIG.statusEffects = duplicate(game.bol.config.statusEffects)
|
CONFIG.statusEffects = duplicate(game.bol.config.statusEffects)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static templateData(it) {
|
|
||||||
return BoLUtility.data(it)?.data ?? {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static data(it) {
|
|
||||||
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
|
|
||||||
return it.data;
|
|
||||||
}
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static storeRoll(roll) {
|
|
||||||
this.rollTab[roll.id] = roll
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static getRoll(rollId) {
|
|
||||||
return this.rollTab[roll.id]
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static createDirectOptionList(min, max) {
|
static createDirectOptionList(min, max) {
|
||||||
let options = {};
|
let options = {};
|
||||||
@ -258,7 +243,7 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getUsers(filter) {
|
static getUsers(filter) {
|
||||||
return game.users.filter(filter).map(user => user.data._id);
|
return game.users.filter(filter).map(user => user.id);
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getWhisperRecipients(rollMode, name) {
|
static getWhisperRecipients(rollMode, name) {
|
||||||
@ -328,6 +313,14 @@ export class BoLUtility {
|
|||||||
let message = game.messages.get(messageId)
|
let message = game.messages.get(messageId)
|
||||||
return message.getFlag("world", "bol-roll-data")
|
return message.getFlag("world", "bol-roll-data")
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static requestInitRoll(actorId, combatData ) {
|
||||||
|
let actor = game.actors.get( actorId )
|
||||||
|
if (actor && actor.isOwner) {
|
||||||
|
ui.notifications.info(game.i18n.localize("BOL.ui.warninitiative"))
|
||||||
|
BoLRoll.aptitudeCheck(actor, "init", undefined, combatData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static cleanupButtons(id) {
|
static cleanupButtons(id) {
|
||||||
@ -422,14 +415,14 @@ export class BoLUtility {
|
|||||||
console.log("Damage Handling", attackId, defenseMode, weaponId)
|
console.log("Damage Handling", attackId, defenseMode, weaponId)
|
||||||
// Only GM process this
|
// Only GM process this
|
||||||
if (rollData && rollData.defenderId) {
|
if (rollData && rollData.defenderId) {
|
||||||
if (rollData.defenseDone) {
|
if (rollData.defenseDone || defenseMode == 'damage-not-applied') {
|
||||||
return
|
return
|
||||||
} // ?? Why ???
|
} // ?? Why ???
|
||||||
rollData.defenseDone = true
|
rollData.defenseDone = true
|
||||||
rollData.defenseMode = defenseMode
|
rollData.defenseMode = defenseMode
|
||||||
let token = game.scenes.current.tokens.get(rollData.targetId)
|
let token = game.scenes.current.tokens.get(rollData.targetId)
|
||||||
let defender = token.actor
|
let defender = token.actor
|
||||||
|
|
||||||
if (defenseMode == 'damage-with-armor') {
|
if (defenseMode == 'damage-with-armor') {
|
||||||
let armorFormula = defender.getArmorFormula()
|
let armorFormula = defender.getArmorFormula()
|
||||||
rollData.rollArmor = new Roll(armorFormula)
|
rollData.rollArmor = new Roll(armorFormula)
|
||||||
@ -522,7 +515,7 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isRangedWeapon(weapon) {
|
static isRangedWeapon(weapon) {
|
||||||
return weapon.data.type == 'ranged' || weapon.data.thrown;
|
return weapon.system.type == 'ranged' || weapon.system.thrown;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -597,6 +590,9 @@ export class BoLUtility {
|
|||||||
if (sockmsg.name == "msg_cleanup_buttons") {
|
if (sockmsg.name == "msg_cleanup_buttons") {
|
||||||
$(`#${sockmsg.data.id}`).hide() // Hide the options roll buttons
|
$(`#${sockmsg.data.id}`).hide() // Hide the options roll buttons
|
||||||
}
|
}
|
||||||
|
if (sockmsg.name == "msg_request_init_roll") {
|
||||||
|
this.requestInitRoll( sockmsg.data.actorId, sockmsg.data.combatData)
|
||||||
|
}
|
||||||
if (sockmsg.name == "msg_damage_handling") {
|
if (sockmsg.name == "msg_damage_handling") {
|
||||||
BoLUtility.processDamageHandling(sockmsg.data.attackId, sockmsg.data.defenseMode, sockmsg.data.weaponId, sockmsg.data.msgId)
|
BoLUtility.processDamageHandling(sockmsg.data.attackId, sockmsg.data.defenseMode, sockmsg.data.weaponId, sockmsg.data.msgId)
|
||||||
}
|
}
|
||||||
@ -604,15 +600,15 @@ export class BoLUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static computeSpellCost(spell, nbOptCond = 0) {
|
static computeSpellCost(spell, nbOptCond = 0) {
|
||||||
let pp = spell.data.properties.ppcost
|
let pp = spell.system.properties.ppcost
|
||||||
let minpp = __circle2minpp[spell.data.properties.circle]
|
let minpp = __circle2minpp[spell.system.properties.circle]
|
||||||
pp = (pp - nbOptCond < minpp) ? minpp : pp - nbOptCond
|
pp = (pp - nbOptCond < minpp) ? minpp : pp - nbOptCond
|
||||||
return pp
|
return pp
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getDamageFormula(weaponData, fightOption) {
|
static getDamageFormula(weaponData, fightOption) {
|
||||||
let upgradeDamage = (fightOption && fightOption.data.properties.fightoptiontype == "twoweaponsatt")
|
let upgradeDamage = (fightOption && fightOption.system.properties.fightoptiontype == "twoweaponsatt")
|
||||||
let damageString = weaponData.properties.damage
|
let damageString = weaponData.properties.damage
|
||||||
let modifier = weaponData.properties.damageModifiers ?? 0
|
let modifier = weaponData.properties.damageModifiers ?? 0
|
||||||
let multiplier = weaponData.properties.damageMultiplier ?? 1
|
let multiplier = weaponData.properties.damageMultiplier ?? 1
|
||||||
|
@ -118,7 +118,7 @@ export const registerHandlebarsHelpers = function () {
|
|||||||
})
|
})
|
||||||
Handlebars.registerHelper('includesKey', function (items, type, key) {
|
Handlebars.registerHelper('includesKey', function (items, type, key) {
|
||||||
// console.log(items);
|
// console.log(items);
|
||||||
return items.filter(i => i.type === type).map(i => i.data.key).includes(key);
|
return items.filter(i => i.type === type).map(i => i.system.key).includes(key);
|
||||||
})
|
})
|
||||||
Handlebars.registerHelper('includes', function (array, val) {
|
Handlebars.registerHelper('includes', function (array, val) {
|
||||||
return array.includes(val);
|
return array.includes(val);
|
||||||
|
@ -49,7 +49,7 @@ export default function registerHooks() {
|
|||||||
let macro = game.macros.entities.find(m => (m.name === actor.name) && (m.command === command));
|
let macro = game.macros.entities.find(m => (m.name === actor.name) && (m.command === command));
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
macro = await Macro.create({
|
macro = await Macro.create({
|
||||||
name: actor.data.name,
|
name: actor.name,
|
||||||
type: "script",
|
type: "script",
|
||||||
img: "icons/svg/dice-target.svg",
|
img: "icons/svg/dice-target.svg",
|
||||||
command: command
|
command: command
|
||||||
@ -65,9 +65,9 @@ export default function registerHooks() {
|
|||||||
let macro = game.macros.entities.find(m => (m.name === journal.name) && (m.command === command));
|
let macro = game.macros.entities.find(m => (m.name === journal.name) && (m.command === command));
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
macro = await Macro.create({
|
macro = await Macro.create({
|
||||||
name: journal.data.name,
|
name: journal.name,
|
||||||
type: "script",
|
type: "script",
|
||||||
img: (journal.data.img) ? journal.data.img : "icons/svg/book.svg",
|
img: (journal.img) ? journal.img : "icons/svg/book.svg",
|
||||||
command: command
|
command: command
|
||||||
}, {displaySheet: false})
|
}, {displaySheet: false})
|
||||||
game.user.assignHotbarMacro(macro, slot);
|
game.user.assignHotbarMacro(macro, slot);
|
||||||
|
@ -37,13 +37,13 @@ export class Macros {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(rollType === "attribute") {
|
if(rollType === "attribute") {
|
||||||
let attribute = eval(`actor.data.data.attributes.${key}`);
|
let attribute = eval(`actor.system.attributes.${key}`);
|
||||||
let rollLabel = (attribute.label) ? game.i18n.localize(attribute.label) : null;
|
let rollLabel = (attribute.label) ? game.i18n.localize(attribute.label) : null;
|
||||||
let description = actor.name + " - " + game.i18n.localize('BOL.ui.attributeCheck') + " - " + game.i18n.localize(attribute.label) ;
|
let description = actor.name + " - " + game.i18n.localize('BOL.ui.attributeCheck') + " - " + game.i18n.localize(attribute.label) ;
|
||||||
BoLRoll.attributeRollDialog(actor, actorData, attribute, rollLabel, description, adv, mod);
|
BoLRoll.attributeRollDialog(actor, actorData, attribute, rollLabel, description, adv, mod);
|
||||||
}
|
}
|
||||||
else if(rollType === "aptitude") {
|
else if(rollType === "aptitude") {
|
||||||
let aptitude = eval(`actor.data.data.aptitudes.${key}`);
|
let aptitude = eval(`actor.system.aptitudes.${key}`);
|
||||||
let rollLabel = (aptitude.label) ? game.i18n.localize(aptitude.label) : null;
|
let rollLabel = (aptitude.label) ? game.i18n.localize(aptitude.label) : null;
|
||||||
let description = actor.name + " - " + game.i18n.localize('BOL.ui.aptitudeCheck') + " - " + game.i18n.localize(aptitude.label) ;
|
let description = actor.name + " - " + game.i18n.localize('BOL.ui.aptitudeCheck') + " - " + game.i18n.localize(aptitude.label) ;
|
||||||
BoLRoll.aptitudeRollDialog(actor, actorData, aptitude, rollLabel, description, adv, mod);
|
BoLRoll.aptitudeRollDialog(actor, actorData, aptitude, rollLabel, description, adv, mod);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
],
|
],
|
||||||
"url": "https://www.uberwald.me/gitea/public/bol",
|
"url": "https://www.uberwald.me/gitea/public/bol",
|
||||||
"license": "LICENSE.txt",
|
"license": "LICENSE.txt",
|
||||||
"version": "10.5.10",
|
"version": "10.5.15",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "10"
|
"verified": "10"
|
||||||
@ -202,7 +202,7 @@
|
|||||||
],
|
],
|
||||||
"socket": true,
|
"socket": true,
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.10.zip",
|
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.15.zip",
|
||||||
"background": "systems/bol/ui/page_accueil.webp",
|
"background": "systems/bol/ui/page_accueil.webp",
|
||||||
"gridDistance": 1.5,
|
"gridDistance": 1.5,
|
||||||
"gridUnits": "m",
|
"gridUnits": "m",
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
<div class="attributes flexrow">
|
<div class="attributes flexrow">
|
||||||
{{#each attributes as |attribute id|}}
|
{{#each attributes as |attribute id|}}
|
||||||
<div class="attribute stat flex1 flex-group-center {{key}}">
|
<div class="attribute stat flex1 flex-group-center {{key}}">
|
||||||
<label class="stat-label"><a class="rollable" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">{{localize label}}</a></label><br/>
|
<label class="stat-label"><a class="rollable" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">{{localize label}}</a></label>
|
||||||
<input class="stat-value rounded" type="text" name="system.attributes.{{key}}.value" value="{{numberFormat value decimals=0 sign=true}}" data-dtype="Number"/><br/>
|
{{#if attribute.numModifier}}
|
||||||
|
<label class="stat-value rounded">{{attribute.numModifier}}</label>
|
||||||
|
{{/if}}
|
||||||
|
{{#if (count attribute.diceModifier)}}
|
||||||
|
<label class="stat-value rounded">{{attribute.diceModifier}}</label>
|
||||||
|
{{/if}}
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<input class="stat-value rounded" type="text" name="system.attributes.{{key}}.value" value="{{numberFormat value decimals=0 sign=true}}" data-dtype="Number"/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<span class="stat-roll rollable" title="2d6" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">
|
<span class="stat-roll rollable" title="2d6" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">
|
||||||
<i class="darkgreen fas fa-dice"></i>
|
<i class="darkgreen fas fa-dice"></i>
|
||||||
</span>
|
</span>
|
||||||
@ -24,8 +34,17 @@
|
|||||||
<div class="aptitudes flexrow">
|
<div class="aptitudes flexrow">
|
||||||
{{#each aptitudes as |aptitude id|}}
|
{{#each aptitudes as |aptitude id|}}
|
||||||
<div class="aptitude stat flex1 flex-group-center">
|
<div class="aptitude stat flex1 flex-group-center">
|
||||||
<label class="stat-label"><a class="rollable" data-roll-type="aptitude" data-roll="2d6+@aptitudes.{{key}}.value" data-adv="0" data-key="{{key}}">{{localize label}}</a></label><br/>
|
<label class="stat-label"><a class="rollable" data-roll-type="aptitude" data-roll="2d6+@aptitudes.{{key}}.value" data-adv="0" data-key="{{key}}">{{localize label}}</a></label>
|
||||||
|
{{#if aptitude.numModifier}}
|
||||||
|
<label class="stat-value rounded">{{aptitude.numModifier}}</label>
|
||||||
|
{{/if}}
|
||||||
|
{{#if (count aptitude.diceModifier)}}
|
||||||
|
<label class="stat-value rounded">{{aptitude.diceModifier}}</label>
|
||||||
|
{{/if}}
|
||||||
|
<br/>
|
||||||
|
|
||||||
<input class="stat-value rounded-border" type="text" name="system.aptitudes.{{key}}.value" value="{{numberFormat value decimals=0 sign=true}}" data-dtype="Number"/><br/>
|
<input class="stat-value rounded-border" type="text" name="system.aptitudes.{{key}}.value" value="{{numberFormat value decimals=0 sign=true}}" data-dtype="Number"/><br/>
|
||||||
|
|
||||||
<span class="stat-roll rollable" title="2d6" data-roll-type="aptitude" data-roll="2d6+@aptitudes.{{key}}.value" data-adv="0" data-key="{{key}}">
|
<span class="stat-roll rollable" title="2d6" data-roll-type="aptitude" data-roll="2d6+@aptitudes.{{key}}.value" data-adv="0" data-key="{{key}}">
|
||||||
<i class="darkgreen fas fa-dice"></i>
|
<i class="darkgreen fas fa-dice"></i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -4,20 +4,25 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
|
|
||||||
{{#if (eq hp 0)}}
|
|
||||||
{{localize "BOL.chat.vitalityzero" name=name hp=hp}}
|
|
||||||
<br>{{localize "BOL.chat.vitalityheroism"}}
|
|
||||||
<br>{{localize "BOL.chat.vitalityheroismhint"}}
|
|
||||||
{{else}}
|
|
||||||
{{localize "BOL.chat.vitalitydying" name=name hp=hp}}
|
|
||||||
<br>{{localize "BOL.chat.vitalitydyingheroism"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (lt hp -5)}}
|
{{#if isHeroAdversary}}
|
||||||
<br><strong>{{localize "BOL.chat.isdead" name=name}}</strong>
|
{{#if (eq hp 0)}}
|
||||||
<br>{{localize "BOL.chat.epitaph"}}
|
{{localize "BOL.chat.vitalityzero" name=name hp=hp}}
|
||||||
{{/if}}
|
<br>{{localize "BOL.chat.vitalityheroism"}}
|
||||||
|
<br>{{localize "BOL.chat.vitalityheroismhint"}}
|
||||||
|
{{else}}
|
||||||
|
{{localize "BOL.chat.vitalitydying" name=name hp=hp}}
|
||||||
|
<br>{{localize "BOL.chat.vitalitydyingheroism"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (lt hp -5)}}
|
||||||
|
<br><strong>{{localize "BOL.chat.isdead" name=name}}</strong>
|
||||||
|
<br>{{localize "BOL.chat.epitaph"}}
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<br><strong>{{localize "BOL.chat.isdead" name=name}}</strong>
|
||||||
|
<br>{{localize "BOL.chat.epitaph"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -3,5 +3,7 @@
|
|||||||
|
|
||||||
{{#if isCritical}}
|
{{#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-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 isRealCritical}}
|
||||||
{{/if}}
|
<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}}
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
<div>
|
<div>
|
||||||
{{#if isSuccess}}
|
{{#if isSuccess}}
|
||||||
{{#if isLegendary}}
|
{{#if isLegendary}}
|
||||||
<h2 class="success critical"><i class="fas fa-check-double"></i> {{localize "BOL.ui.criticallegend"}}...
|
<h2 class="success critical"><i class="fas fa-check-double"></i> {{localize "BOL.ui.criticallegend"}}...
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if isCritical}}
|
{{#if isCritical}}
|
||||||
<h2 class="success critical"><i class="fas fa-check-double"></i> {{localize "BOL.ui.critical"}}...
|
<h2 class="success critical"><i class="fas fa-check-double"></i> {{localize "BOL.ui.critical"}}...
|
||||||
{{else}}
|
{{else}}
|
||||||
<h2 class="success"><i class="fas fa-check"></i> {{localize "BOL.ui.success"}}...
|
<h2 class="success"><i class="fas fa-check"></i> {{localize "BOL.ui.success"}}...
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isFailure}}
|
{{#if isFailure}}
|
||||||
{{#if isFumble}}
|
{{#if isFumble}}
|
||||||
<h2 class="failure fumble"><i class="fas fa-skull-crossbones"></i> {{localize "BOL.ui.fumble"}}...
|
<h2 class="failure fumble"><i class="fas fa-skull-crossbones"></i> {{localize "BOL.ui.fumble"}}...
|
||||||
{{else}}
|
{{else}}
|
||||||
<h2 class="failure"><i class="fas fa-times"></i> {{localize "BOL.ui.failure"}}...
|
<h2 class="failure"><i class="fas fa-times"></i> {{localize "BOL.ui.failure"}}...
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<img class="chat-icon" src="{{img}}" alt="{{actor.name}}"/>
|
<img class="chat-icon" src="{{img}}" alt="{{actor.name}}"/>
|
||||||
@ -52,9 +52,6 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div id="{{optionsId}}">
|
<div id="{{optionsId}}">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{#if isCritical}}
|
{{#if isCritical}}
|
||||||
<div>
|
<div>
|
||||||
{{localize "BOL.chat.criticalinfo"}}
|
{{localize "BOL.chat.criticalinfo"}}
|
||||||
@ -63,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">
|
<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>
|
<i class="fas fa-book-open"></i>{{localize "BOL.chat.criticalbuttonjournal"}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{#if (and isCritical weapon)}}
|
||||||
|
<div>
|
||||||
|
{{{localize "BOL.chat.heroicreminder"}}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (and isSuccess weapon)}}
|
{{#if (and isSuccess weapon)}}
|
||||||
{{> "systems/bol/templates/chat/rolls/attack-damage-card.hbs"}}
|
{{> "systems/bol/templates/chat/rolls/attack-damage-card.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (and isSuccess spell)}}
|
{{#if (and isSuccess spell)}}
|
||||||
{{> "systems/bol/templates/chat/rolls/spell-roll-card.hbs"}}
|
{{> "systems/bol/templates/chat/rolls/spell-roll-card.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -83,14 +86,14 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if reroll}}
|
{{#if reroll}}
|
||||||
<button class="chat-button button hero-reroll bol-margin-tb-2" data-roll-id=="{{rollId}}" data-actor-id="{{actor.id}}">{{localize "BOL.chat.reroll"}}</button>
|
<button class="chat-button button hero-reroll bol-margin-tb-2" data-actor-id="{{actorId}}">{{localize "BOL.chat.reroll"}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (and isSuccess (not isCritical))}}
|
{{#if (and isSuccess (not isCritical))}}
|
||||||
<button class="chat-button button transform-heroic-roll bol-margin-tb-2" data-roll-id=="{{rollId}}" data-actor-id="{{actor.id}}">{{localize "BOL.chat.toheroic"}}</button>
|
<button class="chat-button button transform-heroic-roll bol-margin-tb-2" data-actor-id="{{actorId}}">{{localize "BOL.chat.toheroic"}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if isRealCritical}}
|
{{#if isRealCritical}}
|
||||||
<button class="chat-button button transform-legendary-roll bol-margin-tb-2" data-roll-id=="{{rollId}}" data-actor-id="{{actor.id}}">{{localize "BOL.chat.tolegend"}}</button>
|
<button class="chat-button button transform-legendary-roll bol-margin-tb-2" data-actor-id="{{actorId}}">{{localize "BOL.chat.tolegend"}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
@ -6,13 +6,17 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<button class="damage-handling" data-defense-mode="damage-with-armor" data-attack-id="{{attackId}}">{{localize "BOL.chat.witharmor"}}</button>
|
<button class="damage-handling" data-defense-mode="damage-with-armor" data-attack-id="{{attackId}}">{{localize "BOL.chat.witharmor"}}</button>
|
||||||
<button class="damage-handling" data-defense-mode="damage-without-armor" data-attack-id="{{attackId}}">{{localize "BOL.chat.withoutarmor"}}</button>
|
<button class="damage-handling" data-defense-mode="damage-without-armor" data-attack--id="{{attackId}}">{{localize "BOL.chat.withoutarmor"}}</button>
|
||||||
|
|
||||||
{{#if defender.system.resources.hero.value}}
|
{{#if isHeroAdversary}}
|
||||||
<button class="damage-handling" data-defense-mode="hero-reduce-damage" data-attack-id="{{attackId}}">{{localize "BOL.chat.shakeoff"}}</button>
|
{{#if (gt defender.system.resources.hero.value 0)}}
|
||||||
|
<button class="damage-handling" data-defense-mode="hero-reduce-damage" data-attack-id="{{attackId}}">{{localize "BOL.chat.shakeoff"}}</button>
|
||||||
|
|
||||||
{{#each defenderWeapons as |weapon idx|}}
|
{{#each defenderWeapons as |weapon idx|}}
|
||||||
<button class="damage-handling" data-defense-mode="hero-in-extremis" data-attack-id="{{@root.attackId}}" data-weapon-id="{{weapon._id}}">{{localize "BOL.chat.splinteredshield" name=weapon.name}}</button>
|
<button class="damage-handling" data-defense-mode="hero-in-extremis" data-attack-id="{{@root.attackId}}" data-weapon-id="{{weapon._id}}">{{localize "BOL.chat.splinteredshield" name=weapon.name}}</button>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<button class="damage-handling" data-defense-mode="damage-not-applied" data-attack-id="{{attackId}}">{{localize "BOL.chat.nodamage"}}</button>
|
||||||
|
|
||||||
{{/if}}
|
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
{{#if (eq horoscopeType "major")}}
|
{{#if (eq horoscopeType "major")}}
|
||||||
{{#if isSuccess}}
|
{{#if isSuccess}}
|
||||||
{{localize "BOL.chat.horoscopemajorsuccess"}}
|
{{localize "BOL.chat.horoscopemajorsuccess" horoscopeName=horoscopeName}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{localize "BOL.chat.horoscopemajorfailure"}}
|
{{localize "BOL.chat.horoscopemajorfailure" horoscopeName=horoscopeName}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user