diff --git a/images/icons/saves/fortitude_save.webp b/images/icons/saves/fortitude_save.webp new file mode 100644 index 0000000..7077346 Binary files /dev/null and b/images/icons/saves/fortitude_save.webp differ diff --git a/images/icons/saves/reflex_save.webp b/images/icons/saves/reflex_save.webp new file mode 100644 index 0000000..1a27365 Binary files /dev/null and b/images/icons/saves/reflex_save.webp differ diff --git a/images/icons/saves/will_save.webp b/images/icons/saves/will_save.webp new file mode 100644 index 0000000..dccfc02 Binary files /dev/null and b/images/icons/saves/will_save.webp differ diff --git a/modules/crucible-actor-sheet.js b/modules/crucible-actor-sheet.js index ab699c2..42f7a67 100644 --- a/modules/crucible-actor-sheet.js +++ b/modules/crucible-actor-sheet.js @@ -45,6 +45,8 @@ export class CrucibleActorSheet extends ActorSheet { spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())), equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ), equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ), + equippedArmor: this.actor.getEquippedArmor(), + equippedShield: this.actor.getEquippedShield(), feats: duplicate(this.actor.getFeats()), subActors: duplicate(this.actor.getSubActors()), race: duplicate(this.actor.getRace()), @@ -150,6 +152,15 @@ export class CrucibleActorSheet extends ActorSheet { const skillId = li.data("item-id") this.actor.rollWeapon(skillId) }); + html.find('.roll-armor-die').click((event) => { + //TODO + ui.notifications.warn("Not implemented") + }); + html.find('.roll-shield-die').click((event) => { + //TODO + ui.notifications.warn("Not implemented") + }); + html.find('.roll-save').click((event) => { const saveKey = $(event.currentTarget).data("save-key") this.actor.rollSave(saveKey) diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index 165a0d8..48a0b09 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -62,23 +62,23 @@ export class CrucibleActor extends Actor { } /* -------------------------------------------- */ - computeHitPoints( ) { + computeHitPoints() { let hp = duplicate(this.data.data.secondary.hp) let max = (this.data.data.abilities.str.value + this.data.data.abilities.con.value) * 6 - if ( max != hp.max || hp.value > max) { + if (max != hp.max || hp.value > max) { hp.max = max hp.value = max // Init case - this.update({ 'data.secondary.hp': hp}) + this.update({ 'data.secondary.hp': hp }) } } /* -------------------------------------------- */ - computeEffortPoints( ) { + computeEffortPoints() { let effort = duplicate(this.data.data.secondary.effort) let max = (this.data.data.abilities.con.value + this.data.data.abilities.int.value) * 6 - if ( max != effort.max || effort.value > max) { + if (max != effort.max || effort.value > max) { effort.max = max effort.value = max // Init case - this.update({ 'data.secondary.effort': effort}) + this.update({ 'data.secondary.effort': effort }) } } @@ -146,12 +146,27 @@ export class CrucibleActor extends Actor { CrucibleUtility.sortArrayObjectsByName(comp) return comp; } + getEquippedArmor() { + let comp = this.data.items.find(item => item.type == 'armor' && item.data.data.equipped) + if (comp) { + return duplicate(comp) + } + return undefined + } /* -------------------------------------------- */ getShields() { let comp = duplicate(this.data.items.filter(item => item.type == 'shield') || []); CrucibleUtility.sortArrayObjectsByName(comp) return comp; } + getEquippedShield() { + let comp = this.data.items.find(item => item.type == 'shield' && item.data.data.equipped) + if (comp) { + return duplicate(comp) + } + return undefined + } + /* -------------------------------------------- */ getRace() { let race = this.data.items.filter(item => item.type == 'race') return race[0] ?? []; @@ -205,8 +220,22 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ async equipItem(itemId) { - let item = this.data.items.find(item => item.id == itemId); + let item = this.data.items.find(item => item.id == itemId) if (item && item.data.data) { + if (item.type == "armor") { + let armor = this.data.items.find(item => item.id != itemId && item.type == "armor" && item.data.data.equipped) + if (armor) { + ui.notifications.warn("You already have an armor equipped!") + return + } + } + if (item.type == "shield") { + let shield = this.data.items.find(item => item.id != itemId && item.type == "shield" && item.data.data.equipped) + if (shield) { + ui.notifications.warn("You already have a shield equipped!") + return + } + } let update = { _id: item.id, "data.equipped": !item.data.data.equipped }; await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity } @@ -236,15 +265,18 @@ export class CrucibleActor extends Actor { getSaveRoll() { return { reflex: { - "label": "Reflex", + "label": "Reflex Save", + "img": "systems/fvtt-crucible-rpg/images/icons/saves/reflex_save.webp", "value": this.data.data.abilities.agi.value + this.data.data.abilities.wit.value }, fortitude: { - "label": "Fortitude", + "label": "Fortitude Save", + "img": "systems/fvtt-crucible-rpg/images/icons/saves/fortitude_save.webp", "value": this.data.data.abilities.str.value + this.data.data.abilities.con.value }, willpower: { - "label": "Willpower", + "label": "Willpower Save", + "img": "systems/fvtt-crucible-rpg/images/icons/saves/will_save.webp", "value": this.data.data.abilities.int.value + this.data.data.abilities.cha.value } } @@ -521,7 +553,7 @@ export class CrucibleActor extends Actor { let weapon = this.data.items.get(weaponId) if (weapon) { weapon = duplicate(weapon) - let skill = this.data.items.find( item => item.name.toLowerCase() == weapon.data.skill.toLowerCase()) + let skill = this.data.items.find(item => item.name.toLowerCase() == weapon.data.skill.toLowerCase()) if (skill) { skill = duplicate(skill) CrucibleUtility.updateSkill(skill) @@ -539,7 +571,7 @@ export class CrucibleActor extends Actor { } } /* -------------------------------------------- */ - rollSave( saveKey) { + rollSave(saveKey) { let saves = this.getSaveRoll() let save = saves[saveKey] if (save) { diff --git a/modules/crucible-item-sheet.js b/modules/crucible-item-sheet.js index 09e35f7..5b8c9fa 100644 --- a/modules/crucible-item-sheet.js +++ b/modules/crucible-item-sheet.js @@ -64,6 +64,7 @@ export class CrucibleItemSheet extends ItemSheet { editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", weaponSkills: CrucibleUtility.getWeaponSkills(), + shieldSkills: CrucibleUtility.getShieldSkills(), data: itemData, limited: this.object.limited, options: this.options, diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 4283254..3c4d391 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -55,12 +55,17 @@ export class CrucibleUtility { static getWeaponSkills() { return duplicate(this.weaponSkills) } - + /*-------------------------------------------- */ + static getShieldSkills() { + return duplicate(this.shieldSkills) + } + /* -------------------------------------------- */ static async ready() { const skills = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.skills") this.skills = skills.map(i => i.toObject()) this.weaponSkills = duplicate( this.skills.filter( item => item.data.isweaponskill)) + this.shieldSkills = duplicate( this.skills.filter( item => item.data.isshieldskill)) } /* -------------------------------------------- */ diff --git a/packs/action-tokens.db b/packs/action-tokens.db old mode 100755 new mode 100644 diff --git a/packs/armor.db b/packs/armor.db old mode 100755 new mode 100644 diff --git a/packs/classpowers.db b/packs/classpowers.db old mode 100755 new mode 100644 diff --git a/packs/conditions.db b/packs/conditions.db old mode 100755 new mode 100644 diff --git a/packs/equipment.db b/packs/equipment.db old mode 100755 new mode 100644 diff --git a/packs/feats.db b/packs/feats.db old mode 100755 new mode 100644 diff --git a/packs/lore-air.db b/packs/lore-air.db old mode 100755 new mode 100644 diff --git a/packs/lore-earth.db b/packs/lore-earth.db old mode 100755 new mode 100644 diff --git a/packs/lore-fire.db b/packs/lore-fire.db old mode 100755 new mode 100644 diff --git a/packs/lore-shadow.db b/packs/lore-shadow.db old mode 100755 new mode 100644 diff --git a/packs/lore-water.db b/packs/lore-water.db old mode 100755 new mode 100644 diff --git a/packs/monster-powers.db b/packs/monster-powers.db old mode 100755 new mode 100644 diff --git a/packs/poisons.db b/packs/poisons.db old mode 100755 new mode 100644 diff --git a/packs/shields.db b/packs/shields.db old mode 100755 new mode 100644 diff --git a/packs/skills.db b/packs/skills.db old mode 100755 new mode 100644 index 4b98de1..3fbc232 --- a/packs/skills.db +++ b/packs/skills.db @@ -13,7 +13,7 @@ {"_id":"Y4o571K5DQseDaGT","name":"Swim","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Swim.webp","data":{"ability":"str","armorpenalty":true,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Kick you feet and don't forget to breathe!

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"ZfIwXZwaBKaVoYbG","name":"Athletics","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Athletics.png","data":{"ability":"agi","armorpenalty":true,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Your ability to run, jump, and climb; a measure of your physical coordination.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"cc74gHSQK4hRR8Vj","name":"Brawn","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Brawn.png","data":{"ability":"str","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

A combination of your Size and Strength.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} -{"_id":"fJjXMpUILcN983XV","name":"Axe","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isfeatdie":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","level":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}}} +{"_id":"fJjXMpUILcN983XV","name":"Axe","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isshiedskill":false,"isfeatdie":false,"issl2":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","level":2,"isshieldskill":true},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}}} {"_id":"fegRI4Vsyr0Us1Ga","name":"Research","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Research.webp","data":{"ability":"int","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Give me a moment to look that up....

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"i8eeE2I9vv2kHwdJ","name":"Shadow Lore","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Shadow%20Lore.webp","data":{"ability":"int","armorpenalty":true,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

You can cast Shadow Lore spells.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"lfB80K2lFSzQH442","name":"Intuition","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Intuition.png","data":{"ability":"wit","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

I see what you did there.  I think you're up to something....

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} @@ -23,3 +23,5 @@ {"_id":"s2AAQviLttcHul3X","name":"Charm","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Charm.png","data":{"ability":"cha","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Getting someone to do what you want because they want to do it.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"xlYUHAUSfQrsjQoi","name":"Survival","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Survival.webp","data":{"ability":"wit","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Help me set this snare and we'll eat like kings in the morning.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"yAhtkgqf7pKyjJTA","name":"Poison Use","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Poison%20Use.webp","data":{"ability":"dex","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Let me apply this to my blade.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} +{"_id":"fJjXMpUILcN983XV","name":"Axe","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isshieldskill":false,"isfeatdie":false,"issl2":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","isshiedskill":false,"level":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}}} +{"_id":"fJjXMpUILcN983XV","name":"Axe","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isshieldskill":true,"isfeatdie":false,"issl2":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","isshiedskill":false,"level":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}}} diff --git a/packs/trickstraps.db b/packs/trickstraps.db old mode 100755 new mode 100644 diff --git a/packs/weapons.db b/packs/weapons.db old mode 100755 new mode 100644 diff --git a/styles/simple.css b/styles/simple.css index 21a1a95..494a9ff 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -581,7 +581,9 @@ ul, li { .sheet-competence-img { width: 24px; + max-width: 24px; height: 24px; + max-height: 24px; flex-grow: 0; margin-right: 0.25rem; } diff --git a/system.json b/system.json index 268565f..e173e21 100644 --- a/system.json +++ b/system.json @@ -208,11 +208,11 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 12, + "templateVersion": 14, "title": "Crucible RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/raw/master/system.json", "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v0.1.20.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg", - "version": "0.1.20", + "version": "0.1.22", "background" : "./images/ui/crucible_welcome_page.webp" } diff --git a/template.json b/template.json index 21ce799..e340786 100644 --- a/template.json +++ b/template.json @@ -4,6 +4,7 @@ "templates": { "biodata": { "biodata": { + "class": "", "age": 0, "size": "", "weight": "", @@ -121,6 +122,7 @@ "armorpenalty": false, "isproficient": false, "isweaponskill": false, + "isshieldskill": false, "isfeatdie": false, "issl2": false, "islore": false, @@ -147,6 +149,7 @@ }, "shield": { "shielddie": "", + "skill": "", "equipped": false, "cost": 0, "description":"" diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index ff010c9..1c928c5 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -17,6 +17,22 @@ {{/if}} {{/each}} + +
  • + +

    Class

    +
    + +
  • +
    @@ -26,6 +42,24 @@ {{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}} {{/if}} {{/each}} + + {{#if equippedArmor}} +
  • + + +

    {{equippedArmor.name}}

    +
    +
  • + {{/if}} + {{#if equippedShield}} +
  • + + +

    {{ability-margin.name}}

    +
    +
  • + {{/if}} +
    diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index 17a0077..3d7bd96 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -59,14 +59,14 @@ {{/each}}) {{/if}} - {{#if (eq advantage "disadvantage1")}} + {{#if (eq disadvantage "disadvantage1")}}
  • 1 Disadvantage Die !  ({{#each roll.terms.10.results as |die idx|}} {{die.result}}  {{/each}})
  • {{/if}} - {{#if (eq advantage "disadvantage2")}} + {{#if (eq disadvantage "disadvantage2")}}
  • 2 Disadvantage Dice !  ({{#each roll.terms.10.results as |die idx|}} {{die.result}}  @@ -101,7 +101,7 @@ {{/if}} {{#if hasFeatDie}} -
  • Feature Die : d10 +
  • Feat Die : d10  ({{#each roll.terms.4.results as |die idx|}} {{die.result}}  {{/each}}) diff --git a/templates/item-shield-sheet.html b/templates/item-shield-sheet.html index 34a1076..e6a2f7f 100644 --- a/templates/item-shield-sheet.html +++ b/templates/item-shield-sheet.html @@ -28,6 +28,17 @@
  • +
  • + +
  • + +
  • diff --git a/templates/item-skill-sheet.html b/templates/item-skill-sheet.html index 8ba301d..9538827 100644 --- a/templates/item-skill-sheet.html +++ b/templates/item-skill-sheet.html @@ -59,6 +59,10 @@ +
  • + +
  • +