New icons

This commit is contained in:
2022-10-23 21:26:18 +02:00
parent 12c2c46724
commit 6ce07c51a4
36 changed files with 256 additions and 463 deletions

View File

@ -41,15 +41,9 @@ export class HawkmoonActorSheet extends ActorSheet {
skills: this.actor.getSkills(),
armes: duplicate(this.actor.getWeapons()),
protections: duplicate(this.actor.getArmors()),
dons: duplicate(this.actor.getDons()),
alignement: this.actor.getAlignement(),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
tendances:duplicate(this.actor.getTendances()),
runes:duplicate(this.actor.getRunes()),
origine: duplicate(this.actor.getOrigine() || {}),
heritage: duplicate(this.actor.getHeritage() || {}),
metier: duplicate(this.actor.getMetier() || {}),
historique: duplicate(this.actor.getHistorique() || {}),
talents: duplicate(this.actor.getTalents() || {}),
profils: duplicate(this.actor.getProfil() || {}),
combat: this.actor.getCombatValues(),
equipements: duplicate(this.actor.getEquipments()),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),

View File

@ -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)

View File

@ -14,8 +14,8 @@ export class HawkmoonItemSheet extends ItemSheet {
template: "systems/fvtt-hawkmoon-cyd/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}

View File

@ -44,7 +44,7 @@ Hooks.once("init", async function () {
CONFIG.Combat.documentClass = HawkmoonCombat
CONFIG.Actor.documentClass = HawkmoonActor
CONFIG.Item.documentClass = HawkmoonItem
game.system.hawkmosn = {
game.system.hawkmoon = {
HawkmoonUtility
}

View File

@ -121,6 +121,7 @@ export class HawkmoonUtility {
const templatePaths = [
'systems/fvtt-hawkmoon-cyd/templates/editor-notes-gm.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-item-description.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-item-nav.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html'
]
return loadTemplates(templatePaths);