Diverses prise en compte technique

This commit is contained in:
sladecraven 2022-10-25 17:54:13 +02:00
parent b64eeb226a
commit 5c54062b81
17 changed files with 159 additions and 291 deletions

View File

@ -71,6 +71,7 @@ export class HawkmoonActor extends Actor {
} }
return arme return arme
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getWeapons() { getWeapons() {
let armes = [] let armes = []
@ -78,9 +79,6 @@ export class HawkmoonActor extends Actor {
if (arme.type == "arme") { if (arme.type == "arme") {
armes.push(this.prepareArme(arme)) armes.push(this.prepareArme(arme))
} }
if (arme.type == "bouclier") {
armes.push(this.prepareBouclier(arme))
}
} }
return armes return armes
} }
@ -173,7 +171,10 @@ export class HawkmoonActor extends Actor {
prepareDerivedData() { prepareDerivedData() {
if (this.type == 'personnage') { if (this.type == 'personnage') {
// TODO let vigueur = Math.floor( (this.system.attributs.pui.value + this.system.attributs.tre.value) / 2)
if (vigueur != this.system.sante.vigueur) {
this.update( { 'system.sante.vigueur': vigueur})
}
} }
super.prepareDerivedData() super.prepareDerivedData()
@ -350,9 +351,10 @@ export class HawkmoonActor extends Actor {
rollData.actorImg = this.img rollData.actorImg = this.img
rollData.actorId = this.id rollData.actorId = this.id
rollData.img = this.img rollData.img = this.img
rollData.canEclatDoubleD20 = true
rollData.doubleD20 = false
rollData.attributs = HawkmoonUtility.getAttributs() rollData.attributs = HawkmoonUtility.getAttributs()
rollData.maitriseId = "none"
rollData.nbEclat = this.system.eclat.value
rollData.nbBA = this.system.bonneaventure.actuelle
if (attrKey) { if (attrKey) {
rollData.attrKey = attrKey rollData.attrKey = attrKey
@ -363,6 +365,7 @@ export class HawkmoonActor extends Actor {
} }
if (compId) { if (compId) {
rollData.competence = duplicate(this.items.get(compId) || {}) rollData.competence = duplicate(this.items.get(compId) || {})
rollData.maitrises = rollData.competence.system.predilections.filter(p => p.maitrise )
rollData.actionImg = rollData.competence?.img rollData.actionImg = rollData.competence?.img
} }
if (compName) { if (compName) {

View File

@ -134,41 +134,56 @@ export class HawkmoonItemSheet extends ItemSheet {
let index = li.data("prediction-index") let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value pred[index].name = ev.currentTarget.value
this.object.update( { 'data.predilections': pred }) pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
}) })
html.find('.edit-predilection-description').change(ev => { html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item") const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index") let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value pred[index].description = ev.currentTarget.value
this.object.update( { 'data.predilections': pred }) pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
}) })
html.find('.delete-prediction').click(ev => { html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item") const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index") let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred.splice(index,1) pred[index].acquise = ev.currentTarget.checked
this.object.update( { 'data.predilections': pred }) pred[index].id = pred[index].id || randomID(16)
}) this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => { html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item") const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index") let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked pred[index].maitrise = ev.currentTarget.checked
this.object.update( { 'data.predilections': pred }) pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
}) })
html.find('.predilection-used').change(ev => { html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item") const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index") let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked pred[index].used = ev.currentTarget.checked
this.object.update( { 'data.predilections': pred }) pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
}) })
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => { html.find('#add-predilection').click(ev => {
let pred = duplicate(this.object.system.predilections) let pred = duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", used: false }) pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'data.predilections': pred }) this.object.update( { 'system.predilections': pred })
}) })
// Update Inventory Item // Update Inventory Item
html.find('.item-delete').click(ev => { html.find('.item-delete').click(ev => {

View File

@ -20,12 +20,12 @@ export class HawkmoonRollDialog extends Dialog {
rolld10: { rolld10: {
icon: '<i class="fas fa-check"></i>', icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d10", label: "Lancer 1d10",
callback: () => { this.roll("1d10") } callback: () => { this.roll("d10") }
}, },
rolld20: { rolld20: {
icon: '<i class="fas fa-check"></i>', icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d20", label: "Lancer 1d20",
callback: () => { this.roll("1d20") } callback: () => { this.roll("d20") }
}, },
cancel: { cancel: {
icon: '<i class="fas fa-times"></i>', icon: '<i class="fas fa-times"></i>',
@ -66,14 +66,8 @@ export class HawkmoonRollDialog extends Dialog {
html.find('#attrKey').change(async (event) => { html.find('#attrKey').change(async (event) => {
this.rollData.attrKey = String(event.currentTarget.value) this.rollData.attrKey = String(event.currentTarget.value)
}) })
html.find('#runemode').change(async (event) => { html.find('#select-maitrise').change(async (event) => {
this.rollData.runemode = String(event.currentTarget.value) this.rollData.maitriseId = String(event.currentTarget.value)
}) })
html.find('#runeame').change(async (event) => {
this.rollData.runeame = Number(event.currentTarget.value)
})
html.find('#doubleD20').change(async (event) => {
this.rollData.doubleD20 = event.currentTarget.checked
})
} }
} }

View File

@ -14,13 +14,10 @@ export class HawkmoonUtility {
Hooks.on("getCombatTrackerEntryContext", (html, options) => { Hooks.on("getCombatTrackerEntryContext", (html, options) => {
HawkmoonUtility.pushInitiativeOptions(html, options); HawkmoonUtility.pushInitiativeOptions(html, options);
}) })
Hooks.on("dropCanvasData", (canvas, data) => {
HawkmoonUtility.dropItemOnToken(canvas, data)
});
this.rollDataStore = {} this.rollDataStore = {}
this.defenderStore = {} this.defenderStore = {}
HawkmoonCommands.init(); HawkmoonCommands.init()
Handlebars.registerHelper('count', function (list) { Handlebars.registerHelper('count', function (list) {
return list.length; return list.length;
@ -107,7 +104,7 @@ export class HawkmoonUtility {
let predIdx = $(event.currentTarget).data("predilection-index") let predIdx = $(event.currentTarget).data("predilection-index")
let messageId = HawkmoonUtility.findChatMessageId(event.currentTarget) let messageId = HawkmoonUtility.findChatMessageId(event.currentTarget)
let message = game.messages.get(messageId) let message = game.messages.get(messageId)
let rollData = message.getFlag("world", "mournblade-roll") let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
await actor.setPredilectionUsed(rollData.competence._id, predIdx) await actor.setPredilectionUsed(rollData.competence._id, predIdx)
rollData.competence = duplicate(actor.getCompetence(rollData.competence._id)) rollData.competence = duplicate(actor.getCompetence(rollData.competence._id))
@ -123,7 +120,8 @@ export class HawkmoonUtility {
'systems/fvtt-hawkmoon-cyd/templates/partial-item-description.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-item-nav.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html', 'systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-item-prix.html' 'systems/fvtt-hawkmoon-cyd/templates/partial-item-prix.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-sante-etat.html',
] ]
return loadTemplates(templatePaths); return loadTemplates(templatePaths);
} }
@ -303,16 +301,16 @@ export class HawkmoonUtility {
rollData.attr = duplicate(actor.system.attributs[rollData.attrKey]) rollData.attr = duplicate(actor.system.attributs[rollData.attrKey])
} }
rollData.diceFormula = rollData.mainDice if ( rollData.maitriseId != "none") {
if (rollData.doubleD20) { // Multiply result ! rollData.selectedMaitrise = rollData.maitrises.find(p => p.id == rollData.maitriseId )
rollData.diceFormula += "*2" rollData.diceFormula = "2" + rollData.mainDice + "kh"
if (!rollData.isReroll) { } else {
actor.changeEclat(-1) rollData.diceFormula = "1" + rollData.mainDice
}
} }
//console.log("BEFORE COMP", rollData) //console.log("BEFORE COMP", rollData)
if (rollData.competence) { if (rollData.competence) {
rollData.predilections = duplicate(rollData.competence.system.predilections.filter(pred => !pred.used) || []) rollData.predilections = duplicate(rollData.competence.system.predilections.filter(pred => pred.acquise && !pred.maitrise && !pred.used) || [])
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0 let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
rollData.diceFormula += `+${rollData.attr.value}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}` rollData.diceFormula += `+${rollData.attr.value}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
} else { } else {
@ -341,14 +339,6 @@ export class HawkmoonUtility {
rollData.finalResult = myRoll.total rollData.finalResult = myRoll.total
this.computeResult(rollData) this.computeResult(rollData)
if (rollData.rune) {
let subAme = rollData.runeame
if (rollData.isEchec && !rollData.isDramatique) {
subAme = Math.ceil((subAme + 1) / 2)
}
actor.subPointsAme(rollData.runemode, subAme)
}
this.createChatWithRollMode(rollData.alias, { this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-generic-result.html`, rollData) content: await renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-generic-result.html`, rollData)
}, rollData) }, rollData)
@ -451,7 +441,7 @@ export class HawkmoonUtility {
chatOptions.alias = chatOptions.alias || name chatOptions.alias = chatOptions.alias || name
let msg = await ChatMessage.create(chatOptions) let msg = await ChatMessage.create(chatOptions)
console.log("=======>", rollData) console.log("=======>", rollData)
msg.setFlag("world", "mournblade-roll", rollData) msg.setFlag("world", "hawkmoon-roll", rollData)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -493,7 +483,7 @@ export class HawkmoonUtility {
let msgId = li.data("message-id") let msgId = li.data("message-id")
let msg = game.messages.get(msgId) let msg = game.messages.get(msgId)
if (msg) { if (msg) {
let rollData = msg.getFlag("world", "mournblade-roll") let rollData = msg.getFlag("world", "hawkmoon-roll")
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
actor.changeBonneAventure(changed) actor.changeBonneAventure(changed)
rollData.isReroll = true rollData.isReroll = true
@ -512,122 +502,57 @@ export class HawkmoonUtility {
let msgId = li.data("message-id") let msgId = li.data("message-id")
let msg = game.messages.get(msgId) let msg = game.messages.get(msgId)
if (msg) { if (msg) {
let rollData = msg.getFlag("world", "mournblade-roll") let rollData = msg.getFlag("world", "hawkmoon-roll")
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
actor.changeEclat(changed) actor.changeEclat(changed)
rollData.isReroll = true rollData.isReroll = true
rollData.textBonus = "Bonus d'Eclat" rollData.textBonus = "Bonus d'Eclat"
rollData.addedBonus = addedBonus if (addedBonus == "reroll") {
HawkmoonUtility.bonusRollHawkmoon(rollData) HawkmoonUtility.rollHawkmoon(rollData)
} else {
rollData.addedBonus = addedBonus
HawkmoonUtility.bonusRollHawkmoon(rollData)
}
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static chatRollMenu(html, options) { static chatRollMenu(html, options) {
let canApply = li => canvas.tokens.controlled.length && li.find(".mournblade-roll").length let canApply = li => canvas.tokens.controlled.length && li.find(".hawkmoon-roll").length
let canApplyBALoyal = function (li) { let canApplyBA = function (li) {
let message = game.messages.get(li.attr("data-message-id")) let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll") let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 0 && actor.getAlignement() == "loyal") return (!rollData.isReroll && actor.getBonneAventure() > 0 )
} }
let canApplyPELoyal = function (li) { let canApplyPE = function (li) {
let message = game.messages.get(li.attr("data-message-id")) let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll") let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getEclat() > 0 && actor.getAlignement() == "loyal") return (!rollData.isReroll && actor.getEclat() > 0 )
}
let canApplyBAChaotique = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 0 && actor.getAlignement() == "chaotique")
}
let canApplyBAChaotique3 = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 2 && actor.getAlignement() == "chaotique")
}
let canApplyPEChaotique = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getEclat() > 0 && actor.getAlignement() == "chaotique")
}
let hasPredilection = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
if (rollData.competence) {
let nbPred = rollData.competence.data.predilections.filter(pred => !pred.used).length
return (!rollData.isReroll && rollData.competence && nbPred > 0)
}
return false
}
let canCompetenceDouble = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
if (rollData.competence) {
return rollData.competence.data.doublebonus
}
return false
} }
options.push( options.push(
{ {
name: "Ajouer +3 (1 point de Bonne Aventure)", name: "Ajouer +3 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>", icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBALoyal, condition: canApply && canApplyBA,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+3") callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+3")
} }
) )
options.push(
{
name: "Ajouer +6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBALoyal && canCompetenceDouble,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+6")
}
)
options.push(
{
name: "Ajouer +1d6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+1d6")
}
)
options.push(
{
name: "Ajouer +2d6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique && canCompetenceDouble,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+2d6")
}
)
options.push(
{
name: "Relancer le dé (3 points de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique3,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -3, "reroll")
}
)
options.push( options.push(
{ {
name: "Ajouter +10 (1 Point d'Eclat)", name: "Ajouter +10 (1 Point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>", icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPELoyal, condition: canApply && canApplyPE,
callback: li => HawkmoonUtility.applyEclatRoll(li, -1, "+10") callback: li => HawkmoonUtility.applyEclatRoll(li, -1, "+10")
} }
) )
options.push( options.push(
{ {
name: "Ajouter +20 (1 Point d'Eclat)", name: "Relancer le dé (1 point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>", icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPELoyal && canCompetenceDouble, condition: canApply && canApplyPE,
callback: li => HawkmoonUtility.applyEclatRoll(li, -1, "+20") callback: li => HawkmoonUtility.applyEclatRoll(li, -3, "reroll")
} }
) )
return options return options

View File

View File

View File

View File

View File

@ -1112,7 +1112,7 @@ ul, li {
text-decoration: none; text-decoration: none;
text-shadow: 0px 1px 0px #4d3534; text-shadow: 0px 1px 0px #4d3534;
position: relative; position: relative;
margin:2px; /*margin:2px;*/
} }
.chat-card-button:hover { .chat-card-button:hover {
@ -1124,9 +1124,10 @@ ul, li {
top:1px; top:1px;
} }
.button-sheet-roll { .button-sheet-roll {
box-shadow: inset 0px 1px 0px 0px #a6827e; box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 60%); background: linear-gradient(to bottom, #41545a 5%, #2e5561 100%);
background-color: #7d5d3b00; background-color: #7d5d3b00;
border-radius: 4px; border-radius: 4px;
border: 1px ridge #846109; border: 1px ridge #846109;
@ -1139,13 +1140,15 @@ ul, li {
text-shadow: 0px 1px 0px #4d3534; text-shadow: 0px 1px 0px #4d3534;
position: relative; position: relative;
max-height:1.8rem; max-height:1.8rem;
max-width: 4rem;
margin-left:4px; margin-left:4px;
flex-grow:1;
max-width: 4rem;
min-width: 4rem;
} }
.button-sheet-roll:hover { .button-sheet-roll:hover {
background: linear-gradient(to bottom, #800000 5%, #3e0101 100%); background: linear-gradient(to bottom, #800000 5%, #3e0101 100%);
background-color: red; background-color: rgb(56, 33, 33);
} }
.button-sheet-roll:active { .button-sheet-roll:active {
position:relative; position:relative;
@ -1247,28 +1250,6 @@ ul, li {
flex-grow: 2; flex-grow: 2;
} }
/*************************************************************/
.button-roll-competence {
min-width: 64px;
max-width: 64px;
background-color: rgba(211, 221, 187, 100);
padding-top: 7px;
padding-left: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 12px;
}
/*************************************************************/
.button-roll-competence-empty {
min-width: 64px;
max-width: 64px;
padding-top: 7px;
padding-left: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 12px;
}
/*************************************************************/ /*************************************************************/
.item-name-img { .item-name-img {

View File

@ -21,7 +21,16 @@
"type": "Item", "type": "Item",
"label": "Compétences", "label": "Compétences",
"name": "skills", "name": "skills",
"path": "packs/skills.db", "path": "packs/competences.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Historiques",
"name": "historiques",
"path": "packs/historiques.db",
"system": "fvtt-hawkmoon-cyd", "system": "fvtt-hawkmoon-cyd",
"private": false, "private": false,
"flags": {} "flags": {}
@ -38,8 +47,8 @@
{ {
"type": "Item", "type": "Item",
"label": "Protections", "label": "Protections",
"name": "protection", "name": "protections",
"path": "packs/protection.db", "path": "packs/protections.db",
"system": "fvtt-hawkmoon-cyd", "system": "fvtt-hawkmoon-cyd",
"private": false, "private": false,
"flags": {} "flags": {}
@ -81,8 +90,8 @@
"flags": {} "flags": {}
} }
], ],
"primaryTokenAttribute": "secondary.health", "primaryTokenAttribute": "sante.vigueur",
"secondaryTokenAttribute": "secondary.delirium", "secondaryTokenAttribute": "bonneaventure.actuelle",
"socket": true, "socket": true,
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"

View File

@ -108,6 +108,10 @@
"prixsc": 0, "prixsc": 0,
"rarete": 0, "rarete": 0,
"equipped": false "equipped": false
},
"automation": {
"isautomated": false,
"automations": []
} }
}, },
"types": [ "types": [
@ -124,10 +128,10 @@
"talent": { "talent": {
"utilisation": "", "utilisation": "",
"prerequis": "", "prerequis": "",
"isbonus": false, "used": false,
"bonusformula": "",
"templates": [ "templates": [
"base" "base",
"automation"
] ]
}, },
"historique": { "historique": {

View File

@ -81,66 +81,23 @@
<h4 class="item-name-label competence-name">Santé</h4> <h4 class="item-name-label competence-name">Santé</h4>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="item flexrow"> <li class="item flexrow">
<label class="label-name">Bonus</label> <label class="label-name item-field-label-short">Vigueur</label>
<input type="text" class="input-numeric-short" name="system.sante.bonus" value="{{system.sante.bonus}}" <label class="label-name item-field-label-short">{{system.sante.vigueur}}</label>
data-dtype="Number" />
<label class="label-name">Total</label>
<label class="label-name">{{system.sante.base}}</label>
</li> </li>
<li class="item flexrow"> <li class="item flexrow">
<label class="label-name">Non létaux</label> <label class="label-name item-field-label-short">Etat</label>
<input type="text" class="input-numeric-short" name="system.sante.nonletaux" <select class="label-name item-field-label-medium" type="text" name="system.sante.etat" value="{{system.sante.etat}}" data-dtype="Number">
value="{{system.sante.nonletaux}}" data-dtype="Number" /> {{#select system.sante.etat}}
<label class="label-name">Létaux</label> {{> systems/fvtt-hawkmoon-cyd/templates/partial-sante-etat.html}}
<input type="text" class="input-numeric-short" name="system.sante.letaux" value="{{system.sante.letaux}}" {{/select}}
data-dtype="Number" /> </select>
</li>
</ul>
<h4 class="item-name-label competence-name">Ame</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="label-name">Max</label>
<input type="text" class="input-numeric-short" name="system.ame.fullmax" value="{{system.ame.fullmax}}"
data-dtype="Number" />
<label class="label-name">Max Actuel</label>
<input type="text" class="input-numeric-short" name="system.ame.currentmax"
value="{{system.ame.currentmax}}" data-dtype="Number" />
<label class="label-name">Courante</label>
<input type="text" class="input-numeric-short" name="system.ame.value" value="{{system.ame.value}}"
data-dtype="Number" />
</li> </li>
</ul> </ul>
<h4 class="item-name-label competence-name">Combat</h4> <h4 class="item-name-label competence-name">Combat</h4>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="item flexrow"> <li class="item flexrow">
<label class="competence-name">Initiative</label> <button class="chat-card-button roll-initiative">Lancer l'initiative</button>
<label class="competence-name">{{combat.initBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.initbonus"
value="{{system.combat.initbonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.initTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">B. Dégats</label>
<label class="competence-name">+{{combat.bonusDegats}}</label>
<input type="text" class="input-numeric-short" name="system.combat.bonusdegats"
value="{{system.combat.bonusdegats}}" data-dtype="Number" />
<label class="competence-name">+{{combat.bonusDegatsTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">Vitesse</label>
<label class="competence-name">{{combat.vitesseBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.vitessebonus"
value="{{system.combat.vitessebonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.vitesseTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">Défense</label>
<label class="competence-name">{{combat.defenseBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.defensebonus"
value="{{system.combat.defensebonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.defenseTotal}}</label>
</li> </li>
</ul> </ul>
</div> </div>
@ -168,32 +125,26 @@
{{#each skills as |skill key|}} {{#each skills as |skill key|}}
<li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence"> <li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence">
<img class="item-name-img" src="{{skill.img}}" /> <img class="item-name-img" src="{{skill.img}}" />
<span class="item-name-label competence-name"><a class="roll-competence" <span class="item-name-label competence-name"><a class="roll-competence item-field-label-short"
data-attr-key="tochoose">{{skill.name}}</a></span> data-attr-key="tochoose">{{skill.name}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text" <select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
data-item-field="niveau" value="{{skill.system.niveau}}" data-dtype="Number"> data-item-field="niveau" value="{{skill.system.niveau}}" data-dtype="Number">
{{#select skill.system.niveau}} {{#select skill.system.niveau}}
{{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}} {{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}}
{{/select}} {{/select}}
</select> </select>
{{#if (ne skill.system.attribut1 "none")}} {{#if (ne skill.system.attribut1 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut1}}">{{upper <button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut1}}">{{upper
skill.system.attribut1}} : {{skill.system.attribut1total}}</button> skill.system.attribut1}} : {{skill.system.attribut1total}}</button>
</span>
{{/if}} {{/if}}
{{#if (ne skill.system.attribut2 "none")}} {{#if (ne skill.system.attribut2 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut2}}">{{upper <button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut2}}">{{upper
skill.system.attribut2}} : {{skill.system.attribut2total}}</button> skill.system.attribut2}} : {{skill.system.attribut2total}}</button>
</span>
{{/if}} {{/if}}
{{#if (ne skill.system.attribut3 "none")}} {{#if (ne skill.system.attribut3 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut3}}">{{upper <button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut3}}">{{upper
skill.system.attribut3}} : {{skill.system.attribut3total}}</button> skill.system.attribut3}} : {{skill.system.attribut3total}}</button>
</span>
{{/if}} {{/if}}
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>

View File

@ -18,28 +18,27 @@
<div> <div>
<ul> <ul>
<li class="mournblade-roll">Attribut : {{attr.label}}</li> <li class="hawkmoon-roll">Attribut : {{attr.label}}</li>
{{#if competence}} {{#if competence}}
<li>Compétence : {{competence.name}}</li> <li>Compétence : {{competence.name}}</li>
{{/if}} {{/if}}
{{#if rune}} {{#if selectedMaitrise}}
<li>Rune : {{rune.name}}</li> <li>Maitrise : {{selectedMaitrise.name}}</li>
<li>Mode : {{runemode}}</li>
<li>Points d'Ame : {{runeame}}</li>
<li>Durée : {{runeduree}} actions complexes</li>
{{/if}} {{/if}}
{{#if bonusRoll}}
<li>{{textBonus}} : {{bonusRoll.total}}</li>
{{/if}}
{{#if arme}} {{#if arme}}
<li>Arme : {{arme.name}} (+{{arme.system.bonusmaniementoff}})</li> <li>Arme : {{arme.name}} (+{{arme.system.bonusmaniementoff}})</li>
{{/if}} {{/if}}
<li>Formule : {{diceFormula}}</li> <li>Formule : {{diceFormula}}</li>
{{#if bonusRoll}}
<li>{{textBonus}} : +{{bonusRoll.total}}</li>
{{/if}}
<li>Total : {{finalResult}}</li> <li>Total : {{finalResult}}</li>
{{#if difficulte}} {{#if difficulte}}
@ -62,6 +61,7 @@
<button class="chat-card-button predilection-reroll" data-predilection-index="{{key}}">Predilection : {{pred.name}}</button> <button class="chat-card-button predilection-reroll" data-predilection-index="{{key}}">Predilection : {{pred.name}}</button>
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
</div> </div>

View File

@ -23,8 +23,8 @@
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 1 </label> <label class="generic-label item-field-label-long">Attribut 1 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text" name="system.attribut1" <select class="status-small-label color-class-common item-field-label-long" type="text"
value="{{system.attribut1}}" data-dtype="string"> name="system.attribut1" value="{{system.attribut1}}" data-dtype="string">
{{#select system.attribut1}} {{#select system.attribut1}}
{{#each attributs as |attrLabel attrKey|}} {{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option> <option value="{{attrKey}}">{{attrLabel}}</option>
@ -34,8 +34,8 @@
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 2 </label> <label class="generic-label item-field-label-long">Attribut 2 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text" name="system.attribut2" <select class="status-small-label color-class-common item-field-label-long" type="text"
value="{{system.attribut2}}" data-dtype="string"> name="system.attribut2" value="{{system.attribut2}}" data-dtype="string">
<option value="none">Aucun</option> <option value="none">Aucun</option>
{{#select system.attribut2}} {{#select system.attribut2}}
{{#each attributs as |attrLabel attrKey|}} {{#each attributs as |attrLabel attrKey|}}
@ -46,8 +46,8 @@
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 3 </label> <label class="generic-label item-field-label-long">Attribut 3 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text" name="system.attribut3" <select class="status-small-label color-class-common item-field-label-long" type="text"
value="{{system.attribut3}}" data-dtype="string"> name="system.attribut3" value="{{system.attribut3}}" data-dtype="string">
<option value="none">Aucun</option> <option value="none">Aucun</option>
{{#select system.attribut3}} {{#select system.attribut3}}
{{#each attributs as |attrLabel attrKey|}} {{#each attributs as |attrLabel attrKey|}}
@ -64,19 +64,22 @@
<ul> <ul>
{{#each system.predilections as |predilection key|}} {{#each system.predilections as |predilection key|}}
<li class="prediction-item item flexrow" data-prediction-index="{{key}}"> <li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<input type="text" class="padd-right color-class-common edit-predilection" <input type="text" class="padd-right color-class-common edit-predilection" value="{{predilection.name}}"
value="{{predilection.name}}" data-dtype="String" /> data-dtype="String" />
</li> </li>
<li class="prediction-item item flexrow" data-prediction-index="{{key}}"> <li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<textarea row="4" type="text" class="padd-right color-class-common edit-predilection-description" <textarea row="4" type="text" class="padd-right color-class-common edit-predilection-description"
data-dtype="String">{{predilection.description}}</textarea> data-dtype="String">{{predilection.description}}</textarea>
</li> </li>
<li class="prediction-item item flexrow" data-prediction-index="{{key}}"> <li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<label class="generic-label">Maitrise ? <input class="predilection-maitrise" type="checkbox" <label class="generic-label">Acquise ? <input class="predilection-acquise" type="checkbox" {{checked
{{checked predilection.maitrise}} /></label> predilection.acquise}} /></label>
<label class="generic-label">Utilisée ? <input class="predilection-used" type="checkbox" <label class="generic-label">Maitrise ? <input class="predilection-maitrise" type="checkbox" {{checked
{{checked predilection.used}} /></label> predilection.maitrise}} /></label>
<label class="generic-label">Utilisée ? <input class="predilection-used" type="checkbox" {{checked
predilection.used}} /></label>
<a class="item-control delete-prediction" title="Supprimer une predilection"><i <a class="item-control delete-prediction" title="Supprimer une predilection"><i
class="fas fa-trash"></i></a> class="fas fa-trash"></i></a>
</li> </li>

View File

@ -18,8 +18,8 @@
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label item-field-label-long">Utilisation </label> <label class="generic-label item-field-label-medium">Utilisation </label>
<select class="status-small-label color-class-common item-field-label-long" type="text" <select class="status-small-label color-class-common item-field-label-medium" type="text"
name="system.utilisation" value="{{system.utilisation}}" data-dtype="String"> name="system.utilisation" value="{{system.utilisation}}" data-dtype="String">
{{#select system.utilisation}} {{#select system.utilisation}}
<option value="permanent">Permanent</option> <option value="permanent">Permanent</option>
@ -32,8 +32,13 @@
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label item-field-label-long">Apporte un bonus ? </label> <label class="generic-label item-field-label-medium">Pré-requis </label>
<input type="checkbox" name="system.isbonus" {{checked system.isbonus}} /> <input type="text" class="padd-right color-class-common item-field-label-medium" name="system.prerequis" value="{{system.prerequis}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-medium">Déja utilisé ? </label>
<input class="predilection-maitrise" type="checkbox" name="system.used" {{checked system.used}} />
</li> </li>
{{#if system.isbonus}} {{#if system.isbonus}}

View File

@ -25,37 +25,23 @@
</div> </div>
{{#if competence}} {{#if competence}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">{{competence.name}}</span> <span class="roll-dialog-label">{{competence.name}}</span>
<span class="small-label">{{competence.system.niveau}}</span> <span class="small-label">{{competence.system.niveau}}</span>
</div> </div>
{{/if}} {{#if maitrises}}
<div class="flexrow">
{{#if rune}} <span class="roll-dialog-label">Utiliser une maîtrise</span>
<div class="flexrow"> <select class="status-small-label color-class-common" id ="select-maitrise" type="text" name="select-maitrise" value="maitriseId" data-dtype="string" >
<span class="roll-dialog-label">{{rune.name}}</span> {{#select maitriseId}}
<span class="small-label">{{rune.system.formule}}</span> <option value="none">Aucune</option>
</div> {{#each maitrises as |maitrise mKey|}}
<div class="flexrow"> <option value="{{maitrise.id}}">{{maitrise.name}}</option>
<span class="roll-dialog-label">Lancement</span> {{/each}}
<select class="roll-dialog-label" id="runemode" type="text" name="runemode" value="{{runemode}}" {{/select}}
data-dtype="String"> </select>
{{#select runemode}} </div>
<option value="prononcer">Prononcer la rune</option> {{/if}}
<option value="inscrire">Inscrire la rune</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Points d'Ame</span>
<select class="roll-dialog-label" id="runeame" type="text" name="runeame" value="{{runeame}}"
data-dtype="Number">
{{#select runeame}}
{{{pointAmeOptions}}}
{{/select}}
</select>
</div>
{{/if}} {{/if}}
<div class="flexrow"> <div class="flexrow">
@ -91,14 +77,6 @@
</div> </div>
{{/if}} {{/if}}
{{#if canEclatDoubleD20}}
<div class="flexrow">
<span class="roll-dialog-label">Doubler le d20 (1 Point d'Eclat)</span>
<input class="" id="doubleD20" type="checkbox" name="doubleD20" value="{{doubleD20}}" {{checked doubleD20}}/>
</div>
{{/if}}
</div> </div>
</form> </form>