diff --git a/gulpfile.js b/gulpfile.js index ba6ab3d..4c748fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,3 +18,8 @@ gulp.task('css', function () { .pipe(postcss(processors)) .pipe(gulp.dest('./styles')); }); + + +function watchUpdates() { + gulp.watch('./postcss/*.css', css); +} diff --git a/images/assets/ecryme_city.webp b/images/assets/ecryme_city.webp new file mode 100644 index 0000000..dc525f1 Binary files /dev/null and b/images/assets/ecryme_city.webp differ diff --git a/images/assets/ecryme_extract_panel_01.webp b/images/assets/ecryme_extract_panel_01.webp new file mode 100644 index 0000000..16e1257 Binary files /dev/null and b/images/assets/ecryme_extract_panel_01.webp differ diff --git a/images/icons/.directory b/images/icons/.directory index e08811e..63007f0 100644 --- a/images/icons/.directory +++ b/images/icons/.directory @@ -1,6 +1,5 @@ [Dolphin] SortRole=modificationtime -Timestamp=2023,2,26,15,32,34.892 +Timestamp=2023,5,10,17,7,42.817 Version=4 -ViewMode=1 VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails diff --git a/images/icons/Artiste.webp b/images/icons/Artiste.webp deleted file mode 100644 index 8fc7413..0000000 Binary files a/images/icons/Artiste.webp and /dev/null differ diff --git a/images/icons/Aventurier.webp b/images/icons/Aventurier.webp deleted file mode 100644 index c0af694..0000000 Binary files a/images/icons/Aventurier.webp and /dev/null differ diff --git a/images/icons/Comedien.webp b/images/icons/Comedien.webp deleted file mode 100644 index 8e8c306..0000000 Binary files a/images/icons/Comedien.webp and /dev/null differ diff --git a/images/icons/Commercant.webp b/images/icons/Commercant.webp deleted file mode 100644 index 2c0ebd9..0000000 Binary files a/images/icons/Commercant.webp and /dev/null differ diff --git a/images/icons/Ecclesiastique.webp b/images/icons/Ecclesiastique.webp deleted file mode 100644 index 1f393da..0000000 Binary files a/images/icons/Ecclesiastique.webp and /dev/null differ diff --git a/images/icons/Ecrivain.webp b/images/icons/Ecrivain.webp deleted file mode 100644 index 94fc7fd..0000000 Binary files a/images/icons/Ecrivain.webp and /dev/null differ diff --git a/images/icons/Enseignant.webp b/images/icons/Enseignant.webp deleted file mode 100644 index c797c58..0000000 Binary files a/images/icons/Enseignant.webp and /dev/null differ diff --git a/images/icons/Ingenieur.webp b/images/icons/Ingenieur.webp deleted file mode 100644 index b16e346..0000000 Binary files a/images/icons/Ingenieur.webp and /dev/null differ diff --git a/images/icons/Journaliste.webp b/images/icons/Journaliste.webp deleted file mode 100644 index 7a7f78d..0000000 Binary files a/images/icons/Journaliste.webp and /dev/null differ diff --git a/images/icons/Juriste.webp b/images/icons/Juriste.webp deleted file mode 100644 index 5c194c7..0000000 Binary files a/images/icons/Juriste.webp and /dev/null differ diff --git a/images/icons/Medecin.webp b/images/icons/Medecin.webp deleted file mode 100644 index a3c9fe9..0000000 Binary files a/images/icons/Medecin.webp and /dev/null differ diff --git a/images/icons/Medium.webp b/images/icons/Medium.webp deleted file mode 100644 index 5d54eda..0000000 Binary files a/images/icons/Medium.webp and /dev/null differ diff --git a/images/icons/Militaire.webp b/images/icons/Militaire.webp deleted file mode 100644 index 5029428..0000000 Binary files a/images/icons/Militaire.webp and /dev/null differ diff --git a/images/icons/Proletaire.webp b/images/icons/Proletaire.webp deleted file mode 100644 index 20cc642..0000000 Binary files a/images/icons/Proletaire.webp and /dev/null differ diff --git a/images/icons/Rentier.webp b/images/icons/Rentier.webp deleted file mode 100644 index fcee775..0000000 Binary files a/images/icons/Rentier.webp and /dev/null differ diff --git a/images/icons/arbalete.webp b/images/icons/arbalete.webp deleted file mode 100644 index 49063d6..0000000 Binary files a/images/icons/arbalete.webp and /dev/null differ diff --git a/images/icons/arc.webp b/images/icons/arc.webp deleted file mode 100644 index d3431e1..0000000 Binary files a/images/icons/arc.webp and /dev/null differ diff --git a/images/icons/archetype.webp b/images/icons/archetype.webp deleted file mode 100644 index 0282df7..0000000 Binary files a/images/icons/archetype.webp and /dev/null differ diff --git a/images/icons/constitution.webp b/images/icons/constitution.webp deleted file mode 100644 index 10b5508..0000000 Binary files a/images/icons/constitution.webp and /dev/null differ diff --git a/images/icons/culturegenerale.webp b/images/icons/culturegenerale.webp deleted file mode 100644 index 46a5089..0000000 Binary files a/images/icons/culturegenerale.webp and /dev/null differ diff --git a/images/icons/epee.webp b/images/icons/epee.webp deleted file mode 100644 index 30b8f4d..0000000 Binary files a/images/icons/epee.webp and /dev/null differ diff --git a/images/icons/equipement.webp b/images/icons/equipement.webp deleted file mode 100644 index 05da749..0000000 Binary files a/images/icons/equipement.webp and /dev/null differ diff --git a/images/icons/fusil.webp b/images/icons/fusil.webp deleted file mode 100644 index f6bb7de..0000000 Binary files a/images/icons/fusil.webp and /dev/null differ diff --git a/images/icons/habilite.webp b/images/icons/habilite.webp deleted file mode 100644 index 45a8e16..0000000 Binary files a/images/icons/habilite.webp and /dev/null differ diff --git a/images/icons/icon_annency.webp b/images/icons/icon_annency.webp new file mode 100644 index 0000000..f2b529c Binary files /dev/null and b/images/icons/icon_annency.webp differ diff --git a/images/icons/icon_boheme.webp b/images/icons/icon_boheme.webp new file mode 100644 index 0000000..719e2db Binary files /dev/null and b/images/icons/icon_boheme.webp differ diff --git a/images/icons/icon_contact.webp b/images/icons/icon_contact.webp new file mode 100644 index 0000000..1b5bcab Binary files /dev/null and b/images/icons/icon_contact.webp differ diff --git a/images/icons/icon_equipment.webp b/images/icons/icon_equipment.webp new file mode 100644 index 0000000..e9abae7 Binary files /dev/null and b/images/icons/icon_equipment.webp differ diff --git a/images/icons/icon_skill.webp b/images/icons/icon_skill.webp new file mode 100644 index 0000000..1fd47f1 Binary files /dev/null and b/images/icons/icon_skill.webp differ diff --git a/images/icons/icon_spec.webp b/images/icons/icon_spec.webp new file mode 100644 index 0000000..4c053cc Binary files /dev/null and b/images/icons/icon_spec.webp differ diff --git a/images/icons/icon_trait.webp b/images/icons/icon_trait.webp new file mode 100644 index 0000000..a9bc59b Binary files /dev/null and b/images/icons/icon_trait.webp differ diff --git a/images/icons/icon_weapon.webp b/images/icons/icon_weapon.webp new file mode 100644 index 0000000..5a065f0 Binary files /dev/null and b/images/icons/icon_weapon.webp differ diff --git a/images/icons/mainsnues.webp b/images/icons/mainsnues.webp deleted file mode 100644 index 0483a29..0000000 Binary files a/images/icons/mainsnues.webp and /dev/null differ diff --git a/images/icons/perception.webp b/images/icons/perception.webp deleted file mode 100644 index 1648443..0000000 Binary files a/images/icons/perception.webp and /dev/null differ diff --git a/images/icons/physique.webp b/images/icons/physique.webp deleted file mode 100644 index 6d66280..0000000 Binary files a/images/icons/physique.webp and /dev/null differ diff --git a/images/icons/rationnalite.webp b/images/icons/rationnalite.webp deleted file mode 100644 index 2b5ea21..0000000 Binary files a/images/icons/rationnalite.webp and /dev/null differ diff --git a/images/icons/resume.webp b/images/icons/resume.webp deleted file mode 100644 index f1c5cdf..0000000 Binary files a/images/icons/resume.webp and /dev/null differ diff --git a/images/icons/revolver.webp b/images/icons/revolver.webp deleted file mode 100644 index 251dfeb..0000000 Binary files a/images/icons/revolver.webp and /dev/null differ diff --git a/images/icons/sortilege.webp b/images/icons/sortilege.webp deleted file mode 100644 index 8eee378..0000000 Binary files a/images/icons/sortilege.webp and /dev/null differ diff --git a/images/icons/spiritualite.webp b/images/icons/spiritualite.webp deleted file mode 100644 index 277ebbe..0000000 Binary files a/images/icons/spiritualite.webp and /dev/null differ diff --git a/images/icons/tarot.webp b/images/icons/tarot.webp deleted file mode 100644 index cc4f1c3..0000000 Binary files a/images/icons/tarot.webp and /dev/null differ diff --git a/images/icons/tirage.webp b/images/icons/tirage.webp deleted file mode 100644 index 70a58b2..0000000 Binary files a/images/icons/tirage.webp and /dev/null differ diff --git a/images/icons/tirer.webp b/images/icons/tirer.webp deleted file mode 100644 index bc7efc6..0000000 Binary files a/images/icons/tirer.webp and /dev/null differ diff --git a/images/icons/wisdom.webp b/images/icons/wisdom.webp deleted file mode 100644 index 175200e..0000000 Binary files a/images/icons/wisdom.webp and /dev/null differ diff --git a/lang/en.json b/lang/en.json index ea99c53..64184e3 100644 --- a/lang/en.json +++ b/lang/en.json @@ -8,6 +8,20 @@ "TypeEquipment": "Equipment" }, "ECRY": { + "chat": { + "formula": "Formula", + "difficulty": "Difficulty", + "dicesum": "Dices result", + "result": "Result", + "margin": "Margin", + "success": "Success!", + "failure": "Failed!", + "specialization": "Specialization", + "traitbonus": "Bonus trait", + "traitmalus": "Malus trait", + "bonusmalustraits": "Traits Bonus/Malus", + "spectranscend": "Self-Transcend : " + }, "ui": { "traitType": "Trait type", "niveauTrait": "Trait level", @@ -44,7 +58,27 @@ "loquacity": "Loquacity", "guile": "Guile", "performance" :"Performance", - "skill": "Skill" + "skill": "Skill", + "troublesome": "Troublesome", + "occasional": "Occasional", + "difficult": "Difficult", + "uncommon": "Uncommon", + "verydifficult": "Very Difficult", + "rare": "Rare", + "extremdifficult": "Extremely difficult", + "veryrare": "Very rare", + "increddifficult": "Incredibly difficult", + "exceptrare": "Exceptionally rare", + "none": "None", + "roll": "Roll !", + "cancel": "Cancel", + "rolltitle": "Test roll", + "spec": "Specialization", + "traitbonus": "Bonus traits", + "traitmalus": "Malus traits", + "applyideal": "Apply ideal", + "applyspleen": "Apply spleen", + "skilltranscendence": "Self Transcendence" } } } \ No newline at end of file diff --git a/lang/fr.json b/lang/fr.json index cea18a9..8b9a263 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -8,6 +8,20 @@ "TypeEquipment": "Equipment" }, "ECRY": { + "chat": { + "formula": "Formule", + "difficulty": "Difficulté", + "dicesum": "Dés", + "result": "Resultat", + "margin": "Marge", + "success": "Succés!", + "failure": "Echec!", + "specialization": "Spécialisation", + "traitbonus": "Trait bonus", + "traitmalus": "Trait malus", + "bonusmalustraits": "Bonus/Malus des Traits", + "spectranscend": "Dépassement de soi : " + }, "ui": { "traitType": "Type de trait", "niveauTrait": "Niveau du trait", @@ -44,7 +58,27 @@ "loquacity": "Faconde", "guile": "Maraude", "performance" :"Représentation", - "skill": "Compétence" + "skill": "Compétence", + "troublesome": "Malaisé", + "occasional": "Peu frequent", + "difficult": "Difficile", + "uncommon": "Atypique", + "verydifficult": "Très difficile", + "rare": "Rare", + "extremdifficult": "Extrêmement difficile", + "veryrare": "Très rare", + "increddifficult": "Incroyable", + "exceptrare": "Exceptionnel", + "none": "Aucun", + "roll": "Lancer les dés !", + "cancel": "Annuler", + "rolltitle": "Ou l'on teste ses compétences", + "spec": "Spécialisation", + "traitbonus": "Traits bonus", + "traitmalus": "Traits malus", + "applyideal": "Utiliser l'idéal", + "applyspleen": "Utiliser le spleen", + "skilltranscendence": "Dépassement de soi" } } } \ No newline at end of file diff --git a/modules/actors/ecryme-actor-sheet.js b/modules/actors/ecryme-actor-sheet.js index 28ff412..cd6e0eb 100644 --- a/modules/actors/ecryme-actor-sheet.js +++ b/modules/actors/ecryme-actor-sheet.js @@ -36,6 +36,9 @@ export class EcrymeActorSheet extends ActorSheet { system: duplicate(this.object.system), limited: this.object.limited, skills: this.actor.prepareSkills(), + traits: this.actor.getRollTraits(), + ideal: this.actor.getIdeal(), + spleen: this.actor.getSpleen(), system: duplicate(this.object.system), config: duplicate(game.system.ecryme.config), weapons: duplicate(this.actor.getWeapons()), diff --git a/modules/actors/ecryme-actor.js b/modules/actors/ecryme-actor.js index 3114c98..4175886 100644 --- a/modules/actors/ecryme-actor.js +++ b/modules/actors/ecryme-actor.js @@ -89,7 +89,26 @@ export class EcrymeActor extends Actor { return comp; } + /* -------------------------------------------- */ + getRollTraits() { + return this.items.filter(it => it.type == "trait" && it.system.traitype == "normal") + } + getIdeal() { + return this.items.find(it => it.type == "trait" && it.system.traitype == "ideal") + } + getSpleen() { + return this.items.find(it => it.type == "trait" && it.system.traitype == "spleen") + } + /* -------------------------------------------- */ + getTrait(id) { + //console.log("TRAITS", this.items, this.items.filter(it => it.type == "trait") ) + return this.items.find(it => it.type == "trait" && it._id == id) + } + /* -------------------------------------------- */ + getSpecialization(id) { + return this.items.find(it => it.type == "specialization" && it.id == id) + } /* -------------------------------------------- */ getSpecializations(skillKey) { return this.items.filter(it => it.type == "specialization" && it.system.skillkey == skillKey) @@ -262,6 +281,12 @@ export class EcrymeActor extends Actor { } } + /* -------------------------------------------- */ + spentSkillTranscendence(skill, value) { + let newValue = this.system.skills[skill.categKey].skilllist[skill.skillKey].value - value + newValue = Math.max(0, newValue) + this.update( { [`system.skills.${skill.categKey}.skilllist.${skill.skillKey}.value`]: newValue}) + } /* -------------------------------------------- */ getCommonRollData() { @@ -271,6 +296,9 @@ export class EcrymeActor extends Actor { rollData.actorId = this.id rollData.img = this.img rollData.isReroll = false + rollData.traits = this.getRollTraits() + rollData.spleen = this.getSpleen() + rollData.ideal = this.getIdeal() return rollData } @@ -279,7 +307,11 @@ export class EcrymeActor extends Actor { rollSkill(categKey, skillKey) { let skill = this.system.skills[categKey].skilllist[skillKey] let rollData = this.getCommonRollData() - rollData.skill = duplicate(skill) + skill = duplicate(skill) + skill.categKey = categKey + skill.skillKey = skillKey + skill.spec = this.getSpecializations(skillKey) + rollData.skill = skill rollData.mode = "skill" rollData.title = game.i18n.localize(skill.name) rollData.img = skill.img diff --git a/modules/common/ecryme-config.js b/modules/common/ecryme-config.js index 0e8a4c4..6941d17 100644 --- a/modules/common/ecryme-config.js +++ b/modules/common/ecryme-config.js @@ -14,6 +14,14 @@ export const ECRYME_CONFIG = { {value: +2, text: "+2"}, {value: +3, text: "+3"} ], + difficulty: { + "-1": {difficulty: "ECRY.ui.none", frequency: "ECRY.ui.none", value: "-"}, + "8": { difficulty: "ECRY.ui.troublesome", frequency: "ECRY.ui.occasional", value: 8 }, + "10": { difficulty: "ECRY.ui.difficult", frequency: "ECRY.ui.uncommon", value: 10 }, + "12": { difficulty: "ECRY.ui.verydifficult", frequency: "ECRY.ui.rare", value: 12 }, + "14": { difficulty: "ECRY.ui.extremdifficult", frequency: "ECRY.ui.veryrare", value: 14 }, + "16": { difficulty: "ECRY.ui.increddifficult", frequency: "ECRY.ui.exceptrare", value: 16 }, + }, skillLevel: { "0": "0", "1": "1", diff --git a/modules/common/ecryme-utility.js b/modules/common/ecryme-utility.js index 185d198..f0c3cbf 100644 --- a/modules/common/ecryme-utility.js +++ b/modules/common/ecryme-utility.js @@ -8,6 +8,7 @@ export class EcrymeUtility { /* -------------------------------------------- */ static async init() { Hooks.on('renderChatLog', (log, html, data) => EcrymeUtility.chatListeners(html)); + Hooks.on("getChatLogEntryContext", (html, options) => EcrymeUtility.chatMenuManager(html, options)); this.rollDataStore = {} this.defenderStore = {} @@ -43,15 +44,22 @@ export class EcrymeUtility { Handlebars.registerHelper('add', function (a, b) { return parseInt(a) + parseInt(b); }) + Handlebars.registerHelper('for', function (from, to, incr, block) { + var accum = ''; + for (var i = from; i <= to; i += incr) + accum += block.fn(i); + return accum; + }) this.buildSkillConfig() + } /*-------------------------------------------- */ static buildSkillConfig() { - game.system.ecryme.config.skills = { } - for (let categKey in game.data.template.Actor.templates.core.skills) { + game.system.ecryme.config.skills = {} + for (let categKey in game.data.template.Actor.templates.core.skills) { let category = game.data.template.Actor.templates.core.skills[categKey] - for(let skillKey in category.skilllist) { + for (let skillKey in category.skilllist) { let skill = duplicate(category.skilllist[skillKey]) skill.categKey = categKey // Auto reference the category game.system.ecryme.config.skills[skillKey] = skill @@ -89,6 +97,32 @@ export class EcrymeUtility { return actor } + /* -------------------------------------------- */ + static chatMenuManager(html, options) { + let canTranscendRoll = [] + for(let i=1; i<=10; i++ ) { + canTranscendRoll[i] = function (li) { + let message = game.messages.get(li.attr("data-message-id")) + let rollData = message.getFlag("world", "rolldata") + //console.log(">>>>>>>>>>>>>>>>>>>>>>>>>> Menu !!!!", rollData) + if (rollData.skill && i <= rollData.skill.value && !rollData.transcendUsed && rollData.spec ) { + return true + } + return false + } + options.push({ + name: game.i18.localize("ECRY.chat.spectranscend") + i, + icon: '', + condition: canTranscendRoll[i], + callback: li => { + let message = game.messages.get(li.attr("data-message-id")) + let rollData = message.getFlag("world", "rolldata") + EcrymeUtility.transcendFromSpec(rollData, i) + } + }) + } + } + /* -------------------------------------------- */ static async chatListeners(html) { @@ -105,7 +139,7 @@ export class EcrymeUtility { let messageId = EcrymeUtility.findChatMessageId(event.currentTarget) this.drawDeckCard(messageId) }) - + } /* -------------------------------------------- */ @@ -191,7 +225,7 @@ export class EcrymeUtility { static async onSocketMesssage(msg) { console.log("SOCKET MESSAGE", msg.name) if (msg.name == "msg-draw-card") { - if ( game.user.isGM && game.system.ecryme.currentTirage) { + if (game.user.isGM && game.system.ecryme.currentTirage) { game.system.ecryme.currentTirage.addCard(msg.data.msgId) } } @@ -258,19 +292,13 @@ export class EcrymeUtility { /* -------------------------------------------- */ static computeResults(rollData) { rollData.isSuccess = false - if (rollData.total <= rollData.target) { + if (!rollData.difficulty || rollData.difficulty == "-") { + return + } + rollData.margin = rollData.total - rollData.difficulty + if (rollData.total > rollData.difficulty) { rollData.isSuccess = true - } - if (rollData.total == 1) { - rollData.isSuccess = true - rollData.isCritical = true - } - if (rollData.total == 20) { - rollData.isSuccess = false - rollData.isFumble = true - } - if (rollData.total <= Math.floor(rollData.target / 3)) { - rollData.isPart = true + rollData.margin = Math.min(rollData.margin, rollData.skill.value) } } @@ -278,24 +306,63 @@ export class EcrymeUtility { static async rollEcryme(rollData) { let actor = game.actors.get(rollData.actorId) + // Fix difficulty + if (!rollData.difficulty || rollData.difficulty == "-") { + rollData.difficulty = 0 + } + rollData.difficulty = Number(rollData.difficulty) // Build the dice formula - let diceFormula = "1d20" - rollData.target = rollData.attr.value + rollData.bonusMalusPerso + rollData.bonusMalusSituation + rollData.bonusMalusDef + rollData.bonusMalusPortee - if (rollData.attr.abbrev == "physique") { - rollData.target += rollData.phyMalus + let diceFormula = "2d6" + if (rollData.useIdeal) { + diceFormula = "3d6kh2" } + if (rollData.useSpleen) { + diceFormula = "3d6kl2" + } + if (rollData.skill) { + diceFormula += "+" + rollData.skill.value + } + if (rollData.skillTranscendence) { + diceFormula += "+" + rollData.skillTranscendence + actor.spentSkillTranscendence(rollData.skill, rollData.skillTranscendence) + } + if (rollData.selectedSpecs && rollData.selectedSpecs.length > 0) { + rollData.spec = actor.getSpecialization(rollData.selectedSpecs[0]) + diceFormula += "+2" + } + rollData.bonusMalusTraits = 0 + if (rollData.traitsBonus && rollData.traitsBonus.length > 0) { + rollData.traitsBonusList = [] + for (let id of rollData.traitsBonus) { + let trait = actor.getTrait(id) + console.log(trait, id) + rollData.traitsBonusList.push(trait) + rollData.bonusMalusTraits += trait.system.level + } + } + if (rollData.traitsMalus && rollData.traitsMalus.length > 0) { + rollData.traitsMalusList = [] + for (let id of rollData.traitsMalus) { + let trait = actor.getTrait(id) + rollData.traitsMalusList.push(trait) + rollData.bonusMalusTraits -= trait.system.level + } + } + diceFormula += "+" + rollData.bonusMalusTraits + diceFormula += "+" + rollData.bonusMalusPerso rollData.diceFormula = diceFormula // Performs roll - console.log("Roll formula", diceFormula) let myRoll = new Roll(diceFormula).roll({ async: false }) await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) - rollData.roll = myRoll + rollData.roll = duplicate(myRoll) rollData.total = myRoll.total + rollData.diceSum = myRoll.terms[0].total this.computeResults(rollData) + console.log("ERRRRR", rollData) let msg = await this.createChatWithRollMode(rollData.alias, { content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-generic-result.hbs`, rollData) }) @@ -307,6 +374,22 @@ export class EcrymeUtility { console.log("Rolldata result", rollData) } + /* -------------------------------------------- */ + static async transcendFromSpec(rollData, value) { + rollData.total += value + rollData.transcendUsed = true + this.computeResults(rollData) + //console.log("Adding spec", value, rollData.total) + + let actor = game.actors.get(rollData.actorId) + actor.spentSkillTranscendence(rollData.skill, value) + + let msg = await this.createChatWithRollMode(rollData.alias, { + content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-generic-result.hbs`, rollData) + }) + msg.setFlag("world", "rolldata", rollData) + } + /* -------------------------------------------- */ static sortArrayObjectsByName(myArray) { myArray.sort((a, b) => { @@ -404,7 +487,12 @@ export class EcrymeUtility { bonusMalusSituation: 0, bonusMalusDef: 0, bonusMalusPortee: 0, - rollMode: game.settings.get("core", "rollMode") + skillTranscendence: 0, + rollMode: game.settings.get("core", "rollMode"), + difficulty: "-", + useSpleen: false, + useIdeal: false, + config: duplicate(game.system.ecryme.config) } EcrymeUtility.updateWithTarget(rollData) return rollData diff --git a/modules/dialogs/ecryme-roll-dialog.js b/modules/dialogs/ecryme-roll-dialog.js index cb8a608..7376da7 100644 --- a/modules/dialogs/ecryme-roll-dialog.js +++ b/modules/dialogs/ecryme-roll-dialog.js @@ -5,14 +5,8 @@ export class EcrymeRollDialog extends Dialog { /* -------------------------------------------- */ static async create(actor, rollData) { - let options = { classes: ["EcrymeDialog"], width: 540, height: 'fit-content', 'z-index': 99999 } - let html - if (rollData.attr && rollData.attr.iscard) { - html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/confrontation-dialog.hbs', rollData); - } else { - html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs', rollData); - } - + let options = { classes: ["ecryme-roll-dialog"], width: 540, height: 'fit-content', 'z-index': 99999 } + let html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs', rollData); return new EcrymeRollDialog(actor, rollData, html, options); } @@ -20,17 +14,17 @@ export class EcrymeRollDialog extends Dialog { constructor(actor, rollData, html, options, close = undefined) { let isCard = rollData.attr && rollData.attr.iscard let conf = { - title: (isCard) ? "Jet" : "Tirage", + title: game.i18n.localize("ECRY.ui.rolltitle"), content: html, buttons: { roll: { icon: '', - label: (isCard) ? "Tirer une carte" : "Lancer le dé", + label: game.i18n.localize("ECRY.ui.roll"), callback: () => { this.roll() } }, cancel: { icon: '', - label: "Annuler", + label: game.i18n.localize("ECRY.ui.cancel"), callback: () => { this.close() } } }, @@ -45,12 +39,7 @@ export class EcrymeRollDialog extends Dialog { /* -------------------------------------------- */ roll() { - let isCard = this.rollData.attr && this.rollData.attr.iscard - if (isCard) { - EcrymeUtility.tirageConfrontationEcryme(this.rollData) - } else { - EcrymeUtility.rollEcryme(this.rollData) - } + EcrymeUtility.rollEcryme(this.rollData) } /* -------------------------------------------- */ @@ -69,24 +58,30 @@ export class EcrymeRollDialog extends Dialog { } $(function () { onLoad(); }); - html.find('#bonusMalusSituation').change((event) => { - this.rollData.bonusMalusSituation = Number(event.currentTarget.value) - }) html.find('#bonusMalusPerso').change((event) => { this.rollData.bonusMalusPerso = Number(event.currentTarget.value) }) - html.find('#bonusMalusDef').change((event) => { - this.rollData.bonusMalusDef = Number(event.currentTarget.value) + html.find('#roll-difficulty').change((event) => { + this.rollData.difficulty = Number(event.currentTarget.value) || 0 }) - html.find('#bonusMalusPortee').change((event) => { - this.rollData.bonusMalusPortee = Number(event.currentTarget.value) + html.find('#roll-specialization').change((event) => { + this.rollData.selectedSpecs = $('#roll-specialization').val() }) - html.find('#confrontationDegre').change((event) => { - this.rollData.confrontationDegre = Number(event.currentTarget.value) + html.find('#roll-trait-bonus').change((event) => { + this.rollData.traitsBonus = $('#roll-trait-bonus').val() }) - html.find('#confrontationModif').change((event) => { - this.rollData.confrontationModif = Number(event.currentTarget.value) + html.find('#roll-trait-malus').change((event) => { + this.rollData.traitsMalus = $('#roll-trait-malus').val() }) - + html.find('#roll-select-transcendence').change((event) => { + this.rollData.skillTranscendence = Number($('#roll-select-transcendence').val()) + }) + html.find('#roll-use-spleen').change((event) => { + this.rollData.useSpleen = event.currentTarget.checked + }) + html.find('#roll-use-ideal').change((event) => { + this.rollData.useIdeal = event.currentTarget.checked + }) + } } \ No newline at end of file diff --git a/modules/items/ecryme-item.js b/modules/items/ecryme-item.js index 1e452b1..b7362dd 100644 --- a/modules/items/ecryme-item.js +++ b/modules/items/ecryme-item.js @@ -1,8 +1,14 @@ import { EcrymeUtility } from "../common/ecryme-utility.js"; export const defaultItemImg = { - weapon: "systems/fvtt-ecryme/images/icons/weapon.webp", - equipement: "systems/fvtt-ecryme/images/icons/equipement.webp" + weapon: "systems/fvtt-ecryme/images/icons/icon_weapon.webp", + equipment: "systems/fvtt-ecryme/images/icons/icon_equipment.webp", + contact: "systems/fvtt-ecryme/images/icons/icon_contact.webp", + boheme: "systems/fvtt-ecryme/images/icons/icon_boheme.webp", + trait: "systems/fvtt-ecryme/images/icons/icon_trait.webp", + annency: "systems/fvtt-ecryme/images/icons/icon_annency.webp", + skill: "systems/fvtt-ecryme/images/icons/icon_skill.webp", + specialization: "systems/fvtt-ecryme/images/icons/icon_spec.webp" } /** diff --git a/postcss/ecryme.css b/postcss/ecryme.css index 2ce44b1..0884fe2 100644 --- a/postcss/ecryme.css +++ b/postcss/ecryme.css @@ -78,7 +78,7 @@ cursor: pointer; } -input:hover, select:hover { +input:hover { border-width: 4px; border-color: rgba(37, 124, 37, 0.7); } @@ -576,10 +576,10 @@ ul, li { } .list-item { - margin: 0.125rem; + /*margin: 0.125rem;*/ /*box-shadow: inset 0px 0px 1px #00000096; - border-radius: 0.25rem;*/ - padding: 0.125rem; + border-radius: 0.25rem; + padding: 0.125rem;*/ flex: 1 1 5rem; display: flex !important; color: rgba(19, 18, 18, 0.95); @@ -1314,3 +1314,15 @@ ul, li { .character-summary-rollable { text-decoration: underline; } + +.ecryme-roll-dialog .window-header { + border-radius: 10px 10px 0% 0%; +} +.ecryme-roll-dialog .window-content { + border-radius: 0% 0% 10px 10px; +} + +.skill-roll-dialog div { + margin-top: 4px; + margin-bottom: 4px; +} \ No newline at end of file diff --git a/styles/ecryme.css b/styles/ecryme.css index 7db7e04..66b3339 100644 --- a/styles/ecryme.css +++ b/styles/ecryme.css @@ -78,7 +78,7 @@ cursor: pointer; } -input:hover, select:hover { +input:hover { border-width: 4px; border-color: rgba(37, 124, 37, 0.7); } @@ -547,10 +547,10 @@ ul, li { } .list-item { - margin: 0.125rem; + /*margin: 0.125rem;*/ /*box-shadow: inset 0px 0px 1px #00000096; - border-radius: 0.25rem;*/ - padding: 0.125rem; + border-radius: 0.25rem; + padding: 0.125rem;*/ flex: 1 1 5rem; display: flex !important; color: rgba(19, 18, 18, 0.95); @@ -1294,3 +1294,15 @@ ul, li { .character-summary-rollable { text-decoration: underline; } + +.ecryme-roll-dialog .window-header { + border-radius: 10px 10px 0% 0%; +} +.ecryme-roll-dialog .window-content { + border-radius: 0% 0% 10px 10px; +} + +.skill-roll-dialog div { + margin-top: 4px; + margin-bottom: 4px; +} \ No newline at end of file diff --git a/system.json b/system.json index 5318674..8f47dee 100644 --- a/system.json +++ b/system.json @@ -31,7 +31,8 @@ "manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme/raw/branch/master/system.json", "compatibility": { "minimum": "10", - "verified": "10" + "verified": "11", + "maximum": "11" }, "id": "fvtt-ecryme", "primaryTokenAttribute": "secondary.health", @@ -44,5 +45,5 @@ "url": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme", "version": "10.0.4", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme/archive/fvtt-ecryme-v10.0.0.zip", - "background": "systems/fvtt-ecryme/images/ui/accueil_01.webp" + "background": "systems/fvtt-ecryme/images/assets/ecryme_extract_panel_01.webp" } \ No newline at end of file diff --git a/template.json b/template.json index ff6a304..c23e44e 100644 --- a/template.json +++ b/template.json @@ -130,7 +130,7 @@ } }, "Item": { - "types": ["equipment", "trait", "weapon", "scar", "specialization","annency", "boheme", "contact"], + "types": ["equipment", "trait", "weapon", "specialization","annency", "boheme", "contact"], "templates": { "common": { "description": "" diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index f58a758..91077f4 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -14,13 +14,27 @@
@@ -99,6 +113,34 @@
+ + +
{{!-- Equipement Tab --}} @@ -214,15 +256,6 @@
+
+
+ -
-
-
diff --git a/templates/chat/chat-generic-result.hbs b/templates/chat/chat-generic-result.hbs index 8997207..e72b507 100644 --- a/templates/chat/chat-generic-result.hbs +++ b/templates/chat/chat-generic-result.hbs @@ -18,55 +18,41 @@
-
- - {{name}} - {{#if system.isdualside}} - {{#if system.ispositif}}Positif{{else}}Négatif{{/if}} - {{/if}} - {{#if value}} - Valeur : {{value}} - {{/if}} -
- diff --git a/templates/chat/request-tarot-card.hbs b/templates/chat/request-tarot-card.hbs deleted file mode 100644 index 3e260f0..0000000 --- a/templates/chat/request-tarot-card.hbs +++ /dev/null @@ -1,4 +0,0 @@ -
- -
- diff --git a/templates/dialogs/roll-dialog-generic.hbs b/templates/dialogs/roll-dialog-generic.hbs index df25465..ddd8bc7 100644 --- a/templates/dialogs/roll-dialog-generic.hbs +++ b/templates/dialogs/roll-dialog-generic.hbs @@ -6,56 +6,97 @@

{{title}}

-
- - {{#if skill}} -
- {{localize skill.name}} : - - {{skill.value}} - -
- {{/if}} - -
- Bonus/Malus : - -
+
- {{#if weapon}} -
- Défense : - -
+ {{#if skill}} +
+ {{localize skill.name}} : + + {{skill.value}} + +
-
- Portée : - -
- {{/if}} +
+ {{localize "ECRY.ui.skilltranscendence"}} : + +
+ +
+ {{localize "ECRY.ui.spec"}} : + +
+ + {{#if spleen}} +
+ {{localize "ECRY.ui.applyspleen"}} {{spleen.name}} + +
+ {{/if}} + + {{#if ideal}} +
+ {{localize "ECRY.ui.applyideal"}} {{ideal.name}} + +
+ {{/if}} + +
+ {{localize "ECRY.ui.traitbonus"}} : + +
+ +
+ {{localize "ECRY.ui.traitmalus"}} : + +
+ + {{/if}} + + +
+ Bonus/Malus : + +
+ +
+ Difficulté : + +
diff --git a/templates/dialogs/tirage-tarot-dialog.hbs b/templates/dialogs/tirage-tarot-dialog.hbs deleted file mode 100644 index ce7473c..0000000 --- a/templates/dialogs/tirage-tarot-dialog.hbs +++ /dev/null @@ -1,72 +0,0 @@ -
-
-

Joueur : {{user.name}}

-
- -
- - {{#if (eq state "select-player")}} -
- Sélectionnez le joueur pour faire le tirage - -
- {{/if}} - - {{#if (eq state "attribute-to-actor")}} -
- Sélectionnez l'acteur pour lui attribuer les tarots - -
- {{/if}} - -
-

Main du joueur :

-
- {{#each cards as |card index|}} -
-
- - {{card.name}} - {{#if card.system.isdualside}} - {{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}} - {{/if}} -
-
- {{/each}} -
- -
-

Main secrête :

-
- {{#each secretCards as |card index|}} -
-
- - {{card.name}} - {{#if card.system.isdualside}} - {{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}} - {{/if}} -
-
- {{/each}} -
- -
- -
- -
\ No newline at end of file diff --git a/templates/items/item-archetype-sheet.hbs b/templates/items/item-archetype-sheet.hbs deleted file mode 100644 index 665f248..0000000 --- a/templates/items/item-archetype-sheet.hbs +++ /dev/null @@ -1,37 +0,0 @@ -
-
- -
-

-
-
- - {{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}} - - - {{!-- Sheet Body --}} -
- - {{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}} - -
- -
-
    -
  • - - -
  • - -
-
-
- -
-
diff --git a/templates/items/item-sortilege-sheet.hbs b/templates/items/item-sortilege-sheet.hbs deleted file mode 100644 index d626657..0000000 --- a/templates/items/item-sortilege-sheet.hbs +++ /dev/null @@ -1,30 +0,0 @@ -
-
- -
-

-
-
- - {{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}} - - - {{!-- Sheet Body --}} -
- - {{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}} - -
- -
-
    -
  • - - -
  • -
-
-
- -
-
diff --git a/templates/items/item-tarot-sheet.hbs b/templates/items/item-tarot-sheet.hbs deleted file mode 100644 index 446a62d..0000000 --- a/templates/items/item-tarot-sheet.hbs +++ /dev/null @@ -1,68 +0,0 @@ -
-
-
-

-
-
- - {{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}} - - - {{!-- Sheet Body --}} -
-
-
- -
- -
- {{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}} - -
- -
-
    - -
  • - - -
  • - - {{#if isGM}} -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • - {{#if system.isdualside}} -
  • - - -
  • - {{/if}} -
  • - - -
  • - {{/if}} - -
-
-
-
- -
-