Merge branch 'pr/52'
commit
c101c65cd3
10
src/acks.css
10
src/acks.css
|
@ -78,13 +78,14 @@
|
|||
animation: 0.8s ease-in 1s infinite alternate notify;
|
||||
}
|
||||
.acks.sheet.actor .sheet-tabs {
|
||||
border-bottom: none;
|
||||
justify-content: flex-end;
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
top: 365px;
|
||||
right: -169px;
|
||||
width: 320px;
|
||||
border-top: none;
|
||||
height: 18px;
|
||||
z-index: -1;
|
||||
}
|
||||
.acks.sheet.actor .sheet-tabs .item {
|
||||
|
@ -95,7 +96,6 @@
|
|||
background: url("/ui/parchment.jpg");
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 80px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
||||
box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.9);
|
||||
font-size: 12px;
|
||||
filter: brightness(0.9);
|
||||
|
@ -107,6 +107,9 @@
|
|||
text-shadow: none;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.acks.sheet.actor .sheet-tabs .item:not(.active) {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.acks.sheet.actor .sheet-body {
|
||||
height: calc(100% - 140px);
|
||||
}
|
||||
|
@ -491,7 +494,7 @@
|
|||
border-radius: 8px;
|
||||
background: url("/systems/acks/assets/treasure.png") no-repeat center;
|
||||
background-size: cover;
|
||||
padding: 5px 8px;
|
||||
padding: 16px 8px;
|
||||
cursor: pointer;
|
||||
filter: grayscale(1) opacity(0.5);
|
||||
}
|
||||
|
@ -633,7 +636,6 @@
|
|||
border: none;
|
||||
}
|
||||
.acks.chat-card .card-content .treasure-list .treasure div {
|
||||
text-indent: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
16
src/acks.js
16
src/acks.js
|
@ -40,8 +40,8 @@ Hooks.once("init", async function () {
|
|||
// Register custom system settings
|
||||
registerSettings();
|
||||
|
||||
CONFIG.Actor.entityClass = AcksActor;
|
||||
CONFIG.Item.entityClass = AcksItem;
|
||||
CONFIG.Actor.documentClass = AcksActor;
|
||||
CONFIG.Item.documentClass = AcksItem;
|
||||
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
|
@ -54,7 +54,9 @@ Hooks.once("init", async function () {
|
|||
makeDefault: true,
|
||||
});
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("acks", AcksItemSheet, { makeDefault: true });
|
||||
Items.registerSheet("acks", AcksItemSheet, {
|
||||
makeDefault: true,
|
||||
});
|
||||
|
||||
await preloadHandlebarsTemplates();
|
||||
});
|
||||
|
@ -86,10 +88,10 @@ Hooks.on("renderSidebarTab", async (object, html) => {
|
|||
}
|
||||
});
|
||||
|
||||
Hooks.on("preCreateCombatant", (combat, data, options, id) => {
|
||||
let init = game.settings.get("acks", "initiative");
|
||||
if (init == "group") {
|
||||
AcksCombat.addCombatant(combat, data, options, id);
|
||||
Hooks.on("createCombatant", async (combatant, options, userId) => {
|
||||
const init = game.settings.get("acks", "initiative");
|
||||
if (init === "group") {
|
||||
await AcksCombat.addCombatant(combatant, options, userId);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ export class AcksActorSheet extends ActorSheet {
|
|||
_onItemSummary(event) {
|
||||
event.preventDefault();
|
||||
let li = $(event.currentTarget).parents(".item"),
|
||||
item = this.actor.getOwnedItem(li.data("item-id")),
|
||||
item = this.actor.items.get(li.data("item-id")),
|
||||
description = TextEditor.enrichHTML(item.data.data.description);
|
||||
// Toggle summary
|
||||
if (li.hasClass("expanded")) {
|
||||
|
@ -94,7 +94,7 @@ export class AcksActorSheet extends ActorSheet {
|
|||
async _onSpellChange(event) {
|
||||
event.preventDefault();
|
||||
const itemId = event.currentTarget.closest(".item").dataset.itemId;
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
const item = this.actor.items.get(itemId);
|
||||
if (event.target.dataset.field == "cast") {
|
||||
return item.update({ "data.cast": parseInt(event.target.value) });
|
||||
} else if (event.target.dataset.field == "memorize") {
|
||||
|
@ -110,7 +110,7 @@ export class AcksActorSheet extends ActorSheet {
|
|||
.find(".item");
|
||||
spells.each((_, el) => {
|
||||
let itemId = el.dataset.itemId;
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
const item = this.actor.items.get(itemId);
|
||||
item.update({
|
||||
_id: item.id,
|
||||
"data.cast": 0,
|
||||
|
@ -130,7 +130,7 @@ export class AcksActorSheet extends ActorSheet {
|
|||
|
||||
html.find(".item .item-controls .item-show").click(async (ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.show();
|
||||
});
|
||||
|
||||
|
@ -143,7 +143,7 @@ export class AcksActorSheet extends ActorSheet {
|
|||
|
||||
html.find(".item .item-rollable .item-image").click(async (ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
if (item.type == "weapon") {
|
||||
if (this.actor.data.type === "monster") {
|
||||
item.update({
|
||||
|
|
|
@ -121,7 +121,7 @@ export class AcksActorSheetCharacter extends AcksActorSheet {
|
|||
async _onQtChange(event) {
|
||||
event.preventDefault();
|
||||
const itemId = event.currentTarget.closest(".item").dataset.itemId;
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
const item = this.actor.items.get(itemId);
|
||||
return item.update({ "data.quantity.value": parseInt(event.target.value) });
|
||||
}
|
||||
|
||||
|
@ -198,14 +198,16 @@ export class AcksActorSheetCharacter extends AcksActorSheet {
|
|||
// Update Inventory Item
|
||||
html.find(".item-edit").click((ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find(".item-delete").click((ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
this.actor.deleteEmbeddedDocuments("Item", [
|
||||
li.data("itemId"),
|
||||
]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
|
@ -226,7 +228,7 @@ export class AcksActorSheetCharacter extends AcksActorSheet {
|
|||
);
|
||||
});
|
||||
|
||||
html.find(".item-create").click((event) => {
|
||||
html.find(".item-create").click(async (event) => {
|
||||
event.preventDefault();
|
||||
const header = event.currentTarget;
|
||||
const type = header.dataset.type;
|
||||
|
@ -236,14 +238,16 @@ export class AcksActorSheetCharacter extends AcksActorSheet {
|
|||
data: duplicate(header.dataset),
|
||||
};
|
||||
delete itemData.data["type"];
|
||||
return this.actor.createOwnedItem(itemData);
|
||||
await this.actor.createEmbeddedDocuments("Item", [
|
||||
itemData,
|
||||
]);
|
||||
});
|
||||
|
||||
//Toggle Equipment
|
||||
html.find(".item-toggle").click(async (ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
await this.actor.updateOwnedItem({
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
await item.update({
|
||||
_id: li.data("itemId"),
|
||||
data: {
|
||||
equipped: !item.data.data.equipped,
|
||||
|
|
|
@ -35,24 +35,26 @@ export class AcksActor extends Actor {
|
|||
/* -------------------------------------------- */
|
||||
/* Socket Listeners and Handlers
|
||||
/* -------------------------------------------- */
|
||||
getExperience(value, options = {}) {
|
||||
async getExperience(value, options = {}) {
|
||||
if (this.data.type != "character") {
|
||||
return;
|
||||
}
|
||||
|
||||
let modified = Math.floor(
|
||||
value + (this.data.data.details.xp.bonus * value) / 100
|
||||
);
|
||||
return this.update({
|
||||
|
||||
await this.update({
|
||||
"data.details.xp.value": modified + this.data.data.details.xp.value,
|
||||
}).then(() => {
|
||||
const speaker = ChatMessage.getSpeaker({ actor: this });
|
||||
ChatMessage.create({
|
||||
content: game.i18n.format("ACKS.messages.GetExperience", {
|
||||
name: this.name,
|
||||
value: modified,
|
||||
}),
|
||||
speaker,
|
||||
});
|
||||
});
|
||||
|
||||
const speaker = ChatMessage.getSpeaker({ actor: this });
|
||||
await ChatMessage.create({
|
||||
content: game.i18n.format("ACKS.messages.GetExperience", {
|
||||
name: this.name,
|
||||
value: modified,
|
||||
}),
|
||||
speaker,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -73,7 +75,7 @@ export class AcksActor extends Actor {
|
|||
}
|
||||
}
|
||||
|
||||
generateSave(hd) {
|
||||
async generateSave(hd) {
|
||||
let saves = {};
|
||||
for (let i = 0; i <= hd; i++) {
|
||||
let tmp = CONFIG.ACKS.monster_saves[i];
|
||||
|
@ -81,7 +83,8 @@ export class AcksActor extends Actor {
|
|||
saves = tmp;
|
||||
}
|
||||
}
|
||||
this.update({
|
||||
|
||||
await this.update({
|
||||
"data.saves": {
|
||||
death: {
|
||||
value: saves.d,
|
||||
|
@ -106,9 +109,13 @@ export class AcksActor extends Actor {
|
|||
/* Rolls */
|
||||
/* -------------------------------------------- */
|
||||
|
||||
rollHP(options = {}) {
|
||||
let roll = new Roll(this.data.data.hp.hd).roll();
|
||||
return this.update({
|
||||
async rollHP(options = {}) {
|
||||
let roll = new Roll(this.data.data.hp.hd);
|
||||
await roll.evaluate({
|
||||
async: true,
|
||||
});
|
||||
|
||||
await this.update({
|
||||
data: {
|
||||
hp: {
|
||||
max: roll.total,
|
||||
|
@ -572,7 +579,7 @@ export class AcksActor extends Actor {
|
|||
const dh = Math.clamped(hp.value - amount, -99, hp.max);
|
||||
|
||||
// Update the Actor
|
||||
return this.update({
|
||||
await this.update({
|
||||
"data.hp.value": dh,
|
||||
});
|
||||
}
|
||||
|
@ -698,10 +705,10 @@ export class AcksActor extends Actor {
|
|||
// Compute treasure
|
||||
let total = 0;
|
||||
let treasure = this.data.items.filter(
|
||||
(i) => i.type == "item" && i.data.treasure
|
||||
(i) => i.data.type == "item" && i.data.data.treasure
|
||||
);
|
||||
treasure.forEach((item) => {
|
||||
total += item.data.quantity.value * item.data.cost
|
||||
total += item.data.data.quantity.value * item.data.data.cost
|
||||
});
|
||||
data.treasure = total;
|
||||
}
|
||||
|
@ -718,14 +725,14 @@ export class AcksActor extends Actor {
|
|||
const data = this.data.data;
|
||||
data.aac.naked = baseAac + data.scores.dex.mod;
|
||||
data.ac.naked = baseAc - data.scores.dex.mod;
|
||||
const armors = this.data.items.filter((i) => i.type == "armor");
|
||||
const armors = this.data.items.filter((i) => i.data.type == "armor");
|
||||
armors.forEach((a) => {
|
||||
if (a.data.equipped && a.data.type != "shield") {
|
||||
baseAc = a.data.ac.value;
|
||||
baseAac = a.data.aac.value;
|
||||
} else if (a.data.equipped && a.data.type == "shield") {
|
||||
AcShield = a.data.ac.value;
|
||||
AacShield = a.data.aac.value;
|
||||
if (a.data.data.equipped && a.data.type != "shield") {
|
||||
baseAc = a.data.data.ac;
|
||||
baseAac = a.data.data.aac.value;
|
||||
} else if (a.data.data.equipped && a.data.type == "shield") {
|
||||
AcShield = a.data.data.ac;
|
||||
AacShield = a.data.data.aac.value;
|
||||
}
|
||||
});
|
||||
data.aac.value = baseAac + data.scores.dex.mod + AacShield + data.aac.mod;
|
||||
|
|
|
@ -76,12 +76,11 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
|
||||
// Settings
|
||||
data.config.morale = game.settings.get("acks", "morale");
|
||||
data.data.details.treasure.link = TextEditor.enrichHTML(data.data.details.treasure.table);
|
||||
data.data.data.details.treasure.link = TextEditor.enrichHTML(data.data.data.details.treasure.table);
|
||||
data.isNew = this.actor.isNew();
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
async _onDrop(event) {
|
||||
super._onDrop(event);
|
||||
let data;
|
||||
|
@ -137,13 +136,11 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
}
|
||||
|
||||
async _resetCounters(event) {
|
||||
const weapons = this.actor.data.items.filter(i => i.type === 'weapon');
|
||||
for (let wp of weapons) {
|
||||
const item = this.actor.getOwnedItem(wp._id);
|
||||
await item.update({
|
||||
for (const weapon of this.actor.itemTypes["weapon"]) {
|
||||
await weapon.update({
|
||||
data: {
|
||||
counter: {
|
||||
value: parseInt(wp.data.counter.max),
|
||||
value: parseInt(weapon.data.data.counter.max, 10),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -153,7 +150,7 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
async _onCountChange(event) {
|
||||
event.preventDefault();
|
||||
const itemId = event.currentTarget.closest(".item").dataset.itemId;
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
const item = this.actor.items.get(itemId);
|
||||
if (event.target.dataset.field == "value") {
|
||||
return item.update({
|
||||
"data.counter.value": parseInt(event.target.value),
|
||||
|
@ -194,18 +191,20 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
// Update Inventory Item
|
||||
html.find(".item-edit").click((ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find(".item-delete").click((ev) => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
this.actor.deleteEmbeddedDocuments("Item", [
|
||||
li.data("itemId"),
|
||||
]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
html.find(".item-create").click((event) => {
|
||||
html.find(".item-create").click(async (event) => {
|
||||
event.preventDefault();
|
||||
const header = event.currentTarget;
|
||||
const type = header.dataset.type;
|
||||
|
@ -224,14 +223,18 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
// Getting back to main logic
|
||||
if (type == "choice") {
|
||||
const choices = header.dataset.choices.split(",");
|
||||
this._chooseItemType(choices).then((dialogInput) => {
|
||||
this._chooseItemType(choices).then(async (dialogInput) => {
|
||||
const itemData = createItem(dialogInput.type, dialogInput.name);
|
||||
this.actor.createOwnedItem(itemData, {});
|
||||
await this.actor.createEmbeddedDocuments("Item", [
|
||||
itemData,
|
||||
]);
|
||||
});
|
||||
return;
|
||||
}
|
||||
const itemData = createItem(type);
|
||||
return this.actor.createOwnedItem(itemData, {});
|
||||
await this.actor.createEmbeddedDocuments("Item", [
|
||||
itemData,
|
||||
]);
|
||||
});
|
||||
|
||||
html.find(".item-reset").click((ev) => {
|
||||
|
@ -250,7 +253,7 @@ export class AcksActorSheetMonster extends AcksActorSheet {
|
|||
|
||||
html.find(".item-pattern").click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
let currentColor = item.data.data.pattern;
|
||||
let colors = Object.keys(CONFIG.ACKS.colors);
|
||||
let index = colors.indexOf(currentColor);
|
||||
|
|
|
@ -1,79 +1,112 @@
|
|||
export class AcksCombat {
|
||||
static rollInitiative(combat, data) {
|
||||
// Check groups
|
||||
static async rollInitiative(combat, data) {
|
||||
// Initialize groups.
|
||||
data.combatants = [];
|
||||
let groups = {};
|
||||
combat.data.combatants.forEach((cbt) => {
|
||||
groups[cbt.flags.acks.group] = { present: true };
|
||||
groups[cbt.data.flags.acks.group] = {present: true};
|
||||
data.combatants.push(cbt);
|
||||
});
|
||||
|
||||
// Roll init
|
||||
Object.keys(groups).forEach((group) => {
|
||||
let roll = new Roll("1d6").roll();
|
||||
roll.toMessage({
|
||||
flavor: game.i18n.format('ACKS.roll.initiative', { group: CONFIG["ACKS"].colors[group] }),
|
||||
// Roll initiative for each group.
|
||||
for (const group in groups) {
|
||||
const roll = new Roll("1d6");
|
||||
await roll.evaluate({async: true});
|
||||
await roll.toMessage({
|
||||
flavor: game.i18n.format('ACKS.roll.initiative', {
|
||||
group: CONFIG["ACKS"].colors[group],
|
||||
}),
|
||||
});
|
||||
groups[group].initiative = roll.total;
|
||||
});
|
||||
|
||||
// Set init
|
||||
for (let i = 0; i < data.combatants.length; ++i) {
|
||||
if (!data.combatants[i].actor) {
|
||||
groups[group].initiative = roll.total;
|
||||
}
|
||||
|
||||
// Set the inititative for each group combatant.
|
||||
for (const combatant of data.combatants) {
|
||||
if (!combatant.actor) {
|
||||
return;
|
||||
}
|
||||
data.combatants[i].initiative =
|
||||
groups[data.combatants[i].flags.acks.group].initiative;
|
||||
if (data.combatants[i].actor.data.data.isSlow) {
|
||||
data.combatants[i].initiative -= 1;
|
||||
|
||||
let initiative = groups[combatant.data.flags.acks.group].initiative;
|
||||
if (combatant.actor.data.data.isSlow) {
|
||||
initiative -= 1;
|
||||
}
|
||||
|
||||
await combatant.update({
|
||||
initiative: initiative,
|
||||
});
|
||||
}
|
||||
|
||||
combat.setupTurns();
|
||||
}
|
||||
|
||||
static async resetInitiative(combat, data) {
|
||||
let reroll = game.settings.get("acks", "initiative");
|
||||
const reroll = game.settings.get("acks", "initiativePersistence");
|
||||
if (!["reset", "reroll"].includes(reroll)) {
|
||||
return;
|
||||
}
|
||||
|
||||
combat.resetAll();
|
||||
}
|
||||
|
||||
static async individualInitiative(combat, data) {
|
||||
let updates = [];
|
||||
let messages = [];
|
||||
combat.data.combatants.forEach((c, i) => {
|
||||
// This comes from foundry.js, had to remove the update turns thing
|
||||
// Roll initiative
|
||||
const cf = combat._getInitiativeFormula(c);
|
||||
const roll = combat._getInitiativeRoll(c, cf);
|
||||
const updates = [];
|
||||
const messages = [];
|
||||
|
||||
let index = 0;
|
||||
|
||||
for (const [id, combatant] of combat.data.combatants.entries()) {
|
||||
const roll = combatant.getInitiativeRoll();
|
||||
await roll.evaluate({async: true});
|
||||
let value = roll.total;
|
||||
if (combat.settings.skipDefeated && c.defeated) {
|
||||
|
||||
if (combat.settings.skipDefeated && combatant.defeated) {
|
||||
value = -790;
|
||||
}
|
||||
updates.push({ _id: c._id, initiative: value });
|
||||
|
||||
updates.push({
|
||||
_id: id,
|
||||
initiative: value,
|
||||
});
|
||||
|
||||
// Determine the roll mode
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if ((c.token.hidden || c.hidden) && (rollMode === "roll")) rollMode = "gmroll";
|
||||
if ((combatant.token.hidden || combatant.hidden)
|
||||
&& (rollMode === "roll")) {
|
||||
rollMode = "gmroll";
|
||||
}
|
||||
|
||||
// Construct chat message data
|
||||
let messageData = mergeObject({
|
||||
const messageData = mergeObject({
|
||||
speaker: {
|
||||
scene: canvas.scene._id,
|
||||
actor: c.actor ? c.actor._id : null,
|
||||
token: c.token._id,
|
||||
alias: c.token.name
|
||||
actor: combatant.actor?.id || null,
|
||||
token: combatant.token.id,
|
||||
alias: combatant.token.name
|
||||
},
|
||||
flavor: game.i18n.format('ACKS.roll.individualInit', { name: c.token.name })
|
||||
flavor: game.i18n.format('ACKS.roll.individualInit', {
|
||||
name: combatant.token.name,
|
||||
}),
|
||||
}, {});
|
||||
const chatData = roll.toMessage(messageData, { rollMode, create: false });
|
||||
|
||||
if (i > 0) chatData.sound = null; // Only play 1 sound for the whole set
|
||||
const chatData = await roll.toMessage(messageData, {
|
||||
rollMode,
|
||||
create: false,
|
||||
});
|
||||
|
||||
// Only play one sound for the whole set.
|
||||
if (index > 0) {
|
||||
chatData.sound = null;
|
||||
}
|
||||
|
||||
messages.push(chatData);
|
||||
});
|
||||
await combat.updateEmbeddedEntity("Combatant", updates);
|
||||
await CONFIG.ChatMessage.entityClass.create(messages);
|
||||
|
||||
++index;
|
||||
}
|
||||
|
||||
await combat.updateEmbeddedDocuments("Combatant", updates);
|
||||
await CONFIG.ChatMessage.documentClass.create(messages);
|
||||
|
||||
data.turn = 0;
|
||||
}
|
||||
|
||||
|
@ -92,20 +125,21 @@ export class AcksCombat {
|
|||
html.find(".combatant").each((_, ct) => {
|
||||
// Append spellcast and retreat
|
||||
const controls = $(ct).find(".combatant-controls .combatant-control");
|
||||
const cmbtant = object.combat.getCombatant(ct.dataset.combatantId);
|
||||
const moveActive = cmbtant.flags.acks && cmbtant.flags.acks.moveInCombat ? "active" : "";
|
||||
const cmbtant = game.combat.combatants.get(ct.dataset.combatantId);
|
||||
const moveActive = cmbtant.data.flags.acks?.moveInCombat ? "active" : "";
|
||||
controls.eq(1).after(
|
||||
`<a class='combatant-control move-combat ${moveActive}'><i class='fas fa-running'></i></a>`
|
||||
);
|
||||
const spellActive = cmbtant.flags.acks && cmbtant.flags.acks.prepareSpell ? "active" : "";
|
||||
const spellActive = cmbtant.data.flags.acks?.prepareSpell ? "active" : "";
|
||||
controls.eq(1).after(
|
||||
`<a class='combatant-control prepare-spell ${spellActive}'><i class='fas fa-magic'></i></a>`
|
||||
);
|
||||
const holdActive = cmbtant.flags.acks && cmbtant.flags.acks.holdTurn ? "active" : "";
|
||||
const holdActive = cmbtant.data.flags.acks?.holdTurn ? "active" : "";
|
||||
controls.eq(1).after(
|
||||
`<a class='combatant-control hold-turn ${holdActive}'><i class='fas fa-pause-circle'></i></a>`
|
||||
);
|
||||
});
|
||||
|
||||
AcksCombat.announceListener(html);
|
||||
|
||||
let init = game.settings.get("acks", "initiative") === "group";
|
||||
|
@ -127,8 +161,8 @@ export class AcksCombat {
|
|||
$(ct).find(".roll").remove();
|
||||
|
||||
// Get group color
|
||||
const cmbtant = object.combat.getCombatant(ct.dataset.combatantId);
|
||||
let color = cmbtant.flags.acks.group;
|
||||
const combatant = object.viewed.combatants.get(ct.dataset.combatantId);
|
||||
let color = combatant.data.flags.acks?.group;
|
||||
|
||||
// Append colored flag
|
||||
let controls = $(ct).find(".combatant-controls");
|
||||
|
@ -136,6 +170,7 @@ export class AcksCombat {
|
|||
`<a class='combatant-control flag' style='color:${color}' title="${CONFIG.ACKS.colors[color]}"><i class='fas fa-flag'></i></a>`
|
||||
);
|
||||
});
|
||||
|
||||
AcksCombat.addListeners(html);
|
||||
}
|
||||
|
||||
|
@ -155,7 +190,7 @@ export class AcksCombat {
|
|||
ct.initiative &&
|
||||
ct.initiative != "-789.00" &&
|
||||
ct._id != data._id &&
|
||||
ct.flags.acks.group == combatant.flags.acks.group
|
||||
ct.data.flags.acks.group == combatant.data.flags.acks.group
|
||||
) {
|
||||
groupInit = ct.initiative;
|
||||
// Set init
|
||||
|
@ -166,75 +201,109 @@ export class AcksCombat {
|
|||
}
|
||||
|
||||
static announceListener(html) {
|
||||
html.find(".combatant-control.hold-turn").click((ev) => {
|
||||
ev.preventDefault();
|
||||
html.find(".combatant-control.hold-turn").click(async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
// Toggle hold announcement
|
||||
let id = $(ev.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
let isActive = ev.currentTarget.classList.contains('active');
|
||||
game.combat.updateCombatant({
|
||||
const id = $(event.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
const isActive = event.currentTarget.classList.contains('active');
|
||||
const combatant = game.combat.combatants.get(id);
|
||||
await combatant.update({
|
||||
_id: id,
|
||||
flags: { acks: { holdTurn: !isActive } },
|
||||
flags: {
|
||||
acks: {
|
||||
holdTurn: !isActive,
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
html.find(".combatant-control.prepare-spell").click((ev) => {
|
||||
ev.preventDefault();
|
||||
|
||||
html.find(".combatant-control.prepare-spell").click(async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
// Toggle spell announcement
|
||||
let id = $(ev.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
let isActive = ev.currentTarget.classList.contains('active');
|
||||
game.combat.updateCombatant({
|
||||
const id = $(event.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
const isActive = event.currentTarget.classList.contains('active');
|
||||
const combatant = game.combat.combatants.get(id);
|
||||
await combatant.update({
|
||||
_id: id,
|
||||
flags: { acks: { prepareSpell: !isActive } },
|
||||
flags: {
|
||||
acks: {
|
||||
prepareSpell: !isActive,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
html.find(".combatant-control.move-combat").click((ev) => {
|
||||
ev.preventDefault();
|
||||
|
||||
html.find(".combatant-control.move-combat").click(async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
// Toggle retreat announcement
|
||||
let id = $(ev.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
let isActive = ev.currentTarget.classList.contains('active');
|
||||
game.combat.updateCombatant({
|
||||
const id = $(event.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
const isActive = event.currentTarget.classList.contains('active');
|
||||
const combatant = game.combat.combatants.get(id);
|
||||
await combatant.update({
|
||||
_id: id,
|
||||
flags: { acks: { moveInCombat: !isActive } },
|
||||
flags: {
|
||||
acks: {
|
||||
moveInCombat: !isActive,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static addListeners(html) {
|
||||
// Cycle through colors
|
||||
html.find(".combatant-control.flag").click((ev) => {
|
||||
html.find(".combatant-control.flag").click(async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (!game.user.isGM) {
|
||||
return;
|
||||
}
|
||||
let currentColor = ev.currentTarget.style.color;
|
||||
let colors = Object.keys(CONFIG.ACKS.colors);
|
||||
|
||||
const currentColor = event.currentTarget.style.color;
|
||||
const colors = Object.keys(CONFIG.ACKS.colors);
|
||||
let index = colors.indexOf(currentColor);
|
||||
if (index + 1 == colors.length) {
|
||||
index = 0;
|
||||
} else {
|
||||
index++;
|
||||
}
|
||||
let id = $(ev.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
game.combat.updateCombatant({
|
||||
|
||||
const id = $(event.currentTarget).closest(".combatant")[0].dataset.combatantId;
|
||||
const combatant = game.combat.combatants.get(id);
|
||||
await combatant.update({
|
||||
_id: id,
|
||||
flags: { acks: { group: colors[index] } },
|
||||
flags: {
|
||||
acks: {
|
||||
group: colors[index],
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
html.find('.combat-control[data-control="reroll"]').click((ev) => {
|
||||
html.find('.combat-control[data-control="reroll"]').click(async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (!game.combat) {
|
||||
return;
|
||||
}
|
||||
let data = {};
|
||||
|
||||
const data = {};
|
||||
AcksCombat.rollInitiative(game.combat, data);
|
||||
game.combat.update({ data: data }).then(() => {
|
||||
game.combat.setupTurns();
|
||||
});
|
||||
|
||||
await game.combat.update({
|
||||
data: data,
|
||||
})
|
||||
|
||||
game.combat.setupTurns();
|
||||
});
|
||||
}
|
||||
|
||||
static addCombatant(combat, data, options, id) {
|
||||
let token = canvas.tokens.get(data.tokenId);
|
||||
static async addCombatant(combatant, options, userId) {
|
||||
let color = "black";
|
||||
switch (token.data.disposition) {
|
||||
switch (combatant.token.data.disposition) {
|
||||
case -1:
|
||||
color = "red";
|
||||
break;
|
||||
|
@ -245,12 +314,16 @@ export class AcksCombat {
|
|||
color = "green";
|
||||
break;
|
||||
}
|
||||
data.flags = {
|
||||
acks: {
|
||||
group: color,
|
||||
|
||||
await combatant.update({
|
||||
flags: {
|
||||
acks: {
|
||||
group: color,
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
static activateCombatant(li) {
|
||||
const turn = game.combat.turns.findIndex(turn => turn._id === li.data('combatant-id'));
|
||||
game.combat.update({turn: turn})
|
||||
|
@ -265,12 +338,13 @@ export class AcksCombat {
|
|||
}
|
||||
|
||||
static async preUpdateCombat(combat, data, diff, id) {
|
||||
let init = game.settings.get("acks", "initiative");
|
||||
let reroll = game.settings.get("acks", "initiative");
|
||||
if (!data.round) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.round !== 1) {
|
||||
const reroll = game.settings.get("acks", "initiativePersistence");
|
||||
|
||||
if (reroll === "reset") {
|
||||
AcksCombat.resetInitiative(combat, data, diff, id);
|
||||
return;
|
||||
|
@ -278,6 +352,9 @@ export class AcksCombat {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const init = game.settings.get("acks", "initiative");
|
||||
|
||||
if (init === "group") {
|
||||
AcksCombat.rollInitiative(combat, data, diff, id);
|
||||
} else if (init === "individual") {
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
import { AcksActor } from '../actor/entity.js';
|
||||
import { AcksDice } from "../dice.js";
|
||||
|
||||
export class AcksCharacterCreator extends FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.classes = ["acks", "dialog", "creator"],
|
||||
options.id = 'character-creator';
|
||||
options.template =
|
||||
'systems/acks/templates/actors/dialogs/character-creation.html';
|
||||
options.id = 'character-creator';
|
||||
options.template = 'systems/acks/templates/actors/dialogs/character-creation.html';
|
||||
options.width = 235;
|
||||
return options;
|
||||
}
|
||||
|
@ -169,7 +167,10 @@ export class AcksCharacterCreator extends FormApplication {
|
|||
}
|
||||
}
|
||||
};
|
||||
this.object.createOwnedItem(itemData);
|
||||
|
||||
await this.object.createEmbeddedDocuments("Item", [
|
||||
itemData,
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* This method is called upon form submission after form data is validated
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
import { AcksActor } from '../actor/entity.js';
|
||||
|
||||
export class AcksCharacterModifiers extends FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
|
@ -29,8 +27,10 @@ export class AcksCharacterModifiers extends FormApplication {
|
|||
* @return {Object}
|
||||
*/
|
||||
getData() {
|
||||
let data = this.object.data;
|
||||
const data = this.object.data;
|
||||
|
||||
data.user = game.user;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
import { AcksActor } from '../actor/entity.js';
|
||||
|
||||
export class AcksEntityTweaks extends FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
|
@ -28,12 +26,15 @@ export class AcksEntityTweaks extends FormApplication {
|
|||
* @return {Object}
|
||||
*/
|
||||
getData() {
|
||||
let data = this.object.data;
|
||||
const data = this.object.data;
|
||||
|
||||
if (this.object.data.type === 'character') {
|
||||
data.isCharacter = true;
|
||||
}
|
||||
|
||||
data.user = game.user;
|
||||
data.config = CONFIG.ACKS;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -52,9 +53,11 @@ export class AcksEntityTweaks extends FormApplication {
|
|||
*/
|
||||
async _updateObject(event, formData) {
|
||||
event.preventDefault();
|
||||
// Update the actor
|
||||
|
||||
// Update the actor.
|
||||
this.object.update(formData);
|
||||
// Re-draw the updated sheet
|
||||
|
||||
// Render the updated sheet.
|
||||
this.object.sheet.render(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,12 +30,14 @@ export class AcksPartySheet extends FormApplication {
|
|||
const settings = {
|
||||
ascending: game.settings.get('acks', 'ascendingAC')
|
||||
};
|
||||
let data = {
|
||||
|
||||
const data = {
|
||||
data: this.object,
|
||||
config: CONFIG.ACKS,
|
||||
user: game.user,
|
||||
settings: settings
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -55,15 +57,18 @@ export class AcksPartySheet extends FormApplication {
|
|||
_dealXP(ev) {
|
||||
// Grab experience
|
||||
const template = `
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Amount</label>
|
||||
<input name="total" placeholder="0" type="text"/>
|
||||
</div>
|
||||
</form>`;
|
||||
let pcs = this.object.entities.filter((e) => {
|
||||
return e.getFlag('acks', 'party') && e.data.type == "character";
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Amount</label>
|
||||
<input name="total" placeholder="0" type="text"/>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
let pcs = this.object.documents.filter((actor) => {
|
||||
return actor.getFlag('acks', 'party') && actor.data.type === "character";
|
||||
});
|
||||
|
||||
new Dialog({
|
||||
title: "Deal Experience",
|
||||
content: template,
|
||||
|
@ -89,11 +94,13 @@ export class AcksPartySheet extends FormApplication {
|
|||
}).render(true);
|
||||
}
|
||||
|
||||
async _selectActors(ev) {
|
||||
async _selectActors(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const template = "/systems/acks/templates/apps/party-select.html";
|
||||
const templateData = {
|
||||
actors: this.object.entities
|
||||
}
|
||||
actors: this.object.documents,
|
||||
};
|
||||
const content = await renderTemplate(template, templateData);
|
||||
new Dialog({
|
||||
title: "Select Party Characters",
|
||||
|
@ -106,7 +113,7 @@ export class AcksPartySheet extends FormApplication {
|
|||
let checks = html.find("input[data-action='select-actor']");
|
||||
checks.each(async (_, c) => {
|
||||
let key = c.getAttribute('name');
|
||||
await this.object.entities[key].setFlag('acks', 'party', c.checked);
|
||||
await this.object.documents[key].setFlag('acks', 'party', c.checked);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -117,11 +124,12 @@ export class AcksPartySheet extends FormApplication {
|
|||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
html
|
||||
.find(".item-controls .item-control .select-actors")
|
||||
.click(this._selectActors.bind(this));
|
||||
|
||||
html.find(".item-controls .item-control .deal-xp").click(this._dealXP.bind(this));
|
||||
html.find(".item-controls .item-control .deal-xp").click(this._dealXP.bind(this));
|
||||
|
||||
html.find("a.resync").click(() => this.render(true));
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ export class AcksDice {
|
|||
const template = "systems/acks/templates/chat/roll-result.html";
|
||||
|
||||
let chatData = {
|
||||
user: game.user._id,
|
||||
user: game.user.id,
|
||||
speaker: speaker,
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,10 @@ export class AcksDice {
|
|||
parts.push(form.bonus.value);
|
||||
}
|
||||
|
||||
const roll = new Roll(parts.join("+"), data).roll();
|
||||
const roll = new Roll(parts.join("+"), data);
|
||||
await roll.evaluate({
|
||||
async: true,
|
||||
});
|
||||
|
||||
// Convert the roll to a chat message and return the roll
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
|
@ -89,10 +92,13 @@ export class AcksDice {
|
|||
rollMode = game.user.isGM ? "selfroll" : "blindroll";
|
||||
}
|
||||
|
||||
if (["gmroll", "blindroll"].includes(rollMode))
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) {
|
||||
chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
|
||||
if (rollMode === "selfroll") chatData["whisper"] = [game.user._id];
|
||||
if (rollMode === "blindroll") {
|
||||
}
|
||||
|
||||
if (rollMode === "selfroll") {
|
||||
chatData["whisper"] = [game.user.id];
|
||||
} else if (rollMode === "blindroll") {
|
||||
chatData["blind"] = true;
|
||||
data.roll.blindroll = true;
|
||||
}
|
||||
|
@ -230,8 +236,15 @@ export class AcksDice {
|
|||
// Optionally include a situational bonus
|
||||
if (form !== null && form.bonus.value) parts.push(form.bonus.value);
|
||||
|
||||
const roll = new Roll(parts.join("+"), data).roll();
|
||||
const dmgRoll = new Roll(data.roll.dmg.join("+"), data).roll();
|
||||
const roll = new Roll(parts.join("+"), data);
|
||||
await roll.evaluate({
|
||||
async: true,
|
||||
});
|
||||
|
||||
const dmgRoll = new Roll(data.roll.dmg.join("+"), data);
|
||||
await dmgRoll.evaluate({
|
||||
async: true,
|
||||
});
|
||||
|
||||
// Add minimal damage of 1
|
||||
if (dmgRoll.total < 1) {
|
||||
|
|
|
@ -47,8 +47,8 @@ export const registerHelpers = async function () {
|
|||
});
|
||||
|
||||
Handlebars.registerHelper("getTagIcon", function (tag) {
|
||||
let idx = Object.keys(CONFIG.ACKS.tags).find(k => (CONFIG.ACKS.tags[k] == tag));
|
||||
return CONFIG.ACKS.tag_images[idx];
|
||||
const index = Object.keys(CONFIG.ACKS.tags).find(k => (CONFIG.ACKS.tags[k] == tag));
|
||||
return CONFIG.ACKS.tag_images[index];
|
||||
});
|
||||
|
||||
Handlebars.registerHelper("counter", function (status, value, max) {
|
||||
|
|
|
@ -280,7 +280,7 @@ export class AcksItem extends Item {
|
|||
const token = this.actor.token;
|
||||
const templateData = {
|
||||
actor: this.actor,
|
||||
tokenId: token ? `${token.scene._id}.${token.id}` : null,
|
||||
tokenId: token ? `${token.parent.id}.${token.id}` : null,
|
||||
item: this.data,
|
||||
data: this.getChatData(),
|
||||
labels: this.labels,
|
||||
|
@ -297,11 +297,11 @@ export class AcksItem extends Item {
|
|||
|
||||
// Basic chat message data
|
||||
const chatData = {
|
||||
user: game.user._id,
|
||||
user: game.user.id,
|
||||
type: CONST.CHAT_MESSAGE_TYPES.OTHER,
|
||||
content: html,
|
||||
speaker: {
|
||||
actor: this.actor._id,
|
||||
actor: this.actor.id,
|
||||
token: this.actor.token,
|
||||
alias: this.actor.name,
|
||||
},
|
||||
|
@ -311,7 +311,7 @@ export class AcksItem extends Item {
|
|||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode))
|
||||
chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
|
||||
if (rollMode === "selfroll") chatData["whisper"] = [game.user._id];
|
||||
if (rollMode === "selfroll") chatData["whisper"] = [game.user.id];
|
||||
if (rollMode === "blindroll") chatData["blind"] = true;
|
||||
|
||||
// Create the chat message
|
||||
|
@ -355,7 +355,7 @@ export class AcksItem extends Item {
|
|||
if (!actor) return;
|
||||
|
||||
// Get the Item
|
||||
const item = actor.getOwnedItem(card.dataset.itemId);
|
||||
const item = actor.items.get(card.dataset.itemId);
|
||||
if (!item) {
|
||||
return ui.notifications.error(
|
||||
`The requested item ${card.dataset.itemId} no longer exists on Actor ${actor.name}`
|
||||
|
@ -395,7 +395,7 @@ export class AcksItem extends Item {
|
|||
const [sceneId, tokenId] = tokenKey.split(".");
|
||||
const scene = game.scenes.get(sceneId);
|
||||
if (!scene) return null;
|
||||
const tokenData = scene.getEmbeddedEntity("Token", tokenId);
|
||||
const tokenData = scene.tokens.get(tokenId);
|
||||
if (!tokenData) return null;
|
||||
const token = new Token(tokenData);
|
||||
return token.actor;
|
||||
|
|
|
@ -17,7 +17,7 @@ export async function createAcksMacro(data, slot) {
|
|||
|
||||
// Create the macro command
|
||||
const command = `game.acks.rollItemMacro("${item.name}");`;
|
||||
let macro = game.macros.entities.find(m => (m.name === item.name) && (m.command === command));
|
||||
let macro = game.macros.find(m => (m.name === item.name) && (m.command === command));
|
||||
if ( !macro ) {
|
||||
macro = await Macro.create({
|
||||
name: item.name,
|
||||
|
|
|
@ -9,7 +9,6 @@ export const addControl = (object, html) => {
|
|||
}
|
||||
|
||||
export const showPartySheet = (object) => {
|
||||
event.preventDefault();
|
||||
new AcksPartySheet(object, {
|
||||
top: window.screen.height / 2 - 180,
|
||||
left:window.screen.width / 2 - 140,
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
export const registerSettings = function () {
|
||||
|
||||
export const registerSettings = () => {
|
||||
game.settings.register("acks", "initiative", {
|
||||
name: game.i18n.localize("ACKS.Setting.Initiative"),
|
||||
hint: game.i18n.localize("ACKS.Setting.InitiativeHint"),
|
||||
default: "individual",
|
||||
scope: "world",
|
||||
type: String,
|
||||
config: true,
|
||||
choices: {
|
||||
individual: "ACKS.Setting.InitiativeIndividual",
|
||||
group: "ACKS.Setting.InitiativeGroup",
|
||||
},
|
||||
});
|
||||
|
||||
game.settings.register("acks", "initiativePersistence", {
|
||||
name: game.i18n.localize("ACKS.Setting.RerollInitiative"),
|
||||
hint: game.i18n.localize("ACKS.Setting.RerollInitiativeHint"),
|
||||
default: "reset",
|
||||
|
|
|
@ -25,44 +25,46 @@ export const augmentTable = (table, html, data) => {
|
|||
html.find(".sheet-footer .roll").replaceWith(roll);
|
||||
}
|
||||
|
||||
html.find(".roll-treasure").click((ev) => {
|
||||
rollTreasure(table.object, { event: ev });
|
||||
html.find(".roll-treasure").click(async (event) => {
|
||||
await rollTreasure(table.object, { event: event });
|
||||
});
|
||||
};
|
||||
|
||||
function drawTreasure(table, data) {
|
||||
const percent = (chance) => {
|
||||
const roll = new Roll("1d100").roll();
|
||||
return roll.total <= chance;
|
||||
};
|
||||
async function drawTreasure(table, data) {
|
||||
data.treasure = {};
|
||||
if (table.getFlag('acks', 'treasure')) {
|
||||
table.results.forEach((r) => {
|
||||
if (percent(r.weight)) {
|
||||
const text = table._getResultChatText(r);
|
||||
data.treasure[r._id] = ({
|
||||
img: r.img,
|
||||
for (const result of table.results) {
|
||||
const roll = new Roll("1d100");
|
||||
await roll.evaluate({async: true});
|
||||
|
||||
if (roll.total <= result.data.weight) {
|
||||
const text = result.getChatText();
|
||||
data.treasure[result.id] = ({
|
||||
img: result.img,
|
||||
text: TextEditor.enrichHTML(text),
|
||||
});
|
||||
if ((r.type === CONST.TABLE_RESULT_TYPES.ENTITY) && (r.collection === "RollTable")) {
|
||||
const embeddedTable = game.tables.get(r.resultId);
|
||||
drawTreasure(embeddedTable, data.treasure[r._id]);
|
||||
|
||||
if ((result.data.type === CONST.TABLE_RESULT_TYPES.DOCUMENT)
|
||||
&& (result.collection === "RollTable")) {
|
||||
const embeddedTable = game.tables.get(result.resultId);
|
||||
drawTreasure(embeddedTable, data.treasure[result.id]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const results = table.roll().results;
|
||||
results.forEach((s) => {
|
||||
const text = TextEditor.enrichHTML(table._getResultChatText(s));
|
||||
data.treasure[s._id] = {img: s.img, text: text};
|
||||
const results = await table.roll().results;
|
||||
results.forEach((result) => {
|
||||
const text = TextEditor.enrichHTML(result.getChatText());
|
||||
data.treasure[result.id] = {img: result.img, text: text};
|
||||
});
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async function rollTreasure(table, options = {}) {
|
||||
// Draw treasure
|
||||
const data = drawTreasure(table, {});
|
||||
const data = await drawTreasure(table, {});
|
||||
let templateData = {
|
||||
treasure: data.treasure,
|
||||
table: table,
|
||||
|
@ -70,7 +72,7 @@ async function rollTreasure(table, options = {}) {
|
|||
|
||||
// Animation
|
||||
if (options.event) {
|
||||
let results = $(event.currentTarget.parentElement)
|
||||
let results = $(options.event.currentTarget.parentElement)
|
||||
.prev()
|
||||
.find(".table-result");
|
||||
results.each((_, item) => {
|
||||
|
@ -83,7 +85,7 @@ async function rollTreasure(table, options = {}) {
|
|||
|
||||
let html = await renderTemplate(
|
||||
"systems/acks/templates/chat/roll-treasure.html",
|
||||
templateData
|
||||
templateData,
|
||||
);
|
||||
|
||||
let chatData = {
|
||||
|
@ -93,7 +95,7 @@ async function rollTreasure(table, options = {}) {
|
|||
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
|
||||
if (rollMode === "selfroll") chatData["whisper"] = [game.user._id];
|
||||
if (rollMode === "selfroll") chatData["whisper"] = [game.user.id];
|
||||
if (rollMode === "blindroll") chatData["blind"] = true;
|
||||
|
||||
ChatMessage.create(chatData);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"title": "Adventurer Conqueror King System",
|
||||
"description": "Play B/X or other OSR compatible content using the ACKS system",
|
||||
"version": "0.7.5",
|
||||
"minimumCoreVersion": "0.7.4",
|
||||
"compatibleCoreVersion": "0.7.9",
|
||||
"minimumCoreVersion": "9",
|
||||
"compatibleCoreVersion": "9",
|
||||
"templateVersion": 2,
|
||||
"author": "The Happy Anarchist",
|
||||
"esmodules": ["acks.js"],
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<a class="item" data-tab="abilities">
|
||||
{{localize "ACKS.category.abilities"}}
|
||||
</a>
|
||||
{{#if data.spells.enabled}}
|
||||
{{#if data.data.spells.enabled}}
|
||||
<a class="item" data-tab="spells">
|
||||
{{localize "ACKS.category.spells"}}
|
||||
</a>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<div class="tab" data-group="primary" data-tab="abilities">
|
||||
{{> "systems/acks/templates/actors/partials/character-abilities-tab.html"}}
|
||||
</div>
|
||||
{{#if data.spells.enabled}}
|
||||
{{#if data.data.spells.enabled}}
|
||||
<div class="tab" data-group="primary" data-tab="spells">
|
||||
{{> "systems/acks/templates/actors/partials/character-spells-tab.html"}}
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<a class="item" data-tab="attributes">
|
||||
{{localize "ACKS.category.attributes"}}
|
||||
</a>
|
||||
{{#if data.spells.enabled}}
|
||||
{{#if data.data.spells.enabled}}
|
||||
<a class="item" data-tab="spells">
|
||||
{{localize "ACKS.category.spells"}}
|
||||
</a>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<div class="tab" data-group="primary" data-tab="attributes">
|
||||
{{> "systems/acks/templates/actors/partials/monster-attributes-tab.html"}}
|
||||
</div>
|
||||
{{#if data.spells.enabled}}
|
||||
{{#if data.data.spells.enabled}}
|
||||
<div class="tab" data-group="primary" data-tab="spells">
|
||||
{{> "systems/acks/templates/actors/partials/character-spells-tab.html"}}
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<div class="inventory">
|
||||
<div class="item-titles">{{localize "ACKS.category.notes"}}</div>
|
||||
<div class="resizable-editor" data-editor-size="320">
|
||||
{{editor content=data.details.biography target="data.details.biography"
|
||||
{{editor content=data.data.details.biography target="data.details.biography"
|
||||
button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,28 +2,28 @@
|
|||
<li class="attribute flexrow" data-exploration="ld">
|
||||
<h4 class="attribute-name box-title" title="({{localize 'ACKS.exploration.ld.abrev'}}) {{localize 'ACKS.exploration.ld.long'}}"><a>{{ localize "ACKS.exploration.ld.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.exploration.ld" type="text" value="{{data.exploration.ld}}" value="18" data-dtype="Number" placeholder="0" />
|
||||
<input name="data.exploration.ld" type="text" value="{{data.data.exploration.ld}}" value="18" data-dtype="Number" placeholder="0" />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute flexrow" data-exploration="od">
|
||||
<h4 class="attribute-name box-title" title="({{localize 'ACKS.exploration.od.abrev'}}) {{localize 'ACKS.exploration.od.long'}}"><a>{{ localize "ACKS.exploration.od.short" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.exploration.od" type="text" value="{{data.exploration.od}}" value="18" placeholder="0" data-dtype="String" />
|
||||
<input name="data.exploration.od" type="text" value="{{data.data.exploration.od}}" value="18" placeholder="0" data-dtype="String" />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute flexrow" data-exploration="sd">
|
||||
<h4 class="attribute-name box-title" title="({{localize 'ACKS.exploration.sd.abrev'}}) {{localize 'ACKS.exploration.sd.long'}}"><a>{{ localize "ACKS.exploration.sd.short" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.exploration.sd" type="text" value="{{data.exploration.sd}}" value="18" placeholder="0" data-dtype="String" />
|
||||
<input name="data.exploration.sd" type="text" value="{{data.data.exploration.sd}}" value="18" placeholder="0" data-dtype="String" />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute flexrow" data-exploration="ft">
|
||||
<h4 class="attribute-name box-title" title="({{localize 'ACKS.exploration.ft.abrev'}}) {{localize 'ACKS.exploration.ft.long'}}"><a>{{ localize "ACKS.exploration.ft.short" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.exploration.ft" type="text" value="{{data.exploration.ft}}" value="18" placeholder="0" data-dtype="String" />
|
||||
<input name="data.exploration.ft" type="text" value="{{data.data.exploration.ft}}" value="18" placeholder="0" data-dtype="String" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -41,7 +41,7 @@
|
|||
{{#each abilities as |item|}}
|
||||
<li class="item-entry">
|
||||
<div class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-name {{#if item.data.roll}}item-rollable{{/if}} flexrow">
|
||||
<div class="item-name {{#if item.data.data.roll}}item-rollable{{/if}} flexrow">
|
||||
<div class="item-image" style="background-image: url({{item.img}})"></div>
|
||||
<a>
|
||||
<h4 title="{{item.name}}">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.str.long' }}">
|
||||
<a>{{ localize "ACKS.scores.str.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.str.value" type="text" value="{{data.scores.str.value}}" placeholder="0"
|
||||
<input name="data.scores.str.value" type="text" value="{{data.data.scores.str.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.int.long' }}">
|
||||
<a>{{ localize "ACKS.scores.int.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.int.value" type="text" value="{{data.scores.int.value}}" placeholder="0"
|
||||
<input name="data.scores.int.value" type="text" value="{{data.data.scores.int.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.wis.long' }}">
|
||||
<a>{{ localize "ACKS.scores.wis.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.wis.value" type="text" value="{{data.scores.wis.value}}" placeholder="0"
|
||||
<input name="data.scores.wis.value" type="text" value="{{data.data.scores.wis.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.dex.long' }}">
|
||||
<a>{{ localize "ACKS.scores.dex.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.dex.value" type="text" value="{{data.scores.dex.value}}" placeholder="0"
|
||||
<input name="data.scores.dex.value" type="text" value="{{data.data.scores.dex.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.con.long' }}">
|
||||
<a>{{ localize "ACKS.scores.con.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.con.value" type="text" value="{{data.scores.con.value}}" placeholder="0"
|
||||
<input name="data.scores.con.value" type="text" value="{{data.data.scores.con.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.scores.cha.long' }}">
|
||||
<a>{{ localize "ACKS.scores.cha.short" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.scores.cha.value" type="text" value="{{data.scores.cha.value}}" placeholder="0"
|
||||
<input name="data.scores.cha.value" type="text" value="{{data.data.scores.cha.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -63,25 +63,25 @@
|
|||
<div class="resources">
|
||||
<div class="flexrow">
|
||||
<div class="health">
|
||||
<input class="health-value health-top" name="data.hp.value" type="text" value="{{data.hp.value}}"
|
||||
<input class="health-value health-top" name="data.hp.value" type="text" value="{{data.data.hp.value}}"
|
||||
data-dtype="Number" placeholder="0" title="{{localize 'ACKS.Health'}}" />
|
||||
<input class="health-value health-bottom" name="data.hp.max" type="text" value="{{data.hp.max}}"
|
||||
<input class="health-value health-bottom" name="data.hp.max" type="text" value="{{data.data.hp.max}}"
|
||||
data-dtype="Number" placeholder="0" title="{{localize 'ACKS.HealthMax'}}" />
|
||||
<div class="health-empty" style="height:{{counter false data.hp.value data.hp.max}}%"></div>
|
||||
<div class="health-full" style="height:{{counter true data.hp.value data.hp.max}}%"></div>
|
||||
<div class="health-empty" style="height:{{counter false data.data.hp.value data.data.hp.max}}%"></div>
|
||||
<div class="health-full" style="height:{{counter true data.data.hp.value data.data.hp.max}}%"></div>
|
||||
</div>
|
||||
<div class="health armor-class">
|
||||
{{#if config.ascendingAC}}
|
||||
<div class="health-value health-top" title="{{localize 'ACKS.ArmorClass'}}">{{data.aac.value}}</div>
|
||||
<div class="health-value health-top" title="{{localize 'ACKS.ArmorClass'}}">{{data.data.aac.value}}</div>
|
||||
<div class="health-value health-bottom" title="{{localize 'ACKS.ArmorClassNaked'}}">
|
||||
{{data.aac.naked}}</div>
|
||||
{{#if data.aac.shield}}<div class="shield" title="{{localize 'ACKS.items.hasShield'}} ({{data.aac.shield}})"><i
|
||||
{{data.data.aac.naked}}</div>
|
||||
{{#if data.data.aac.shield}}<div class="shield" title="{{localize 'ACKS.items.hasShield'}} ({{data.data.aac.shield}})"><i
|
||||
class="fas fa-shield-alt"></i></div>{{/if}}
|
||||
{{else}}
|
||||
<div class="health-value health-top" title="{{localize 'ACKS.ArmorClass'}}">{{data.ac.value}}</div>
|
||||
<div class="health-value health-top" title="{{localize 'ACKS.ArmorClass'}}">{{data.data.ac.value}}</div>
|
||||
<div class="health-value health-bottom" title="{{localize 'ACKS.ArmorClassNaked'}}">
|
||||
{{data.ac.naked}}</div>
|
||||
{{#if data.ac.shield}}<div class="shield" title="{{localize 'ACKS.items.hasShield'}} ({{data.ac.shield}})"><i
|
||||
{{data.data.ac.naked}}</div>
|
||||
{{#if data.data.ac.shield}}<div class="shield" title="{{localize 'ACKS.items.hasShield'}} ({{data.data.ac.shield}})"><i
|
||||
class="fas fa-shield-alt"></i></div>{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<a>{{ localize "ACKS.HitDiceShort" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.hp.hd" type="text" value="{{data.hp.hd}}" placeholder=""
|
||||
<input name="data.hp.hd" type="text" value="{{data.data.hp.hd}}" placeholder=""
|
||||
data-dtype="String" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -103,8 +103,8 @@
|
|||
<a>{{ localize "ACKS.BHRShort" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value"
|
||||
title="Calculated from {{data.hp.max}} HP">
|
||||
{{data.hp.bhr}}
|
||||
title="Calculated from {{data.data.hp.max}} HP">
|
||||
{{data.data.hp.bhr}}
|
||||
</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -113,8 +113,8 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.Initiative' }}">
|
||||
{{ localize "ACKS.InitiativeShort" }}</h4>
|
||||
<div class="attribute-value"
|
||||
title="{{localize 'ACKS.scores.dex.long'}}({{data.scores.dex.init}}) + {{localize 'ACKS.Modifier'}}({{data.initiative.mod}})">
|
||||
{{add data.scores.dex.init data.initiative.mod}}
|
||||
title="{{localize 'ACKS.scores.dex.long'}}({{data.data.scores.dex.init}}) + {{localize 'ACKS.Modifier'}}({{data.data.initiative.mod}})">
|
||||
{{add data.data.scores.dex.init data.data.initiative.mod}}
|
||||
</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -127,8 +127,8 @@
|
|||
<a>{{localize 'ACKS.MeleeShort'}}</a></h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value"
|
||||
title="{{localize 'ACKS.scores.str.long'}}({{data.scores.str.mod}}) + {{localize 'ACKS.Modifier'}}({{data.thac0.mod.melee}})">
|
||||
{{add data.scores.str.mod data.thac0.mod.melee}}
|
||||
title="{{localize 'ACKS.scores.str.long'}}({{data.data.scores.str.mod}}) + {{localize 'ACKS.Modifier'}}({{data.data.thac0.mod.melee}})">
|
||||
{{add data.data.scores.str.mod data.data.thac0.mod.melee}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -138,7 +138,7 @@
|
|||
</h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value">
|
||||
<input name="data.thac0.throw" type="text" value="{{data.thac0.throw}}" placeholder=""
|
||||
<input name="data.thac0.throw" type="text" value="{{data.data.thac0.throw}}" placeholder=""
|
||||
data-dtype="Number" +/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -149,7 +149,7 @@
|
|||
</h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value">
|
||||
<input name="data.thac0.value" type="text" value="{{data.thac0.value}}" placeholder="0"
|
||||
<input name="data.thac0.value" type="text" value="{{data.data.thac0.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -160,8 +160,8 @@
|
|||
<a>{{localize 'ACKS.MissileShort'}}</a></h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value"
|
||||
title="{{localize 'ACKS.scores.dex.long'}}({{data.scores.dex.mod}}) + {{localize 'ACKS.Modifier'}}({{data.thac0.mod.missile}})">
|
||||
{{add data.scores.dex.mod data.thac0.mod.missile}}
|
||||
title="{{localize 'ACKS.scores.dex.long'}}({{data.data.scores.dex.mod}}) + {{localize 'ACKS.Modifier'}}({{data.data.thac0.mod.missile}})">
|
||||
{{add data.data.scores.dex.mod data.data.thac0.mod.missile}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -174,7 +174,7 @@
|
|||
{{localize 'ACKS.movement.overland.short'}}</h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value">
|
||||
{{divide data.movement.base 5}}
|
||||
{{divide data.data.movement.base 5}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -182,8 +182,8 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.movement.exploration.long' }}">
|
||||
{{ localize "ACKS.movement.exploration.short" }}</h4>
|
||||
<div class="attribute-value flexrow">
|
||||
<input name="data.movement.base" type="text" value="{{data.movement.base}}" placeholder="0"
|
||||
data-dtype="Number" {{#if data.config.movementAuto}}disabled{{/if}} />
|
||||
<input name="data.movement.base" type="text" value="{{data.data.movement.base}}" placeholder="0"
|
||||
data-dtype="Number" {{#if data.data.config.movementAuto}}disabled{{/if}} />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute attribute-secondaries">
|
||||
|
@ -191,7 +191,7 @@
|
|||
{{localize 'ACKS.movement.encounter.short'}}</h4>
|
||||
<div class="flexrow">
|
||||
<div class="attribute-value">
|
||||
{{divide data.movement.base 3}}
|
||||
{{divide data.data.movement.base 3}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -205,43 +205,43 @@
|
|||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.paralysis.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.paralysis.value" type="text" value="{{data.saves.paralysis.value}}"
|
||||
<input name="data.saves.paralysis.value" type="text" value="{{data.data.saves.paralysis.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="death">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.death.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.death.value" type="text" value="{{data.saves.death.value}}" placeholder="0"
|
||||
<input name="data.saves.death.value" type="text" value="{{data.data.saves.death.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="breath">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.breath.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.breath.value" type="text" value="{{data.saves.breath.value}}"
|
||||
<input name="data.saves.breath.value" type="text" value="{{data.data.saves.breath.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="wand">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.wand.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.wand.value" type="text" value="{{data.saves.wand.value}}" placeholder="0"
|
||||
<input name="data.saves.wand.value" type="text" value="{{data.data.saves.wand.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="spell">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.spell.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.spell.value" type="text" value="{{data.saves.spell.value}}"
|
||||
<input name="data.saves.spell.value" type="text" value="{{data.data.saves.spell.value}}"
|
||||
placeholder="0" />
|
||||
</li>
|
||||
{{#unless config.removeMagicBonus}}
|
||||
<li class="attribute saving-throw">
|
||||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.saves.magic.long' }}">
|
||||
{{ localize "ACKS.saves.magic.long"}}</h4>
|
||||
<div class="attribute-value flat" title="{{localize 'ACKS.scores.wis.long'}}({{data.scores.wis.mod}})">
|
||||
{{mod data.scores.wis.mod}}
|
||||
<div class="attribute-value flat" title="{{localize 'ACKS.scores.wis.long'}}({{data.data.scores.wis.mod}})">
|
||||
{{mod data.data.scores.wis.mod}}
|
||||
</div>
|
||||
</li>
|
||||
{{/unless}}
|
||||
|
|
|
@ -4,36 +4,36 @@
|
|||
<input name="name" type="text" value="{{actor.name}}" placeholder="{{localize 'ACKS.details.name'}}" data-dtype="String" />
|
||||
</h1>
|
||||
<ul class="summary flexrow">
|
||||
{{#if data.retainer.enabled}}
|
||||
{{#if data.data.retainer.enabled}}
|
||||
<li>
|
||||
<input type="text" name="data.retainer.wage" value="{{data.retainer.wage}}" data-dtype="String"
|
||||
<input type="text" name="data.retainer.wage" value="{{data.data.retainer.wage}}" data-dtype="String"
|
||||
/>
|
||||
<label>{{localize 'ACKS.RetainerWage'}}</label>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
<input type="text" name="data.details.title" value="{{data.details.title}}" data-dtype="String"
|
||||
<input type="text" name="data.details.title" value="{{data.data.details.title}}" data-dtype="String"
|
||||
/>
|
||||
<label>{{localize 'ACKS.details.title'}}</label>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
<input type="text" name="data.details.alignment" value="{{data.details.alignment}}" data-dtype="String"
|
||||
<input type="text" name="data.details.alignment" value="{{data.data.details.alignment}}" data-dtype="String"
|
||||
/>
|
||||
<label>{{localize 'ACKS.details.alignment'}}</label>
|
||||
</li>
|
||||
{{#if data.retainer.enabled}}
|
||||
{{#if data.data.retainer.enabled}}
|
||||
<li class="flexrow check-field">
|
||||
<div class="check morale-check" title="{{localize 'ACKS.roll.morale'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
<div>
|
||||
<input type="text" name="data.details.morale" value="{{data.details.morale}}" />
|
||||
<input type="text" name="data.details.morale" value="{{data.data.details.morale}}" />
|
||||
<label>{{localize 'ACKS.details.morale'}}</label>
|
||||
</div>
|
||||
</li>
|
||||
<li class="flex2 check-field" data-stat="lr">
|
||||
<div class="check loyalty-check" title="{{localize 'ACKS.loyalty.check'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
<div class="attribute-value">
|
||||
<input name="data.retainer.loyalty" type="text" value="{{data.retainer.loyalty}}" placeholder="Loyal" data-dtype="String" />
|
||||
<input name="data.retainer.loyalty" type="text" value="{{data.data.retainer.loyalty}}" placeholder="Loyal" data-dtype="String" />
|
||||
<label>{{localize 'ACKS.Loyalty'}}</label>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -41,21 +41,21 @@
|
|||
</ul>
|
||||
<ul class="summary flexrow">
|
||||
<li class="flex3">
|
||||
<input type="text" name="data.details.class" value="{{data.details.class}}" data-dtype="String"
|
||||
<input type="text" name="data.details.class" value="{{data.data.details.class}}" data-dtype="String"
|
||||
/>
|
||||
<label>{{localize 'ACKS.details.class'}}</label>
|
||||
</li>
|
||||
<li class="{{#if (gt data.details.xp.value data.details.xp.next)}}notify{{/if}}">
|
||||
<input type="text" name="data.details.level" value="{{data.details.level}}" data-dtype="Number"
|
||||
<li class="{{#if (gt data.data.details.xp.value data.data.details.xp.next)}}notify{{/if}}">
|
||||
<input type="text" name="data.details.level" value="{{data.data.details.level}}" data-dtype="Number"
|
||||
/>
|
||||
<label>{{localize 'ACKS.details.level'}}</label>
|
||||
</li>
|
||||
<li class="flex2">
|
||||
<input type="text" name="data.details.xp.value" value="{{data.details.xp.value}}" data-dtype="Number"
|
||||
<input type="text" name="data.details.xp.value" value="{{data.data.details.xp.value}}" data-dtype="Number"
|
||||
/>
|
||||
<label>{{localize 'ACKS.details.experience.base'}}</label>
|
||||
{{#if data.details.xp.bonus}}
|
||||
<span class="xp-bonus">+{{data.details.xp.bonus}}%</span>
|
||||
{{#if data.data.details.xp.bonus}}
|
||||
<span class="xp-bonus">+{{data.data.details.xp.bonus}}%</span>
|
||||
{{/if}}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
{{#each item.data.tags as |tag|}}
|
||||
{{#unless (getTagIcon tag.value)}}
|
||||
<span title="{{tag.title}}">{{tag.value}}{{#unless @last}},{{/unless}}</span>
|
||||
|
||||
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
@ -155,7 +153,7 @@
|
|||
<li class="item-titles flexrow">
|
||||
<div class="item-caret"><i class="fas fa-caret-down"></i></div>
|
||||
<div class="item-name">{{localize "ACKS.items.Treasure"}}</div>
|
||||
<div class="field-long">{{roundTreas data.treasure}} <i class="fas fa-circle"></i></div>
|
||||
<div class="field-long">{{roundTreas data.data.treasure}} <i class="fas fa-circle"></i></div>
|
||||
<div class="field-short"><i class="fas fa-hashtag"></i></div>
|
||||
<div class="field-short"><i class="fas fa-weight-hanging"></i></div>
|
||||
<div class="item-controls">
|
||||
|
@ -198,7 +196,7 @@
|
|||
</div>
|
||||
</section>
|
||||
<section>
|
||||
{{#with data.encumbrance}}
|
||||
{{#with data.data.encumbrance}}
|
||||
<div class="encumbrance {{#if encumbered}}encumbered{{/if}}">
|
||||
<span class="encumbrance-bar" style="width:{{pct}}%"></span>
|
||||
<span class="encumbrance-label">{{value}} / {{max}}</span>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<ol>
|
||||
{{#each data.languages.value as |lang|}}
|
||||
{{#each data.data.languages.value as |lang|}}
|
||||
<li class="item flexrow" data-lang="{{lang}}">
|
||||
<div class="item-name">
|
||||
{{lang}}
|
||||
|
@ -28,7 +28,7 @@
|
|||
<div class="flex3 description">
|
||||
<div class="item-titles">{{localize "ACKS.category.description"}}</div>
|
||||
<div>
|
||||
{{editor content=data.details.description target="data.details.description"
|
||||
{{editor content=data.data.details.description target="data.details.description"
|
||||
button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<div class="inventory notes">
|
||||
<div class="item-titles">{{localize "ACKS.category.notes"}}</div>
|
||||
<div class="resizable-editor" data-editor-size="140">
|
||||
{{editor content=data.details.notes target="data.details.notes"
|
||||
{{editor content=data.data.details.notes target="data.details.notes"
|
||||
button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="field-short">{{localize 'ACKS.spells.Slots'}}</div>
|
||||
<div class="field-long flexrow">
|
||||
<input type="text" value="{{lookup @root.slots.used @key}}" name="data.spells.{{id}}.value" data-dtype="Number"
|
||||
placeholder="0" disabled>/<input type="text" value="{{lookup (lookup ../actor.data.spells @key) 'max'}}"
|
||||
placeholder="0" disabled>/<input type="text" value="{{lookup (lookup ../actor.data.data.spells @key) 'max'}}"
|
||||
name="data.spells.{{id}}.max" data-dtype="Number" placeholder="0"></div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-create" data-type="spell" data-lvl="{{id}}" title="{{localize 'ACKS.Add'}}"><i
|
||||
|
@ -35,7 +35,7 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="field-short memorize flexrow">
|
||||
<input type="text" value="{{item.data.cast}}" data-dtype="Number" placeholder="0" data-field="cast"
|
||||
<input type="text" value="{{item.data.data.cast}}" data-dtype="Number" placeholder="0" data-field="cast"
|
||||
title="{{localize 'ACKS.spells.Cast'}}"></div>
|
||||
<div class="item-controls">
|
||||
{{#if ../../owner}}
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
<h4 class="attribute-name box-title" title="{{localize 'ACKS.Health'}}">{{ localize "ACKS.HealthShort" }}
|
||||
<a class="hp-roll"><i class="fas fa-dice"></i></a></h4>
|
||||
<div class="attribute-value flexrow">
|
||||
<input name="data.hp.value" type="text" value="{{data.hp.value}}" data-dtype="Number"
|
||||
<input name="data.hp.value" type="text" value="{{data.data.hp.value}}" data-dtype="Number"
|
||||
placeholder="0" />
|
||||
<span class="sep"> / </span>
|
||||
<input name="data.hp.max" type="text" value="{{data.hp.max}}" data-dtype="Number" placeholder="0" />
|
||||
<input name="data.hp.max" type="text" value="{{data.data.hp.max}}" data-dtype="Number" placeholder="0" />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute hit-dice">
|
||||
|
@ -16,7 +16,7 @@
|
|||
<a>{{ localize "ACKS.HitDiceShort" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.hp.hd" type="text" value="{{data.hp.hd}}" data-dtype="String" />
|
||||
<input name="data.hp.hd" type="text" value="{{data.data.hp.hd}}" data-dtype="String" />
|
||||
</div>
|
||||
</li>
|
||||
<li class="attribute">
|
||||
|
@ -24,14 +24,14 @@
|
|||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.ArmorClass' }}">
|
||||
{{ localize "ACKS.AscArmorClassShort" }}</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.aac.value" type="text" value="{{data.aac.value}}" data-dtype="Number"
|
||||
<input name="data.aac.value" type="text" value="{{data.data.aac.value}}" data-dtype="Number"
|
||||
placeholder="10" data-dtype="Number" />
|
||||
</div>
|
||||
{{else}}
|
||||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.ArmorClass' }}">
|
||||
{{ localize "ACKS.ArmorClassShort" }}</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.ac.value" type="text" value="{{data.ac.value}}" data-dtype="Number"
|
||||
<input name="data.ac.value" type="text" value="{{data.data.ac.value}}" data-dtype="Number"
|
||||
placeholder="9" data-dtype="Number" />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -41,25 +41,25 @@
|
|||
<h4 class="attribute-name box-title" title="{{localize 'ACKS.AB'}}"><a>{{ localize "ACKS.ABShort" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.thac0.throw" type="text" value="{{data.thac0.throw}}" placeholder=""
|
||||
<input name="data.thac0.throw" type="text" value="{{data.data.thac0.throw}}" placeholder=""
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
{{else}}
|
||||
<h4 class="attribute-name box-title" title="{{localize 'ACKS.Thac0'}}"><a>{{ localize "ACKS.Thac0" }}</a>
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.thac0.value" type="text" value="{{data.thac0.value}}" placeholder="0"
|
||||
<input name="data.thac0.value" type="text" value="{{data.data.thac0.value}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{#if data.retainer.enabled}}
|
||||
{{#if data.data.retainer.enabled}}
|
||||
<li class="attribute">
|
||||
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.Loyalty' }}">
|
||||
{{ localize "ACKS.LoyaltyShort" }}
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.retainer.loyalty" type="text" value="{{data.retainer.loyalty}}" placeholder="0"
|
||||
<input name="data.retainer.loyalty" type="text" value="{{data.data.retainer.loyalty}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -69,7 +69,7 @@
|
|||
{{ localize "ACKS.movement.short" }}
|
||||
</h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.movement.base" type="text" value="{{data.movement.base}}" placeholder="0"
|
||||
<input name="data.movement.base" type="text" value="{{data.data.movement.base}}" placeholder="0"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
</li>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<li class="item-entry">
|
||||
<div class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-pattern" title="{{localize 'ACKS.items.pattern'}}" style="background:linear-gradient(0.25turn, {{item.data.pattern}}, transparent)"></div>
|
||||
<div class="item-name {{#if item.data.roll}}item-rollable{{/if}} flexrow">
|
||||
<div class="item-name {{#if item.data.data.roll}}item-rollable{{/if}} flexrow">
|
||||
<div class="item-image" style="background-image: url({{item.img}})"></div>
|
||||
<h4 title="{{item.name}}">
|
||||
{{item.name~}}
|
||||
|
@ -157,7 +157,7 @@
|
|||
<li class="attacks-description">
|
||||
{{#unless isNew}}
|
||||
<label>{{ localize "ACKS.movement.details" }}</label>
|
||||
<input name="data.movement.value" type="text" value="{{data.movement.value}}" data-dtype="String" />
|
||||
<input name="data.movement.value" type="text" value="{{data.data.movement.value}}" data-dtype="String" />
|
||||
{{else}}
|
||||
<button data-action="generate-saves">{{localize "ACKS.dialog.generateSaves"}}</button>
|
||||
{{/unless}}
|
||||
|
@ -166,35 +166,35 @@
|
|||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.death.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.death.value" type="text" value="{{data.saves.death.value}}"
|
||||
<input name="data.saves.death.value" type="text" value="{{data.data.saves.death.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="wand">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.wand.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.wand.value" type="text" value="{{data.saves.wand.value}}"
|
||||
<input name="data.saves.wand.value" type="text" value="{{data.data.saves.wand.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="paralysis">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.paralysis.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.paralysis.value" type="text" value="{{data.saves.paralysis.value}}"
|
||||
<input name="data.saves.paralysis.value" type="text" value="{{data.data.saves.paralysis.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="breath">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.breath.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.breath.value" type="text" value="{{data.saves.breath.value}}"
|
||||
<input name="data.saves.breath.value" type="text" value="{{data.data.saves.breath.value}}"
|
||||
placeholder="0" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="attribute saving-throw" data-save="spell">
|
||||
<h4 class="attribute-name box-title">
|
||||
<a>{{ localize "ACKS.saves.spell.long" }}</a></h4>
|
||||
<div class="attribute-value">
|
||||
<input name="data.saves.spell.value" type="text" value="{{data.saves.spell.value}}"
|
||||
<input name="data.saves.spell.value" type="text" value="{{data.data.saves.spell.value}}"
|
||||
placeholder="0" />
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -6,26 +6,26 @@
|
|||
<ul class="summary flexrow">
|
||||
<li class="flex2 flexrow check-field">
|
||||
<div>
|
||||
<input type="text" name="data.details.alignment" value="{{data.details.alignment}}" />
|
||||
<input type="text" name="data.details.alignment" value="{{data.data.details.alignment}}" />
|
||||
<label>{{localize 'ACKS.details.alignment'}}</label>
|
||||
</div>
|
||||
<div class="check reaction-check" title="{{localize 'ACKS.roll.reaction'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
</li>
|
||||
<li class="flexrow check-field" data-check="dungeon">
|
||||
<div>
|
||||
<input type="text" name="data.details.appearing.d" value="{{data.details.appearing.d}}" />
|
||||
<input type="text" name="data.details.appearing.d" value="{{data.data.details.appearing.d}}" />
|
||||
<label>{{localize 'ACKS.details.appearing'}}</label>
|
||||
</div>
|
||||
<div class="check appearing-check" title="{{localize 'ACKS.roll.appearing'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
</li>
|
||||
<li class="flexrow check-field" data-check="wilderness">
|
||||
(<div><input type="text" name="data.details.appearing.w" value="{{data.details.appearing.w}}" /></div>)
|
||||
(<div><input type="text" name="data.details.appearing.w" value="{{data.data.details.appearing.w}}" /></div>)
|
||||
<div class="check appearing-check" title="{{localize 'ACKS.roll.appearing'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
</li>
|
||||
{{#if config.morale}}
|
||||
<li class="flexrow check-field">
|
||||
<div>
|
||||
<input type="text" name="data.details.morale" value="{{data.details.morale}}" />
|
||||
<input type="text" name="data.details.morale" value="{{data.data.details.morale}}" />
|
||||
<label>{{localize 'ACKS.details.morale'}}</label>
|
||||
</div>
|
||||
<div class="check morale-check" title="{{localize 'ACKS.roll.morale'}}"><a><i class="fas fa-dice"></i></a></div>
|
||||
|
@ -34,11 +34,11 @@
|
|||
</ul>
|
||||
<ul class="summary flexrow">
|
||||
<li>
|
||||
<input type="text" name="data.details.xp" value="{{data.details.xp}}" />
|
||||
<input type="text" name="data.details.xp" value="{{data.data.details.xp}}" />
|
||||
<label>{{localize 'ACKS.details.experience.award'}}</label>
|
||||
</li>
|
||||
<li class="treasure-table" title="{{localize 'ACKS.details.treasureTableHint'}}">
|
||||
<div>{{{data.details.treasure.link}}}</div>
|
||||
<div>{{{data.data.details.treasure.link}}}</div>
|
||||
<label>{{localize 'ACKS.details.treasure'}}</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
<ol class="actor-list">
|
||||
{{#each data.entities as |e|}} {{#if e.data.flags.acks.party}}
|
||||
<li class="actor flexrow" data-actor-id="{{e.id}}">
|
||||
{{#each data.documents as |actor|}} {{#if actor.data.flags.acks.party}}
|
||||
<li class="actor flexrow" data-actor-id="{{actor.id}}">
|
||||
<div class="field-img">
|
||||
<img src="{{e.img}}" />
|
||||
<img src="{{actor.img}}" />
|
||||
<div class="img-btns flexrow">
|
||||
<button type="button" data-action="open-sheet"><i class="fas fa-user"></i></button>
|
||||
</div>
|
||||
|
@ -26,17 +26,17 @@
|
|||
<div class="fields">
|
||||
<div class="flexrow field-row">
|
||||
<div class="field-name flex2">
|
||||
<strong>{{e.name}}</strong>
|
||||
<strong>{{actor.name}}</strong>
|
||||
</div>
|
||||
<div class="field-long" title="{{localize 'ACKS.Health'}}">
|
||||
<i class="fas fa-heart"></i>
|
||||
{{e.data.data.hp.value}}/{{e.data.data.hp.max}}
|
||||
{{actor.data.data.hp.value}}/{{actor.data.data.hp.max}}
|
||||
</div>
|
||||
<div class="field-short" title="{{localize 'ACKS.ArmorClass'}}">
|
||||
<i class="fas fa-shield-alt"></i>
|
||||
{{#if @root.settings.ascending}}<strong>{{e.data.data.aac.value}}</strong>
|
||||
<sub>{{e.data.data.aac.naked}}</sub>
|
||||
{{else}}<strong>{{e.data.data.ac.value}}</strong> <sub>{{e.data.data.ac.naked}}</sub>
|
||||
{{#if @root.settings.ascending}}<strong>{{actor.data.data.aac.value}}</strong>
|
||||
<sub>{{actor.data.data.aac.naked}}</sub>
|
||||
{{else}}<strong>{{actor.data.data.ac.value}}</strong> <sub>{{actor.data.data.ac.naked}}</sub>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,40 +44,40 @@
|
|||
<div class="field-short" title="{{localize 'ACKS.Thac0'}}">
|
||||
<i class="fas fa-crosshairs"></i>
|
||||
{{#unless @root.settings.ascending}}
|
||||
{{e.data.data.thac0.value}}
|
||||
{{actor.data.data.thac0.value}}
|
||||
{{else}}
|
||||
{{e.data.data.thac0.throw}}
|
||||
{{actor.data.data.thac0.throw}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{#if (eq e.data.type 'character')}}
|
||||
{{#if (eq actor.data.type 'character')}}
|
||||
<div class="field-short" title="{{localize 'ACKS.Melee'}}">
|
||||
<i class="fas fa-fist-raised"></i>
|
||||
{{add e.data.data.scores.str.mod e.data.data.thac0.mod.melee}}
|
||||
{{add actor.data.data.scores.str.mod actor.data.data.thac0.mod.melee}}
|
||||
</div>
|
||||
<div class="field-short" title="{{localize 'ACKS.Missile'}}">
|
||||
<i class="fas fa-bullseye"></i>
|
||||
{{add e.data.data.scores.dex.mod e.data.data.thac0.mod.missile}}
|
||||
{{add actor.data.data.scores.dex.mod actor.data.data.thac0.mod.missile}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="field-short flex2">
|
||||
<i class="fas fa-shoe-prints" title="{{localize 'ACKS.movement.base'}}"></i>
|
||||
<span title="{{localize 'ACKS.movement.encounter.long'}}">{{e.data.data.movement.encounter}}</span> <sub
|
||||
title="{{localize 'ACKS.movement.exploration.long'}}">{{e.data.data.movement.base}}</sub>
|
||||
<span title="{{localize 'ACKS.movement.encounter.long'}}">{{actor.data.data.movement.encounter}}</span> <sub
|
||||
title="{{localize 'ACKS.movement.exploration.long'}}">{{actor.data.data.movement.base}}</sub>
|
||||
</div>
|
||||
{{#if (eq e.data.type 'character')}}
|
||||
{{#if (eq actor.data.type 'character')}}
|
||||
<div class="field-short flex2">
|
||||
<i class="fas fa-weight-hanging" title="{{localize 'ACKS.Encumbrance'}}"></i>
|
||||
{{roundWeight e.data.data.encumbrance.value}}k
|
||||
{{roundWeight actor.data.data.encumbrance.value}}k
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="flexrow field-row">
|
||||
<div class="field-longer flexrow">
|
||||
{{#each e.data.data.saves as |s i|}}
|
||||
{{#each actor.data.data.saves as |s i|}}
|
||||
<span title="{{lookup @root.config.saves_long i}}">{{lookup @root.config.saves_short i}} {{s.value}}</span>
|
||||
{{/each}}
|
||||
{{#if (eq e.data.type 'character')}}<span><i class="fas fa-magic"
|
||||
title="{{localize 'ACKS.saves.magic.long'}}"></i>{{mod e.data.data.scores.wis.mod}}</span>{{/if}}
|
||||
{{#if (eq actor.data.type 'character')}}<span><i class="fas fa-magic"
|
||||
title="{{localize 'ACKS.saves.magic.long'}}"></i>{{mod actor.data.data.scores.wis.mod}}</span>{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="acks chat-card item-card" data-actor-id="{{actor._id}}" data-item-id="{{item._id}}"
|
||||
<div class="acks chat-card item-card" data-actor-id="{{actor.id}}" data-item-id="{{item._id}}"
|
||||
{{#if tokenId}}data-token-id="{{tokenId}}" {{/if}}>
|
||||
<header class="card-header flexrow">
|
||||
<img src="{{item.img}}" title="{{item.name}}" width="36" height="36" />
|
||||
|
|
|
@ -13,20 +13,20 @@
|
|||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.abilities.Requirements'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.requirements" value="{{data.requirements}}" data-dtype="String" />
|
||||
<input type="text" name="data.requirements" value="{{data.data.requirements}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.items.Roll'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.roll" value="{{data.roll}}" data-dtype="String" />
|
||||
<input type="text" name="data.roll" value="{{data.data.roll}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.RollType'}}</label>
|
||||
<div class="form-fields">
|
||||
<select name="data.rollType">
|
||||
{{#select data.rollType}}
|
||||
{{#select data.data.rollType}}
|
||||
{{#each config.roll_type as |t a|}}
|
||||
<option value="{{a}}">{{t}}</option>
|
||||
{{/each}}
|
||||
|
@ -37,20 +37,20 @@
|
|||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.RollTarget'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.rollTarget" value="{{data.rollTarget}}" data-dtype="Number" />
|
||||
<input type="text" name="data.rollTarget" value="{{data.data.rollTarget}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.BlindRoll'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="checkbox" name="data.blindroll" value="{{data.blindroll}}" {{checked data.blindroll}} data-dtype="Number"/>
|
||||
<input type="checkbox" name="data.blindroll" value="{{data.data.blindroll}}" {{checked data.data.blindroll}} data-dtype="Number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.spells.Save'}}</label>
|
||||
<div class="form-fields">
|
||||
<select name="data.save">
|
||||
{{#select data.save}}
|
||||
{{#select data.data.save}}
|
||||
<option value=""></option>
|
||||
{{#each config.saves_short as |save a|}}
|
||||
<option value="{{a}}">{{save}}</option>
|
||||
|
@ -61,7 +61,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{editor content=data.description target="data.description" button=true
|
||||
{{editor content=data.data.description target="data.description" button=true
|
||||
owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.ArmorAAC'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.aac.value" value="{{data.aac.value}}" data-dtype="Number" />
|
||||
<input type="text" name="data.aac.value" value="{{data.data.aac.value}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.armor.type'}}</label>
|
||||
<div class="form-fields">
|
||||
<select name="data.type">
|
||||
{{#select data.type}}
|
||||
{{#select data.data.type}}
|
||||
<option value=""></option>
|
||||
{{#each config.armor as |armor a|}}
|
||||
<option value="{{a}}">{{armor}}</option>
|
||||
|
@ -32,18 +32,18 @@
|
|||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Cost'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number" />
|
||||
<input type="text" name="data.cost" value="{{data.data.cost}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Weight'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
|
||||
<input type="text" name="data.weight" value="{{data.data.weight}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{editor content=data.description target="data.description" button=true
|
||||
{{editor content=data.data.description target="data.description" button=true
|
||||
owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,30 +13,30 @@
|
|||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Quantity'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.quantity.value" value="{{data.quantity.value}}" data-dtype="Number" />/<input type="text" name="data.quantity.max" value="{{data.quantity.max}}" data-dtype="Number" />
|
||||
<input type="text" name="data.quantity.value" value="{{data.data.quantity.value}}" data-dtype="Number" />/<input type="text" name="data.quantity.max" value="{{data.data.quantity.max}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Treasure'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="checkbox" name="data.treasure" value="{{data.treasure}}" {{checked data.treasure}} data-dtype="Boolean"/>
|
||||
<input type="checkbox" name="data.treasure" value="{{data.data.treasure}}" {{checked data.data.treasure}} data-dtype="Boolean"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Cost'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number" />
|
||||
<input type="text" name="data.cost" value="{{data.data.cost}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.items.Weight'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
|
||||
<input type="text" name="data.weight" value="{{data.data.weight}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="description weapon-editor">
|
||||
{{editor content=data.description target="data.description" button=true
|
||||
{{editor content=data.data.description target="data.description" button=true
|
||||
owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,32 +13,32 @@
|
|||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.spells.Level'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.lvl" value="{{data.lvl}}" data-dtype="Number" />
|
||||
<input type="text" name="data.lvl" value="{{data.data.lvl}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.spells.Class'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.class" value="{{data.class}}" data-dtype="String" />
|
||||
<input type="text" name="data.class" value="{{data.data.class}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.spells.Duration'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.duration" value="{{data.duration}}" data-dtype="String" />
|
||||
<input type="text" name="data.duration" value="{{data.data.duration}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.spells.Range'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.range" value="{{data.range}}" data-dtype="String" />
|
||||
<input type="text" name="data.range" value="{{data.data.range}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize 'ACKS.spells.Save'}}</label>
|
||||
<div class="form-fields">
|
||||
<select name="data.save">
|
||||
{{#select data.save}}
|
||||
{{#select data.data.save}}
|
||||
<option value=""></option>
|
||||
{{#each config.saves_short as |save a|}}
|
||||
<option value="{{a}}">{{save}}</option>
|
||||
|
@ -50,12 +50,12 @@
|
|||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.items.Roll'}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="data.roll" value="{{data.roll}}" data-dtype="String" />
|
||||
<input type="text" name="data.roll" value="{{data.data.roll}}" data-dtype="String" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{editor content=data.description target="data.description" button=true
|
||||
{{editor content=data.data.description target="data.description" button=true
|
||||
owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<input
|
||||
type="text"
|
||||
name="data.cost"
|
||||
value="{{data.cost}}"
|
||||
value="{{data.data.cost}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
</div>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<input
|
||||
type="text"
|
||||
name="data.weight"
|
||||
value="{{data.weight}}"
|
||||
value="{{data.data.weight}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
</div>
|
||||
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<ol class="tag-list">
|
||||
{{#each data.tags as |tag|}}
|
||||
{{#each data.data.tags as |tag|}}
|
||||
<li class="tag" title="{{tag.title}}" data-tag="{{tag.value}}">
|
||||
<span>{{tag.value}}</span>
|
||||
<a class="tag-delete"><i class="fas fa-times"></i></a>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<input
|
||||
type="text"
|
||||
name="data.damage"
|
||||
value="{{data.damage}}"
|
||||
value="{{data.data.damage}}"
|
||||
data-dtype="String"
|
||||
/>
|
||||
</div>
|
||||
|
@ -84,39 +84,39 @@
|
|||
<input
|
||||
type="text"
|
||||
name="data.bonus"
|
||||
value="{{data.bonus}}"
|
||||
value="{{data.data.bonus}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group attack-type">
|
||||
<a title="{{localize 'ACKS.items.Melee'}}" class="melee-toggle {{#if
|
||||
data.melee}}active{{/if}}"><i class="fas fa-fist-raised"></i></a>
|
||||
data.data.melee}}active{{/if}}"><i class="fas fa-fist-raised"></i></a>
|
||||
<a title="{{localize 'ACKS.items.Missile'}}" class="missile-toggle
|
||||
{{#if data.missile}}active{{/if}}"><i class="fas fa-bullseye"></i></a>
|
||||
{{#if data.data.missile}}active{{/if}}"><i class="fas fa-bullseye"></i></a>
|
||||
</div>
|
||||
{{#if data.missile}}
|
||||
{{#if data.data.missile}}
|
||||
<div class="form-group block-input">
|
||||
<label>{{localize 'ACKS.items.Range'}}</label>
|
||||
<div class="form-fields range">
|
||||
<input
|
||||
type="text"
|
||||
name="data.range.short"
|
||||
value="{{data.range.short}}"
|
||||
value="{{data.data.range.short}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
<div class="sep"></div>
|
||||
<input
|
||||
type="text"
|
||||
name="data.range.medium"
|
||||
value="{{data.range.medium}}"
|
||||
value="{{data.data.range.medium}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
<div class="sep"></div>
|
||||
<input
|
||||
type="text"
|
||||
name="data.range.long"
|
||||
value="{{data.range.long}}"
|
||||
value="{{data.data.range.long}}"
|
||||
data-dtype="Number"
|
||||
/>
|
||||
</div>
|
||||
|
@ -126,7 +126,7 @@
|
|||
<label>{{localize 'ACKS.spells.Save'}}</label>
|
||||
<div class="form-fields">
|
||||
<select name="data.save">
|
||||
{{#select data.save}}
|
||||
{{#select data.data.save}}
|
||||
<option value=""></option>
|
||||
{{#each config.saves_short as |save a|}}
|
||||
<option value="{{a}}">{{save}}</option>
|
||||
|
@ -141,16 +141,16 @@
|
|||
<input
|
||||
type="checkbox"
|
||||
name="data.slow"
|
||||
value="{{data.slow}}"
|
||||
value="{{data.data.slow}}"
|
||||
{{checked
|
||||
data.slow}}
|
||||
data.data.slow}}
|
||||
data-dtype="Number"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="description weapon-editor">
|
||||
{{editor content=data.description target="data.description" button=true
|
||||
{{editor content=data.data.description target="data.description" button=true
|
||||
owner=owner editable=editable}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue