diff --git a/css/mosh.css b/css/mosh.css index de8ea693..93e3c0d6 100644 --- a/css/mosh.css +++ b/css/mosh.css @@ -636,6 +636,24 @@ font-weight: bold; text-align: center; } + +.mosh .armor-mod { + margin: -8px; + height: 24px; + width: 35px; + /* padding: 0; */ + border: 3px solid #111; + background-color: #111; + border-radius: 0.6em; + font-size: 0.9rem; + font-weight: bold; + text-align: center; + position: relative; + color: white; + top: 8px; + right: -19px; +} + .mosh .savetext { display: block; margin-bottom: .2em; @@ -929,6 +947,7 @@ grid-column: 2/span 2; } + .mosh .roll-target { box-sizing: border-box; display: grid; diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 589850f3..6a6058e3 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -172,12 +172,15 @@ export class MothershipActorSheet extends ActorSheet { weapon.sheet.render(true); }); - // Rollable Attributes + html.find('.stat-roll').click(ev => { const div = $(ev.currentTarget); const statName = div.data("key"); const attribute = this.actor.data.data.stats[statName]; - this.actor.rollStat(attribute); + var shifted = false; + if (ev.shiftKey) shifted = true; + + this.actor.rollStat(attribute, shifted); }); // Rollable Skill @@ -284,6 +287,7 @@ export class MothershipActorSheet extends ActorSheet { * @private */ _onItemCreate(event) { + event.preventDefault(); const header = event.currentTarget; // Get the type of item to create. @@ -298,9 +302,11 @@ export class MothershipActorSheet extends ActorSheet { type: type, data: data }; + // Remove the type from the dataset since it's in the itemData.type prop. delete itemData.data["type"]; + // Finally, create the item! return this.actor.createOwnedItem(itemData); } @@ -328,8 +334,44 @@ export class MothershipActorSheet extends ActorSheet { // Remove the type from the dataset since it's in the itemData.type prop. delete itemData.data["type"]; + let d = new Dialog({ + title: "New Skill", + content: "

Name

\ + \ +

Rank


", + buttons: { + roll: { + icon: '', + label: "Create", + callback: (html) => { + var rank = html.find('[id=\"rank\"]')[0].value; + if(rank == "Trained") + itemData.data.bonus = 10; + if(rank == "Expert") + itemData.data.bonus = 15; + if(rank == "Master") + itemData.data.bonus = 20; + + itemData.data.rank = rank; + itemData.name = html.find('[id=\"name\"]')[0].value + this.actor.createOwnedItem(itemData);} + }, + cancel: { + icon: '', + label: "Cancel", + callback: () => { } + } + }, + default: "roll", + close: () => { } + }); + d.render(true); + // Finally, create the item! - return this.actor.createOwnedItem(itemData); + return ; } diff --git a/module/actor/actor.js b/module/actor/actor.js index dcbce0d8..7de2f308 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -31,12 +31,13 @@ export class MothershipActor extends Actor { const armors = this.getEmbeddedCollection("Item").filter(e => "armor" === e.type); for (let armor of armors) { - console.log(armor); if (armor.data.data.equipped) { armorBonus += armor.data.data.bonus; } } data.stats.armor.mod = armorBonus; + data.stats.armor.total = armorBonus+data.stats.armor.value; + } /** @@ -80,7 +81,7 @@ export class MothershipActor extends Actor { d.render(true); } - rollStat(attribute) { + rollStat(attribute, shifted = false) { console.log(attribute); let attLabel = attribute.label?.charAt(0).toUpperCase() + attribute.label?.toLowerCase().slice(1); @@ -88,26 +89,30 @@ export class MothershipActor extends Actor { attLabel = attribute.charAt(0)?.toUpperCase() + attribute.toLowerCase().slice(1); //this.rollAttribute(attribute, "none"); - - let d = new Dialog({ - title: "Select Roll Type", - content: "

Advantages/Disadvantage


", - buttons: { - roll: { - icon: '', - label: "Roll", - callback: (html) => this.rollAttribute(attribute, html.find('[id=\"advantage\"]')[0].value) + if(shifted){ + this.rollAttribute(attribute, 'None'); + } + else { + let d = new Dialog({ + title: "Select Roll Type", + content: "

Advantages/Disadvantage


", + buttons: { + roll: { + icon: '', + label: "Roll", + callback: (html) => this.rollAttribute(attribute, html.find('[id=\"advantage\"]')[0].value) + }, + cancel: { + icon: '', + label: "Cancel", + callback: () => { } + } }, - cancel: { - icon: '', - label: "Cancel", - callback: () => { } - } - }, - default: "roll", - close: () => { } - }); - d.render(true); + default: "roll", + close: () => { } + }); + d.render(true); + } } rollStress(attribute) { diff --git a/module/actor/creature-sheet.js b/module/actor/creature-sheet.js index b62a8624..ce43ddcf 100644 --- a/module/actor/creature-sheet.js +++ b/module/actor/creature-sheet.js @@ -132,7 +132,11 @@ export class MothershipCreatureSheet extends ActorSheet { const div = $(ev.currentTarget); const statName = div.data("key"); const attribute = this.actor.data.data.stats[statName]; - this.actor.rollStat(attribute); + + var shifted = false; + if (ev.shiftKey) shifted = true; + + this.actor.rollStat(attribute, shifted); }); //Weapons diff --git a/system.json b/system.json index e7c46942..e02e2953 100644 --- a/system.json +++ b/system.json @@ -2,9 +2,9 @@ "name": "mosh", "title": "MoSh - Unofficial Mothership", "description": "The unofficial Mothership system for FoundryVTT.", - "version": "0.1.5b", + "version": "0.1.6", "minimumCoreVersion": "0.8.6", - "compatibleCoreVersion": "0.8.6", + "compatibleCoreVersion": "0.8.9", "templateVersion": 2, "author": "Futilrevenge", "esmodules": ["module/mosh.js"], diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 313ebcc8..46e35440 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -263,6 +263,8 @@ data-target="{{data.stats.armor.value}}" data-label="Armor">ARMOR +
{{data.stats.armor.total}}
@@ -284,11 +286,11 @@ {{!-- Biography Tab --}}
- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} + {{editor content=data.biography target="data.biography" button=true owner=owner editable=true}}
{{!-- Notes Tab --}}
- {{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}} + {{editor content=data.notes target="data.notes" button=true owner=owner editable=true}}
{{!-- Owned Items Tab --}}
diff --git a/templates/actor/ship-sheet.html b/templates/actor/ship-sheet.html index d557fe21..1c5845be 100644 --- a/templates/actor/ship-sheet.html +++ b/templates/actor/ship-sheet.html @@ -193,7 +193,7 @@ {{!-- Biography Tab --}}
- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} + {{editor content=data.biography target="data.biography" button=true owner=owner editable=true}}
{{!-- Layout Tab --}}