diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js
index 568fddf..0533319 100644
--- a/module/actor/actor-sheet.js
+++ b/module/actor/actor-sheet.js
@@ -23,24 +23,24 @@ export class MothershipActorSheet extends ActorSheet {
data.dtypes = ["String", "Number", "Boolean"];
- const superData = data.data.data;
-
- for (let attr of Object.values(data.data.data.attributes)) {
+ const superData = data.data.system;
+
+ for (let attr of Object.values(data.data.system.attributes)) {
attr.isCheckbox = attr.dtype === "Boolean";
}
// Prepare items.
- if (this.actor.data.type == 'character') {
+ if (this.actor.type == 'character') {
this._prepareCharacterItems(data);
}
- if (data.data.data.settings == null) {
- data.data.data.settings = {};
+ if (data.data.system.settings == null) {
+ data.data.system.settings = {};
}
- data.data.data.settings.useCalm = game.settings.get("mosh", "useCalm");
- data.data.data.settings.hideWeight = game.settings.get("mosh", "hideWeight");
- data.data.data.settings.firstEdition = game.settings.get("mosh", "firstEdition");
+ data.data.system.settings.useCalm = game.settings.get("mosh", "useCalm");
+ data.data.system.settings.hideWeight = game.settings.get("mosh", "hideWeight");
+ data.data.system.settings.firstEdition = game.settings.get("mosh", "firstEdition");
//SKILL XP BUTTONS
@@ -86,6 +86,8 @@ export class MothershipActorSheet extends ActorSheet {
*/
_prepareCharacterItems(sheetData) {
const actorData = sheetData.data;
+ console.log(sheetData);
+ console.log("sheetdata Above");
// Initialize containers.
const gear = [];
const skills = [];
@@ -96,8 +98,8 @@ export class MothershipActorSheet extends ActorSheet {
let curWeight = 0;
// Iterate through items, allocating to containers
// let totalWeight = 0;
- for (let i of sheetData.data.items) {
- let item = i.data;
+ for (let i of sheetData.items) {
+ let item = i.system;
i.img = i.img || DEFAULT_TOKEN;
if (i.type === 'item') {
@@ -141,20 +143,20 @@ export class MothershipActorSheet extends ActorSheet {
}
}
- if(actorData.data.weight == undefined){
- actorData.data.weight = {
+ if(actorData.system.weight == undefined){
+ actorData.system.weight = {
"current" : 0,
"capacity" : 0
};
}
- if(actorData.data.credits == undefined){
- actorData.data.credits = {
+ if(actorData.system.credits == undefined){
+ actorData.system.credits = {
"value" : 0,
};
}
- actorData.data.weight.capacity = Math.ceil((actorData.data.stats.strength.value/10) + 3);
- actorData.data.weight.current = curWeight;
+ actorData.system.weight.capacity = Math.ceil((actorData.system.stats.strength.value/10) + 3);
+ actorData.system.weight.current = curWeight;
//console.log("Current Weight: " + curWeight + " Capacity: " + actorData.data.weight.capacity);
// Assign and return
@@ -208,15 +210,15 @@ export class MothershipActorSheet extends ActorSheet {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.treatment.value;
+ let amount = item.system.treatment.value;
if (event.button == 0) {
if (amount < 3) {
- item.data.treatment.value = Number(amount) + 1;
+ item.system.treatment.value = Number(amount) + 1;
}
} else if (event.button == 2) {
if (amount > 0) {
- item.data.treatment.value = Number(amount) - 1;
+ item.system.treatment.value = Number(amount) - 1;
}
}
@@ -229,7 +231,7 @@ export class MothershipActorSheet extends ActorSheet {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- item.data.equipped = !item.data.equipped;
+ item.system.equipped = !item.system.equipped;
this.actor.updateEmbeddedDocuments('Item', [item]);
});
@@ -247,12 +249,12 @@ export class MothershipActorSheet extends ActorSheet {
html.on('mousedown', '.item-quantity', ev => {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.quantity;
+ let amount = item.system.quantity;
if (event.button == 0) {
- item.data.quantity = Number(amount) + 1;
+ item.system.quantity = Number(amount) + 1;
} else if (event.button == 2) {
- item.data.quantity = Number(amount) - 1;
+ item.system.quantity = Number(amount) - 1;
}
this.actor.updateEmbeddedDocuments('Item', [item]);
@@ -292,7 +294,7 @@ export class MothershipActorSheet extends ActorSheet {
html.find('.stat-roll').click(ev => {
const div = $(ev.currentTarget);
const statName = div.data("key");
- const attribute = this.actor.data.data.stats[statName];
+ const attribute = this.actor.system.stats[statName];
var shifted = false;
if (ev.shiftKey) shifted = true;
this.actor.rollStat(attribute, shifted);
@@ -326,15 +328,15 @@ export class MothershipActorSheet extends ActorSheet {
html.on('mousedown', '.weapon-ammo', ev => {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.ammo;
+ let amount = item.system.ammo;
if (event.button == 0) {
if (amount >= 0) {
- item.data.ammo = Number(amount) + 1;
+ item.system.ammo = Number(amount) + 1;
}
} else if (event.button == 2) {
if (amount > 0) {
- item.data.ammo = Number(amount) - 1;
+ item.system.ammo = Number(amount) - 1;
}
}
@@ -346,14 +348,14 @@ export class MothershipActorSheet extends ActorSheet {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- if (!item.data.useAmmo) {
- item.data.curShots = item.data.shots;
+ if (!item.system.useAmmo) {
+ item.system.curShots = item.system.shots;
} else {
- item.data.ammo += item.data.curShots;
- let reloadAmount = Math.min(item.data.ammo, item.data.shots);
- item.data.curShots = reloadAmount;
+ item.system.ammo += item.system.curShots;
+ let reloadAmount = Math.min(item.system.ammo, item.system.shots);
+ item.system.curShots = reloadAmount;
- item.data.ammo -= reloadAmount;
+ item.system.ammo -= reloadAmount;
}
this.actor.updateEmbeddedDocuments('Item', [item]);
@@ -370,13 +372,13 @@ export class MothershipActorSheet extends ActorSheet {
// Rollable Item/Anything with a description that we want to click on.
html.find('.calm-roll').click(ev => {
- const attribute = this.actor.data.data.other.stress;
+ const attribute = this.actor.system.other.stress;
attribute.label = "Calm";
this.actor.rollStress(attribute);
});
// Rollable Item/Anything with a description that we want to click on.
html.find('.stress-roll').click(ev => {
- const attribute = this.actor.data.data.other.stress;
+ const attribute = this.actor.system.other.stress;
attribute.label = "Stress";
this.actor.rollStress(attribute);
});
@@ -502,7 +504,7 @@ export class MothershipActorSheet extends ActorSheet {
const dataset = element.dataset;
if (dataset.roll) {
- let roll = new Roll(dataset.roll, this.actor.data.data);
+ let roll = new Roll(dataset.roll, this.actor.system);
let label = dataset.label ? `Rolling ${dataset.label} to score under ${dataset.target}` : '';
roll.roll().toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
diff --git a/module/actor/actor.js b/module/actor/actor.js
index 007ef09..87aead3 100644
--- a/module/actor/actor.js
+++ b/module/actor/actor.js
@@ -10,8 +10,8 @@ export class MothershipActor extends Actor {
prepareData() {
super.prepareData();
- const actorData = this.data;
- const data = actorData.data;
+ const actorData = this;
+ const data = actorData.system;
const flags = actorData.flags;
// Make separate methods for each Actor type (character, npc, etc.) to keep
@@ -25,14 +25,14 @@ export class MothershipActor extends Actor {
* Prepare Character type specific data
*/
_prepareCharacterData(actorData) {
- const data = actorData.data;
+ const data = actorData.system;
let armorBonus = 0;
const armors = this.getEmbeddedCollection("Item").filter(e => "armor" === e.type);
for (let armor of armors) {
- if (armor.data.data.equipped) {
- armorBonus += armor.data.data.bonus;
+ if (armor.system.equipped) {
+ armorBonus += armor.system.bonus;
}
}
data.stats.armor.mod = armorBonus;
@@ -44,11 +44,11 @@ export class MothershipActor extends Actor {
* Prepare Character type specific data
*/
_prepareCreatureData(actorData) {
- const data = actorData.data;
+ const data = actorData;
}
_prepareShipData(actorData) {
- const data = actorData.data;
+ const data = actorData;
}
rollStatSelect(statList) {
@@ -67,7 +67,7 @@ export class MothershipActor extends Actor {
roll: {
icon: ' ',
label: "Roll",
- callback: (html) => this.rollStat(this.data.data.stats[html.find('[id=\"stat\"]')[0].value])
+ callback: (html) => this.rollStat(this.system.stats[html.find('[id=\"stat\"]')[0].value])
},
cancel: {
icon: ' ',
@@ -152,10 +152,10 @@ export class MothershipActor extends Actor {
console.log(item);
- if (item.data.useAmmo == true || item.data.shots > 0) {
- if (item.data.shots == 0) {
- if (item.data.ammo > 0) {
- item.data.ammo -= 1;
+ if (item.system.useAmmo == true || item.system.shots > 0) {
+ if (item.system.shots == 0) {
+ if (item.system.ammo > 0) {
+ item.system.ammo -= 1;
this.updateEmbeddedDocuments('Item', [item]);
} else {
@@ -177,14 +177,14 @@ export class MothershipActor extends Actor {
return;
}
} else {
- if (item.data.curShots > 0) {
- let subAmount = Math.max(item.data.shotsPerFire, 1);
- item.data.curShots = Math.max(item.data.curShots - subAmount, 0);
+ if (item.system.curShots > 0) {
+ let subAmount = Math.max(item.system.shotsPerFire, 1);
+ item.system.curShots = Math.max(item.system.curShots - subAmount, 0);
console.log("Unloading Shots");
this.updateEmbeddedDocuments('Item', [item]);
}
else {
- if (item.data.ammo > 0 || !item.data.useAmmo) {
+ if (item.system.ammo > 0 || !item.system.useAmmo) {
//Select the stat of the roll.
let t = new Dialog({
title: "Reload",
@@ -227,7 +227,7 @@ export class MothershipActor extends Actor {
// let speaker = ChatMessage.getSpeaker({ actor });
// ChatMessage.create({
// speaker,
- // content: item.data.ammo > 0 ? `I need to reload my ` + item.name + "!" : "I'm out of ammo!",
+ // content: item.system.ammo > 0 ? `I need to reload my ` + item.name + "!" : "I'm out of ammo!",
// type: CHAT_MESSAGE_TYPES.EMOTE
// },
// { chatBubble: true });
@@ -242,12 +242,14 @@ export class MothershipActor extends Actor {
content: "
Advantage/Disadvantage \
None \
Advantage/Disadvantage \
- ",
+ \
+ \
+ Skill Bonus ",
buttons: {
roll: {
icon: ' ',
label: "Roll",
- callback: (html) => this.rollAttribute(this.data.data.stats["combat"], html.find('[id=\"advantage\"]')[0].value, item)
+ callback: (html) => this.rollAttribute(this.system.stats["combat"], html.find('[id=\"advantage\"]')[0].value, item, false, html.find('[id=\"bonus\"]')[0].value)
},
cancel: {
icon: ' ',
@@ -265,14 +267,14 @@ export class MothershipActor extends Actor {
let item = duplicate(this.getEmbeddedDocument("Item",itemId));
if (event.button == 0) {
- if (!item.data.useAmmo) {
- item.data.curShots = item.data.shots;
+ if (!item.system.useAmmo) {
+ item.system.curShots = item.system.shots;
} else {
- item.data.ammo += item.data.curShots;
- let reloadAmount = Math.min(item.data.ammo, item.data.shots);
- item.data.curShots = reloadAmount;
+ item.system.ammo += item.system.curShots;
+ let reloadAmount = Math.min(item.system.ammo, item.system.shots);
+ item.system.curShots = reloadAmount;
- item.data.ammo -= reloadAmount;
+ item.system.ammo -= reloadAmount;
}
}
@@ -311,7 +313,7 @@ export class MothershipActor extends Actor {
roll: {
icon: ' ',
label: "Roll",
- callback: (html) => this.rollAttribute(this.data.data.stats[html.find('[id=\"stat\"]')[0].value], html.find('[id=\"advantage\"]')[0].value, item)
+ callback: (html) => this.rollAttribute(this.system.stats[html.find('[id=\"stat\"]')[0].value], html.find('[id=\"advantage\"]')[0].value, item)
},
cancel: {
icon: ' ',
@@ -325,7 +327,7 @@ export class MothershipActor extends Actor {
t.render(true);
}
- async rollAttribute(attribute, advantage, item = "", rollOver = false) {
+ async rollAttribute(attribute, advantage, item = "", rollOver = false, bonus = 0) {
let attributeName = attribute.label?.charAt(0).toUpperCase() + attribute.label?.toLowerCase().slice(1);
if (!attribute.label && isNaN(attributeName))
attributeName = attribute.charAt(0)?.toUpperCase() + attribute.toLowerCase().slice(1);
@@ -361,7 +363,7 @@ export class MothershipActor extends Actor {
let damageRoll = 0;
if (item.type == "weapon") {
- damageRoll = new Roll(item.data.damage);
+ damageRoll = new Roll(item.system.damage);
damageRoll.evaluate({async: false});
console.log(damageRoll);
}
@@ -370,9 +372,9 @@ export class MothershipActor extends Actor {
const diceData = this.formatDice(r);
let mod = 0;
- if (attribute.mod > 0) mod = attribute.mod;
-
- let targetValue = attribute.value + mod + (item == "" ? 0 : item.data.bonus);
+ if (attribute.mod > 0) mod += attribute.mod;
+ console.log("Bonus: " + mod);
+ let targetValue = attribute.value + mod + (item == "" ? 0 : parseInt(bonus));
let critical = false;
@@ -428,7 +430,7 @@ export class MothershipActor extends Actor {
value: resultText
},
isCreature: {
- value: this.data.type == "creature" ? true : false
+ value: this.type == "creature" ? true : false
},
panic: panic,
panicText : panicText
@@ -441,6 +443,7 @@ export class MothershipActor extends Actor {
isWeapon: item.type == "weapon" ? true : false,
critical: critical,
advantage: advantage == "advantage" ? true : false,
+ bonus: bonus,
diceData
};
@@ -553,12 +556,12 @@ export class MothershipActor extends Actor {
var rollInsert = '';
- if(item.data.roll){
- let r = new Roll(item.data.roll, {});
+ if(item.system.roll){
+ let r = new Roll(item.system.roll, {});
r.evaluate({async: false});
rollInsert = '\
- '+item.data.roll+'
\
+ '+item.system.roll+'
\
';
diff --git a/module/actor/creature-sheet.js b/module/actor/creature-sheet.js
index a81aeda..5c355ec 100644
--- a/module/actor/creature-sheet.js
+++ b/module/actor/creature-sheet.js
@@ -66,7 +66,7 @@ export class MothershipCreatureSheet extends ActorSheet {
// }
// Prepare items.
- if (this.actor.data.type == 'creature') {
+ if (this.actor.type == 'creature') {
this._prepareCreatureItems(data);
}
@@ -82,15 +82,15 @@ export class MothershipCreatureSheet extends ActorSheet {
*/
_prepareCreatureItems(sheetData) {
const actorData = sheetData.data;
-
+
// Initialize containers.
const abilities = [];
const weapons = [];
// Iterate through items, allocating to containers
// let totalWeight = 0;
- for (let i of sheetData.data.items) {
- let item = i.data;
+ for (let i of sheetData.items) {
+ let item = i.system;
i.img = i.img || DEFAULT_TOKEN;
if (i.type === 'ability') {
@@ -136,7 +136,7 @@ export class MothershipCreatureSheet extends ActorSheet {
html.find('.stat-roll').click(ev => {
const div = $(ev.currentTarget);
const statName = div.data("key");
- const attribute = this.actor.data.data.stats[statName];
+ const attribute = this.actor.system.stats[statName];
var shifted = false;
if (ev.shiftKey) shifted = true;
@@ -169,15 +169,15 @@ export class MothershipCreatureSheet extends ActorSheet {
html.on('mousedown', '.weapon-ammo', ev => {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.ammo;
+ let amount = item.system.ammo;
if (event.button == 0) {
if (amount >= 0) {
- item.data.ammo = Number(amount) + 1;
+ item.system.ammo = Number(amount) + 1;
}
} else if (event.button == 2) {
if (amount > 0) {
- item.data.ammo = Number(amount) - 1;
+ item.system.ammo = Number(amount) - 1;
}
}
@@ -190,14 +190,14 @@ export class MothershipCreatureSheet extends ActorSheet {
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
if (event.button == 0) {
- if (!item.data.useAmmo) {
- item.data.curShots = item.data.shots;
+ if (!item.system.useAmmo) {
+ item.system.curShots = item.system.shots;
} else {
- item.data.ammo += item.data.curShots;
- let reloadAmount = Math.min(item.data.ammo, item.data.shots);
- item.data.curShots = reloadAmount;
+ item.system.ammo += item.system.curShots;
+ let reloadAmount = Math.min(item.system.ammo, item.system.shots);
+ item.system.curShots = reloadAmount;
- item.data.ammo -= reloadAmount;
+ item.system.ammo -= reloadAmount;
}
}
@@ -276,7 +276,7 @@ export class MothershipCreatureSheet extends ActorSheet {
console.log(super.getData());
if (dataset.roll) {
- let roll = new Roll(dataset.roll, this.actor.data.data);
+ let roll = new Roll(dataset.roll, this.actor.system);
let label = dataset.label ? `Rolling ${dataset.label} to score under ${dataset.target}` : '';
roll.roll().toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
diff --git a/module/actor/ship-sheet.js b/module/actor/ship-sheet.js
index e847908..6493937 100644
--- a/module/actor/ship-sheet.js
+++ b/module/actor/ship-sheet.js
@@ -20,26 +20,31 @@ export class MothershipShipSheet extends ActorSheet {
/** @override */
getData() {
const data = super.getData();
+
data.dtypes = ["String", "Number", "Boolean"];
- // for (let attr of Object.values(data.data.attributes)) {
+
+ // for (let attr of Object.values(data.data.system.attributes)) {
// attr.isCheckbox = attr.dtype === "Boolean";
- // }
- console.log(data);
+ // }
+
+ const superData = data.data.system;
+
// Prepare items.
- if (this.actor.data.type == 'ship') {
+ if (this.actor.type == 'ship') {
this._prepareShipItems(data);
}
- if (data.data.settings == null) {
- data.data.settings = {};
+ if (superData.settings == null) {
+ superData.settings = {};
}
- data.data.settings.useCalm = game.settings.get("mosh", "useCalm");
- data.data.settings.hideWeight = game.settings.get("mosh", "hideWeight");
+ superData.settings.useCalm = game.settings.get("mosh", "useCalm");
+ superData.settings.hideWeight = game.settings.get("mosh", "hideWeight");
+ superData.settings.firstEdition = game.settings.get("mosh", "firstEdition");
- let maxHull = data.data.data.supplies.hull.max;
+ let maxHull = superData.supplies.hull.max;
- data.data.data.supplies.hull.percentage = " [ "+Math.round(maxHull * 0.25)+" | "+Math.round(maxHull * 0.5)+" | "+Math.round(maxHull * 0.75)+" ]";
+ superData.supplies.hull.percentage = " [ "+Math.round(maxHull * 0.25)+" | "+Math.round(maxHull * 0.5)+" | "+Math.round(maxHull * 0.75)+" ]";
return data.data;
}
@@ -62,8 +67,8 @@ export class MothershipShipSheet extends ActorSheet {
// Iterate through items, allocating to containers
// let totalWeight = 0;
- for (let i of sheetData.data.items) {
- let item = i.data;
+ for (let i of sheetData.items) {
+ let item = i.system;
i.img = i.img || DEFAULT_TOKEN;
if (i.type === 'ability') {
@@ -107,10 +112,10 @@ export class MothershipShipSheet extends ActorSheet {
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
item.sheet.render(true);
- let amount = item.data.quantity;
+ let amount = item.system.quantity;
if (item.type == "module") {
- item.data.totalHull = amount * item.data.hull;
+ item.system.totalHull = amount * item.system.hull;
}
});
@@ -118,16 +123,16 @@ export class MothershipShipSheet extends ActorSheet {
html.on('mousedown', '.item-quantity', ev => {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.quantity;
+ let amount = item.system.quantity;
if (event.button == 0) {
- item.data.quantity = Number(amount) + 1;
+ item.system.quantity = Number(amount) + 1;
} else if (event.button == 2) {
- item.data.quantity = Number(amount) - 1;
+ item.system.quantity = Number(amount) - 1;
}
if (item.type == "module") {
- item.data.totalHull = item.data.quantity * item.data.hull;
+ item.system.totalHull = item.system.quantity * item.system.hull;
}
this.actor.updateEmbeddedDocuments('Item', [item]);
@@ -137,7 +142,7 @@ export class MothershipShipSheet extends ActorSheet {
html.find('.stat-roll').click(ev => {
const div = $(ev.currentTarget);
const statName = div.data("key");
- const attribute = this.actor.data.data.stats[statName];
+ const attribute = this.actor.system.stats[statName];
this.actor.rollStat(attribute);
});
@@ -161,15 +166,15 @@ export class MothershipShipSheet extends ActorSheet {
html.on('mousedown', '.weapon-ammo', ev => {
const li = ev.currentTarget.closest(".item");
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
- let amount = item.data.ammo;
+ let amount = item.system.ammo;
if (event.button == 0) {
if (amount >= 0) {
- item.data.ammo = Number(amount) + 1;
+ item.system.ammo = Number(amount) + 1;
}
} else if (event.button == 2) {
if (amount > 0) {
- item.data.ammo = Number(amount) - 1;
+ item.system.ammo = Number(amount) - 1;
}
}
@@ -182,14 +187,14 @@ export class MothershipShipSheet extends ActorSheet {
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
if (event.button == 0) {
- if (!item.data.useAmmo) {
- item.data.curShots = item.data.shots;
+ if (!item.system.useAmmo) {
+ item.system.curShots = item.system.shots;
} else {
- item.data.ammo += item.data.curShots;
- let reloadAmount = Math.min(item.data.ammo, item.data.shots);
- item.data.curShots = reloadAmount;
+ item.system.ammo += item.system.curShots;
+ let reloadAmount = Math.min(item.system.ammo, item.system.shots);
+ item.system.curShots = reloadAmount;
- item.data.ammo -= reloadAmount;
+ item.system.ammo -= reloadAmount;
}
}
diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js
index 18f9206..f3a6d3a 100644
--- a/module/item/item-sheet.js
+++ b/module/item/item-sheet.js
@@ -18,11 +18,11 @@ export class MothershipItemSheet extends ItemSheet {
get template() {
const path = "systems/mosh/templates/item";
// Return a single sheet for all item types.
- return `${path}/item-${this.item.data.type}-sheet.html`;
+ return `${path}/item-${this.item.type}-sheet.html`;
// Alternatively, you could use the following return statement to do a
// unique item sheet by type, like `weapon-sheet.html`.
- // return `${path}/${this.item.data.type}-sheet.html`;
+ // return `${path}/${this.item.system.type}-sheet.html`;
}
/* -------------------------------------------- */
@@ -30,9 +30,9 @@ export class MothershipItemSheet extends ItemSheet {
/** @override */
getData() {
const data = super.getData();
- const superData = data.data.data;
+ const superData = data.system;
- if(data.data.type == "weapon"){
+ if(data.type == "weapon"){
if(superData.ranges.value == "" && superData.ranges.medium > 0){
superData.ranges.value = superData.ranges.short + "/" + superData.ranges.medium + "/" + superData.ranges.long;
superData.ranges.medium = 0;
diff --git a/module/item/item.js b/module/item/item.js
index 9f3e52e..c147a0c 100644
--- a/module/item/item.js
+++ b/module/item/item.js
@@ -10,9 +10,9 @@ export class MothershipItem extends Item {
super.prepareData();
// Get the Item's data
- const itemData = this.data;
- const actorData = this.actor ? this.actor.data : {};
- const data = itemData.data;
+ const itemData = this;
+ const actorData = this.actor ? this.actor.system : {};
+ const data = itemData.system;
}
static chatListeners(html) {
diff --git a/module/mosh.js b/module/mosh.js
index 7037b9c..8017418 100644
--- a/module/mosh.js
+++ b/module/mosh.js
@@ -188,7 +188,7 @@ function rollStatMacro() {
let actor;
if (speaker.token) actor = game.actors.tokens[speaker.token];
if (!actor) actor = game.actors.get(speaker.actor);
- const stat = actor ? Object.entries(actor.data.data.stats) : null;
+ const stat = actor ? Object.entries(actor.system.stats) : null;
// if (stat == null) {
diff --git a/system.json b/system.json
index e4f3ba1..8cb3ba3 100644
--- a/system.json
+++ b/system.json
@@ -1,29 +1,30 @@
{
- "name": "mosh",
"title": "MoSh - Unofficial Mothership",
"description": "The unofficial Mothership system for FoundryVTT.",
- "version": "0.2.3",
- "minimumCoreVersion": "0.8.6",
- "compatibleCoreVersion": "V9",
- "templateVersion": 2,
- "author": "Futilrevenge",
- "esmodules": ["module/mosh.js"],
- "styles": ["css/mosh.css"],
- "scripts": [],
+ "version": "0.3.0",
+ "esmodules": [
+ "module/mosh.js"
+ ],
+ "styles": [
+ "css/mosh.css"
+ ],
"packs": [
{
"name": "tables",
"label": "Tables",
"system": "mosh",
"path": "packs/tables.db",
- "entity": "RollTable"
+ "type": "RollTable",
+ "private": false,
+ "flags": {}
}
],
"languages": [
{
"lang": "en",
"name": "English",
- "path": "lang/en.json"
+ "path": "lang/en.json",
+ "flags": {}
}
],
"gridDistance": 1,
@@ -33,5 +34,16 @@
"url": "https://github.com/Futil/foundry-mothership",
"manifest": "https://raw.githubusercontent.com/Futil/foundry-mothership/master/system.json",
"download": "https://github.com/Futil/foundry-mothership/archive/master.zip",
- "license": "LICENSE.txt"
-}
+ "license": "LICENSE.txt",
+ "id": "mosh",
+ "authors": [
+ {
+ "name": "Futilrevenge",
+ "flags": {}
+ }
+ ],
+ "compatibility": {
+ "minimum": "V10",
+ "verified": "V10"
+ }
+}
\ No newline at end of file
diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html
index 989de9f..07682d0 100644
--- a/templates/actor/actor-sheet.html
+++ b/templates/actor/actor-sheet.html
@@ -26,45 +26,45 @@
-
+
-
+
-
+
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
-
+
{{else}}
-
+
{{/if}}
-
-
+
+
@@ -73,14 +73,14 @@
-
Health
+
Health
Current
@@ -89,8 +89,8 @@
-
- {{#if data.settings.firstEdition}}
+
+ {{#if system.settings.firstEdition}}
Wounds
{{else}}
Hits
@@ -98,28 +98,28 @@
Current
Maximum
- {{#if data.settings.useCalm}}
+ {{#if system.settings.useCalm}}
-
Calm
+
Calm
Current
@@ -128,14 +128,14 @@
{{else}}
-
Stress
+
Stress
Current
@@ -143,50 +143,50 @@
{{/if}}
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
{{else}}
{{/if}}
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
-
Armor Points
+
Armor Points
{{data.stats.armor.mod}}
+ data-dtype="Number" >{{system.stats.armor.mod}}
{{/if}}
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
TRAUMA RESPONSE
{{else}}
STRESS RESPONSE
{{/if}}
- {{#if data.settings.firstEdition}}
-
+ {{#if system.settings.firstEdition}}
+
{{else}}
-
+
{{/if}}
@@ -198,8 +198,8 @@
-
+
-->
@@ -207,12 +207,12 @@
-
+
-->
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
-
+
+
@@ -240,10 +240,10 @@
SPEED
-
-
+
@@ -255,11 +255,11 @@
INTELLECT
-
+
-
+
+
@@ -270,17 +270,17 @@
COMBAT
-
-
+
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
{{else}}
@@ -288,34 +288,34 @@
SANITY
- SANITY
+
FEAR
- FEAR
+
BODY
- BODY
+
- {{#unless data.settings.firstEdition}}
+ {{#unless system.settings.firstEdition}}
ARMOR
-
ARMOR
+
-
{{data.stats.armor.total}}
+
{{system.stats.armor.total}}
{{/unless}}
@@ -342,11 +342,11 @@
{{!-- Biography Tab --}}
- {{editor content=data.biography target="data.biography" button=true owner=owner editable=true}}
+ {{editor target="system.biography" button=true owner=owner editable=true}}
{{!-- Notes Tab --}}
- {{editor content=data.notes target="data.notes" button=true owner=owner editable=true}}
+ {{editor target="system.notes" button=true owner=owner editable=true}}
{{!-- Owned Items Tab --}}
@@ -355,7 +355,7 @@
{{armor.name}}
- {{armor.data.bonus}}
- {{armor.data.features}}
-
+ {{armor.system.bonus}}
+ {{armor.system.features}}
+
@@ -388,7 +388,7 @@
Item Name
Quantity
- {{#if data.settings.hideWeight}}
+ {{#if system.settings.hideWeight}}
{{else}}
Weight
{{/if}}
@@ -398,13 +398,13 @@
Item
- {{#if data.settings.hideWeight}}
+ {{#if system.settings.hideWeight}}
{{#each gear as |item id|}}
{{item.name}}
- {{item.data.quantity}}
- {{item.data.cost}}
+ {{item.system.quantity}}
+ {{item.system.cost}}
@@ -416,9 +416,9 @@
{{item.name}}
- {{item.data.quantity}}
- {{item.data.weight}}
- {{item.data.cost}}
+ {{item.system.quantity}}
+ {{item.system.weight}}
+ {{item.system.cost}}
@@ -427,10 +427,10 @@
{{/each}}
{{/if}}
- {{#unless data.settings.hideWeight}}
+ {{#unless system.settings.hideWeight}}
{{/unless}}
@@ -453,8 +453,8 @@
{{skill.name}}
- {{skill.data.rank}}
- {{skill.data.bonus}}
+ {{skill.system.rank}}
+ {{skill.system.bonus}}
@@ -463,17 +463,17 @@
{{/each}}
- {{#if data.settings.firstEdition}}
+ {{#if system.settings.firstEdition}}
Skill Training
- {{{data.xp.html}}}
+ {{{system.xp.html}}}
-
+
@@ -491,11 +491,11 @@
{{#each conditions as |condition id|}}
- {{condition.data.description}}
+ {{condition.system.description}}
- {{#if condition.data.treatment.html}}
+ {{#if condition.system.treatment.html}}
- {{{condition.data.treatment.html}}}
+ {{{condition.system.treatment.html}}}
{{else}}
-
+
-
+
+
@@ -69,11 +69,11 @@
SPEED
-
+
-
+
+
@@ -84,11 +84,11 @@
INTELLECT
-
+
-
+
+
@@ -99,11 +99,11 @@
COMBAT
-
+
-
+
+
@@ -111,15 +111,15 @@
-
Hull
-
{{data.supplies.hull.percentage}}
+
Hull
+
{{system.supplies.hull.percentage}}
Current
@@ -129,28 +129,28 @@
-
Fuel
+
Fuel
Current
Maximum
-
Stock
+
Stock
Current
@@ -164,7 +164,7 @@
{{#each abilities as |ability id|}}
{{ability.name}}
-
{{{ability.data.description}}}
+
{{{ability.system.description}}}
@@ -192,13 +192,13 @@
{{!-- Biography Tab --}}
- {{editor content=data.biography target="data.biography" button=true owner=owner editable=true}}
+ {{editor target="system.biography" button=true owner=owner editable=true}}
{{!-- Layout Tab --}}
-
+
{{!-- Owned Weapons Tab --}}
@@ -221,14 +221,14 @@
{{weapon.name}}
-
{{weapon.data.damage}}
- {{#if weapon.data.useAmmo}}
-
{{weapon.data.ammo}}
+
{{weapon.system.damage}}
+ {{#if weapon.system.useAmmo}}
+
{{weapon.system.ammo}}
{{else}}
N/A
{{/if}}
- {{#if weapon.data.shots}}
-
{{weapon.data.curShots}}/{{weapon.data.shots}} {{weapon.system.curShots}}/{{weapon.system.shots}}
{{else}}
N/A
@@ -262,9 +262,9 @@
{{module.name}}
-
{{module.data.quantity}}
-
{{module.data.hull}}
-
{{module.data.feature}}
+
{{module.system.quantity}}
+
{{module.system.hull}}
+
{{module.system.feature}}
@@ -293,9 +293,9 @@
{{item.name}}
-
{{item.data.quantity}}
-
{{item.data.weight}}
-
{{item.data.cost}}
+
{{item.system.quantity}}
+
{{item.system.weight}}
+
{{item.system.cost}}
diff --git a/templates/chat/statroll.html b/templates/chat/statroll.html
index a1798dc..b0aa228 100644
--- a/templates/chat/statroll.html
+++ b/templates/chat/statroll.html
@@ -12,7 +12,7 @@
{{{insert}}}
-
{{{item.data.description}}}
+
{{{item.system.description}}}
{{else}}
@@ -49,10 +49,10 @@
{{stat.name}} ({{this.target}})
Mod ({{this.mod}})
{{#if useSkill}}
-
{{item.name}} ({{item.data.bonus}})
+
{{item.name}} ({{item.system.bonus}})
{{/if}}
{{#if isWeapon}}
-
{{item.name}} ({{item.data.bonus}})
+
{{item.name}} ({{bonus}})
{{/if}}
@@ -63,20 +63,20 @@
{{data.diceTotal.damageValue}}
-
({{item.data.damage}})
+
({{item.system.damage}})
- {{#if item.data.ranges.medium}}
-
Range: {{item.data.ranges.short}}/{{item.data.ranges.medium}}/{{item.data.ranges.long}}
+ {{#if item.system.ranges.medium}}
+
Range: {{item.system.ranges.short}}/{{item.system.ranges.medium}}/{{item.system.ranges.long}}
{{else}}
Range: CQC
{{/if}}
- {{#if item.data.shots}}
-
Shots: {{item.data.curShots}}/{{item.data.shots}}
+ {{#if item.system.shots}}
+
Shots: {{item.system.curShots}}/{{item.system.shots}}
{{else}}
- {{#if item.data.useAmmo}}
-
Ammo: {{item.data.ammo}}
+ {{#if item.system.useAmmo}}
+
Ammo: {{item.system.ammo}}
{{/if}}
{{/if}}
@@ -84,16 +84,16 @@
-
Crit Damage: [[/r {{item.data.critDmg}}]]
-
Crit Effect: {{item.data.critEffect}}
+
Crit Damage: [[/r {{item.system.critDmg}}]]
+
Crit Effect: {{item.system.critEffect}}
{{/if}}
- {{#if item.data.description}}
+ {{#if item.system.description}}
-
{{{item.data.description}}}
+
{{{item.system.description}}}
{{/if}}
{{/if}}
@@ -101,7 +101,7 @@
{{#if useSkill}}
-
{{{item.data.description}}}
+
{{{item.system.description}}}
{{/if}}
{{#if data.panic}}
diff --git a/templates/dialogs/creature-settings-dialog.html b/templates/dialogs/creature-settings-dialog.html
index 5d3a784..fc63b7e 100644
--- a/templates/dialogs/creature-settings-dialog.html
+++ b/templates/dialogs/creature-settings-dialog.html
@@ -4,27 +4,27 @@
diff --git a/templates/item/item-ability-sheet.html b/templates/item/item-ability-sheet.html
index 2cb9528..6128b86 100644
--- a/templates/item/item-ability-sheet.html
+++ b/templates/item/item-ability-sheet.html
@@ -6,7 +6,7 @@
@@ -22,7 +22,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
diff --git a/templates/item/item-armor-sheet.html b/templates/item/item-armor-sheet.html
index 25dd90a..e961781 100644
--- a/templates/item/item-armor-sheet.html
+++ b/templates/item/item-armor-sheet.html
@@ -6,15 +6,15 @@
@@ -31,7 +31,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
{{!-- Item Tab --}}
@@ -39,11 +39,11 @@
diff --git a/templates/item/item-condition-sheet.html b/templates/item/item-condition-sheet.html
index 58c47e6..597633c 100644
--- a/templates/item/item-condition-sheet.html
+++ b/templates/item/item-condition-sheet.html
@@ -5,7 +5,7 @@
Description
-
+
@@ -20,7 +20,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor content=system.description target="system.description" button=true owner=owner editable=true}}
-->
diff --git a/templates/item/item-item-sheet.html b/templates/item/item-item-sheet.html
index ad7259e..963ef19 100644
--- a/templates/item/item-item-sheet.html
+++ b/templates/item/item-item-sheet.html
@@ -6,15 +6,15 @@
@@ -31,7 +31,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
{{!-- Attributes Tab --}}
diff --git a/templates/item/item-module-sheet.html b/templates/item/item-module-sheet.html
index 4183b2b..5a6372a 100644
--- a/templates/item/item-module-sheet.html
+++ b/templates/item/item-module-sheet.html
@@ -6,15 +6,15 @@
@@ -30,7 +30,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
\ No newline at end of file
diff --git a/templates/item/item-skill-sheet.html b/templates/item/item-skill-sheet.html
index e0b68dd..9239c5a 100644
--- a/templates/item/item-skill-sheet.html
+++ b/templates/item/item-skill-sheet.html
@@ -6,11 +6,11 @@
@@ -26,7 +26,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
diff --git a/templates/item/item-weapon-sheet.html b/templates/item/item-weapon-sheet.html
index 685c477..7d8c8c8 100644
--- a/templates/item/item-weapon-sheet.html
+++ b/templates/item/item-weapon-sheet.html
@@ -6,47 +6,47 @@
@@ -65,7 +65,7 @@
{{!-- Description Tab --}}
- {{editor content=data.description target="data.description" button=true owner=owner editable=true}}
+ {{editor target="system.description" button=true owner=owner editable=true}}
{{!-- Ranges Tab --}}
@@ -73,15 +73,15 @@
@@ -91,11 +91,11 @@