Update confrontation
This commit is contained in:
parent
88385d2307
commit
a3df0499a7
13
lang/en.json
13
lang/en.json
@ -106,7 +106,18 @@
|
||||
"preservation": "Preservation",
|
||||
"dicepool": "Available dices",
|
||||
"selectconfront": "Select for confrontation",
|
||||
"transcendapply": "Apply la Transcend to "
|
||||
"transcendapply": "Apply la Transcend to ",
|
||||
"healthcombat": "Health&Fight",
|
||||
"name": "Name",
|
||||
"weapons": "Weapons",
|
||||
"weapon": "Weapon",
|
||||
"melee": "Melee",
|
||||
"ranged": "Ranged",
|
||||
"weapontype": "Weapon type",
|
||||
"type": "Type",
|
||||
"applyimpact": "Apply impact",
|
||||
"applybonus": "Apply bonus",
|
||||
"bonuspool": "Available bonuses"
|
||||
}
|
||||
}
|
||||
}
|
15
lang/fr.json
15
lang/fr.json
@ -30,7 +30,7 @@
|
||||
"ui": {
|
||||
"traitType": "Type de trait",
|
||||
"niveauTrait": "Niveau du trait",
|
||||
"effect": "Effect",
|
||||
"effect": "Incidence",
|
||||
"weight": "Poids",
|
||||
"cost": "Prix",
|
||||
"costUnit": "Unité",
|
||||
@ -106,7 +106,18 @@
|
||||
"preservation": "Préservation",
|
||||
"dicepool": "Dés disponibles",
|
||||
"selectconfront": "Sélectionner pour la Confrontation",
|
||||
"transcendapply": "Appliquer la Transcendence à "
|
||||
"transcendapply": "Appliquer la Transcendence à ",
|
||||
"healthcombat": "Santé&Combat",
|
||||
"name": "Nom",
|
||||
"weapons": "Armes",
|
||||
"weapon": "Arme",
|
||||
"melee": "Mêlée",
|
||||
"ranged": "A Distance",
|
||||
"weapontype": "Type d'arme",
|
||||
"type": "Type",
|
||||
"applyimpact": "Appliquer l'impact",
|
||||
"applybonus": "Appliquer le bonus",
|
||||
"bonuspool": "Bonus disponibles"
|
||||
}
|
||||
}
|
||||
}
|
@ -122,6 +122,11 @@ export class EcrymeActorSheet extends ActorSheet {
|
||||
let skillKey = $(event.currentTarget).data("skill-key")
|
||||
this.actor.rollSkillConfront(categKey, skillKey)
|
||||
});
|
||||
html.find('.roll-weapon-confront').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let weaponId = li.data("item-id");
|
||||
this.actor.rollWeaponConfront(weaponId)
|
||||
});
|
||||
|
||||
html.find('.impact-modify').click((event) => {
|
||||
let impactType = $(event.currentTarget).data("impact-type")
|
||||
|
@ -299,6 +299,12 @@ export class EcrymeActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
modifyConfrontBonus( modifier ) {
|
||||
let newBonus = this.system.internals.confrontbonus + bonus
|
||||
this.update({'system.internals.confrontbonus': newBonus})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
spentSkillTranscendence(skill, value) {
|
||||
let newValue = this.system.skills[skill.categKey].skilllist[skill.skillKey].value - value
|
||||
@ -306,8 +312,18 @@ export class EcrymeActor extends Actor {
|
||||
this.update({ [`system.skills.${skill.categKey}.skilllist.${skill.skillKey}.value`]: newValue })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getBonusList() {
|
||||
let bonusList = []
|
||||
for(let i=0; i<this.system.internals.confrontbonus; i++) {
|
||||
bonusList.push( { value: 1, type: "bonus", location: "mainpool"})
|
||||
}
|
||||
return bonusList
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCommonRollData() {
|
||||
this.system.internals.confrontbonus = 5 // TO BE REMOVED!!!!
|
||||
let rollData = EcrymeUtility.getBasicRollData()
|
||||
rollData.alias = this.name
|
||||
rollData.actorImg = this.img
|
||||
@ -315,8 +331,9 @@ export class EcrymeActor extends Actor {
|
||||
rollData.img = this.img
|
||||
rollData.isReroll = false
|
||||
rollData.traits = duplicate(this.getRollTraits())
|
||||
rollData.spleen = this.getSpleen()
|
||||
rollData.ideal = this.getIdeal()
|
||||
rollData.spleen = duplicate(this.getSpleen() || {})
|
||||
rollData.ideal = duplicate(this.getIdeal() || {})
|
||||
rollData.confrontBonus = this.getBonusList()
|
||||
|
||||
return rollData
|
||||
}
|
||||
@ -358,6 +375,25 @@ export class EcrymeActor extends Actor {
|
||||
confrontStartDialog.render(true)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollWeaponConfront(weaponId) {
|
||||
let weapon = this.items.get(weaponId)
|
||||
let rollData
|
||||
if (weapon && weapon.system.weapontype == "melee") {
|
||||
rollData = this.getCommonSkill("physical", "fencing")
|
||||
} else {
|
||||
rollData = this.getCommonSkill("physical", "shooting")
|
||||
}
|
||||
rollData.mode = "weapon"
|
||||
rollData.weapon = duplicate(weapon)
|
||||
rollData.title = game.i18n.localize("ECRY.ui.confrontation") + " : " + game.i18n.localize(rollData.skill.name)
|
||||
rollData.executionTotal = rollData.skill.value
|
||||
rollData.preservationTotal = rollData.skill.value
|
||||
rollData.applyTranscendence = "execution"
|
||||
let confrontStartDialog = await EcrymeConfrontStartDialog.create(this, rollData)
|
||||
confrontStartDialog.render(true)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollWeapon(weaponId) {
|
||||
let weapon = this.items.get(weaponId)
|
||||
|
@ -6,7 +6,10 @@ export const ECRYME_CONFIG = {
|
||||
spleen: "Spleen",
|
||||
ideal: "Ideal"
|
||||
},
|
||||
|
||||
weaponTypes: {
|
||||
"melee": "ECRY.ui.melee",
|
||||
"ranged": "ECRY.ui.ranged"
|
||||
},
|
||||
traitLevel: [
|
||||
{value: -3, text: "-3"},
|
||||
{value: -2, text: "-2"},
|
||||
|
@ -2,9 +2,9 @@
|
||||
import { EcrymeCommands } from "../app/ecryme-commands.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __maxImpacts = {superficial: 4, light: 3, serious: 2, major: 1}
|
||||
const __nextImpacts = {superficial: "light", light: "serious", serious: "major", major: "major"}
|
||||
|
||||
const __maxImpacts = { superficial: 4, light: 3, serious: 2, major: 1 }
|
||||
const __nextImpacts = { superficial: "light", light: "serious", serious: "major", major: "major" }
|
||||
const __effect2Impact= [ "none", "superficial", "superficial", "light", "light", "serious", "serious", "major", "major" ]
|
||||
/* -------------------------------------------- */
|
||||
export class EcrymeUtility {
|
||||
|
||||
@ -102,6 +102,89 @@ export class EcrymeUtility {
|
||||
}
|
||||
return actor
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getImpactFromEffect(effectValue) {
|
||||
if (effectValue >= __effect2Impact.length) {
|
||||
return "major"
|
||||
}
|
||||
return __effect2Impact[effectValue]
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static async processConfrontation() {
|
||||
let confront = {
|
||||
type: "confront-data",
|
||||
rollData1: this.confrontData1,
|
||||
rollData2: this.confrontData2,
|
||||
}
|
||||
// Compute margin
|
||||
confront.marginExecution = this.confrontData1.executionTotal - this.confrontData2.preservationTotal
|
||||
confront.marginPreservation = this.confrontData1.preservationTotal - this.confrontData2.executionTotal
|
||||
console.log(confront.marginExecution, confront.marginPreservation)
|
||||
// Filter margin
|
||||
let maxMargin // Dummy max
|
||||
if ( confront.marginExecution > 0) { // Successful hit
|
||||
// Limit with skill+spec
|
||||
maxMargin = confront.rollData1.skill.value + ((confront.rollData1.spec) ? 2 : 0)
|
||||
confront.marginExecution = Math.min(confront.marginExecution, maxMargin)
|
||||
} else { // Failed hit
|
||||
maxMargin = confront.rollData2.skill.value + ((confront.rollData2.spec) ? 2 : 0)
|
||||
confront.marginExecution = -Math.min(Math.abs(confront.marginExecution), maxMargin)
|
||||
}
|
||||
|
||||
if ( confront.marginPreservation > 0) { // Successful defense
|
||||
// Limit with skill+spec
|
||||
maxMargin = confront.rollData1.skill.value + ((confront.rollData1.spec) ? 2 : 0)
|
||||
confront.marginPreservation = Math.min(confront.marginPreservation, maxMargin)
|
||||
} else { // Failed defense
|
||||
maxMargin = confront.rollData2.skill.value + ((confront.rollData2.spec) ? 2 : 0)
|
||||
confront.marginPreservation = - Math.min(Math.abs(confront.marginPreservation), maxMargin)
|
||||
}
|
||||
|
||||
// Compute effects
|
||||
confront.effectExecution = confront.marginExecution
|
||||
if (confront.rollData1.weapon && confront.marginExecution > 0) {
|
||||
confront.effectExecution += confront.rollData1.weapon.system.effect
|
||||
confront.impactExecution = this.getImpactFromEffect(confront.effectExecution)
|
||||
}
|
||||
if ( confront.marginExecution < 0) {
|
||||
confront.bonus2 = -confront.marginExecution
|
||||
}
|
||||
confront.effectPreservation = confront.marginPreservation
|
||||
if (confront.rollData2.weapon && confront.marginPreservation < 0) {
|
||||
confront.effectPreservation = - (Math.abs(confront.marginPreservation) + confront.rollData2.weapon.system.effect)
|
||||
confront.impactPreservation = this.getImpactFromEffect(Math.abs(confront.effectPreservation))
|
||||
}
|
||||
if ( confront.marginPreservation > 0) {
|
||||
confront.bonus1 = -confront.marginPreservation
|
||||
}
|
||||
|
||||
let msg = await this.createChatWithRollMode(this.confrontData1.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-confrontation-result.hbs`, confront)
|
||||
})
|
||||
msg.setFlag("world", "ecryme-rolldata", confront)
|
||||
console.log("Confront result", confront)
|
||||
|
||||
this.lastConfront = confront
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static manageConfrontation(rollData) {
|
||||
console.log("Confront", rollData)
|
||||
// Auto - Reset
|
||||
if (this.confrontData1 && this.confrontData2) {
|
||||
this.confrontData1 = undefined
|
||||
this.confrontData2 = undefined
|
||||
}
|
||||
// Then attribute
|
||||
if (!this.confrontData1) {
|
||||
this.confrontData1 = rollData
|
||||
} else if (this.confrontData1 && this.confrontData1.rollId != rollData.rollId) {
|
||||
this.confrontData2 = rollData
|
||||
this.processConfrontation().catch("Error during confrontation processing")
|
||||
} else {
|
||||
ui.notifications.warn(game.i18n.localize("ECRY.warn.confrontalready"))
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static chatMenuManager(html, options) {
|
||||
@ -132,14 +215,23 @@ export class EcrymeUtility {
|
||||
/* -------------------------------------------- */
|
||||
static async chatListeners(html) {
|
||||
|
||||
html.on("click", '.roll-destin', event => {
|
||||
html.on("click", '.button-select-confront', event => {
|
||||
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "rolldata")
|
||||
let actor = this.getActorFromRollData(rollData)
|
||||
actor.incDecDestin(-1)
|
||||
rollData.isReroll = true
|
||||
this.rollEcryme(rollData).catch("Error on rollEcryme")
|
||||
let rollData = message.getFlag("world", "ecryme-rolldata")
|
||||
EcrymeUtility.manageConfrontation(rollData)
|
||||
})
|
||||
html.on("click", '.button-apply-impact', event => {
|
||||
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
|
||||
let message = game.messages.get(messageId)
|
||||
let actor = game.actors.get($(event.currentTarget).data("actor-id"))
|
||||
actor.modifyImpact($(event.currentTarget).data("impact-type"), $(event.currentTarget).data("impact"), 1)
|
||||
})
|
||||
html.on("click", '.button-apply-bonus', event => {
|
||||
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
|
||||
let message = game.messages.get(messageId)
|
||||
let actor = game.actors.get($(event.currentTarget).data("actor-id"))
|
||||
actor.modifyConfrontBonus( $(event.currentTarget).data("bonus") )
|
||||
})
|
||||
html.on("click", '.draw-tarot-card', event => {
|
||||
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
|
||||
@ -158,6 +250,7 @@ export class EcrymeUtility {
|
||||
'systems/fvtt-ecryme/templates/items/partial-item-description.hbs',
|
||||
'systems/fvtt-ecryme/templates/dialogs/partial-common-roll-dialog.hbs',
|
||||
'systems/fvtt-ecryme/templates/dialogs/partial-confront-dice-area.hbs',
|
||||
'systems/fvtt-ecryme/templates/dialogs/partial-confront-bonus-area.hbs',
|
||||
'systems/fvtt-ecryme/templates/actors/partial-impacts.hbs',
|
||||
]
|
||||
return loadTemplates(templatePaths);
|
||||
@ -254,7 +347,7 @@ export class EcrymeUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static chatDataSetup(content, modeOverride, isRoll = false, forceWhisper) {
|
||||
static chatDataSetup(content, modeOverride, forceWhisper, isRoll = false) {
|
||||
let chatData = {
|
||||
user: game.user.id,
|
||||
rollMode: modeOverride || game.settings.get("core", "rollMode"),
|
||||
@ -288,7 +381,9 @@ export class EcrymeUtility {
|
||||
rollMode = rollMode ?? game.settings.get("core", "rollMode");
|
||||
switch (rollMode) {
|
||||
case "blindroll": //GM only
|
||||
whisper = this.getUsers(user => user.isGM);
|
||||
blind = true;
|
||||
break
|
||||
case "gmroll": //GM + rolling player
|
||||
whisper = this.getUsers(user => user.isGM);
|
||||
break;
|
||||
@ -313,7 +408,8 @@ export class EcrymeUtility {
|
||||
rollData.margin = rollData.total - rollData.difficulty
|
||||
if (rollData.total > rollData.difficulty) {
|
||||
rollData.isSuccess = true
|
||||
rollData.margin = Math.min(rollData.margin, rollData.skill.value)
|
||||
let maxMargin = rollData.skill.value + (rollData.spec) ? 2 : 0
|
||||
rollData.margin = Math.min(rollData.margin, maxMargin)
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,7 +484,6 @@ export class EcrymeUtility {
|
||||
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-generic-result.hbs`, rollData)
|
||||
})
|
||||
msg.setFlag("world", "ecryme-rolldata", rollData)
|
||||
|
||||
console.log("Rolldata result", rollData)
|
||||
}
|
||||
|
||||
@ -501,6 +596,7 @@ export class EcrymeUtility {
|
||||
static getBasicRollData() {
|
||||
let rollData = {
|
||||
rollId: randomID(16),
|
||||
type: "roll-data",
|
||||
bonusMalusPerso: 0,
|
||||
bonusMalusSituation: 0,
|
||||
bonusMalusDef: 0,
|
||||
|
@ -9,7 +9,7 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
let options = mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-ecryme ecryme-confrontation-dialog"],
|
||||
dragDrop: [{ dragSelector: ".confront-dice-container", dropSelector: null }],
|
||||
width: 540, height: 'fit-content', 'z-index': 99999
|
||||
width: 620, height: 'fit-content', 'z-index': 99999
|
||||
});
|
||||
|
||||
let html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/confront-dialog.hbs', rollData);
|
||||
@ -50,6 +50,7 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
let msg = await EcrymeUtility.createChatMessage(this.rollData.alias, "blindroll", {
|
||||
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-confrontation-pending.hbs`, this.rollData)
|
||||
})
|
||||
console.log("MSG", this.rollData)
|
||||
msg.setFlag("world", "ecryme-rolldata", this.rollData)
|
||||
}
|
||||
|
||||
@ -61,31 +62,43 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
|
||||
let button = this.buttonDisabled
|
||||
setTimeout(function () { $(".launchConfront").attr("disabled", button) }, 180)
|
||||
|
||||
}
|
||||
|
||||
/* ------------------ -------------------------- */
|
||||
_onDragStart(event) {
|
||||
super._onDragStart(event)
|
||||
console.log("DRAG", event)
|
||||
const diceData = {
|
||||
let dragType = $(event.srcElement).data("drag-type")
|
||||
let diceData = {}
|
||||
console.log("DRAGTYPE", dragType)
|
||||
if (dragType == "dice") {
|
||||
diceData = {
|
||||
dragType: "dice",
|
||||
diceIndex: $(event.srcElement).data("dice-idx"),
|
||||
diceValue: $(event.srcElement).data("dice-value"),
|
||||
}
|
||||
} else {
|
||||
diceData = {
|
||||
dragType: "bonus",
|
||||
bonusIndex: $(event.srcElement).data("bonus-idx"),
|
||||
bonusValue: 1
|
||||
}
|
||||
}
|
||||
event.dataTransfer.setData("text/plain", JSON.stringify(diceData));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_onDrop(event) {
|
||||
let dataJSON = event.dataTransfer.getData('text/plain')
|
||||
console.log("DICEDATA", dataJSON)
|
||||
let data = JSON.parse(dataJSON)
|
||||
if ( data.dragType == "dice") {
|
||||
let idx = Number(data.diceIndex)
|
||||
//console.log("DATA", data, event, event.srcElement.className)
|
||||
if (event.srcElement.className.includes("execution")) {
|
||||
if (event.srcElement.className.includes("execution") &&
|
||||
this.rollData.availableDices.filter(d => d.location == "execution").length < 2) {
|
||||
this.rollData.availableDices[idx].location = "execution"
|
||||
}
|
||||
if (event.srcElement.className.includes("preservation")) {
|
||||
if (event.srcElement.className.includes("preservation") &&
|
||||
this.rollData.availableDices.filter(d => d.location == "preservation").length < 2) {
|
||||
this.rollData.availableDices[idx].location = "preservation"
|
||||
}
|
||||
if (event.srcElement.className.includes("dice-list")) {
|
||||
@ -97,9 +110,21 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
} else {
|
||||
this.buttonDisabled = true
|
||||
}
|
||||
} else {
|
||||
let idx = Number(data.bonusIndex)
|
||||
if (event.srcElement.className.includes("execution")) {
|
||||
this.rollData.confrontBonus[idx].location = "execution"
|
||||
}
|
||||
if (event.srcElement.className.includes("preservation")) {
|
||||
this.rollData.confrontBonus[idx].location = "preservation"
|
||||
}
|
||||
if (event.srcElement.className.includes("bonus-list")) {
|
||||
this.rollData.confrontBonus[idx].location = "mainpool"
|
||||
}
|
||||
}
|
||||
|
||||
// Manage total values
|
||||
this.computeTotals().catch("Error on dice pools")
|
||||
this.computeTotals()
|
||||
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@ -115,20 +140,27 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeTotals() {
|
||||
computeTotals() {
|
||||
let rollData = this.rollData
|
||||
let actor = game.actors.get(rollData.actorId)
|
||||
|
||||
rollData.executionTotal = rollData.availableDices.filter(d => d.location == "execution").reduce((previous, current) => {
|
||||
return previous + current.result
|
||||
}, rollData.skill.value)
|
||||
rollData.executionTotal = rollData.confrontBonus.filter(d => d.location == "execution").reduce((previous, current) => {
|
||||
return previous + 1
|
||||
}, rollData.executionTotal)
|
||||
|
||||
rollData.preservationTotal = rollData.availableDices.filter(d => d.location == "preservation").reduce((previous, current) => {
|
||||
return previous + current.result
|
||||
}, rollData.skill.value)
|
||||
rollData.preservationTotal = rollData.confrontBonus.filter(d => d.location == "preservation").reduce((previous, current) => {
|
||||
return previous + 1
|
||||
}, rollData.preservationTotal)
|
||||
this.processTranscendence()
|
||||
|
||||
if (rollData.selectedSpecs && rollData.selectedSpecs.length > 0) {
|
||||
rollData.spec = actor.getSpecialization(rollData.selectedSpecs[0])
|
||||
rollData.spec = duplicate(actor.getSpecialization(rollData.selectedSpecs[0]))
|
||||
this.rollData.executionTotal += "+2"
|
||||
this.rollData.preservationTotal += "+2"
|
||||
}
|
||||
@ -161,7 +193,7 @@ export class EcrymeConfrontDialog extends Dialog {
|
||||
rollData.preservationTotal += rollData.bonusMalusTraits
|
||||
rollData.preservationTotal += rollData.bonusMalusPerso
|
||||
|
||||
this.refreshDialog()
|
||||
this.refreshDialog().catch("Error on refresh confrontation dialog")
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -1350,9 +1350,35 @@ ul, li {
|
||||
.confront-dice {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
.bonus-spec {
|
||||
max-width: 48px;
|
||||
}
|
||||
.confront-bonus-container {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
color: black;
|
||||
}
|
||||
.pool-list {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.confront-bonus-centered {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
font-size: 1.6rem;
|
||||
color: darkgreen;
|
||||
font-family: MailartRubberstamp;
|
||||
transform: translate(-50%, -55%);
|
||||
}
|
||||
|
||||
.dice-spec {
|
||||
max-width: 64px;
|
||||
}
|
||||
.confront-dice-container {
|
||||
position: relative;
|
||||
max-width: 128px;
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
color: black;
|
||||
@ -1364,7 +1390,7 @@ ul, li {
|
||||
font-size: 2rem;
|
||||
color: darkgreen;
|
||||
font-family: MailartRubberstamp;
|
||||
transform: translate(-50%, -80%);
|
||||
transform: translate(-50%, -55%);
|
||||
}
|
||||
.confront-area {
|
||||
margin: 2px;
|
||||
@ -1374,4 +1400,6 @@ ul, li {
|
||||
border-color: #000000;
|
||||
border-radius: 6px;
|
||||
border: 2px ridge #443307;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
@ -1330,9 +1330,35 @@ ul, li {
|
||||
.confront-dice {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
.bonus-spec {
|
||||
max-width: 48px;
|
||||
}
|
||||
.confront-bonus-container {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
color: black;
|
||||
}
|
||||
.pool-list {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.confront-bonus-centered {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
font-size: 1.6rem;
|
||||
color: darkgreen;
|
||||
font-family: MailartRubberstamp;
|
||||
transform: translate(-50%, -55%);
|
||||
}
|
||||
|
||||
.dice-spec {
|
||||
max-width: 64px;
|
||||
}
|
||||
.confront-dice-container {
|
||||
position: relative;
|
||||
max-width: 128px;
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
color: black;
|
||||
@ -1344,14 +1370,16 @@ ul, li {
|
||||
font-size: 2rem;
|
||||
color: darkgreen;
|
||||
font-family: MailartRubberstamp;
|
||||
transform: translate(-50%, -80%);
|
||||
transform: translate(-50%, -55%);
|
||||
}
|
||||
.confront-area {
|
||||
margin: 2px;
|
||||
padding: 4px;
|
||||
min-height: 96px;
|
||||
min-height: 64px;
|
||||
border-width: 2px;
|
||||
border-color: #000000;
|
||||
border-radius: 6px;
|
||||
border: 2px ridge #443307;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
],
|
||||
"title": "Ecryme, le Jeu de Rôles",
|
||||
"url": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme",
|
||||
"version": "11.0.1",
|
||||
"version": "11.0.3",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme/archive/fvtt-ecryme-v10.0.0.zip",
|
||||
"background": "systems/fvtt-ecryme/images/assets/ecryme_extract_panel_01.webp"
|
||||
}
|
@ -135,6 +135,9 @@
|
||||
"serious": 0,
|
||||
"major": 0
|
||||
}
|
||||
},
|
||||
"internals": {
|
||||
"confrontbonus": 0
|
||||
}
|
||||
},
|
||||
"npccore": {
|
||||
@ -200,6 +203,7 @@
|
||||
"common",
|
||||
"equipement"
|
||||
],
|
||||
"weapontype": "melee",
|
||||
"effect": 0
|
||||
},
|
||||
"specialization": {
|
||||
|
@ -50,7 +50,7 @@
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="competences">{{localize "ECRY.ui.skills"}}</a>
|
||||
<a class="item" data-tab="traits">{{localize "ECRY.ui.traits"}}</a>
|
||||
<a class="item" data-tab="confrontation">{{localize "ECRY.ui.confrontation"}}</a>
|
||||
<a class="item" data-tab="combat">{{localize "ECRY.ui.healthcombat"}}</a>
|
||||
<a class="item" data-tab="equipements">{{localize "ECRY.ui.equipment"}}</a>
|
||||
<a class="item" data-tab="biodata">{{localize "ECRY.ui.bionotes"}}</a>
|
||||
</nav>
|
||||
@ -69,7 +69,8 @@
|
||||
<ul class="stat-list alternate-list item-list">
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header impact-title">
|
||||
<h3><label class="items-title-text">{{localize category.name}} ({{valueAtIndex @root.impactsMalus categkey}})</label></h3>
|
||||
<h3><label class="items-title-text">{{localize category.name}} ({{valueAtIndex @root.impactsMalus
|
||||
categkey}})</label></h3>
|
||||
</span>
|
||||
</li>
|
||||
{{#each category.skilllist as |skill skillkey|}}
|
||||
@ -150,7 +151,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab confrontation" data-group="primary" data-tab="confrontation">
|
||||
<div class="tab combat" data-group="primary" data-tab="combat">
|
||||
|
||||
<div class="flexrow">
|
||||
{{> systems/fvtt-ecryme/templates/actors/partial-impacts.hbs impacts=system.impacts.physical
|
||||
@ -164,18 +165,31 @@
|
||||
<ul class="item-list alternate-list">
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header-long2">
|
||||
<h3><label class="item-name-label-header-long2">{{localize "ECRY.ui.ongoingconfront"}}</label></h3>
|
||||
<h3><label class="item-name-label-header-long2">{{localize "ECRY.ui.weapons"}}</label></h3>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="item-field-label-medium">{{localize "ECRY.ui.type"}}</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="item-field-label-medium">{{localize "ECRY.ui.effect"}}</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each confrontations as |confront key|}}
|
||||
<li class="item flexrow list-item list-item-shadow" data-item-id="{{confront._id}}">
|
||||
{{#each weapons as |weapon key|}}
|
||||
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
|
||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||
src="{{confront.img}}" /></a>
|
||||
<span class="item-name-label-long2">{{confront.name}}</span>
|
||||
src="{{weapon.img}}" /></a>
|
||||
<span class="item-name-label-long2">
|
||||
<a class="roll-weapon-confront" data-category-key="{{categkey}}" data-skill-key="{{skillkey}}">
|
||||
<i class="fa-regular fa-swords"></i>
|
||||
{{weapon.name}}
|
||||
</a>
|
||||
</span>
|
||||
<span class="item-field-label-medium">{{localize (concat "ECRY.ui." weapon.system.weapontype)}}</span>
|
||||
<span class="item-field-label-medium">{{weapon.system.effect}}</span>
|
||||
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-delete" title="Delete confrontation"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-control item-delete" title="Delete weapon"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
54
templates/chat/chat-confrontation-result.hbs
Normal file
54
templates/chat/chat-confrontation-result.hbs
Normal file
@ -0,0 +1,54 @@
|
||||
<div class="chat-message-header">
|
||||
{{#if actorImg}}
|
||||
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
|
||||
{{/if}}
|
||||
<h4 class="chat-actor-name">{{alias}}</h4>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{{#if img}}
|
||||
<div>
|
||||
<img class="chat-icon" src="{{img}}" alt="{{alias}}" />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
<li>Confrontation : {{rollData1.alias}} vs {{rollData2.alias}}</li>
|
||||
<li>{{localize rollData1.skill.name}} ({{rollData1.skill.value}}) vs {{localize rollData2.skill.name}} ({{rollData2.skill.value}}) </li>
|
||||
<li>{{rollData1.executionTotal}} vs {{rollData2.preservationTotal}} : {{marginExecution}}</li>
|
||||
<li>{{rollData1.preservationTotal}} vs {{rollData2.executionTotal}} : {{marginPreservation}}</li>
|
||||
|
||||
{{#if rollData1.weapon}}
|
||||
<li>{{rollData1.alias}} {{rollData1.weapon.name}} ({{rollData1.weapon.system.effect}})
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollData2.weapon}}
|
||||
<li>{{rollData2.alias}} {{rollData2.weapon.name}} ({{rollData2.weapon.system.effect}})</li>
|
||||
{{/if}}
|
||||
|
||||
<li>{{localize "ECRY.ui.effect"}} {{localize "ECRY.ui.execution"}} : {{effectExecution}}</li>
|
||||
{{#if impactExecution}}
|
||||
<li>Impact {{rollData2.alias}} : 1 {{localize (concat "ECRY.ui." impactExecution)}}</li>
|
||||
<button class="button-apply-impact" data-actor-id="{{rollData2.actorId}}" data-impact-type={{rollData1.skill.categKey}} data-impact="{{impactExecution}}">{{localize "ECRY.ui.applyimpact"}}</button>
|
||||
{{/if}}
|
||||
{{#if bonus2}}
|
||||
<li>Bonus {{rollData2.alias}} : {{bonus2}}</li>
|
||||
<button class="button-apply-bonus" data-actor-id="{{rollData2.actorId}}" data-bonus="{{bonus2}}">{{localize "ECRY.ui.applybonus"}}</button>
|
||||
{{/if}}
|
||||
|
||||
<li>{{localize "ECRY.ui.effect"}} {{localize "ECRY.ui.preservation"}} : {{effectPreservation}}</li>
|
||||
{{#if impactPreservation}}
|
||||
<li>Impact {{rollData1.alias}} : 1 {{localize (concat "ECRY.ui." impactPreservation)}}</li>
|
||||
<button class="button-apply-impact" data-actor-id="{{rollData1.actorId}}" data-impact-type={{rollData1.skill.categKey}} data-impact="{{impactPreservation}}">{{localize "ECRY.ui.applyimpact"}}</button>
|
||||
{{/if}}
|
||||
{{#if bonus1}}
|
||||
<li>Bonus {{rollData1.alias}} : {{bonus1}}</li>
|
||||
<button class="button-apply-bonus" data-actor-id="{{rollData1.actorId}}" data-bonus="{{bonus1}}">{{localize "ECRY.ui.applybonus"}}</button>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -14,6 +14,8 @@
|
||||
<h3>{{localize "ECRY.ui.execution"}} : <span id="execution-total">{{executionTotal}}</span> </h3>
|
||||
<div id="confront-execution" class="flexrow confront-area confront-execution-area">
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-dice-area.hbs filter="execution"}}
|
||||
<br>
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-bonus-area.hbs filter="execution"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -21,16 +23,29 @@
|
||||
<h3>{{localize "ECRY.ui.preservation"}} : <span id="preservation-total">{{preservationTotal}}</span></h3>
|
||||
<div id="confront-preservation" class="flexrow confront-area confront-preservation-area">
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-dice-area.hbs filter="preservation"}}
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-bonus-area.hbs filter="preservation"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<h4>{{localize "ECRY.ui.dicepool"}}</h4>
|
||||
<div id="confront-dice-pool" class="flexrow confront-area confrontation-dice-list">
|
||||
<div id="confront-dice-pool" class="flexrow confront-area confrontation-dice-list pool-list">
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-dice-area.hbs filter="mainpool"}}
|
||||
</div>
|
||||
|
||||
<h4>{{localize "ECRY.ui.bonuspool"}} (Total : {{count confrontBonus}})</h4>
|
||||
<div id="confront-bonus-pool" class="flexrow confront-area confrontation-bonus-list pool-list">
|
||||
{{> systems/fvtt-ecryme/templates/dialogs/partial-confront-bonus-area.hbs filter="mainpool"}}
|
||||
</div>
|
||||
|
||||
{{#if weapon}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">{{localize "ECRY.ui.weapon"}} : </span>
|
||||
<span class="roll-dialog-label">{{weapon.name}} ({{localize "ECRY.ui.effect"}} {{weapon.system.effect}})</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if impactMalus}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">{{localize "ECRY.ui.impactmalus"}} : </span>
|
||||
|
10
templates/dialogs/partial-confront-bonus-area.hbs
Normal file
10
templates/dialogs/partial-confront-bonus-area.hbs
Normal file
@ -0,0 +1,10 @@
|
||||
{{#each confrontBonus as |bonus idx|}}
|
||||
{{#if (eq bonus.location ../filter)}}
|
||||
<div class="confront-dice-container bonus-spec" data-drag-type="bonus" data-bonus-idx={{idx}}>
|
||||
<span draggable="true" data-drag-type="bonus" data-bonus-idx={{idx}}>
|
||||
<img class="confront-dice" data-drag-type="bonus" data-bonus-idx={{idx}} src="icons/svg/circle.svg" >
|
||||
<label class="confront-bonus-centered" data-drag-type="bonus" data-bonus-idx={{idx}}>+1</label>
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
@ -1,9 +1,9 @@
|
||||
{{#each availableDices as |dice idx|}}
|
||||
{{#if (eq dice.location ../filter)}}
|
||||
<div class="confront-dice-container" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<span draggable="true" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<img class="confront-dice" src="icons/svg/d6-grey.svg" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<label class="confront-dice-centered" data-dice-idx={{idx}}
|
||||
<div class="confront-dice-container dice-spec" data-drag-type="dice" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<span draggable="true" data-drag-type="dice" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<img class="confront-dice" src="icons/svg/d6-grey.svg" data-drag-type="dice" data-dice-idx={{idx}} data-dice-value="{{dice.result}}">
|
||||
<label class="confront-dice-centered" data-drag-type="dice" data-dice-idx={{idx}}
|
||||
data-dice-value="{{dice.result}}">{{dice.result}}</label>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -19,6 +19,17 @@
|
||||
<div class="tab" data-group="primary">
|
||||
<ul>
|
||||
|
||||
<li class="flexrow">
|
||||
<label class="item-name-label-long">{{localize "ECRY.ui.weapontype"}}</label>
|
||||
<select class="item-field-label-medium" type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String">
|
||||
{{#select system.weapontype}}
|
||||
{{#each config.weaponTypes as |type key| }}
|
||||
<option value="{{key}}">{{localize type}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="flexrow">
|
||||
<label class="item-name-label-long">{{localize "ECRY.ui.effect"}}</label>
|
||||
<input type="text" class="item-field-label-short" name="system.effect" value="{{system.effect}}" data-dtype="Number"/>
|
||||
|
Loading…
Reference in New Issue
Block a user