|
|
|
@ -71,20 +71,6 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
}
|
|
|
|
|
return arme
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
prepareBouclier(bouclier) {
|
|
|
|
|
bouclier = duplicate(bouclier)
|
|
|
|
|
let combat = this.getCombatValues()
|
|
|
|
|
bouclier.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
|
|
|
|
|
bouclier.system.attrKey = "pui"
|
|
|
|
|
bouclier.system.totalDegats = bouclier.system.degats + "+" + combat.bonusDegatsTotal
|
|
|
|
|
bouclier.system.totalOffensif = this.system.attributs.pui.value + bouclier.system.competence.system.niveau
|
|
|
|
|
bouclier.system.isdefense = true
|
|
|
|
|
bouclier.system.bonusmaniementoff = 0
|
|
|
|
|
bouclier.system.totalDefensif = combat.defenseTotal + bouclier.system.competence.system.niveau + bouclier.system.bonusdefense
|
|
|
|
|
return bouclier
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getWeapons() {
|
|
|
|
|
let armes = []
|
|
|
|
@ -99,17 +85,6 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
return armes
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getDons() {
|
|
|
|
|
return this.items.filter(item => item.type == "don")
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getTendances() {
|
|
|
|
|
return this.items.filter(item => item.type == "tendance")
|
|
|
|
|
}
|
|
|
|
|
getRunes() {
|
|
|
|
|
return this.items.filter(item => item.type == "rune")
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getEquipments() {
|
|
|
|
|
return this.items.filter(item => item.type == "equipement")
|
|
|
|
@ -118,14 +93,14 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
getArmors() {
|
|
|
|
|
return this.items.filter(item => item.type == "protection")
|
|
|
|
|
}
|
|
|
|
|
getOrigine() {
|
|
|
|
|
return this.items.find(item => item.type == "origine")
|
|
|
|
|
getHistorique() {
|
|
|
|
|
return this.items.find(item => item.type == "historique")
|
|
|
|
|
}
|
|
|
|
|
getMetier() {
|
|
|
|
|
return this.items.find(item => item.type == "metier")
|
|
|
|
|
getProfil() {
|
|
|
|
|
return this.items.find(item => item.type == "profil")
|
|
|
|
|
}
|
|
|
|
|
getHeritage() {
|
|
|
|
|
return this.items.find(item => item.type == "heritage")
|
|
|
|
|
getTalents() {
|
|
|
|
|
return this.items.find(item => item.type == "talent")
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getSkills() {
|
|
|
|
@ -160,20 +135,9 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getAspect() {
|
|
|
|
|
return (this.system.balance.loi > this.system.balance.chaos) ? this.system.balance.loi : this.system.balance.chaos
|
|
|
|
|
}
|
|
|
|
|
getMarge() {
|
|
|
|
|
return Math.abs( this.system.balance.loi - this.system.balance.chaos)
|
|
|
|
|
}
|
|
|
|
|
getAlignement() {
|
|
|
|
|
return (this.system.balance.loi > this.system.balance.chaos) ? "loyal" : "chaotique"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
getDefenseBase() {
|
|
|
|
|
return this.system.attributs.tre.value + 5
|
|
|
|
|
return this.system.attributs.tre.value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
@ -209,14 +173,7 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
prepareDerivedData() {
|
|
|
|
|
|
|
|
|
|
if (this.type == 'personnage') {
|
|
|
|
|
let newSante = this.system.sante.bonus + (this.system.attributs.pui.value + this.system.attributs.tre.value) * 2 + 5
|
|
|
|
|
if (this.system.sante.base != newSante) {
|
|
|
|
|
this.update({ 'system.sante.base': newSante })
|
|
|
|
|
}
|
|
|
|
|
let newAme = (this.system.attributs.cla.value + this.system.attributs.tre.value) * this.system.biodata.amemultiplier + 5
|
|
|
|
|
if (this.system.ame.fullmax != newAme) {
|
|
|
|
|
this.update({ 'system.ame.fullmax': newAme })
|
|
|
|
|
}
|
|
|
|
|
// TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
super.prepareDerivedData()
|
|
|
|
@ -285,21 +242,6 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
this.update({ 'system.eclat.value': newE })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
canEclatDoubleD20() {
|
|
|
|
|
return (this.getAlignement() == "loyal" && this.system.eclat.value > 0)
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
subPointsAme(runeMode, value) {
|
|
|
|
|
let ame = duplicate(this.system.ame)
|
|
|
|
|
if(runeMode == "prononcer") {
|
|
|
|
|
ame.value -= value
|
|
|
|
|
} else {
|
|
|
|
|
ame.currentmax -= value
|
|
|
|
|
}
|
|
|
|
|
this.update( {'system.ame': ame})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
compareName(a, b) {
|
|
|
|
|
if (a.name < b.name) {
|
|
|
|
@ -408,14 +350,14 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
rollData.actorImg = this.img
|
|
|
|
|
rollData.actorId = this.id
|
|
|
|
|
rollData.img = this.img
|
|
|
|
|
rollData.canEclatDoubleD20 = this.canEclatDoubleD20()
|
|
|
|
|
rollData.canEclatDoubleD20 = true
|
|
|
|
|
rollData.doubleD20 = false
|
|
|
|
|
rollData.attributs = HawkmoonUtility.getAttributs()
|
|
|
|
|
|
|
|
|
|
if (attrKey) {
|
|
|
|
|
rollData.attrKey = attrKey
|
|
|
|
|
if (attrKey != "tochoose") {
|
|
|
|
|
rollData.actionImg = "systems/fvtt-mournblade/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
|
|
|
|
|
rollData.actionImg = "systems/fvtt-mournblade-cyd/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
|
|
|
|
|
rollData.attr = duplicate(this.system.attributs[attrKey])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -445,23 +387,6 @@ export class HawkmoonActor extends Actor {
|
|
|
|
|
rollDialog.render(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
async rollRune(runeId) {
|
|
|
|
|
let comp = this.items.find(comp => comp.type == "competence" && comp.name.toLowerCase() == "savoir : runes")
|
|
|
|
|
if ( !comp) {
|
|
|
|
|
ui.notifications.warn("La compétence Savoirs : Runes n'a pas été trouvée, abandon.")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let rollData = this.getCommonRollData("cla", undefined, "Savoir : Runes")
|
|
|
|
|
rollData.rune = duplicate(this.items.get(runeId) || {})
|
|
|
|
|
rollData.difficulte = rollData.rune?.system?.seuil || 0
|
|
|
|
|
rollData.runemode = "prononcer"
|
|
|
|
|
rollData.runeame = 1
|
|
|
|
|
console.log("runeData", rollData)
|
|
|
|
|
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
|
|
|
|
rollDialog.render(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
async rollArmeOffensif(armeId) {
|
|
|
|
|
let arme = this.items.get(armeId)
|
|
|
|
|