Ajout du xplog
This commit is contained in:
@@ -27,7 +27,7 @@ export class BoLActorSheet extends ActorSheet {
|
||||
|
||||
function onLoad() {
|
||||
let logoSheet = BoLUtility.getLogoActorSheet()
|
||||
$(".bol-actor-form").css("backgroundImage",`url(${logoSheet})`)
|
||||
$(".bol-actor-form").css("backgroundImage", `url(${logoSheet})`)
|
||||
}
|
||||
// Setup everything onload
|
||||
$(function () { onLoad(); });
|
||||
@@ -147,6 +147,7 @@ export class BoLActorSheet extends ActorSheet {
|
||||
formData.fightoptions = this.actor.fightoptions
|
||||
formData.ammos = this.actor.ammos
|
||||
formData.misc = this.actor.misc
|
||||
formData.xplog = this.actor.xplog
|
||||
formData.combat = this.actor.buildCombat()
|
||||
formData.initiativeRank = this.actor.getInitiativeRank()
|
||||
//formData.combatCreature = this.actor.buildCombatCreature()
|
||||
@@ -155,12 +156,12 @@ export class BoLActorSheet extends ActorSheet {
|
||||
formData.options = this.options
|
||||
formData.owner = this.document.isOwner
|
||||
formData.editScore = this.options.editScore
|
||||
formData.useBougette = (this.actor.type == "character" && BoLUtility.getUseBougette()) || false
|
||||
formData.useBougette = (this.actor.type == "character" && BoLUtility.getUseBougette()) || false
|
||||
formData.bougette = this.actor.getBougette()
|
||||
formData.charType = this.actor.getCharType()
|
||||
formData.villainy = this.actor.getVillainy()
|
||||
formData.biography = await TextEditor.enrichHTML(this.object.system.details?.biography || "", {async: true})
|
||||
formData.notes = await TextEditor.enrichHTML(this.object.system.details.notes || "", {async: true})
|
||||
formData.villainy = this.actor.getVillainy()
|
||||
formData.biography = await TextEditor.enrichHTML(this.object.system.details?.biography || "", { async: true })
|
||||
formData.notes = await TextEditor.enrichHTML(this.object.system.details.notes || "", { async: true })
|
||||
formData.isSorcerer = this.actor.isSorcerer()
|
||||
formData.isAlchemist = this.actor.isAlchemist()
|
||||
formData.isAstrologer = this.actor.isAstrologer()
|
||||
@@ -248,22 +249,22 @@ export class BoLActorSheet extends ActorSheet {
|
||||
case "attributexp":
|
||||
this.actor.incAttributeXP(dataset.key)
|
||||
break;
|
||||
case "bougette":
|
||||
this.actor.rollBougette()
|
||||
break;
|
||||
case "careerxp":
|
||||
this.actor.incCareerXP( li.data("item-id"))
|
||||
this.actor.incCareerXP(li.data("item-id"))
|
||||
break;
|
||||
case "horoscope-minor":
|
||||
BoLRoll.horoscopeCheck(this.actor, event, "minor")
|
||||
break
|
||||
case "horoscope-major":
|
||||
BoLRoll.horoscopeCheck(this.actor, event, "major")
|
||||
break
|
||||
break
|
||||
case "horoscope-major-group":
|
||||
BoLRoll.horoscopeCheck(this.actor, event, "majorgroup")
|
||||
break
|
||||
|
||||
break
|
||||
case "bougette":
|
||||
this.actor.rollBougette()
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
@@ -204,6 +204,24 @@ export class BoLActor extends Actor {
|
||||
return undefined
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addXPLog(type, name, cost, value) {
|
||||
let xplog = {
|
||||
name: "XP : "+game.i18n.localize(type), type: "feature",
|
||||
img: "icons/magic/symbols/chevron-elipse-circle-blue.webp",
|
||||
system: {
|
||||
subtype: "xplog", properties: {
|
||||
xptype: type,
|
||||
xpdate: new Date().toLocaleDateString(),
|
||||
xpname: name,
|
||||
xpcost: cost,
|
||||
xpvalue: value
|
||||
}
|
||||
}
|
||||
}
|
||||
this.createEmbeddedDocuments('Item', [xplog])
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
incAttributeXP(key) {
|
||||
let attr = duplicate(this.system.attributes[key])
|
||||
@@ -214,6 +232,7 @@ export class BoLActor extends Actor {
|
||||
attr.value += 1
|
||||
xp.spent += nextXP
|
||||
this.update({ [`system.attributes.${key}`]: attr, [`system.xp`]: xp })
|
||||
this.addXPLog("attribute", key, nextXP, attr.value)
|
||||
} else {
|
||||
ui.notifications.warn("Pas assez de points d'expérience !")
|
||||
}
|
||||
@@ -230,6 +249,7 @@ export class BoLActor extends Actor {
|
||||
apt.value += 1
|
||||
xp.spent += nextXP
|
||||
this.update({ [`system.aptitudes.${key}`]: apt, [`system.xp`]: xp })
|
||||
this.addXPLog("aptitude", key, nextXP, apt.value)
|
||||
} else {
|
||||
ui.notifications.warn("Pas assez de points d'expérience !")
|
||||
}
|
||||
@@ -246,6 +266,7 @@ export class BoLActor extends Actor {
|
||||
xp.spent += nextXP
|
||||
this.update({ [`system.xp`]: xp })
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: career._id, 'system.rank': career.system.rank + 1 }])
|
||||
this.addXPLog("career", career.name, nextXP, career.system.rank+1)
|
||||
} else {
|
||||
ui.notifications.warn("Pas assez de points d'expérience !")
|
||||
}
|
||||
@@ -298,6 +319,9 @@ export class BoLActor extends Actor {
|
||||
get boleffects() {
|
||||
return this.items.filter(i => i.type === "feature" && i.system.subtype === "boleffect")
|
||||
}
|
||||
get xplog() {
|
||||
return this.items.filter(i => i.type === "feature" && i.system.subtype === "xplog")
|
||||
}
|
||||
get horoscopes() {
|
||||
return this.items.filter(i => i.type === "feature" && i.system.subtype === "horoscope")
|
||||
}
|
||||
|
Reference in New Issue
Block a user