diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index d6d0f19..ec606f7 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -297,13 +297,13 @@ export class PegasusActor extends Actor { /* ------------------------------------------- */ async buildContainerTree() { - let equipments = duplicate(this.data.items.filter(item => item.type == "equipment") || [] ) + let equipments = duplicate(this.data.items.filter(item => item.type == "equipment") || []) for (let equip1 of equipments) { - if ( equip1.data.iscontainer) { + if (equip1.data.iscontainer) { equip1.data.contents = [] equip1.data.contentsEnc = 0 for (let equip2 of equipments) { - if ( equip1._id != equip2._id && equip2.data.containerid == equip1._id ) { + if (equip1._id != equip2._id && equip2.data.containerid == equip1._id) { equip1.data.contents.push(equip2) equip1.data.contentsEnc += equip2.data.weight } @@ -311,27 +311,35 @@ export class PegasusActor extends Actor { } } + // Compute whole enc let enc = 0 - for( let item of equipments) { + for (let item of equipments) { if (item.data.equipped) { - if ( item.data.iscontainer) { + if (item.data.iscontainer) { enc += item.data.contentsEnc } else { enc += item.data.weight } } } + for (let item of this.data.items) { // Process items/shields/armors + if ((item.type == "weapon" || item.type == "shield" || item.type == "armor") && item.data.data.equipped) { + enc += item.data.data.weight + } + } + + // Store local values this.encCurrent = enc - this.containersTree = equipments.filter( item => item.data.containerid == "") // Returns the root of equipements without container + this.containersTree = equipments.filter(item => item.data.containerid == "") // Returns the root of equipements without container // Manages slow effect - let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity() ) - this.encHindrance = Math.floor(this.encCurrent / this.getEncumbranceCapacity() ) - + let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity()) + this.encHindrance = Math.floor(this.encCurrent / this.getEncumbranceCapacity()) + //console.log("Capacity", overCapacity, this.encCurrent / this.getEncumbranceCapacity() ) let effect = this.data.items.find(item => item.type == "effect" && item.data.data.slow) - if (overCapacity >= 4 ) { - if ( !effect) { + if (overCapacity >= 4) { + if (!effect) { effect = await PegasusUtility.getEffectFromCompendium("Slowed") effect.data.slow = true this.createEmbeddedDocuments('Item', [effect]) @@ -344,14 +352,27 @@ export class PegasusActor extends Actor { } /* -------------------------------------------- */ - modifyMomentum( incDec) { + modifyMomentum(incDec) { let momentum = duplicate(this.data.data.momentum) momentum.value += incDec - if ( momentum.value >= 0 && momentum.value <= momentum.max ){ - this.update( { 'data.momentum': momentum}) + if (momentum.value >= 0 ) { + this.update({ 'data.momentum': momentum }) + let chatData = { + user: game.user.id, + rollMode: game.settings.get("core", "rollMode"), + whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')) + } + if (incDec > 0) { + chatData.content = `
${this.name} has gained a Momentum${this.name} has used a Momentum true) { let array = Array.from(this.getEmbeddedCollection("ActiveEffect").values()); @@ -372,25 +393,25 @@ export class PegasusActor extends Actor { } /* -------------------------------------------- */ - async addObjectToContainer( itemId, containerId ) { - let container = this.data.items.find( item => item.id == containerId && item.data.data.iscontainer) - let object = this.data.items.find( item => item.id == itemId ) + async addObjectToContainer(itemId, containerId) { + let container = this.data.items.find(item => item.id == containerId && item.data.data.iscontainer) + let object = this.data.items.find(item => item.id == itemId) console.log("Found", container, object) - if ( container ) { - if ( object.data.data.iscontainer) { + if (container) { + if (object.data.data.iscontainer) { ui.notifications.warn("Only 1 level of container allowed") return } - let alreadyInside = this.data.items.filter( item => item.data.data.containerid && item.data.data.containerid == containerId); - if ( alreadyInside.length >= container.data.data.containercapacity ) { + let alreadyInside = this.data.items.filter(item => item.data.data.containerid && item.data.data.containerid == containerId); + if (alreadyInside.length >= container.data.data.containercapacity) { ui.notifications.warn("Container is already full !") return - } else { - await this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'data.containerid':containerId }] ) + } else { + await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'data.containerid': containerId }]) } - } else if ( object && object.data.data.containerid) { // remove from container + } else if (object && object.data.data.containerid) { // remove from container console.log("Removeing: ", object) - await this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'data.containerid':"" }]); + await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'data.containerid': "" }]); } } @@ -414,7 +435,7 @@ export class PegasusActor extends Actor { let dropID = $(event.target).parents(".item").attr("data-item-id") // Only relevant if container drop let objectID = item.id || item._id - this.addObjectToContainer( objectID, dropID ) + this.addObjectToContainer(objectID, dropID) } /* -------------------------------------------- */ @@ -438,7 +459,7 @@ export class PegasusActor extends Actor { getSubActors() { let subActors = []; for (let id of this.data.data.subactors) { - subActors.push( duplicate(game.actors.get(id)) ) + subActors.push(duplicate(game.actors.get(id))) } return subActors; } @@ -531,7 +552,7 @@ export class PegasusActor extends Actor { effects.push(effect) } if (effects.length > 0) { - this.createEmbeddedDocuments('Item', effects ) + this.createEmbeddedDocuments('Item', effects) } this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'data.activated': true }]) } @@ -735,7 +756,7 @@ export class PegasusActor extends Actor { /* -------------------------------------------- */ async computeNRGHealth() { if (this.isToken) return - + if (this.isOwner || game.user.isGM) { let updates = {} let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod; @@ -974,8 +995,8 @@ export class PegasusActor extends Actor { if (this.data.data.combat.hindrancedice > 0) { effectsList.push({ label: "Health/Delirium Hindrance", type: "hindrance", applied: false, value: this.data.data.combat.hindrancedice }) } - let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity() ) - if (overCapacity > 0 ) { + let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity()) + if (overCapacity > 0) { effectsList.push({ label: "Encumbrance Hindrance", type: "hindrance", applied: false, value: overCapacity }) } let effects = this.data.items.filter(item => item.type == 'effect') @@ -1083,14 +1104,14 @@ export class PegasusActor extends Actor { } /* -------------------------------------------- */ - powerDmgRoll( itemId) { + powerDmgRoll(itemId) { let power = this.data.items.get(itemId) - if (power ) { + if (power) { power = duplicate(power) - this.rollPool( power.data.dmgstatistic ) + this.rollPool(power.data.dmgstatistic) } } - + /* -------------------------------------------- */ rollPool(statKey, useShield = false) { let stat = this.getStat(statKey) diff --git a/styles/simple.css b/styles/simple.css index 7c3d130..06ff1d1 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -217,9 +217,10 @@ table {border: 1px solid #7a7971;} -webkit-box-flex: 0; -ms-flex: 0 0 128px; flex: 0 0 128px; - width: 128px; + width: 196px; height: auto; max-height:260px; + margin-top: 0px; margin-right: 10px; object-fit: cover; object-position: 50% 0; @@ -1253,11 +1254,18 @@ Stealth STL: #505050 Perception PER: #f9c801 Also Used for Ranged Damage Focus FOC: #ff0084 */ +.color-class-black { + background-color: black; + background: black; +} .color-class-agi, .color-class-range { background-color: #02a41d; background: #02a41d; } +.color-class-pool { + background-color:#c5c3c3; +} .color-class-mnd { background-color: #a100fe; } @@ -1272,6 +1280,9 @@ Focus FOC: #ff0084 .color-class-dmgres { background-color: #990304; } +.color-class-mr { + background-color: #050505; +} .color-class-com, .color-class-melee { background-color: #0136ff; @@ -1306,10 +1317,10 @@ Focus FOC: #ff0084 max-width: 24px; } .status-col-name { - max-width: 48px; + max-width: 62px; } .status-block { - max-width: 128px; + max-width: 216px; } .momentum-block { max-width: 128px; @@ -1325,7 +1336,7 @@ Focus FOC: #ff0084 } .stat-margin { margin-left: 4px; - margin-top: 6px; + margin-top: 5px; } .combat-margin { margin-left: 4px; @@ -1336,6 +1347,7 @@ Focus FOC: #ff0084 } .item-stat-roll { max-height: 42px; + min-height: 36px; } .item-stat-roll select, .item-stat-roll input { margin-top: 4px; @@ -1349,4 +1361,17 @@ Focus FOC: #ff0084 max-width: 48px; max-height: 48px; border: 0; +} +.items-title-bg { + margin-top: 6px; + background: black; + color: white; +} +.lock-icon { + width:16px; + height: 16px; +} +.item-sheet-img { + width: 64px; + height: auto; } \ No newline at end of file diff --git a/system.json b/system.json index 2a7a74d..255e5e9 100644 --- a/system.json +++ b/system.json @@ -183,6 +183,6 @@ "templateVersion": 86, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.5.2", + "version": "0.5.3", "background" : "./images/ui/pegasus_welcome_page.webp" } diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 93ad6f7..19e631a 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -3,12 +3,11 @@ {{!-- Sheet Header --}}
+

-

-
    @@ -17,6 +16,14 @@ {{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}} {{/if}} {{/each}} +
  • + + + + +

    Dice Pool

    +
    +
@@ -27,6 +34,22 @@ {{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}} {{/if}} {{/each}} +
  • + + + + +

    MR

    +
    + + +
  • @@ -34,37 +57,10 @@ {{> systems/fvtt-pegasus-rpg/templates/partial-actor-status.html}}
    -
    -
    - - - - - - - - - -
    - - - + -
    - - -
    -
    - - -
    - + @@ -153,9 +149,9 @@
    • - Stun Level + Current - Stun Threshold + Threshold
    @@ -164,12 +160,12 @@
    -

    Perks

    +

    Perks

      {{#each perks as |perk key|}}
    • - + {{perk.name}} Lvl:{{perk.data.level}} {{#if perk.data.features.range.flag}} @@ -214,9 +210,7 @@     {{/if}} -
      -
    • @@ -225,19 +219,18 @@
    -

    Effects

    +

    Effects

      {{#each effects as |effect key|}}
    • - + {{effect.name}} {{upperFirst effect.data.type}} {{upperFirst effect.data.genre}} Lvl:{{effect.data.effectlevel}} {{upper effect.data.stataffected}}
      -
    • @@ -253,12 +246,12 @@
      -

      Specialisations

      +

      Specialisations

        {{#each specs as |spec key|}}
      • - + {{spec.name}} {{upper spec.data.statistic}} {{spec.data.dice}} @@ -272,7 +265,6 @@   {{/if}}
        -
      • @@ -301,12 +293,12 @@
      -

      Powers

      +

      Powers

      -

      Abilities

      +

      Abilities

        {{#each abilities as |ability key|}}
      • - + {{ability.name}}
        -
      • @@ -372,19 +362,18 @@
      -

      Money

      +

      Money

        {{#each moneys as |money key|}}
      • - + {{money.name}} Qty {{money.data.quantity}} ( -/+)
        -
      • @@ -392,12 +381,12 @@
      -

      Weapons

      +

      Weapons

      -

      Armors & Shields

      +

      Armors & Shields

      -

      Equipment

      +

      Equipment

        {{#each containersTree as |equip key|}}
      • - + {{equip.name}} {{upperFirst equip.data.type}} Qty {{equip.data.quantity}} @@ -500,14 +486,13 @@
        • {{#each equip.data.contents as |subgear key|}}
        • - + {{subgear.name}} {{upperFirst subgear.data.type}} Qty {{subgear.data.quantity}} @@ -521,7 +506,6 @@   {{/if}}
          -
          {{/each}} @@ -537,25 +521,25 @@
          -
            -
          • +
              +
            • -
            • +
            • -
            • +
            • -
            • +
            • -
            • +
            • @@ -563,41 +547,40 @@
            -
          • +
          • -
          • +
          • -
          • +
          • -
          • +
          • +
            -
          • -
          • +
          • +
            -
          -
          -

          Psychology :

          +

          Psychology :

          • @@ -629,8 +612,7 @@
          -
          -

          Development :

          +

          Development :

          • diff --git a/templates/item-ability-sheet.html b/templates/item-ability-sheet.html index b9be0ce..a45ad6d 100644 --- a/templates/item-ability-sheet.html +++ b/templates/item-ability-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-armor-sheet.html b/templates/item-armor-sheet.html index f765274..b6fd3c2 100644 --- a/templates/item-armor-sheet.html +++ b/templates/item-armor-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-effect-sheet.html b/templates/item-effect-sheet.html index b5e4a45..48fe87f 100644 --- a/templates/item-effect-sheet.html +++ b/templates/item-effect-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-equipment-sheet.html b/templates/item-equipment-sheet.html index a8a7194..0fc1c3d 100644 --- a/templates/item-equipment-sheet.html +++ b/templates/item-equipment-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-money-sheet.html b/templates/item-money-sheet.html index 29ef5c4..f4d41fe 100644 --- a/templates/item-money-sheet.html +++ b/templates/item-money-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-perk-sheet.html b/templates/item-perk-sheet.html index f5ac1d4..d353c99 100644 --- a/templates/item-perk-sheet.html +++ b/templates/item-perk-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-power-sheet.html b/templates/item-power-sheet.html index b406be3..abb84fb 100644 --- a/templates/item-power-sheet.html +++ b/templates/item-power-sheet.html @@ -1,6 +1,6 @@
            - +

            @@ -12,21 +12,19 @@
            -
            +
            {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
            -
          • -
            - {{editor content=data.effects target="data.effects" button=true owner=owner editable=editable}} -
            -
          • -
          • -
            +
            + + {{editor content=data.effects target="data.effects" button=true owner=owner editable=editable}} +
            +
            + {{editor content=data.purchasedeffects target="data.purchasedeffects" button=true owner=owner editable=editable}} -
            -
          • +
            diff --git a/templates/item-race-sheet.html b/templates/item-race-sheet.html index 226cd10..ec9bb16 100644 --- a/templates/item-race-sheet.html +++ b/templates/item-race-sheet.html @@ -1,6 +1,6 @@
            - +

            @@ -13,19 +13,19 @@
            -
            +
            {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
            -
            +
            {{editor content=data.environment target="data.environment" button=true owner=owner editable=editable}}
            -
            +
            {{editor content=data.society_culture target="data.society_culture" button=true owner=owner editable=editable}}
            -
            +
            {{editor content=data.outlook target="data.outlook" button=true owner=owner editable=editable}}
            diff --git a/templates/item-role-sheet.html b/templates/item-role-sheet.html index a88d120..b0aa6eb 100644 --- a/templates/item-role-sheet.html +++ b/templates/item-role-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-shield-sheet.html b/templates/item-shield-sheet.html index 0738964..5614e11 100644 --- a/templates/item-shield-sheet.html +++ b/templates/item-shield-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-specialisation-sheet.html b/templates/item-specialisation-sheet.html index fc729eb..2652683 100644 --- a/templates/item-specialisation-sheet.html +++ b/templates/item-specialisation-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/item-weapon-sheet.html b/templates/item-weapon-sheet.html index c0532bf..4acd7f0 100644 --- a/templates/item-weapon-sheet.html +++ b/templates/item-weapon-sheet.html @@ -1,6 +1,6 @@
            - +

            diff --git a/templates/partial-actor-stat-block.html b/templates/partial-actor-stat-block.html index 8b858af..d2cdb82 100644 --- a/templates/partial-actor-stat-block.html +++ b/templates/partial-actor-stat-block.html @@ -3,7 +3,7 @@ -

            {{stat.abbrev}}

            +

            {{stat.abbrev}}

            + {{#if (eq key "socialhealth")}} + + + {{/if}}

          • {{/each}}
          • @@ -29,7 +34,36 @@ + + +
          • +
          • + + + + + + + + + - + +
          • +
          • + + + +
          • + + +