diff --git a/images/icons/feats/.directory b/images/icons/feats/.directory old mode 100644 new mode 100755 diff --git a/images/icons/feats/Blessing Lore.webp b/images/icons/feats/Blessing Lore.webp old mode 100644 new mode 100755 diff --git a/images/icons/feats/Miracle Lore.webp b/images/icons/feats/Miracle Lore.webp old mode 100644 new mode 100755 diff --git a/images/icons/iconic_characters/Jenette.webp b/images/icons/iconic_characters/Jenette.webp new file mode 100755 index 0000000..ec1f892 Binary files /dev/null and b/images/icons/iconic_characters/Jenette.webp differ diff --git a/images/icons/iconic_characters/Jonah.webp b/images/icons/iconic_characters/Jonah.webp new file mode 100755 index 0000000..a4b0db4 Binary files /dev/null and b/images/icons/iconic_characters/Jonah.webp differ diff --git a/images/icons/iconic_characters/Nadgar.webp b/images/icons/iconic_characters/Nadgar.webp new file mode 100755 index 0000000..a48ae3b Binary files /dev/null and b/images/icons/iconic_characters/Nadgar.webp differ diff --git a/images/icons/iconic_characters/Nigel.webp b/images/icons/iconic_characters/Nigel.webp new file mode 100755 index 0000000..493642a Binary files /dev/null and b/images/icons/iconic_characters/Nigel.webp differ diff --git a/images/icons/skills/Acrobatics.webp b/images/icons/skills/Acrobatics.webp index bf11fab..9920fe7 100755 Binary files a/images/icons/skills/Acrobatics.webp and b/images/icons/skills/Acrobatics.webp differ diff --git a/images/icons/skills/Athletics.webp b/images/icons/skills/Athletics.webp old mode 100644 new mode 100755 diff --git a/images/icons/skills/Brawn.webp b/images/icons/skills/Brawn.webp old mode 100644 new mode 100755 diff --git a/images/icons/skills/Charm.webp b/images/icons/skills/Charm.webp old mode 100644 new mode 100755 diff --git a/images/icons/skills/First Aid.webp b/images/icons/skills/First Aid.webp index 47ea3f0..e124b53 100755 Binary files a/images/icons/skills/First Aid.webp and b/images/icons/skills/First Aid.webp differ diff --git a/images/icons/skills/Haggle.webp b/images/icons/skills/Haggle.webp old mode 100644 new mode 100755 diff --git a/images/icons/skills/Intuition.webp b/images/icons/skills/Intuition.webp old mode 100644 new mode 100755 diff --git a/images/icons/skills/Locks and Pockets.webp b/images/icons/skills/Locks and Pockets.webp index aadb094..e5813e1 100755 Binary files a/images/icons/skills/Locks and Pockets.webp and b/images/icons/skills/Locks and Pockets.webp differ diff --git a/images/icons/skills/Poison Use.webp b/images/icons/skills/Poison Use.webp index 650a80d..8f46298 100755 Binary files a/images/icons/skills/Poison Use.webp and b/images/icons/skills/Poison Use.webp differ diff --git a/images/icons/skills/Research.webp b/images/icons/skills/Research.webp index b7b661a..5eef8db 100755 Binary files a/images/icons/skills/Research.webp and b/images/icons/skills/Research.webp differ diff --git a/images/icons/skills/Ride Mount.webp b/images/icons/skills/Ride Mount.webp old mode 100644 new mode 100755 index d9aed43..c3e68ff Binary files a/images/icons/skills/Ride Mount.webp and b/images/icons/skills/Ride Mount.webp differ diff --git a/images/icons/skills/Survival.webp b/images/icons/skills/Survival.webp index 686555f..978d3fb 100755 Binary files a/images/icons/skills/Survival.webp and b/images/icons/skills/Survival.webp differ diff --git a/images/icons/skills/Swim.webp b/images/icons/skills/Swim.webp index 2c953d3..ec2d768 100755 Binary files a/images/icons/skills/Swim.webp and b/images/icons/skills/Swim.webp differ diff --git a/modules/crucible-actor-sheet.js b/modules/crucible-actor-sheet.js index 8a6aaed..ab699c2 100644 --- a/modules/crucible-actor-sheet.js +++ b/modules/crucible-actor-sheet.js @@ -50,7 +50,7 @@ export class CrucibleActorSheet extends ActorSheet { race: duplicate(this.actor.getRace()), moneys: duplicate(this.actor.getMoneys()), encCapacity: this.actor.getEncumbranceCapacity(), - saveRoll: this.actor.getSaveRoll(), + saveRolls: this.actor.getSaveRoll(), containersTree: this.actor.containersTree, encCurrent: this.actor.encCurrent, options: this.options, @@ -94,17 +94,6 @@ export class CrucibleActorSheet extends ActorSheet { this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true }) }) - html.find('.spec-group-activate').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - this.actor.specPowerActivate( itemId) - }); - html.find('.spec-group-deactivate').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - this.actor.specPowerDeactivate( itemId) - }); - html.find('.equip-activate').click(ev => { const li = $(ev.currentTarget).parents(".item") let itemId = li.data("item-id") @@ -116,37 +105,6 @@ export class CrucibleActorSheet extends ActorSheet { this.actor.equipDeactivate( itemId) }); - html.find('.effect-used').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - this.actor.perkEffectUsed( itemId) - }); - - html.find('.perk-status').change(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - this.actor.updatePerkStatus( itemId, ev.currentTarget.value) - }); - - html.find('.power-cost-spent').change(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - this.actor.updatePowerSpentCost( itemId, ev.currentTarget.value) - }); - - html.find('.power-dmg-roll').click(ev => { - const li = $(ev.currentTarget).parents(".item") - let itemId = li.data("item-id") - this.actor.powerDmgRoll( itemId ) - }) - - html.find('.perk-used').change(ev => { - const li = $(ev.currentTarget).parents(".item") - let itemId = li.data("item-id") - let index = Number($(ev.currentTarget).data("use-index") ) - this.actor.updatePerkUsed( itemId, index, ev.currentTarget.checked ) - }); - html.find('.subactor-edit').click(ev => { const li = $(ev.currentTarget).parents(".item"); let actorId = li.data("actor-id"); @@ -177,46 +135,6 @@ export class CrucibleActorSheet extends ActorSheet { const li = $(event.currentTarget).parents(".item") this.actor.incDecAmmo( li.data("item-id"), +1 ) } ); - - html.find('.stun-minus').click(event => { - this.actor.modifyStun( -1 ) - } ) - html.find('.stun-plus').click(event => { - this.actor.modifyStun( 1 ) - } ) - - - html.find('.momentum-minus').click(event => { - this.actor.modifyMomentum( -1 ) - } ) - html.find('.momentum-plus').click(event => { - this.actor.modifyMomentum( 1 ) - } ) - - html.find('.unarmed-attack').click((event) => { - this.actor.rollUnarmedAttack(); - }); - html.find('.generic-pool-roll').click((event) => { - this.openGenericRoll() - } ); - html.find('.attack-melee').click((event) => { - this.actor.rollPool( 'com', false, "melee-atk"); - }); - html.find('.attack-ranged').click((event) => { - this.actor.rollPool( 'agi', false, "ranged-atk"); - }); - html.find('.defense-roll').click((event) => { - this.actor.rollPool( 'def', true); - }); - html.find('.damage-melee').click((event) => { - this.actor.rollPool( 'str', false, "melee-dmg"); - }); - html.find('.damage-ranged').click((event) => { - this.actor.rollPool( 'per', false, "ranged-dmg"); - }); - html.find('.damage-resistance').click((event) => { - this.actor.rollPool( 'phy', false, "dmg-res"); - }); html.find('.roll-ability').click((event) => { const abilityKey = $(event.currentTarget).data("ability-key"); @@ -232,28 +150,11 @@ export class CrucibleActorSheet extends ActorSheet { const skillId = li.data("item-id") this.actor.rollWeapon(skillId) }); - html.find('.weapon-roll').click((event) => { - const li = $(event.currentTarget).parents(".item"); - const weaponId = li.data("item-id"); - this.actor.rollWeapon(weaponId); - }); - html.find('.armor-roll').click((event) => { - const li = $(event.currentTarget).parents(".item"); - const armorId = li.data("item-id"); - this.actor.rollArmor(armorId); + html.find('.roll-save').click((event) => { + const saveKey = $(event.currentTarget).data("save-key") + this.actor.rollSave(saveKey) }); - html.find('.weapon-damage-roll').click((event) => { - const li = $(event.currentTarget).parents(".item"); - const weaponId = li.data("item-id"); - this.actor.rollWeapon(weaponId, true); - }); - - html.find('.weapon-damage').click((event) => { - const li = $(event.currentTarget).parents(".item"); - const weapon = this.actor.getOwnedItem(li.data("item-id")); - this.actor.rollDamage(weapon, 'damage'); - }); html.find('.lock-unlock-sheet').click((event) => { this.options.editScore = !this.options.editScore; @@ -269,35 +170,12 @@ export class CrucibleActorSheet extends ActorSheet { this.actor.equipItem( li.data("item-id") ); this.render(true); }); - html.find('.power-activate').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - this.actor.activatePower( li.data("item-id") ); - this.render(true); - }); - html.find('.vice-virtue-activate').click(ev => { - const li = $(ev.currentTarget).parents(".item") - this.actor.activateViceOrVirtue( li.data("item-id") ) - this.render(true); - }) - - html.find('.change-worstfear').change(ev => { - this.actor.manageWorstFear( ev.currentTarget.checked ) - }); - html.find('.change-desires').change(ev => { - this.actor.manageDesires( ev.currentTarget.checked ) - }); html.find('.update-field').change(ev => { const fieldName = $(ev.currentTarget).data("field-name"); let value = Number(ev.currentTarget.value); this.actor.update( { [`${fieldName}`]: value } ); }); - html.find('.perk-active').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - this.actor.activatePerk( li.data("item-id") ); - this.render(true); - }); - } /* -------------------------------------------- */ diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index 0ed40ab..165a0d8 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -61,12 +61,35 @@ export class CrucibleActor extends Actor { super.prepareData(); } + /* -------------------------------------------- */ + 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) { + hp.max = max + hp.value = max // Init case + this.update({ 'data.secondary.hp': hp}) + } + } + /* -------------------------------------------- */ + 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) { + effort.max = max + effort.value = max // Init case + this.update({ 'data.secondary.effort': effort}) + } + } + /* -------------------------------------------- */ prepareDerivedData() { - if (this.type == 'character') { + if (this.type == 'character' || game.user.isGM) { this.data.data.encCapacity = this.getEncumbranceCapacity() this.buildContainerTree() + this.computeHitPoints() + this.computeEffortPoints() } super.prepareDerivedData(); @@ -515,7 +538,21 @@ export class CrucibleActor extends Actor { } } } + /* -------------------------------------------- */ + rollSave( saveKey) { + let saves = this.getSaveRoll() + let save = saves[saveKey] + if (save) { + save = duplicate(save) + let rollData = this.getCommonRollData() + rollData.mode = "save" + rollData.save = save + //rollData.img = skill.img + this.startRoll(rollData) + } + + } /* -------------------------------------------- */ async startRoll(rollData) { this.syncRoll(rollData) diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 8128117..4283254 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -271,15 +271,23 @@ export class CrucibleUtility { let actor = game.actors.get(rollData.actorId) - // stat => 0 - let diceFormula = String(rollData.ability.value) + "d6cs>=5" + // ability/save => 0 + let diceFormula + let startFormula = "0d6cs>=5" + if ( rollData.ability) { + startFormula = String(rollData.ability.value) + "d6cs>=5" + } + if ( rollData.save) { + startFormula = String(rollData.save.value) + "d6cs>=5" + } + diceFormula = startFormula // skill => 2 // feat => 4 // bonus => 6 if (rollData.skill) { let level = rollData.skill.data.level - if (level == 0 && rollData.skill.data.isfeatdie ) { + if (rollData.skill.data.issl2 ) { rollData.hasSLBonus = true level += 2 if (level > 7) { level = 7} @@ -292,7 +300,7 @@ export class CrucibleUtility { rollData.rollAdvantage = "roll-disadvantage" } - if (rollData.skill.data.level > 0 && rollData.skill.data.isfeatdie) { + if (rollData.skill.data.isfeatdie) { rollData.hasFeatDie = true diceFormula += "+ 1d10cs>=5" } else { @@ -341,6 +349,7 @@ export class CrucibleUtility { } // Performs roll + console.log("Roll formula", diceFormula) let myRoll = rollData.roll if (!myRoll) { // New rolls only of no rerolls myRoll = new Roll(diceFormula).roll({ async: false }) diff --git a/system.json b/system.json index bbd043e..26646fd 100644 --- a/system.json +++ b/system.json @@ -208,11 +208,11 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 11, + "templateVersion": 12, "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.18.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v0.1.19.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg", - "version": "0.1.18", + "version": "0.1.19", "background" : "./images/ui/crucible_welcome_page.webp" } diff --git a/template.json b/template.json index 0a992ad..21ce799 100644 --- a/template.json +++ b/template.json @@ -66,13 +66,13 @@ "hp": { "label": "Hitpoint", "abbrev": "hb", - "value": 0, + "value": -1, "max": 0 }, "effort": { "label": "Effort", "abbrev": "eff", - "value": 0, + "value": -1, "max": 0 } }, @@ -122,6 +122,7 @@ "isproficient": false, "isweaponskill": false, "isfeatdie": false, + "issl2": false, "islore": false, "skilltype": "", "isinnate": false, diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index 061dffd..17a0077 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -18,6 +18,14 @@