adding people stuff to creatures
This commit is contained in:
@@ -516,7 +516,6 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
// 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.createEmbeddedDocuments("Item", [itemData]);
|
||||
}
|
||||
|
||||
+434
-108
@@ -11,8 +11,8 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
var options = {
|
||||
classes: ["mosh", "sheet", "actor", "creature"],
|
||||
template: "systems/mosh/templates/actor/creature-sheet.html",
|
||||
width: 700,
|
||||
height: 650,
|
||||
width: 820,
|
||||
height: 770,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "character" }]
|
||||
};
|
||||
|
||||
@@ -68,6 +68,8 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
// attr.isCheckbox = attr.dtype === "Boolean";
|
||||
// }
|
||||
|
||||
const superData = data.data.system;
|
||||
|
||||
// Prepare items.
|
||||
if (this.actor.type == 'creature') {
|
||||
this._prepareCreatureItems(data);
|
||||
@@ -84,6 +86,38 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.description, {async: true});
|
||||
data.data.enriched.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.biography, {async: true});
|
||||
|
||||
//SKILL XP BUTTONS
|
||||
superData.xp.html = '';
|
||||
if (superData.xp.html == '') {
|
||||
for (let i = 1; i <= 15; i++) {
|
||||
if (i > superData.xp.value) {
|
||||
if (i % 5) {
|
||||
superData.xp.html += '<div class="circle"></div>';
|
||||
}
|
||||
else { //If a special one
|
||||
let trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -54px;">Trained</div>';
|
||||
if (i == 10) trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -50px;">Expert</div>';
|
||||
else if (i == 15) trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -52px;">Master</div>';
|
||||
superData.xp.html += '<div class="circle" style="background:rgb(200,200,200);">' + trainLevel + '</div>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i % 5) {
|
||||
superData.xp.html += '<div class="circle-f"></div>';
|
||||
}
|
||||
else { //If a special one
|
||||
let trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -54px; color:black;">Trained</div>';
|
||||
if (i == 10) trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -50px; color:black;">Expert</div>';
|
||||
else if (i == 15) trainLevel = '<div class="skill_training_text" style="position: relative; top: 17px; text-align: center; left: -52px; color:black;">Master</div>';
|
||||
superData.xp.html += '<div class="circle-f" style="background:black;">' + trainLevel + '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//END SKILL XP
|
||||
|
||||
return data.data;
|
||||
}
|
||||
|
||||
@@ -105,32 +139,69 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
*/
|
||||
_prepareCreatureItems(sheetData) {
|
||||
const actorData = sheetData.data;
|
||||
|
||||
//console.log(sheetData);
|
||||
///console.log("sheetdata Above");
|
||||
// Initialize containers.
|
||||
const abilities = [];
|
||||
const gear = [];
|
||||
const skills = [];
|
||||
const weapons = [];
|
||||
const armors = [];
|
||||
const conditions = [];
|
||||
|
||||
let curWeight = 0;
|
||||
// Iterate through items, allocating to containers
|
||||
// let totalWeight = 0;
|
||||
for (let i of sheetData.items) {
|
||||
let item = i.system;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
let item = i.system;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
|
||||
if (i.type === 'ability') {
|
||||
abilities.push(i);
|
||||
} else if (i.type === 'weapon') {
|
||||
if (item.ranges.value == "" && item.ranges.medium > 0) {
|
||||
item.ranges.value = item.ranges.short + "/" + item.ranges.medium + "/" + item.ranges.long;
|
||||
item.ranges.medium = 0;
|
||||
}
|
||||
|
||||
weapons.push(i);
|
||||
if (i.type === 'item') {
|
||||
gear.push(i);
|
||||
curWeight += item.weight * item.quantity;
|
||||
} else if (i.type === 'skill') {
|
||||
skills.push(i);
|
||||
} else if (i.type === 'armor') {
|
||||
armors.push(i);
|
||||
curWeight += item.weight;
|
||||
} else if (i.type === 'weapon') {
|
||||
//We need to update this from the old system.
|
||||
if (item.ranges.value == "" && item.ranges.medium > 0) {
|
||||
item.ranges.value = item.ranges.short + "/" + item.ranges.medium + "/" + item.ranges.long;
|
||||
item.ranges.medium = 0;
|
||||
}
|
||||
|
||||
weapons.push(i);
|
||||
curWeight += item.weight;
|
||||
} else if (i.type === 'condition') {
|
||||
// We'll handle the pip html here.
|
||||
if (item.treatment == null) {
|
||||
item.treatment = {
|
||||
"value": 0,
|
||||
"html": ""
|
||||
};
|
||||
}
|
||||
let pipHtml = "";
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (i < item.treatment.value) {
|
||||
pipHtml += '<i class="fas fa-circle"></i>';
|
||||
}
|
||||
else {
|
||||
pipHtml += '<i class="far fa-circle"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
item.treatment.html = pipHtml;
|
||||
|
||||
conditions.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Assign and return
|
||||
actorData.abilities = abilities;
|
||||
actorData.gear = gear;
|
||||
actorData.skills = skills;
|
||||
actorData.armors = armors;
|
||||
actorData.weapons = weapons;
|
||||
actorData.conditions = conditions;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@@ -140,25 +211,126 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteEmbeddedDocuments("Item", [li.data("itemId")]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
html.on('mousedown', '.char-pip-button', ev => {
|
||||
|
||||
const div = $(ev.currentTarget);
|
||||
const targetName = div.data("key");
|
||||
|
||||
let amount = this.actor.system.xp.value;
|
||||
let newAmount = amount;
|
||||
let max = div.data("max");
|
||||
let min = div.data("min");
|
||||
|
||||
if (event.button == 0) {
|
||||
if (amount < max) {
|
||||
newAmount = Number(amount) + 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (amount > min) {
|
||||
newAmount = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.update({'system.xp.value': newAmount});
|
||||
|
||||
});
|
||||
|
||||
html.on('mousedown', '.treatment-button', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
|
||||
let amount = item.system.treatment.value;
|
||||
|
||||
if (event.button == 0) {
|
||||
if (amount < 3) {
|
||||
item.system.treatment.value = Number(amount) + 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.treatment.value = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
item.system.equipped = !item.system.equipped;
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Add Inventory Item
|
||||
html.find('.item-create').click(this._onItemCreate.bind(this));
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render({force: true});
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Attribute
|
||||
html.find('.stat-roll').click(ev => {
|
||||
const div = $(ev.currentTarget);
|
||||
const statName = div.data("key");
|
||||
this.actor.rollCheck(null, 'low', statName, null, null, null);
|
||||
//Quantity adjuster
|
||||
html.on('mousedown', '.item-quantity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
let amount = item.system.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
item.system.quantity = Number(amount) + 1;
|
||||
} else if (event.button == 2) {
|
||||
item.system.quantity = Number(amount) - 1;
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Severity adjuster
|
||||
html.on('mousedown', '.severity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
|
||||
let amount = item.system.severity;
|
||||
|
||||
if (event.button == 0) {
|
||||
item.system.severity = Number(amount) + 1;
|
||||
} else if (event.button == 2 && amount > 0) {
|
||||
item.system.severity = Number(amount) - 1;
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteEmbeddedDocuments("Item", [li.data("itemId")]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
//SKILLS
|
||||
// Add Inventory Item
|
||||
html.find('.skill-create').click(this._onSkillCreate.bind(this));
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.skill-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const skill = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
skill.sheet.render({force: true});
|
||||
});
|
||||
|
||||
//Weapons
|
||||
@@ -167,102 +339,167 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render({force: true});
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Attribute
|
||||
html.find('.stat-roll').click(ev => {
|
||||
const div = $(ev.currentTarget);
|
||||
const statName = div.data("key");
|
||||
this.actor.rollCheck(null, 'low', statName, null, null, null);
|
||||
});
|
||||
|
||||
// Rollable Skill
|
||||
html.find('.skill-roll').click(ev => {
|
||||
const li = event.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
this.actor.rollCheck(null, null, null, item.name, item.system.bonus, null);
|
||||
});
|
||||
|
||||
// Rollable Weapon
|
||||
html.find('.weapon-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let swarm_damage_roll_string =null;
|
||||
if (this.actor.system.swarm && this.actor.system.swarm.enabled){
|
||||
//replace the roll damage for swarm actors
|
||||
let new_dice_ammount = item.system.damage.match(/([0-9]+)d[0-9]+/i)[1]*this.getWoundsLeft(html);
|
||||
swarm_damage_roll_string = item.system.damage.replace(/([0-9]+)(d[0-9]+)/i,`${new_dice_ammount}$2`);
|
||||
}
|
||||
this.actor.rollCheck(null, 'low', 'combat', null, null, item,swarm_damage_roll_string);
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
this.actor.rollCheck(null, 'low', 'combat', null, null, item);
|
||||
});
|
||||
|
||||
// Rollable Damage
|
||||
html.find('.dmg-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let swarm_damage_roll_string =null;
|
||||
if (this.actor.system.swarm && this.actor.system.swarm.enabled){
|
||||
//replace the roll damage for swarm actors
|
||||
let new_dice_ammount = item.system.damage.match(/([0-9]+)d[0-9]+/i)[1]*this.getWoundsLeft(html);
|
||||
swarm_damage_roll_string = item.system.damage.replace(/([0-9]+)(d[0-9]+)/i,`${new_dice_ammount}$2`);
|
||||
}
|
||||
this.actor.rollCheck(null, null, 'damage', null, null, item,swarm_damage_roll_string);
|
||||
});
|
||||
|
||||
//increase ammo
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
//dupe item to work on
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.ammo;
|
||||
//increase ammo
|
||||
if (event.button == 0) {
|
||||
if (amount >= 0) {
|
||||
item.system.ammo = Number(amount) + 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.ammo = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
//update ammo count
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//increase shots
|
||||
html.on('mousedown', '.weapon-shots', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
if (event.button == 0) {
|
||||
if (item.system.curShots >= 0 && item.system.curShots < item.system.shots && item.system.ammo > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) + 1;
|
||||
item.system.ammo = Number(item.system.ammo) - 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (item.system.curShots > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) - 1;
|
||||
item.system.ammo = Number(item.system.ammo) + 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
this.actor.reloadWeapon(li.dataset.itemId);
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
this.actor.rollCheck(null, null, 'damage', null, null, item);
|
||||
});
|
||||
|
||||
// Rollable Item/Anything with a description that we want to click on.
|
||||
html.find('.description-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
this.actor.printDescription(li.dataset.itemId, {
|
||||
event: ev
|
||||
});
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
this.actor.printDescription(li.dataset.itemId, {
|
||||
event: ev
|
||||
});
|
||||
});
|
||||
|
||||
//increase ammo
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.ammo;
|
||||
if (event.button == 0) {
|
||||
if (amount >= 0) {
|
||||
item.system.ammo = Number(amount) + 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.ammo = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//increase shots
|
||||
html.on('mousedown', '.weapon-shots', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
if (event.button == 0) {
|
||||
if (item.system.curShots >= 0 && item.system.curShots < item.system.shots && item.system.ammo > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) + 1;
|
||||
item.system.ammo = Number(item.system.ammo) - 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (item.system.curShots > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) - 1;
|
||||
item.system.ammo = Number(item.system.ammo) + 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
this.actor.reloadWeapon(li.dataset.itemId);
|
||||
});
|
||||
|
||||
//increase AP
|
||||
html.on('mousedown', '.armor-ap', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.armorPoints;
|
||||
if (event.button == 0) {
|
||||
item.system.armorPoints = Number(amount) + 1;
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.armorPoints = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//increase DR
|
||||
html.on('mousedown', '.armor-dr', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.damageReduction;
|
||||
if (event.button == 0) {
|
||||
item.system.damageReduction = Number(amount) + 1;
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.damageReduction = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//increase oxygen
|
||||
html.on('mousedown', '.armor-oxy', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.oxygenCurrent;
|
||||
if (event.button == 0) {
|
||||
if (amount < item.system.oxygenMax) {
|
||||
item.system.oxygenCurrent = Number(amount) + 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (amount > 0) {
|
||||
item.system.oxygenCurrent = Number(amount) - 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Clicking on Armor
|
||||
html.find('.armor-roll').click(ev => {
|
||||
//roll panic check
|
||||
this.actor.chooseCover();
|
||||
});
|
||||
|
||||
// Drag events for macros.
|
||||
if (this.actor.isOwner) {
|
||||
let handler = ev => this._onDragStart(ev);
|
||||
let handler = ev => this._onDragStart(ev);
|
||||
|
||||
html.find('li.dropitem').each((i, li) => {
|
||||
if (li.classList.contains("inventory-header")) return;
|
||||
li.setAttribute("draggable", true);
|
||||
li.addEventListener("dragstart", handler, false);
|
||||
});
|
||||
html.find('li.dropitem').each((i, li) => {
|
||||
if (li.classList.contains("inventory-header")) return;
|
||||
li.setAttribute("draggable", true);
|
||||
li.addEventListener("dragstart", handler, false);
|
||||
});
|
||||
}
|
||||
|
||||
// update swarm combat
|
||||
@@ -317,6 +554,84 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
return this.actor.createEmbeddedDocuments("Item", [itemData]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle creating a new Owned skill for the actor using initial data defined in the HTML dataset
|
||||
* @param {Event} event The originating click event
|
||||
* @private
|
||||
*/
|
||||
_onSkillCreate(event) {
|
||||
event.preventDefault();
|
||||
const header = event.currentTarget;
|
||||
// Get the type of item to create.
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
//const data = duplicate(header.dataset);
|
||||
// Initialize a default name.
|
||||
const name = `New Skill`;
|
||||
// Prepare the item object.
|
||||
const itemData = {
|
||||
name: name,
|
||||
type: type,
|
||||
system: data
|
||||
};
|
||||
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: `New Skill`},
|
||||
classes: ["macro-popup-dialog"],
|
||||
content: `
|
||||
<div class="macro_window">
|
||||
<div class="macro_desc" style="padding-left: 8px; padding-bottom: 0px;">
|
||||
<h4> Name </h4>
|
||||
</div>
|
||||
<input type="text" id="name" name="name" value="New Skill">
|
||||
</div>
|
||||
<div class="macro_window">
|
||||
<div class="macro_desc" style="padding-left: 8px; padding-bottom: 0px;">
|
||||
<h4> Rank </h4>
|
||||
</div>
|
||||
<select name="rank" id="rank">
|
||||
<option value="Trained">Trained</option>
|
||||
<option value="Expert">Expert</option>
|
||||
<option value="Master">Master</option>
|
||||
</select>
|
||||
</div>
|
||||
`,
|
||||
buttons: [
|
||||
{
|
||||
icon: 'fas fa-check',
|
||||
action: "create",
|
||||
label: "Create",
|
||||
callback: (event, button, dialog) => {
|
||||
var rank = button.form.querySelector('[id=\"rank\"]')?.value;
|
||||
if (rank == "Trained")
|
||||
itemData.system.bonus = 10;
|
||||
if (rank == "Expert")
|
||||
itemData.system.bonus = 15;
|
||||
if (rank == "Master")
|
||||
itemData.system.bonus = 20;
|
||||
|
||||
itemData.system.rank = rank;
|
||||
itemData.name = button.form.querySelector('[id=\"name\"]')?.value
|
||||
this.actor.createEmbeddedDocuments("Item", [itemData]);
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-times',
|
||||
action: "cancel",
|
||||
label: "Cancel",
|
||||
callback: () => { }
|
||||
}
|
||||
],
|
||||
default: "roll",
|
||||
close: () => { }
|
||||
});
|
||||
d.render({force: true});
|
||||
|
||||
// Finally, create the item!
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle clickable rolls.
|
||||
@@ -340,4 +655,15 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
async _updateObject(event, formData) {
|
||||
const actor = this.object;
|
||||
|
||||
var updateData;
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
|
||||
await actor.update(updateData, {
|
||||
diff: false
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-1
@@ -158,6 +158,7 @@
|
||||
"base"
|
||||
],
|
||||
"biography": "",
|
||||
"notes": "",
|
||||
"description": "This is a description",
|
||||
"xp": {
|
||||
"value": 1,
|
||||
@@ -197,9 +198,12 @@
|
||||
"enabled" : false
|
||||
},
|
||||
"armor": {
|
||||
"value": 10,
|
||||
"value": 0,
|
||||
"mod": 0,
|
||||
"min": 0,
|
||||
"max": 99,
|
||||
"damageReduction": 0,
|
||||
"cover": "none",
|
||||
"label": "Armor",
|
||||
"rollLabel": "Armor Save",
|
||||
"enabled" : false
|
||||
|
||||
@@ -353,7 +353,6 @@
|
||||
<a class="tab-select" data-tab="items">{{ localize 'Mosh.Items' }}</a>
|
||||
<a class="tab-select" data-tab="description">{{ localize 'Mosh.Bio' }}</a>
|
||||
<a class="tab-select" data-tab="notes">{{ localize 'Mosh.Notes' }}</a>
|
||||
|
||||
</nav>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</header>
|
||||
<div class="creature-description-grid">
|
||||
<div class="creaturedescription">
|
||||
<div class="grid">
|
||||
<div class="grid grid-3col">
|
||||
<!-- Health -->
|
||||
<div class="resource healthspread minmaxtopstat">
|
||||
<label for="system.health.value" class="resource-label minmaxtext">{{ localize 'Mosh.Health' }}</label>
|
||||
@@ -134,7 +134,35 @@
|
||||
<div class="healthmaxtext">{{ localize 'Mosh.Current' }}</div>
|
||||
<div class="healthmaxtext">{{ localize 'Mosh.Maximum' }}</div>
|
||||
</div>
|
||||
<!-- Armor -->
|
||||
<div class="resource healthspread minmaxtopstat">
|
||||
<label for="system.stats.armor.value" class="resource-label minmaxtext rollable armor-roll">{{ localize 'Mosh.Armor' }}</label>
|
||||
<div class="minmaxwrapper" style="width: 100%; background: black; border-radius: 0.3em;">
|
||||
<div class="maxhealth-input" style="display: flex;">
|
||||
<div class="whiteText" type="text" data-dtype="Number">{{system.stats.armor.mod}}</div>
|
||||
{{#if (compare 'str' system.stats.armor.cover '===' 'insignificant')}}
|
||||
<div class="highlightText" type="text" data-dtype="Number" style="font-size: 0.8rem;"> 5</div>
|
||||
{{/if}}
|
||||
{{#if (compare 'str' system.stats.armor.cover '===' 'light')}}
|
||||
<div class="highlightText" type="text" data-dtype="Number" style="font-size: 0.8rem;"> 10</div>
|
||||
{{/if}}
|
||||
{{#if (compare 'str' system.stats.armor.cover '===' 'heavy')}}
|
||||
<div class="highlightText" type="text" data-dtype="Number" style="font-size: 0.8rem;"> 20</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="slant" style="border-right: 2px solid #ffffff; transform: skewX(0deg);"></div>
|
||||
<div class="maxhealth-input" style="display: flex;">
|
||||
<div class="whiteText" type="text" data-dtype="Number">{{system.stats.armor.damageReduction}}</div>
|
||||
{{#if (compare 'str' system.stats.armor.cover '===' 'heavy')}}
|
||||
<div class="highlightText" type="text" data-dtype="Number" style="font-size: 0.8rem;"> 5</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="healthmaxtext">{{ localize 'Mosh.ArmorPoints' }}</div>
|
||||
<div class="healthmaxtext">{{ localize 'Mosh.DMGReduction' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<br></br>
|
||||
{{editor enriched.description target="system.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
<div class="creature-abilities">
|
||||
@@ -159,8 +187,11 @@
|
||||
|
||||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="mosh sheet-tabs tabs" data-group="primary">
|
||||
<a class="tab-select" data-tab="skills">{{ localize 'Mosh.Skills' }}</a>
|
||||
<a class="tab-select" data-tab="weapons">{{ localize 'Mosh.Weapons' }}</a>
|
||||
<a class="tab-select" data-tab="items">{{ localize 'Mosh.Items' }}</a>
|
||||
<a class="tab-select" data-tab="description">{{ localize 'Mosh.Bio' }}</a>
|
||||
<a class="tab-select" data-tab="notes">{{ localize 'Mosh.Notes' }}</a>
|
||||
</nav>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
@@ -168,32 +199,248 @@
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab biography" data-group="primary" data-tab="description">
|
||||
{{editor system.biography target="system.biography" button=true owner=owner editable=true}}
|
||||
{{editor enriched.biography target="system.biography" button=true editable=true}}
|
||||
</div>
|
||||
{{!-- Notes Tab --}}
|
||||
<div class="tab biography" data-group="primary" data-tab="notes">
|
||||
{{editor enriched.notes target="system.notes" button=true editable=true}}
|
||||
</div>
|
||||
{{!-- Owned Items Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
|
||||
{{#if system.settings.firstEdition}}
|
||||
<!-- ARMOR -->
|
||||
<ol class="items-list" role="table">
|
||||
<li class="item flexrow item-header" role="rowgroup">
|
||||
<div class="item-image" role="cell"></div>
|
||||
<div class="skill-stat" style="flex-grow: 2.5;" role="cell">{{ localize 'Mosh.ArmorName' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.AP' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.DR' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Speed' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Oxygen' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Equipped' }}</div>
|
||||
<div class="item-controls" role="cell">
|
||||
<a class="item-control item-create" title="{{ localize 'Mosh.CreateArmor' }}" data-type="armor"><i class="fas fa-plus"></i> {{ localize 'Mosh.Add' }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each armors as |armor id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{armor._id}}" role="rowgroup">
|
||||
<div class="item-image" role="cell"><img src="{{armor.img}}" title="{{armor.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 2.55;" role="cell">{{armor.name}}</h4>
|
||||
<div class="skill-stat armor-ap list-roll" role="cell">{{armor.system.armorPoints}}</div>
|
||||
<div class="skill-stat armor-dr list-roll" role="cell">{{armor.system.damageReduction}}</div>
|
||||
<div class="skill-stat">{{armor.system.speed}}</div>
|
||||
{{#if armor.system.oxygenMax}}
|
||||
<div class="skill-stat armor-oxy list-roll" role="cell">{{armor.system.oxygenCurrent}}/{{armor.system.oxygenMax}}</div>
|
||||
{{else}}
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.NA' }}</div>
|
||||
{{/if}}
|
||||
<div class="skill-stat item-equip" role="cell"><input type="checkbox" name="armor.system.equipped" data-dtype="Boolean"
|
||||
{{checked armor.system.equipped}} /></div>
|
||||
<div class="item-controls" role="cell">
|
||||
<a class="item-control item-edit" title="{{ localize 'Mosh.EditArmor' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteArmor' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
{{else}}
|
||||
<!-- ARMOR -->
|
||||
<ol class="items-list" role="table">
|
||||
<li class="item flexrow item-header" role="rowgroup">
|
||||
<div class="item-image" role="cell"></div>
|
||||
<div class="skill-stat" style="flex-grow: 2.5;" role="cell">{{ localize 'Mosh.ArmorName' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.SaveBonus' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Speed' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Oxygen' }}</div>
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.Equipped' }}</div>
|
||||
<div class="item-controls" role="cell">
|
||||
<a class="item-control item-create" title="{{ localize 'Mosh.CreateArmor' }}" data-type="armor"><i class="fas fa-plus"></i> {{ localize 'Mosh.Add' }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each armors as |armor id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{armor._id}}" role="rowgroup">
|
||||
<div class="item-image" role="cell"><img src="{{armor.img}}" title="{{armor.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 2.55;" role="cell">{{armor.name}}</h4>
|
||||
<div class="skill-stat armor-ap list-roll" role="cell">{{armor.system.armorPoints}}</div>
|
||||
<div class="skill-stat">{{armor.system.speed}}</div>
|
||||
{{#if armor.system.oxygenMax}}
|
||||
<div class="skill-stat armor-oxy list-roll" role="cell">{{armor.system.oxygenCurrent}}/{{armor.system.oxygenMax}}</div>
|
||||
{{else}}
|
||||
<div class="skill-stat" role="cell">{{ localize 'Mosh.NA' }}</div>
|
||||
{{/if}}
|
||||
<div class="skill-stat item-equip" role="cell"><input type="checkbox" name="armor.system.equipped" data-dtype="Boolean"
|
||||
{{checked armor.system.equipped}} /></div>
|
||||
<div class="item-controls" role="cell">
|
||||
<a class="item-control item-edit" title="{{ localize 'Mosh.EditArmor' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteArmor' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
{{/if}}
|
||||
|
||||
<!-- ITEMS -->
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
<div class="skill-stat" style="flex-grow: 1.5;">{{ localize 'Mosh.ItemName' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Quantity' }}</div>
|
||||
{{#if system.settings.hideWeight}}
|
||||
{{else}}
|
||||
<div class="skill-stat">{{ localize 'Mosh.Weight' }}</div>
|
||||
{{/if}}
|
||||
<div class="skill-stat">{{ localize 'Mosh.Value' }}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-create" title="{{ localize 'Mosh.CreateItem' }}" data-type="item"><i class="fas fa-plus"></i> Add</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#if system.settings.hideWeight}}
|
||||
{{#each gear as |item id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 1.5;">{{item.name}}</h4>
|
||||
<div class="skill-stat list-roll item-quantity">{{item.system.quantity}}</div>
|
||||
<div class="skill-stat">{{item.system.cost}}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="{{ localize 'Mosh.EditItem' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteItem'}}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each gear as |item id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 1.54;">{{item.name}}</h4>
|
||||
<div class="skill-stat list-roll item-quantity">{{item.system.quantity}}</div>
|
||||
<div class="skill-stat">{{item.system.weight}}</div>
|
||||
<div class="skill-stat">{{item.system.cost}}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="{{ localize 'Mosh.EditItem' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteItem' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</ol>
|
||||
{{#unless system.settings.hideWeight}}
|
||||
<div class="item flex-group-left item-header">
|
||||
<div class="skill-stat" style="flex-grow: 1.5;">{{ localize 'Mosh.CarryingCapacity' }}: {{system.weight.capacity}}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.CurrentWeight' }}: {{system.weight.current}}</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
</div>
|
||||
{{!-- Owned Skills Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="skills">
|
||||
<!-- SKILLS -->
|
||||
<ol class="items-list" style="margin-bottom : 10px;">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.SkillName' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.SkillRank' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.SkillBonus' }}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control skill-create" title="{{ localize 'Mosh.CreateSkill' }}" data-type="skill"><i class="fas fa-plus"></i> {{ localize 'Mosh.Add' }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each skills as |skill id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{skill._id}}">
|
||||
<div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div>
|
||||
<div class="skill-name skill-roll list-roll">{{skill.name}}</div>
|
||||
<div class="skill-stat">{{skill.system.rank}}</div>
|
||||
<div class="skill-stat">{{skill.system.bonus}}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control skill-edit" title="{{ localize 'Mosh.EditSkill' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteSkill' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
|
||||
{{#if system.settings.firstEdition}}
|
||||
|
||||
<!-- XP -->
|
||||
<div class ="skill_training_frame" style="margin-bottom : 10px;">
|
||||
<div class="grid grid-3col" style="grid-template-columns: 90px auto 283px ;">
|
||||
<div class="skill-stat" style="position: relative; top: 6px;"><strong>{{ localize 'Mosh.SkillTraining' }}</strong></div>
|
||||
<textarea name="system.xp.selectedSkill" rows="2" class="textarea-input-grey" type="text" data-target="system.xp.selectedSkill" placeholder="" style="height: 30px; margin: 0; position: relative; top: 50%; -ms-transform: translateY(-50%); transform: translateY(-50%); background: white; color: black;">{{system.xp.selectedSkill}}</textarea>
|
||||
<div class="char-pip-button list-roll flex" style="position: relative; top: -7px;" data-key="xp" data-label="XP" data-max="16" data-min="0">{{{system.xp.html}}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/if}}
|
||||
|
||||
<div class="seperatorLine"></div>
|
||||
|
||||
|
||||
|
||||
<!-- Conditions -->
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Condition' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Severity' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Treatment' }}</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-create" title="{{ localize 'Mosh.CreateCondition' }}" data-type="condition"><i class="fas fa-plus"></i> {{ localize 'Mosh.Add' }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each conditions as |condition id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{condition._id}}">
|
||||
<div class="item-image"><img src="{{condition.img}}" title="{{condition.name}}" width="24" height="24"/></div>
|
||||
<div class="skill-name description-roll list-roll">{{condition.name}}</div>
|
||||
<div class="skill-stat list-roll severity">{{condition.system.severity}}</div>
|
||||
<div class="skill-stat">
|
||||
{{#if condition.system.treatment.html}}
|
||||
<div class="treatment-button list-roll flex" style="margin: 0; position: relative; top: 50%; -ms-transform: translateY(-50%); transform: translateY(-50%);" data-key="condition" data-label="condition" data-max="3" data-min="0">
|
||||
{{{condition.system.treatment.html}}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="treatment-button list-roll flex" style="margin: 0; position: relative; top: 50%; -ms-transform: translateY(-50%); transform: translateY(-50%);" data-key="condition" data-label="condition" data-max="3" data-min="0">
|
||||
{{condition.name}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control skill-edit" title="{{ localize 'Mosh.EditCondition' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteCondition' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{{/each}}
|
||||
</ol>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{{!-- Owned Weapons Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="weapons">
|
||||
<!-- WEAPONS -->
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
|
||||
<div class="skill-stat" style="flex-grow: 2;">{{ localize 'Mosh.Name' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Damage' }}{{#if system.swarm.enabled}} {{ localize 'Mosh.SwarmWoundShort' }}{{/if}}</div>
|
||||
<div class="skill-stat" style="flex-grow: 2;">{{ localize 'Mosh.WeaponName' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Damage' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Ammo' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Shots' }}</div>
|
||||
<div class="skill-stat">{{ localize 'Mosh.Range' }}</div>
|
||||
|
||||
<div class="item-controls">
|
||||
<a class="item-control weapon-create" title="{{ localize 'Mosh.CreateWeapon' }}" data-type="weapon"><i class="fas fa-plus"></i>
|
||||
{{ localize 'Mosh.Add' }}</a>
|
||||
<a class="item-control weapon-create" title="{{ localize 'Mosh.CreateWeapon' }}" data-type="weapon"><i class="fas fa-plus"></i> {{ localize 'Mosh.Add' }}</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{{#each weapons as |weapon id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{weapon._id}}">
|
||||
<li class="item flexrow dropitem" data-item-id="{{weapon._id}}">
|
||||
<!-- <div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div> -->
|
||||
<div class="item-image"><img src="{{weapon.img}}" title="{{weapon.name}}" width="24" height="24" /></div>
|
||||
<div class="skill-name weapon-roll list-roll" style="flex-grow: 2;">{{weapon.name}}</div>
|
||||
<div class="skill-name weapon-roll list-roll" style="flex-grow: 2.05;">{{weapon.name}}</div>
|
||||
{{#if weapon.system.antiArmor}}
|
||||
<div class="skill-stat dmg-roll list-roll">{{weapon.system.damage}} ({{ localize 'Mosh.AntyArmorAcronym' }})</div>
|
||||
{{else}}
|
||||
<div class="skill-stat dmg-roll list-roll">{{weapon.system.damage}}</div>
|
||||
{{/if}}
|
||||
{{#if weapon.system.useAmmo}}
|
||||
<div class="skill-stat weapon-ammo list-roll">{{weapon.system.ammo}}</div>
|
||||
{{else}}
|
||||
@@ -214,20 +461,16 @@
|
||||
<div class="skill-stat">{{ localize 'Mosh.NA' }}</div>
|
||||
{{/if}}
|
||||
{{#if weapon.system.ranges.value}}
|
||||
<!-- <div class="skill-stat">{{weapon.system.ranges.short}}/{{weapon.system.ranges.medium}}/{{weapon.system.ranges.long}} -->
|
||||
<!-- </div> -->
|
||||
<div class="skill-stat">{{weapon.system.ranges.value}}</div>
|
||||
{{else}}
|
||||
<div class="skill-stat">{{ localize 'Mosh.NA' }}</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="item-controls">
|
||||
<a class="item-control weapon-edit" title="{{ localize 'Mosh.EditWeapon' }}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="{{ localize 'Mosh.DeleteWeapon' }}"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user