diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index c6ba6a3..06f9a34 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -55,6 +55,7 @@ export class PegasusActorSheet extends ActorSheet { race: duplicate(this.actor.getRace()), role: duplicate(this.actor.getRole()), effects: duplicate(this.actor.getEffects()), + moneys: duplicate(this.actor.getMoneys()), options: this.options, owner: this.document.isOwner, editScore: this.options.editScore, @@ -119,22 +120,22 @@ export class PegasusActorSheet extends ActorSheet { this.actor.rollUnarmedAttack(); }); html.find('.attack-melee').click((event) => { - this.actor.rollPool( 'com', true); + this.actor.rollPool( 'com'); }); html.find('.attack-ranged').click((event) => { - this.actor.rollPool( 'agi', true); + this.actor.rollPool( 'agi'); }); html.find('.defense-roll').click((event) => { this.actor.rollPool( 'def', true); }); html.find('.damage-melee').click((event) => { - this.actor.rollPool( 'str', true); + this.actor.rollPool( 'str'); }); html.find('.damage-ranged').click((event) => { - this.actor.rollPool( 'per', true); + this.actor.rollPool( 'per'); }); html.find('.damage-resistance').click((event) => { - this.actor.rollPool( 'phy', true); + this.actor.rollPool( 'phy'); }); html.find('.roll-stat').click((event) => { diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 8395bbb..87b055b 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -110,6 +110,11 @@ export class PegasusActor extends Actor { return comp; } /* -------------------------------------------- */ + getMoneys() { + let comp = this.data.items.filter(item => item.type == 'money'); + return comp; + } + /* -------------------------------------------- */ getArmors() { let comp = duplicate(this.data.items.filter(item => item.type == 'armor') || []); return comp; @@ -481,9 +486,18 @@ export class PegasusActor extends Actor { rollDialog.render(true); } + /* -------------------------------------------- */ + getShieldDice() { + let shields = this.data.items.filter( item => item.type == "shield" && item.data.data.equipped) + let def = 0 + for ( let sh of shields) { + def += sh.data.data.level + } + return def + } /* -------------------------------------------- */ - rollPool(statKey, useSPec) { + rollPool(statKey, useShield=false) { let stat = this.getStat(statKey); if (stat) { let rollData = this.getCommonRollData() @@ -491,7 +505,10 @@ export class PegasusActor extends Actor { rollData.specList = this.getRelevantSpec(statKey) rollData.selectedSpec = "0" rollData.stat = stat; - + + if (useShield) { + rollData.otherDicesLevel = this.getShieldDice() + } this.startRoll(rollData); } else { ui.notifications.warn("Statistic not found !"); @@ -608,14 +625,15 @@ export class PegasusActor extends Actor { updates['data.nrg.max'] = nrgValue updates['data.nrg.value'] = nrgValue } + nrgValue = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod; if (nrgValue != this.data.data.combat.stunthreshold) { updates['data.combat.stunthreshold'] = nrgValue } - let mrLevel = (this.data.data.statistics.agi.value + this.data.data.statistics.str.value) - this.data.data.statistics.phy.value - mrLevel = (mrLevel < 1) ? 1 : mrLevel; - if (mrLevel != this.data.data.mr.value) { - updates['data.mr.value'] = mrLevel + let momentum = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod + if (momentum != this.data.data.momentum.max) { + updates['data.momentum.value'] = momentum + updates['data.momentum.max'] = momentum } let race = this.getRace() diff --git a/modules/pegasus-item.js b/modules/pegasus-item.js index 4d0840f..c98e560 100644 --- a/modules/pegasus-item.js +++ b/modules/pegasus-item.js @@ -4,7 +4,7 @@ export const defaultItemImg = { specialisation: "systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp", perk: "systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp", ability: "systems/fvtt-pegasus-rpg/images/icons/icon_raceability.webp", - armor: "systems/fvtt-pegasus-rpg/images/icons/icon_armor.webp", + armor: "systems/fvtt-pegasus-rpg/images/icons/icon_armour.webp", weapon: "systems/fvtt-pegasus-rpg/images/icons/icon_weapon.webp", equipment: "systems/fvtt-pegasus-rpg/images/icons/icon_equipment.webp", effect: "systems/fvtt-pegasus-rpg/images/icons/icon_effect.webp", diff --git a/styles/simple.css b/styles/simple.css index be5b928..3ce540f 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -678,6 +678,10 @@ ul, li { margin-left: 4px; } +.small-label { + margin-top: 5px; +} + .padd-right { margin-right: 8px; } @@ -780,8 +784,7 @@ ul, li { /* background: rgb(105,85,65) url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat right bottom;*/ #sidebar.collapsed { - height: 430px !important; - position: absolute; + height: 470px !important; } #sidebar-tabs > .collapsed, #chat-controls .chat-control-icon { diff --git a/system.json b/system.json index 35fbc17..1ea885e 100644 --- a/system.json +++ b/system.json @@ -160,9 +160,9 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 61, + "templateVersion": 63, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.1.10", + "version": "0.1.12", "background" : "./images/ui/pegasus_welcome_page.webp" } diff --git a/template.json b/template.json index f59609f..7388722 100644 --- a/template.json +++ b/template.json @@ -130,6 +130,7 @@ "value": 0, "type": "value", "ismax": true, + "iscombat": true, "bonus": 0, "max": 0 }, @@ -138,6 +139,7 @@ "value": 0, "type": "value", "ismax": true, + "iscombat": true, "bonus": 0, "max": 0 }, @@ -179,7 +181,7 @@ } }, "Item": { - "types": [ "race", "role", "ability", "specialisation", "perk", "power" , "armor", "shield", "equipment", "weapon", "effect"], + "types": [ "race", "role", "ability", "specialisation", "perk", "power" , "armor", "shield", "equipment", "weapon", "effect", "money"], "effect": { "type": "", "genre": "", @@ -430,6 +432,12 @@ "equipped": false, "description":"" }, + "money" : { + "value": 0, + "quantity": 0, + "weight": 0, + "description": "" + }, "weapon": { "statistic": "", "damagestatistic": "", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 967e9c6..ff5ab36 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -53,7 +53,7 @@
- -
@@ -133,36 +118,6 @@ -
- -

Perks

-
- -
@@ -191,12 +146,42 @@
@@ -254,6 +239,37 @@ {{/each}} +
+ +

Perks

+
+
    + {{#each perks as |perk key|}} +
  • + + {{perk.name}} + Lvl:{{perk.data.level}} + Rounds: + + + +
  • + {{/each}} +
+
+

Weapons

@@ -302,10 +318,10 @@ @@ -323,6 +339,7 @@ {{power.name}} {{/if}} + {{power.data.type}} {{#if power.data.activated}}Activated{{/if}}
{{#if power.data.activated}} + +
+

Money

+
+

Equipment

diff --git a/templates/item-money-sheet.html b/templates/item-money-sheet.html new file mode 100644 index 0000000..7d7512a --- /dev/null +++ b/templates/item-money-sheet.html @@ -0,0 +1,32 @@ +
+
+ +
+

+
+
+ + {{!-- Sheet Body --}} +
+ +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
  • +
+
+ +
+
diff --git a/templates/partial-roll-common-dices.html b/templates/partial-roll-common-dices.html index 65619d3..d788e9c 100644 --- a/templates/partial-roll-common-dices.html +++ b/templates/partial-roll-common-dices.html @@ -14,7 +14,7 @@
Bonus Dice : - {{#select bonusDicesLevel}} {{{optionsDiceList}}} {{/select}}