final stretch to v13
This commit is contained in:
+22
-12
@@ -534,11 +534,12 @@ p {
|
||||
.mosh .roll-image {
|
||||
-webkit-box-flex: 0;
|
||||
flex: 0 24px;
|
||||
margin-top: -1px;
|
||||
margin-right: -9px;
|
||||
width: 48px;
|
||||
margin-top: -3px;
|
||||
margin-left: 11px;
|
||||
margin-right: 0px;
|
||||
width: 50px;
|
||||
border-radius: 0 0 0 16px;
|
||||
/* margin-right: 5px; */
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.mosh .items-list .item img {
|
||||
@@ -1593,9 +1594,9 @@ p {
|
||||
|
||||
.mosh .rollweaponh1 {
|
||||
height: 32px;
|
||||
margin-top: 0;
|
||||
margin-left: -9px;
|
||||
margin-right: -9px;
|
||||
margin-top: -15px;
|
||||
margin-left: -8px;
|
||||
margin-right: -11px;
|
||||
font-size: 1.0rem;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
@@ -1790,6 +1791,11 @@ p {
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
/* MPD macro image */
|
||||
.macro-popup-dialog .macro_img {
|
||||
|
||||
}
|
||||
|
||||
/* MPD macro desc */
|
||||
.macro-popup-dialog .macro_desc {
|
||||
font-family: "Roboto", sans-serif;
|
||||
@@ -1811,6 +1817,10 @@ p {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* MPD macro prompt */
|
||||
.macro-popup-dialog .macro_prompt {
|
||||
|
||||
}
|
||||
|
||||
/* MPD grid layouts */
|
||||
.macro-popup-dialog .grid-1col {
|
||||
@@ -1855,14 +1865,14 @@ p {
|
||||
.macro-popup-dialog input[type="radio"] {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
accent-color: initial;
|
||||
accent-color: initial; /* ignore theme accent */
|
||||
box-sizing: border-box;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid #777;
|
||||
border: 2px solid #777; /* medium grey ring */
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
display: inline-flex;
|
||||
background: #fff; /* white center when unchecked */
|
||||
display: inline-flex; /* center the pseudo-dot */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 0;
|
||||
@@ -1880,7 +1890,7 @@ p {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #111;
|
||||
background: #111; /* dot color */
|
||||
transform: scale(0);
|
||||
transition: transform 120ms ease-in-out;
|
||||
}
|
||||
|
||||
+19
-75
@@ -210,11 +210,8 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
|
||||
let amount = item.system.treatment.value;
|
||||
|
||||
@@ -237,11 +234,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
item.system.equipped = !item.system.equipped;
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
@@ -262,11 +255,8 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
let amount = item.system.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -282,11 +272,8 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.on('mousedown', '.severity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
|
||||
let amount = item.system.severity;
|
||||
|
||||
@@ -340,11 +327,8 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = event.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
this.actor.rollCheck(null, null, null, item.name, item.system.bonus, null);
|
||||
});
|
||||
|
||||
@@ -353,11 +337,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
this.actor.rollCheck(null, 'low', 'combat', null, null, item);
|
||||
});
|
||||
|
||||
@@ -366,11 +346,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
this.actor.rollCheck(null, null, 'damage', null, null, item);
|
||||
});
|
||||
|
||||
@@ -387,11 +363,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.ammo;
|
||||
if (event.button == 0) {
|
||||
if (amount >= 0) {
|
||||
@@ -410,11 +382,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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;
|
||||
@@ -440,11 +408,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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;
|
||||
@@ -461,11 +425,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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;
|
||||
@@ -482,11 +442,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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) {
|
||||
@@ -546,11 +502,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
if (game.release.generation >= 12) {
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
} else {
|
||||
data = duplicate(header.dataset);
|
||||
}
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
@@ -581,11 +533,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
if (game.release.generation >= 12) {
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
} else {
|
||||
data = duplicate(header.dataset);
|
||||
}
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
//const data = duplicate(header.dataset);
|
||||
// Initialize a default name.
|
||||
const name = `New Skill`;
|
||||
@@ -677,11 +625,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const actor = this.object;
|
||||
|
||||
var updateData;
|
||||
if (game.release.generation >= 12) {
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
} else {
|
||||
updateData = expandObject(formData);
|
||||
}
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
|
||||
await actor.update(updateData, {
|
||||
diff: false
|
||||
|
||||
+70
-83
@@ -544,7 +544,7 @@ export class MothershipActor extends Actor {
|
||||
let tableResultType = ``;
|
||||
let tableResultEdited = ``;
|
||||
let tableResultFooter = ``;
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
let rollTarget = null;
|
||||
let valueAddress = [];
|
||||
let specialRoll = null;
|
||||
@@ -778,9 +778,9 @@ export class MothershipActor extends Actor {
|
||||
//panic check #19 customiziation
|
||||
if (tableName === 'Panic Check' && tableResultNumber === 19) {
|
||||
if (this.system.class.value.toLowerCase() === 'android') {
|
||||
tableResultEdited = tableResult[0].text.replace(game.i18n.localize("Mosh.HEARTATTACKSHORTCIRCUITANDROIDS"), game.i18n.localize("Mosh.SHORTCIRCUIT"));
|
||||
tableResultEdited = tableResult[0].description.replace(game.i18n.localize("Mosh.HEARTATTACKSHORTCIRCUITANDROIDS"), game.i18n.localize("Mosh.SHORTCIRCUIT"));
|
||||
} else {
|
||||
tableResultEdited = tableResult[0].text.replace(game.i18n.localize("Mosh.HEARTATTACKSHORTCIRCUITANDROIDS"), game.i18n.localize("Mosh.HEARTATTACK"));
|
||||
tableResultEdited = tableResult[0].description.replace(game.i18n.localize("Mosh.HEARTATTACKSHORTCIRCUITANDROIDS"), game.i18n.localize("Mosh.HEARTATTACK"));
|
||||
}
|
||||
}
|
||||
//assign message description text
|
||||
@@ -849,7 +849,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/rollTable.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//make message
|
||||
let macroMsg = await rollResult.toMessage({
|
||||
id: chatId,
|
||||
@@ -890,10 +890,10 @@ export class MothershipActor extends Actor {
|
||||
let buttonDesc = ``;
|
||||
//create HTML for this window
|
||||
//header
|
||||
let dialogDesc = await renderTemplate('systems/mosh/templates/dialogs/skill-check-stat-selection-dialog.html');
|
||||
let dialogDesc = await foundry.applications.handlebars.renderTemplate('systems/mosh/templates/dialogs/skill-check-stat-selection-dialog.html');
|
||||
//create button header if needed
|
||||
if (!rollString) {
|
||||
buttonDesc = `<h4>` + game.i18n.localize("Mosh.SelectYourRollType") + `:</h4>`;
|
||||
buttonDesc = `<div class="macro_prompt">` + game.i18n.localize("Mosh.SelectYourRollType") + `</div>`;
|
||||
} else {
|
||||
buttonDesc = ``;
|
||||
}
|
||||
@@ -901,7 +901,7 @@ export class MothershipActor extends Actor {
|
||||
const dialogData = {
|
||||
window: {title: game.i18n.localize("Mosh.ChooseAStat")},
|
||||
classes: ["macro-popup-dialog"],
|
||||
position: {width: 600,height: 500},
|
||||
position: {width: 600},
|
||||
content: dialogDesc + buttonDesc,
|
||||
buttons: []
|
||||
};
|
||||
@@ -978,7 +978,7 @@ export class MothershipActor extends Actor {
|
||||
let buttonDesc = ``;
|
||||
//create HTML for this window
|
||||
//header
|
||||
let skillHeader = await renderTemplate('systems/mosh/templates/dialogs/choose-skill-dialog-header.html');
|
||||
let skillHeader = await foundry.applications.handlebars.renderTemplate('systems/mosh/templates/dialogs/choose-skill-dialog-header.html');
|
||||
//skill template
|
||||
let skillRow = `
|
||||
<label for="[RADIO_ID]">
|
||||
@@ -1192,7 +1192,7 @@ export class MothershipActor extends Actor {
|
||||
let woundEffect = ``;
|
||||
let msgHeader = ``;
|
||||
let msgImgPath = ``;
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID());
|
||||
let chatId = foundry.utils.randomID();
|
||||
let firstEdition = game.settings.get('mosh', 'firstEdition');
|
||||
let useCalm = game.settings.get('mosh', 'useCalm');
|
||||
//customize this roll if its a unique use-case
|
||||
@@ -1393,11 +1393,11 @@ export class MothershipActor extends Actor {
|
||||
alias: this.name
|
||||
}
|
||||
};
|
||||
let template = 'systems/mosh/templates/chat/rollCheck.html';
|
||||
renderTemplate(template, messageData).then(content => {
|
||||
chatData.content = content;
|
||||
ChatMessage.create(chatData);
|
||||
});
|
||||
//create message
|
||||
const template = 'systems/mosh/templates/chat/rollCheck.html';
|
||||
const content = await foundry.applications.handlebars.renderTemplate(template, templateData);
|
||||
chatData.content = content;
|
||||
await ChatMessage.create(chatData);
|
||||
//log what was done
|
||||
console.log(`Rolled damage on:${weapon.name}`);
|
||||
//return messageData
|
||||
@@ -1665,19 +1665,19 @@ export class MothershipActor extends Actor {
|
||||
//prep text for success
|
||||
if (parsedRollResult.success && parsedRollResult.critical) {
|
||||
//flavor text
|
||||
flavorText = tableData.getResultsForRoll(0)[0].text;
|
||||
flavorText = tableData.getResultsForRoll(0)[0].description;
|
||||
//prep text for critical success
|
||||
} else if (parsedRollResult.success && !parsedRollResult.critical) {
|
||||
//flavor text
|
||||
flavorText = tableData.getResultsForRoll(1)[0].text;
|
||||
flavorText = tableData.getResultsForRoll(1)[0].description;
|
||||
//prep text for failure
|
||||
} else if (!parsedRollResult.success && !parsedRollResult.critical) {
|
||||
//flavor text
|
||||
flavorText = tableData.getResultsForRoll(2)[0].text;
|
||||
flavorText = tableData.getResultsForRoll(2)[0].description;
|
||||
//prep text for critical failure
|
||||
} else if (!parsedRollResult.success && parsedRollResult.critical) {
|
||||
//flavor text
|
||||
flavorText = tableData.getResultsForRoll(3)[0].text;
|
||||
flavorText = tableData.getResultsForRoll(3)[0].description;
|
||||
}
|
||||
}
|
||||
//morale check
|
||||
@@ -1775,7 +1775,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/rollCheck.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//make message
|
||||
let macroMsg = await rollResult.toMessage({
|
||||
id: chatId,
|
||||
@@ -1825,7 +1825,7 @@ export class MothershipActor extends Actor {
|
||||
let msgFlavor = ``;
|
||||
let msgOutcome = ``;
|
||||
let msgChange = ``;
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
let halfDamage = false;
|
||||
let firstEdition = game.settings.get('mosh', 'firstEdition');
|
||||
let useCalm = game.settings.get('mosh', 'useCalm');
|
||||
@@ -1975,7 +1975,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/modifyActor.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//push message
|
||||
ChatMessage.create({
|
||||
id: chatId,
|
||||
@@ -2116,7 +2116,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/modifyActor.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//make message
|
||||
let macroMsg = await rollResult.toMessage({
|
||||
id: chatId,
|
||||
@@ -2156,7 +2156,7 @@ export class MothershipActor extends Actor {
|
||||
let oldValue = 0;
|
||||
let newValue = 0;
|
||||
let flavorText = ``;
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID(): randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
//get item data
|
||||
let itemData = await fromIdUuid(itemId,{type:"Item"});
|
||||
//add or increase the count of the item, depending on type, if the actor has it
|
||||
@@ -2240,7 +2240,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/modifyItem.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//make message
|
||||
ChatMessage.create({
|
||||
id: chatId,
|
||||
@@ -2264,9 +2264,11 @@ export class MothershipActor extends Actor {
|
||||
return new Promise(async (resolve) => {
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue"),
|
||||
window: {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue")
|
||||
},
|
||||
classes: ["macro-popup-dialog"],
|
||||
content: `<h4>` + game.i18n.localize("Mosh.OutOfAmmoNeedReload") + `</h4><br/>`,
|
||||
content: `<div class="macro_prompt">` + game.i18n.localize("Mosh.OutOfAmmoNeedReload") + `</div>`,
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Reload"),
|
||||
@@ -2295,9 +2297,11 @@ export class MothershipActor extends Actor {
|
||||
return new Promise(async (resolve) => {
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue"),
|
||||
window: {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue")
|
||||
},
|
||||
classes: ["macro-popup-dialog"],
|
||||
content: `<h4>` + game.i18n.localize("Mosh.OutOfAmmo") + `</h4><br/>`,
|
||||
content: `<div class="macro_prompt">` + game.i18n.localize("Mosh.OutOfAmmo") + `</div>`,
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.OK"),
|
||||
@@ -2320,15 +2324,10 @@ export class MothershipActor extends Actor {
|
||||
let messageTemplate = ``;
|
||||
let messageContent = ``;
|
||||
let msgBody = ``;
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
//dupe item to work with
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
} else {
|
||||
item = duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
}
|
||||
|
||||
item = foundry.utils.duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
//reload
|
||||
if (!item.system.useAmmo) {
|
||||
//exit function (it should not be possible to get here)
|
||||
@@ -2378,7 +2377,7 @@ export class MothershipActor extends Actor {
|
||||
//prepare template
|
||||
messageTemplate = 'systems/mosh/templates/chat/reload.html';
|
||||
//render template
|
||||
messageContent = await renderTemplate(messageTemplate, messageData);
|
||||
messageContent = await foundry.applications.handlebars.renderTemplate(messageTemplate, messageData);
|
||||
//push message
|
||||
ChatMessage.create({
|
||||
id: chatId,
|
||||
@@ -2399,7 +2398,7 @@ export class MothershipActor extends Actor {
|
||||
//make the player take bleeding damage
|
||||
async takeBleedingDamage() {
|
||||
//init vars
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
//determine bleeding amount
|
||||
let healthLost = this.items.getName("Bleeding").system.severity * -1;
|
||||
//run the function for the player's 'Selected Character'
|
||||
@@ -2446,7 +2445,7 @@ export class MothershipActor extends Actor {
|
||||
//make the player take radiation damage
|
||||
async takeRadiationDamage() {
|
||||
//init vars
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
//reduce all stats and saves by 1
|
||||
this.modifyActor('system.stats.strength.value', -1, null, false);
|
||||
this.modifyActor('system.stats.speed.value', -1, null, false);
|
||||
@@ -2499,7 +2498,7 @@ export class MothershipActor extends Actor {
|
||||
//make the player take radiation damage
|
||||
async takeCryoDamage(rollString) {
|
||||
//init vars
|
||||
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID() : randomID())
|
||||
let chatId = foundry.utils.randomID();
|
||||
//roll the dice
|
||||
//parse the roll string
|
||||
let parsedRollString = this.parseRollString(rollString, 'low');
|
||||
@@ -2583,7 +2582,7 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
|
||||
//create pop-up HTML
|
||||
let msgContent = await renderTemplate('systems/mosh/templates/dialogs/choose-cover-dialog.html', {
|
||||
let msgContent = await foundry.applications.handlebars.renderTemplate('systems/mosh/templates/dialogs/choose-cover-dialog.html', {
|
||||
curDR:curDR,
|
||||
curAP:curAP,
|
||||
none_checked: none_checked,
|
||||
@@ -2625,7 +2624,7 @@ export class MothershipActor extends Actor {
|
||||
//wrap the whole thing in a promise, so that it waits for the form to be interacted with
|
||||
return new Promise(async (resolve) => {
|
||||
//create pop-up HTML
|
||||
let msgContent = await renderTemplate('systems/mosh/templates/dialogs/distres-signal-dialog.html');
|
||||
let msgContent = await foundry.applications.handlebars.renderTemplate('systems/mosh/templates/dialogs/distres-signal-dialog.html');
|
||||
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
@@ -2823,75 +2822,63 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
|
||||
// print description
|
||||
printDescription(itemId, options = {
|
||||
event: null
|
||||
}) {
|
||||
printDescription(itemId, options = {event: null}) {
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
} else {
|
||||
item = duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.getEmbeddedDocument('Item', itemId));
|
||||
this.chatDesc(item);
|
||||
}
|
||||
|
||||
// Print the item description into the chat.
|
||||
chatDesc(item) {
|
||||
async chatDesc(item) {
|
||||
let swapNameDesc = false;
|
||||
let swapName = '';
|
||||
let itemName = item.name?.charAt(0).toUpperCase() + item.name?.toLowerCase().slice(1);
|
||||
if (!item.name && isNaN(itemName)) {
|
||||
itemName = item.charAt(0)?.toUpperCase() + item.toLowerCase().slice(1);
|
||||
}
|
||||
var rollInsert = '';
|
||||
|
||||
let rollInsert = '';
|
||||
if (item.system.roll) {
|
||||
let r = new Roll(item.system.roll, {});
|
||||
r.evaluate({
|
||||
async: false
|
||||
});
|
||||
rollInsert = '\
|
||||
<div class="rollh2" style="text-transform: lowercase;">' + item.system.roll + '</div>\
|
||||
<div class="roll-grid">\
|
||||
<div class="roll-result">' + r._total + '</div>\
|
||||
</div>';
|
||||
const r = new Roll(item.system.roll, {});
|
||||
await r.evaluate();
|
||||
rollInsert = `
|
||||
<div class="rollh2" style="text-transform: lowercase;">${item.system.roll}</div>
|
||||
<div class="roll-grid">
|
||||
<div class="roll-result">${r.total}</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
//add flag to swap name and description, if desc contains trinket or patch
|
||||
if (item.system.description === '<p>Patch</p>' || item.system.description === '<p>Trinket</p>' || item.system.description === '<p>Maintenance Issue</p>') {
|
||||
// add flag to swap name and description, if desc contains trinket or patch
|
||||
if (["<p>Patch</p>", "<p>Trinket</p>", "<p>Maintenance Issue</p>"].includes(item.system.description)) {
|
||||
swapNameDesc = true;
|
||||
swapName = item.system.description.replaceAll('<p>', '').replaceAll('</p>', '');
|
||||
}
|
||||
|
||||
var templateData = {
|
||||
const templateData = {
|
||||
actor: this,
|
||||
stat: {
|
||||
name: itemName.toUpperCase()
|
||||
},
|
||||
item: item,
|
||||
stat: { name: itemName.toUpperCase() },
|
||||
item,
|
||||
insert: rollInsert,
|
||||
onlyDesc: true,
|
||||
swapNameDesc: swapNameDesc,
|
||||
swapName: swapName
|
||||
swapNameDesc,
|
||||
swapName
|
||||
};
|
||||
|
||||
let chatData = {
|
||||
const chatData = {
|
||||
user: game.user.id,
|
||||
speaker: {
|
||||
actor: this.id,
|
||||
token: this.token,
|
||||
alias: this.name
|
||||
}
|
||||
speaker: { actor: this.id, token: this.token, alias: this.name }
|
||||
};
|
||||
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
|
||||
const rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) {
|
||||
chatData.whisper = ChatMessage.getWhisperRecipients("GM");
|
||||
}
|
||||
|
||||
const template = 'systems/mosh/templates/chat/itemRoll.html';
|
||||
const content = await foundry.applications.handlebars.renderTemplate(template, templateData);
|
||||
chatData.content = content;
|
||||
await ChatMessage.create(chatData);
|
||||
|
||||
let template = 'systems/mosh/templates/chat/itemRoll.html';
|
||||
renderTemplate(template, templateData).then(content => {
|
||||
chatData.content = content;
|
||||
ChatMessage.create(chatData);
|
||||
});
|
||||
//log what was done
|
||||
console.log(`Created chat message with details on ${item.name}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,11 +49,8 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
async _updateObject(event, formData) {
|
||||
const actor = this.object;
|
||||
var updateData;
|
||||
if (game.release.generation >= 12) {
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
} else {
|
||||
updateData = expandObject(formData);
|
||||
}
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
|
||||
|
||||
|
||||
await actor.update(updateData, {
|
||||
@@ -179,11 +176,7 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.find('.weapon-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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
|
||||
@@ -197,11 +190,7 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.find('.dmg-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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
|
||||
@@ -216,11 +205,7 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
//dupe item to work on
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.ammo;
|
||||
//increase ammo
|
||||
if (event.button == 0) {
|
||||
@@ -240,11 +225,7 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.on('mousedown', '.weapon-shots', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
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;
|
||||
@@ -320,11 +301,7 @@ export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
if (game.release.generation >= 12) {
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
} else {
|
||||
data = duplicate(header.dataset);
|
||||
}
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
// Prepare the item object.
|
||||
|
||||
@@ -193,17 +193,16 @@ export class MothershipShipSheetSBT extends foundry.appv1.sheets.ActorSheet {
|
||||
if (index != 0 && actorData.megadamage.hits.includes(index)) {
|
||||
// megadamageHTML += `<i class="fa-solid fa-wrench megadamage-button rollable" data-key="${index}"></i>  `;
|
||||
megadamageHTML += `<i class="fas fa-circle megadamage-button rollable" data-key="${index}"></i>  `;
|
||||
megadamageHTML += `<b>${index} |</b> ${entry[1].text} <br/> <br/>`;
|
||||
megadamageHTML += `<b>${index} |</b> ${entry[1].description} <br/> <br/>`;
|
||||
} else if (index != 0) {
|
||||
// megadamageHTML += `<i class="fa-solid fa-wrench megadamage-button rollable" data-key="${index}"></i>  `;
|
||||
megadamageHTML += `<div class="grey"><i class="far fa-circle megadamage-button rollable grey" data-key="${index}"></i>  `;
|
||||
megadamageHTML += `<b>${index} |</b> ${entry[1].text} <br/> <br/></div>`;
|
||||
megadamageHTML += `<b>${index} |</b> ${entry[1].description} <br/> <br/></div>`;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
// } else {
|
||||
|
||||
// megadamageHTML += entries[0][1].text + "<br/> <br/>";
|
||||
// }
|
||||
|
||||
await this.object.update({
|
||||
@@ -284,11 +283,7 @@ export class MothershipShipSheetSBT extends foundry.appv1.sheets.ActorSheet {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
let amount = item.system.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -391,11 +386,7 @@ export class MothershipShipSheetSBT extends foundry.appv1.sheets.ActorSheet {
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
//const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.system.ammo;
|
||||
|
||||
@@ -458,11 +449,8 @@ export class MothershipShipSheetSBT extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
if (game.release.generation >= 12) {
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
} else {
|
||||
data = duplicate(header.dataset);
|
||||
}
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
|
||||
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
|
||||
@@ -127,11 +127,8 @@ export class MothershipShipSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.on('mousedown', '.item-quantity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
let amount = item.system.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -167,22 +164,16 @@ export class MothershipShipSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.find('.weapon-roll').click(ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
this.actor.rollCheck(null, 'low', 'combat', null, null, item);
|
||||
});
|
||||
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
var item;
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
} else {
|
||||
item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId));
|
||||
|
||||
let amount = item.system.ammo;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -239,11 +230,8 @@ export class MothershipShipSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
var data;
|
||||
if (game.release.generation >= 12) {
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
} else {
|
||||
data = duplicate(header.dataset);
|
||||
}
|
||||
data = foundry.utils.duplicate(header.dataset);
|
||||
|
||||
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
|
||||
@@ -15,11 +15,8 @@ export class MothershipClassSheet extends MothershipItemSheet {
|
||||
};
|
||||
options.dragDrop = [{dragSelector: null, dropSelector: ".dropitem"}];
|
||||
|
||||
if (game.release.generation >= 12) {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, options);
|
||||
} else {
|
||||
return mergeObject(super.defaultOptions, options);
|
||||
}
|
||||
return foundry.utils.mergeObject(super.defaultOptions, options);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -320,20 +317,6 @@ export class MothershipClassSheet extends MothershipItemSheet {
|
||||
// Finally, create the item!
|
||||
return;
|
||||
}
|
||||
/****
|
||||
async _updateObject(event, formData) {
|
||||
const item = this.object;
|
||||
|
||||
var updateData;
|
||||
if (game.release.generation >= 12) {
|
||||
updateData = foundry.utils.expandObject(formData);
|
||||
} else {
|
||||
updateData = expandObject(formData);
|
||||
}
|
||||
|
||||
await item.update(updateData, {
|
||||
diff: false
|
||||
});
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,8 @@ export class MothershipSkillSheet extends MothershipItemSheet {
|
||||
};
|
||||
options.dragDrop = [{dragSelector: null, dropSelector: ".dropitem"}];
|
||||
|
||||
if (game.release.generation >= 12) {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, options);
|
||||
} else {
|
||||
return mergeObject(super.defaultOptions, options);
|
||||
}
|
||||
return foundry.utils.mergeObject(super.defaultOptions, options);
|
||||
|
||||
}
|
||||
|
||||
/** @override */
|
||||
|
||||
+3
-14
@@ -310,11 +310,8 @@ async function createMothershipMacro(data, slot) {
|
||||
var actor = game.actors.get(itemUUID[1]);
|
||||
var item;
|
||||
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(actor.getEmbeddedDocument('Item',itemUUID[3]));
|
||||
} else {
|
||||
item = duplicate(actor.getEmbeddedDocument('Item',itemUUID[3]));
|
||||
}
|
||||
|
||||
console.log(item);
|
||||
|
||||
if (!item) return ui.notifications.warn("You can only create macro buttons for owned Items");
|
||||
@@ -358,11 +355,7 @@ function rollItemMacro(itemName) {
|
||||
//get item id
|
||||
itemId = game.user.character.items.getName(itemName)._id;
|
||||
//get item
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(game.user.character.getEmbeddedDocument("Item", itemId));
|
||||
} else {
|
||||
item = duplicate(game.user.character.getEmbeddedDocument("Item", itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(game.user.character.getEmbeddedDocument("Item", itemId));
|
||||
//warn if no item
|
||||
if (!item) return ui.notifications.warn(`Your controlled Actor does not have an item named ${itemName}`);
|
||||
//roll action
|
||||
@@ -385,11 +378,7 @@ function rollItemMacro(itemName) {
|
||||
//get item id
|
||||
itemId = token.actor.items.getName(itemName)._id;
|
||||
//get item
|
||||
if (game.release.generation >= 12) {
|
||||
item = foundry.utils.duplicate(token.actor.getEmbeddedDocument("Item", itemId));
|
||||
} else {
|
||||
item = duplicate(token.actor.getEmbeddedDocument("Item", itemId));
|
||||
}
|
||||
item = foundry.utils.duplicate(token.actor.getEmbeddedDocument("Item", itemId));
|
||||
//warn if no item
|
||||
if (!item) return ui.notifications.warn(`Your controlled Actor does not have an item named ${itemName}`);
|
||||
//roll action
|
||||
|
||||
@@ -113,15 +113,15 @@ export class DLActorGenerator extends FormApplication {
|
||||
for (var i = 0; i < tableResult.results.length; i++) {
|
||||
if (tableResult.results[i].type == "pack" || tableResult.results[i].type == "document") {
|
||||
if (type == "ul") {
|
||||
this._element.find(`ul[id="${id}.text"]`).append(`<li>${tableResult.results[i].text}</li>`);
|
||||
this._element.find(`ul[id="${id}.description"]`).append(`<li>${tableResult.results[i].description}</li>`);
|
||||
} else {
|
||||
resultText += tableResult.results[i].text + "; ";
|
||||
resultText += tableResult.results[i].description + "; ";
|
||||
}
|
||||
resultUuid.push(tableResult.results[i].documentId);
|
||||
} else if (tableResult.results[i].type == "text") {
|
||||
let tableTextmatch = tableResult.results[i].text.match(/(.*)(@UUID.*)/i);
|
||||
let tableTextmatch = tableResult.results[i].description.match(/(.*)(@UUID.*)/i);
|
||||
if (type == "ul") {
|
||||
this._element.find(`ul[id="${id}.text"]`).append(`<li>${await foundry.applications.ux.TextEditor.implementation.enrichHTML(tableTextmatch[2].replace(/(\<br\s\/>)+/i, ""), { async: true })}</li>`);
|
||||
this._element.find(`ul[id="${id}.description"]`).append(`<li>${await foundry.applications.ux.TextEditor.implementation.enrichHTML(tableTextmatch[2].replace(/(\<br\s\/>)+/i, ""), { async: true })}</li>`);
|
||||
}
|
||||
else {
|
||||
resultText += tableTextmatch[1].replace(/(\<br\s\/>)+/i, "");
|
||||
@@ -134,8 +134,8 @@ export class DLActorGenerator extends FormApplication {
|
||||
html.find(`img[id="` + id + `.value"]`).prop('hidden', true);
|
||||
html.find(`input[id="` + id + `.value"]`).prop('hidden', false);
|
||||
html.find(`input[id="` + id + `.value"]`).prop('value', tableRoll);
|
||||
html.find(`input[id="` + id + `.text"]`).prop('hidden', false);
|
||||
html.find(`input[id="` + id + `.text"]`).prop('value', resultText);
|
||||
html.find(`input[id="` + id + `.description"]`).prop('hidden', false);
|
||||
html.find(`input[id="` + id + `.description"]`).prop('value', resultText);
|
||||
html.find(`input[id="` + id + `.uuid"]`).prop('value', resultUuid);
|
||||
|
||||
}
|
||||
@@ -222,7 +222,6 @@ export class DLActorGenerator extends FormApplication {
|
||||
* @returns
|
||||
*/
|
||||
async updateSkillHtmlUl(html, skillsUuid) {
|
||||
//html.find(`ul[id="system.class.skils.text"]`).empty();
|
||||
let new_skills = await html.find(`input[id="system.class.skills.uuid"]`).prop("value").split(",").filter(Boolean);
|
||||
for (let i = 0; i < skillsUuid.length; i++) {
|
||||
let skill = null;
|
||||
|
||||
@@ -59,7 +59,7 @@ export class DLShipMegaDamage extends FormApplication {
|
||||
megadamageSettingsHTML += `<i class="far fa-circle megadamage-button rollable" data-key="${index}"></i>  `;
|
||||
}
|
||||
|
||||
megadamageSettingsHTML += `<b>${index} |</b> ${entry[1].text} <br/> <br/>`;
|
||||
megadamageSettingsHTML += `<b>${index} |</b> ${entry[1].description} <br/> <br/>`;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.905 4e10 Delete type=3 #1
|
||||
2025/08/28-23:53:35.362 20a8 Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.626 42e8 Delete type=3 #1
|
||||
2025/08/28-23:53:35.045 2e0c Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.655 1694 Delete type=3 #1
|
||||
2025/08/28-23:53:35.105 3368 Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.921 4e10 Delete type=3 #1
|
||||
2025/08/28-23:53:35.415 20a8 Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.672 1584 Delete type=3 #1
|
||||
2025/08/28-23:53:35.163 3018 Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.955 4e10 Delete type=3 #1
|
||||
2025/08/28-23:53:35.445 2e0c Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.772 1584 Delete type=3 #1
|
||||
2025/08/28-23:53:35.205 2e0c Delete type=3 #1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.973 42e8 Delete type=3 #1
|
||||
2025/08/28-23:53:35.465 20a8 Delete type=3 #1
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +1 @@
|
||||
2025/08/18-18:17:23.791 4e10 Delete type=3 #1
|
||||
2025/08/28-23:53:35.252 2e0c Delete type=3 #1
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
{{/if}}
|
||||
{{#if item.system.damageReduction}}
|
||||
<div class="description">
|
||||
<div class="body"><strong>{{ localize 'Mosh.DamageReduction' }}: </strong>{{item.system.damageReduction}}</div>
|
||||
<div class="body"><strong>{{ localize 'Mosh.DMGReduction' }}: </strong>{{item.system.damageReduction}}</div>
|
||||
</div>
|
||||
<div style="margin-bottom : 5px;"></div>
|
||||
<div style="border-bottom: 1px solid #999; height: 0; width: 100%;"></div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{{#each tableResult}}
|
||||
<li class="table-result flexrow" data-result-id="{{{this._id}}}">
|
||||
<img class="result-image" src="{{{this.img}}}">
|
||||
<div class="result-text"><a class="content-link broken" draggable="true" data-type="Item" data-uuid="undefined"><i class="fas fa-unlink"></i>{{{this.text}}}</a></div>
|
||||
<div class="result-text"><a class="content-link broken" draggable="true" data-type="Item" data-uuid="undefined"><i class="fas fa-unlink"></i>{{{this.description}}}</a></div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
@@ -41,7 +41,7 @@
|
||||
{{#if tableResultEdited}}
|
||||
<div class="description" style="margin-bottom : 20px;">{{{tableResultEdited}}}{{{tableResultFooter}}}</div>
|
||||
{{else}}
|
||||
<div class="description" style="margin-bottom : 20px;">{{{tableResult.[0].text}}}{{{tableResultFooter}}}</div>
|
||||
<div class="description" style="margin-bottom : 20px;">{{{tableResult.[0].description}}}{{{tableResultFooter}}}</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if (compare 'str' specialRoll '===' 'maintenanceCheck')}}
|
||||
|
||||
@@ -1,83 +1,58 @@
|
||||
<style>
|
||||
.macro_window{
|
||||
background: rgb(230,230,230);
|
||||
border-radius: 9px;
|
||||
}
|
||||
.macro_img{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
padding-right: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-column: span 2 / span 2;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
<div class ="macro_window" style="margin-bottom : 7px; padding-left: 8px;">
|
||||
<div class="macro_desc"><h3>{{ localize "Mosh.SelectAStat" }}</h3>
|
||||
{{ localize "Mosh.ChooseTheStatForSkillCheck" }}<em>{{ localize "Mosh.GivingYouAHigherNumber"}}.</em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<label for="str">
|
||||
<div class ="macro_window" style="margin-bottom : 7px; vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="str" name="stat" value="strength" checked="checked">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/strength.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Strength" }}:</strong> {{ localize "Mosh.StrengthSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="spd">
|
||||
<div class ="macro_window" style="margin-bottom : 7px; vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="spd" name="stat" value="speed">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/speed.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Speed"}}:</strong> {{ localize "Mosh.SpeedSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="int">
|
||||
<div class ="macro_window" style="margin-bottom : 7px; vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="int" name="stat" value="intellect">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/intellect.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Intellect"}}:</strong> {{ localize "Mosh.IntellectSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="com">
|
||||
<div class ="macro_window" style="margin-bottom : 7px; vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="com" name="stat" value="combat">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/combat.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Combat"}}:</strong> {{ localize "Mosh.CombatSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<div class ="macro_window" style="padding-left: 8px;">
|
||||
<div class="macro_desc"><h4>{{ localize "Mosh.SelectAStat" }}</h4>
|
||||
{{ localize "Mosh.ChooseTheStatForSkillCheck" }}<em>{{ localize "Mosh.GivingYouAHigherNumber"}}</em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<label for="str">
|
||||
<div class ="macro_window" style="vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="align-items: center; grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="str" name="stat" value="strength" checked="checked">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/strength.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Strength" }}:</strong> {{ localize "Mosh.StrengthSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="spd">
|
||||
<div class ="macro_window" style="vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="align-items: center; grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="spd" name="stat" value="speed">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/speed.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Speed"}}:</strong> {{ localize "Mosh.SpeedSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="int">
|
||||
<div class ="macro_window" style="vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="align-items: center; grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="int" name="stat" value="intellect">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/intellect.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Intellect"}}:</strong> {{ localize "Mosh.IntellectSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<label for="com">
|
||||
<div class ="macro_window" style="vertical-align: middle; padding-left: 3px;">
|
||||
<div class="grid grid-3col" style="align-items: center; grid-template-columns: 20px 60px auto">
|
||||
<input type="radio" id="com" name="stat" value="combat">
|
||||
<div class="macro_img" style="padding-top: 5px; padding-left: 0px; padding-right: 0px; padding-bottom: 5px;"><img src="systems/mosh/images/icons/ui/attributes/combat.png" style="border:none"/></div>
|
||||
<div class="macro_desc" style="display: table;">
|
||||
<span style="display: table-cell; vertical-align: middle;">
|
||||
<strong>{{ localize "Mosh.Combat"}}:</strong> {{ localize "Mosh.CombatSkillExample"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
Reference in New Issue
Block a user