Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31573bd522 | |||
| abea77906d |
@@ -4102,6 +4102,109 @@ i.prismrpg {
|
|||||||
font-family: var(--font-secondary);
|
font-family: var(--font-secondary);
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
font-size: calc(var(--font-size-standard) * 1.2);
|
||||||
}
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card {
|
||||||
|
font-family: var(--font-primary);
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
margin: 2px 0;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
|
||||||
|
border-bottom: 1px solid #444;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.95em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #d4af37;
|
||||||
|
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
|
||||||
|
font-family: var(--font-secondary);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-header .item-type {
|
||||||
|
padding: 1px 6px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 0.65em;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-image {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6px;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-image img {
|
||||||
|
max-width: 50px;
|
||||||
|
max-height: 50px;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid rgba(212, 175, 55, 0.3);
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-image img:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-description {
|
||||||
|
padding: 6px 8px;
|
||||||
|
color: #000;
|
||||||
|
font-size: 0.8em;
|
||||||
|
line-height: 1.3;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-details {
|
||||||
|
padding: 6px 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 3px;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-details .item-detail {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px 6px;
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border-left: 2px solid rgba(212, 175, 55, 0.5);
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-details .item-detail strong {
|
||||||
|
color: #d4af37;
|
||||||
|
margin-right: 6px;
|
||||||
|
min-width: 90px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card .item-details .item-detail:nth-child(even) {
|
||||||
|
background: rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card.weapon-item .item-header {
|
||||||
|
background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card.armor-item .item-header {
|
||||||
|
background: linear-gradient(135deg, #4a5cf7 0%, #2c3e9e 100%);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card.spell-item .item-header {
|
||||||
|
background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card.skill-item .item-header {
|
||||||
|
background: linear-gradient(135deg, #16a085 0%, #0e6655 100%);
|
||||||
|
}
|
||||||
|
.chat-log .message-content .prismrpg-item-chat-card.equipment-item .item-header {
|
||||||
|
background: linear-gradient(135deg, #f39c12 0%, #b8730f 100%);
|
||||||
|
}
|
||||||
.application.dialog.prismrpg {
|
.application.dialog.prismrpg {
|
||||||
color: var(--color-dark-1);
|
color: var(--color-dark-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,104 +1,6 @@
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
export class PrismRPGCombatTracker extends foundry.applications.sidebar.tabs.CombatTracker {
|
|
||||||
|
|
||||||
static PARTS = {
|
|
||||||
"header": {
|
|
||||||
"template": "systems/fvtt-prism-rpg/templates/combat-tracker-header-v2.hbs"
|
|
||||||
},
|
|
||||||
"tracker": {
|
|
||||||
"template": "systems/fvtt-prism-rpg/templates/combat-tracker-v2.hbs"
|
|
||||||
},
|
|
||||||
"footer": {
|
|
||||||
"template": "systems/fvtt-prism-rpg/templates/combat-tracker-footer-v2.hbs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static DEFAULT_OPTIONS = foundry.utils.mergeObject(super.DEFAULT_OPTIONS, {
|
|
||||||
actions: {
|
|
||||||
initiativePlus: PrismRPGCombatTracker.#initiativePlus,
|
|
||||||
initiativeMinus: PrismRPGCombatTracker.#initiativeMinus,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
async _prepareContext(options) {
|
|
||||||
let data = await super._prepareContext(options);
|
|
||||||
console?.log("Combat Tracker Data", data);
|
|
||||||
/*for (let u of data.turns) {
|
|
||||||
let c = game.combat.combatants.get(u.id);
|
|
||||||
u.progressionCount = c.system.progressionCount
|
|
||||||
u.isMonster = c.actor.type === "monster"
|
|
||||||
}
|
|
||||||
console.log("Combat Data", data);*/
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static #initiativePlus(ev) {
|
|
||||||
ev.preventDefault();
|
|
||||||
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
|
||||||
let c = game.combat.combatants.get(cId);
|
|
||||||
c.update({ 'initiative': c.initiative + 1 });
|
|
||||||
console.log("Initiative Plus");
|
|
||||||
}
|
|
||||||
|
|
||||||
static #initiativeMinus(ev) {
|
|
||||||
ev.preventDefault();
|
|
||||||
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
|
||||||
let c = game.combat.combatants.get(cId);
|
|
||||||
let newInit = Math.max(c.initiative - 1, 0);
|
|
||||||
c.update({ 'initiative': newInit });
|
|
||||||
}
|
|
||||||
|
|
||||||
activateListeners(html) {
|
|
||||||
super.activateListeners(html);
|
|
||||||
// Display Combat settings
|
|
||||||
html.find(".initiative-plus").click(ev => {
|
|
||||||
ev.preventDefault();
|
|
||||||
let cId = ev.currentTarget.closest(".combatant").dataset.combatantId;
|
|
||||||
let c = game.combat.combatants.get(cId);
|
|
||||||
c.update({ 'initiative': c.initiative + 1 });
|
|
||||||
});
|
|
||||||
|
|
||||||
html.find(".initiative-minus").click(ev => {
|
|
||||||
ev.preventDefault();
|
|
||||||
let cId = ev.currentTarget.closest(".combatant").dataset.combatantId;
|
|
||||||
let c = game.combat.combatants.get(cId);
|
|
||||||
c.update({ 'initiative': c.initiative - 1 });
|
|
||||||
console.log("Initiative Minus");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static get defaultOptions() {
|
|
||||||
let path = "systems/fvtt-prism-rpg/templates/combat-tracker.hbs";
|
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
|
||||||
template: path,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PrismRPGCombat extends Combat {
|
export class PrismRPGCombat extends Combat {
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the Array of combatants sorted into initiative order, breaking ties alphabetically by name.
|
|
||||||
* @returns {Combatant[]}
|
|
||||||
*/
|
|
||||||
setupTurns() {
|
|
||||||
console?.log("Setup Turns....");
|
|
||||||
this.turns ||= [];
|
|
||||||
|
|
||||||
// Determine the turn order and the current turn
|
|
||||||
const turns = this.combatants.contents.sort(this.sortCombatantsLF);
|
|
||||||
if (this.turn !== null) this.turn = Math.clamp(this.turn, 0, turns.length - 1);
|
|
||||||
|
|
||||||
// Update state tracking
|
|
||||||
let c = turns[this.turn];
|
|
||||||
this.current = this._getCurrentState(c);
|
|
||||||
if (!this.previous) this.previous = this.current;
|
|
||||||
|
|
||||||
// Return the array of prepared turns
|
|
||||||
return this.turns = turns;
|
|
||||||
}
|
|
||||||
|
|
||||||
async rollInitiative(ids, options) {
|
async rollInitiative(ids, options) {
|
||||||
console.log("%%%%%%%%% Roll Initiative", ids, options);
|
console.log("%%%%%%%%% Roll Initiative", ids, options);
|
||||||
@@ -123,98 +25,5 @@ export class PrismRPGCombat extends Combat {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetProgression(cId) {
|
|
||||||
let c = this.combatants.get(cId);
|
|
||||||
c.update({ 'system.progressionCount': 0 });
|
|
||||||
}
|
|
||||||
|
|
||||||
setCasting(cId) {
|
|
||||||
let c = this.combatants.get(cId);
|
|
||||||
c.setFlag(SYSTEM.id, "casting", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
resetCasting(cId) {
|
|
||||||
let c = this.combatants.get(cId);
|
|
||||||
c.setFlag(SYSTEM.id, "casting", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
isCasting(cId) {
|
|
||||||
let c = this.combatants.get(cId);
|
|
||||||
return c.getFlag(SYSTEM.id, "casting");
|
|
||||||
}
|
|
||||||
|
|
||||||
async nextTurn() {
|
|
||||||
console.log("NEXT TURN");
|
|
||||||
|
|
||||||
let turn = this.turn ?? -1;
|
|
||||||
let skipDefeated = this.settings.skipDefeated;
|
|
||||||
|
|
||||||
// Determine the next turn number
|
|
||||||
let next = null;
|
|
||||||
for (let [i, t] of this.turns.entries()) {
|
|
||||||
console.log("Turn", t);
|
|
||||||
if (i <= turn) continue;
|
|
||||||
if (skipDefeated && t.isDefeated) continue;
|
|
||||||
next = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Maybe advance to the next round
|
|
||||||
let round = this.round;
|
|
||||||
if ((this.round === 0) || (next === null) || (next >= this.turns.length)) {
|
|
||||||
return this.nextRound();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the document, passing data through a hook first
|
|
||||||
const updateData = { round, turn: next };
|
|
||||||
const updateOptions = { advanceTime: CONFIG.time.turnTime, direction: 1 };
|
|
||||||
Hooks.callAll("combatTurn", this, updateData, updateOptions);
|
|
||||||
return this.update(updateData, updateOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
async nextRound() {
|
|
||||||
this.turnsDone = false
|
|
||||||
|
|
||||||
let turn = this.turn === null ? null : 0; // Preserve the fact that it's no-one's turn currently.
|
|
||||||
console.log("ROUND", this);
|
|
||||||
|
|
||||||
let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime;
|
|
||||||
advanceTime += CONFIG.time.roundTime;
|
|
||||||
let nextRound = this.round + 1;
|
|
||||||
|
|
||||||
let initOK = true;
|
|
||||||
for (let c of this.combatants) {
|
|
||||||
if (c.initiative === null) {
|
|
||||||
initOK = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!initOK) {
|
|
||||||
ui.notifications.error("All combatants must have initiative rolled before the round can advance.");
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let c of this.combatants) {
|
|
||||||
if (nextRound >= c.initiative) {
|
|
||||||
let user = game.users.find(u => u.active && u.character && u.character.id === c.actor.id);
|
|
||||||
if (user?.hasPlayerOwner) {
|
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollProgressionDice", progressionCount: c.system.progressionCount + 1, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
|
||||||
} else {
|
|
||||||
user = game.users.find(u => u.active && u.isGM);
|
|
||||||
c.actor.system.rollProgressionDice(this.id, c.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the document, passing data through a hook first
|
|
||||||
const updateData = { round: nextRound, turn };
|
|
||||||
const updateOptions = { advanceTime, direction: 1 };
|
|
||||||
Hooks.callAll("combatRound", this, updateData, updateOptions);
|
|
||||||
return this.update(updateData, updateOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sortCombatantsLF(a, b) {
|
|
||||||
return a.initiative - b.initiative;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,15 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
|||||||
rollInitiative: PrismRPGCharacterSheet.#onRollInitiative,
|
rollInitiative: PrismRPGCharacterSheet.#onRollInitiative,
|
||||||
armorHitPointsPlus: PrismRPGCharacterSheet.#onArmorHitPointsPlus,
|
armorHitPointsPlus: PrismRPGCharacterSheet.#onArmorHitPointsPlus,
|
||||||
armorHitPointsMinus: PrismRPGCharacterSheet.#onArmorHitPointsMinus,
|
armorHitPointsMinus: PrismRPGCharacterSheet.#onArmorHitPointsMinus,
|
||||||
|
armorPointsPlus: PrismRPGCharacterSheet.#onArmorPointsPlus,
|
||||||
|
armorPointsMinus: PrismRPGCharacterSheet.#onArmorPointsMinus,
|
||||||
|
actionPointsPlus: PrismRPGCharacterSheet.#onActionPointsPlus,
|
||||||
|
actionPointsMinus: PrismRPGCharacterSheet.#onActionPointsMinus,
|
||||||
manaPointsPlus: PrismRPGCharacterSheet.#onManaPointsPlus,
|
manaPointsPlus: PrismRPGCharacterSheet.#onManaPointsPlus,
|
||||||
manaPointsMinus: PrismRPGCharacterSheet.#onManaPointsMinus,
|
manaPointsMinus: PrismRPGCharacterSheet.#onManaPointsMinus,
|
||||||
hpPlus: PrismRPGCharacterSheet.#onHpPlus,
|
hpPlus: PrismRPGCharacterSheet.#onHpPlus,
|
||||||
hpMinus: PrismRPGCharacterSheet.#onHpMinus,
|
hpMinus: PrismRPGCharacterSheet.#onHpMinus,
|
||||||
|
postItemToChat: PrismRPGCharacterSheet.#onPostItemToChat,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,43 +163,215 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
|||||||
await this.document.system.rollInitiative()
|
await this.document.system.rollInitiative()
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onArmorHitPointsPlus(event, target) {
|
static async #onArmorHitPointsPlus(event, target) {
|
||||||
let armorHP = this.actor.system.combat.armorHitPoints
|
let armorHP = this.actor.system.combat.armorHitPoints
|
||||||
armorHP += 1
|
armorHP += 1
|
||||||
this.actor.update({ "system.combat.armorHitPoints": armorHP })
|
this.actor.update({ "system.combat.armorHitPoints": armorHP })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onArmorHitPointsMinus(event, target) {
|
static async #onArmorHitPointsMinus(event, target) {
|
||||||
let armorHP = this.actor.system.combat.armorHitPoints
|
let armorHP = this.actor.system.combat.armorHitPoints
|
||||||
armorHP -= 1
|
armorHP -= 1
|
||||||
this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
|
this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onManaPointsPlus(event, target) {
|
static async #onManaPointsPlus(event, target) {
|
||||||
let mana = this.actor.system.manaPoints.value
|
let mana = this.actor.system.manaPoints.value
|
||||||
mana += 1
|
mana += 1
|
||||||
this.actor.update({ "system.manaPoints.value": Math.min(mana, this.actor.system.manaPoints.max) })
|
this.actor.update({ "system.manaPoints.value": Math.min(mana, this.actor.system.manaPoints.max) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onManaPointsMinus(event, target) {
|
static async #onManaPointsMinus(event, target) {
|
||||||
let mana = this.actor.system.manaPoints.value
|
let mana = this.actor.system.manaPoints.value
|
||||||
mana -= 1
|
mana -= 1
|
||||||
this.actor.update({ "system.manaPoints.value": Math.max(mana, 0) })
|
this.actor.update({ "system.manaPoints.value": Math.max(mana, 0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onHpPlus(event, target) {
|
static async #onArmorPointsPlus(event, target) {
|
||||||
|
let armor = this.actor.system.armorPoints.value
|
||||||
|
armor += 1
|
||||||
|
this.actor.update({ "system.armorPoints.value": Math.min(armor, this.actor.system.armorPoints.max) })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #onArmorPointsMinus(event, target) {
|
||||||
|
let armor = this.actor.system.armorPoints.value
|
||||||
|
armor -= 1
|
||||||
|
this.actor.update({ "system.armorPoints.value": Math.max(armor, 0) })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async#onActionPointsPlus(event, target) {
|
||||||
|
let actionPoints = this.actor.system.actionPoints.value
|
||||||
|
actionPoints += 1
|
||||||
|
this.actor.update({ "system.actionPoints.value": Math.min(actionPoints, this.actor.system.actionPoints.max) })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async#onActionPointsMinus(event, target) {
|
||||||
|
let actionPoints = this.actor.system.actionPoints.value
|
||||||
|
actionPoints -= 1
|
||||||
|
this.actor.update({ "system.actionPoints.value": Math.max(actionPoints, 0) })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async#onHpPlus(event, target) {
|
||||||
let hp = this.actor.system.hp.value
|
let hp = this.actor.system.hp.value
|
||||||
hp += 1
|
hp += 1
|
||||||
this.actor.update({ "system.hp.value": Math.min(hp, this.actor.system.hp.max) })
|
this.actor.update({ "system.hp.value": Math.min(hp, this.actor.system.hp.max) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onHpMinus(event, target) {
|
static async#onHpMinus(event, target) {
|
||||||
let hp = this.actor.system.hp.value
|
let hp = this.actor.system.hp.value
|
||||||
hp -= 1
|
hp -= 1
|
||||||
this.actor.update({ "system.hp.value": Math.max(hp, 0) })
|
this.actor.update({ "system.hp.value": Math.max(hp, 0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onCreateEquipment(event, target) {
|
static async #onCreateEquipment(event, target) {
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #onPostItemToChat(event, target) {
|
||||||
|
console.log("PRISM RPG | PostItemToChat action triggered", { event: event, target: target })
|
||||||
|
|
||||||
|
// Try to find the item element from the clicked target or its parents
|
||||||
|
let itemElement = null
|
||||||
|
|
||||||
|
// First try with the target (the actual clicked element)
|
||||||
|
if (event.target) {
|
||||||
|
itemElement = event.target.closest('[data-item-id]')
|
||||||
|
}
|
||||||
|
|
||||||
|
// If not found, try with currentTarget (the element with the action)
|
||||||
|
if (!itemElement && event.currentTarget) {
|
||||||
|
itemElement = event.currentTarget.closest('[data-item-id]')
|
||||||
|
}
|
||||||
|
|
||||||
|
// If still not found, try with the target parameter
|
||||||
|
if (!itemElement && target) {
|
||||||
|
itemElement = target.closest('[data-item-id]')
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("PRISM RPG | Found item element", { itemElement: itemElement })
|
||||||
|
|
||||||
|
if (!itemElement) {
|
||||||
|
console.warn("PRISM RPG | Could not find item element for posting to chat")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemId = itemElement.dataset.itemId
|
||||||
|
|
||||||
|
if (!itemId) {
|
||||||
|
console.warn("PRISM RPG | Item ID not found for posting to chat")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const item = this.actor.items.get(itemId)
|
||||||
|
|
||||||
|
if (!item) {
|
||||||
|
console.warn("PRISM RPG | Item not found for posting to chat", { itemId: itemId })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a chat message with the item data
|
||||||
|
const speaker = ChatMessage.getSpeaker({ actor: this.actor })
|
||||||
|
const content = await this.formatItemForChat(item)
|
||||||
|
|
||||||
|
await ChatMessage.create({
|
||||||
|
content: content,
|
||||||
|
speaker: speaker,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async formatItemForChat(item) {
|
||||||
|
// Format the item data for chat display
|
||||||
|
const itemTypeClass = `${item.type}-item`
|
||||||
|
let htmlContent = `
|
||||||
|
<div class="prismrpg-item-chat-card ${itemTypeClass}">
|
||||||
|
<div class="item-header">
|
||||||
|
<h3>${item.name}</h3>
|
||||||
|
<span class="item-type">${game.i18n.localize(`TYPES.Item.${item.type}`) || item.type}</span>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
// Add item image if available
|
||||||
|
if (item.img && !item.img.includes('icons/svg/mystery-man.svg')) {
|
||||||
|
htmlContent += `<div class="item-image"><img src="${item.img}" alt="${item.name}"></div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add item description if available
|
||||||
|
if (item.system.description && item.system.description.trim() !== '') {
|
||||||
|
const enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.system.description, { async: true })
|
||||||
|
htmlContent += `<div class="item-description">${enrichedDescription}</div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add specific item data based on item type
|
||||||
|
htmlContent += `<div class="item-details">`
|
||||||
|
|
||||||
|
switch (item.type) {
|
||||||
|
case 'weapon':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Type:</strong> ${item.system.weaponType || 'Unknown'}</div>
|
||||||
|
<div class="item-detail"><strong>Damage:</strong> ${item.system.damage || 'N/A'}</div>
|
||||||
|
<div class="item-detail"><strong>APC:</strong> ${item.system.apc || 0}</div>
|
||||||
|
`
|
||||||
|
if (item.system.damageType) {
|
||||||
|
const damageTypes = []
|
||||||
|
if (item.system.damageType.piercing) damageTypes.push('Piercing')
|
||||||
|
if (item.system.damageType.bludgeoning) damageTypes.push('Bludgeoning')
|
||||||
|
if (item.system.damageType.slashing) damageTypes.push('Slashing')
|
||||||
|
if (damageTypes.length > 0) {
|
||||||
|
htmlContent += `<div class="item-detail"><strong>Damage Type:</strong> ${damageTypes.join('/')}</div>`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'armor':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Armor Type:</strong> ${item.system.armorType || 'Unknown'}</div>
|
||||||
|
<div class="item-detail"><strong>Armor Points:</strong> ${item.system.armorPoints || 0}</div>
|
||||||
|
<div class="item-detail"><strong>APC:</strong> ${item.system.apc || 0}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'shield':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Shield Type:</strong> ${item.system.shieldType || 'Unknown'}</div>
|
||||||
|
<div class="item-detail"><strong>Armor Points:</strong> ${item.system.armorPoints || 0}</div>
|
||||||
|
<div class="item-detail"><strong>APC:</strong> ${item.system.apc || 0}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'skill':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Modifier:</strong> ${item.system.modifier || 0}</div>
|
||||||
|
<div class="item-detail"><strong>Core Skill:</strong> ${item.system.isCoreSkill ? 'Yes' : 'No'}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'spell':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Level:</strong> ${item.system.level || 'Unknown'}</div>
|
||||||
|
<div class="item-detail"><strong>Mana Cost:</strong> ${item.system.manaCost || 0}</div>
|
||||||
|
<div class="item-detail"><strong>Casting Time:</strong> ${item.system.castingTime || 'N/A'}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'miracle':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Prayer Time:</strong> ${item.system.prayerTime || 'N/A'}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'equipment':
|
||||||
|
htmlContent += `
|
||||||
|
<div class="item-detail"><strong>Weight:</strong> ${item.system.weight || 'N/A'}</div>
|
||||||
|
`
|
||||||
|
break
|
||||||
|
|
||||||
|
default:
|
||||||
|
// For other item types, just show basic info
|
||||||
|
htmlContent += `<div class="item-detail"><strong>Item Type:</strong> ${item.type}</div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
htmlContent += `</div></div>`
|
||||||
|
|
||||||
|
return htmlContent
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRender(context, options) {
|
_onRender(context, options) {
|
||||||
|
|||||||
@@ -159,38 +159,14 @@ export default class PrismRPGActor extends Actor {
|
|||||||
case "weapon-damage-medium":
|
case "weapon-damage-medium":
|
||||||
case "weapon-attack": {
|
case "weapon-attack": {
|
||||||
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||||
let skill
|
if (!weapon) {
|
||||||
let skills = this.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
|
console.error("Weapon not found", weapon, skill)
|
||||||
if (skills.length > 0) {
|
|
||||||
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
|
|
||||||
} else {
|
|
||||||
skills = this.items.filter((i) => i.type === "skill" && i.name.toLowerCase().replace(" skill", "") === weapon.name.toLowerCase())
|
|
||||||
if (skills.length > 0) {
|
|
||||||
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
|
|
||||||
} else {
|
|
||||||
skills = this.items.filter((i) => i.type === "skill" && i.system.weaponClass === weapon.system.weaponClass)
|
|
||||||
if (skills.length > 0) {
|
|
||||||
skill = this.getBestWeaponClassSkill(skills, rollType, 0.5)
|
|
||||||
} else {
|
|
||||||
skills = this.items.filter((i) => i.type === "skill" && i.system.weaponClass.includes(SYSTEM.WEAPON_CATEGORIES[weapon.system.weaponClass]))
|
|
||||||
if (skills.length > 0) {
|
|
||||||
skill = this.getBestWeaponClassSkill(skills, rollType, 0.25)
|
|
||||||
} else {
|
|
||||||
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!weapon || !skill) {
|
|
||||||
console.error("Weapon or skill not found", weapon, skill)
|
|
||||||
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
|
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a plain object for rollTarget to ensure weapon data is preserved
|
// Create a plain object for rollTarget to ensure weapon data is preserved
|
||||||
rollTarget = {
|
rollTarget = {
|
||||||
...skill.toObject(),
|
|
||||||
weapon: weapon.toObject(),
|
weapon: weapon.toObject(),
|
||||||
rollKey: rollKey,
|
rollKey: rollKey,
|
||||||
combat: foundry.utils.duplicate(this.system.combat),
|
combat: foundry.utils.duplicate(this.system.combat),
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+51
-51
@@ -89,6 +89,11 @@ export default class PrismRPGCharacter extends foundry.abstract.TypeDataModel {
|
|||||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
schema.actionPoints = new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
|
})
|
||||||
|
|
||||||
schema.biodata = new fields.SchemaField({
|
schema.biodata = new fields.SchemaField({
|
||||||
level: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
|
level: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
|
||||||
alignment: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
alignment: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||||
@@ -165,6 +170,21 @@ export default class PrismRPGCharacter extends foundry.abstract.TypeDataModel {
|
|||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
super.prepareDerivedData();
|
super.prepareDerivedData();
|
||||||
|
|
||||||
|
// Calculate action points max based on level
|
||||||
|
const level = this.biodata.level
|
||||||
|
let actionPointsMax = 4
|
||||||
|
if (level >= 3 && level <= 5) {
|
||||||
|
actionPointsMax = 5
|
||||||
|
} else if (level >= 6 && level <= 8) {
|
||||||
|
actionPointsMax = 6
|
||||||
|
} else if (level >= 9 && level <= 10) {
|
||||||
|
actionPointsMax = 7
|
||||||
|
}
|
||||||
|
// Set max action points (but don't override if already set to a higher value)
|
||||||
|
if (this.actionPoints.max < actionPointsMax) {
|
||||||
|
this.actionPoints.max = actionPointsMax
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate sub-attributes from parent characteristics
|
// Calculate sub-attributes from parent characteristics
|
||||||
// Sub-attribute = lowest ability modifier between the two parent characteristics
|
// Sub-attribute = lowest ability modifier between the two parent characteristics
|
||||||
for (let subAttrKey in SYSTEM.SUB_ATTRIBUTES) {
|
for (let subAttrKey in SYSTEM.SUB_ATTRIBUTES) {
|
||||||
@@ -241,66 +261,46 @@ export default class PrismRPGCharacter extends foundry.abstract.TypeDataModel {
|
|||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rolls initiative for the character: 1d20 + initiative modifier
|
||||||
|
* @param {string} combatId - Optional combat ID to update
|
||||||
|
* @param {string} combatantId - Optional combatant ID to update
|
||||||
|
* @returns {Promise<Roll|null>} The initiative roll or null if cancelled
|
||||||
|
*/
|
||||||
async rollInitiative(combatId = undefined, combatantId = undefined) {
|
async rollInitiative(combatId = undefined, combatantId = undefined) {
|
||||||
const hasTarget = false
|
// Get the initiative sub-attribute modifier
|
||||||
let actorClass = this.biodata.class;
|
const initiativeModifier = this.subAttributes.initiative.value
|
||||||
|
|
||||||
let wisDef = SYSTEM.CHARACTERISTICS_TABLES.wis.find((c) => c.value === this.characteristics.wis.value)
|
// Create the roll formula: 1d20 + initiative modifier
|
||||||
let maxInit = Number(wisDef.init_cap) || 1000
|
const formula = `1d20 + ${initiativeModifier}`
|
||||||
|
|
||||||
let roll = await PrismRPGRoll.promptInitiative({
|
// Roll the initiative
|
||||||
actorId: this.parent.id,
|
let initRoll = new Roll(formula)
|
||||||
actorName: this.parent.name,
|
await initRoll.evaluate()
|
||||||
actorImage: this.parent.img,
|
|
||||||
combatId,
|
// Create the chat message
|
||||||
combatantId,
|
let msg = await initRoll.toMessage({
|
||||||
actorClass,
|
flavor: `${game.i18n.localize("PRISMRPG.Label.initiative")} - ${this.parent.name}`,
|
||||||
maxInit,
|
speaker: ChatMessage.getSpeaker({ actor: this.parent })
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
// Wait for 3D dice animation if enabled
|
||||||
}
|
if (game?.dice3d) {
|
||||||
|
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||||
async rollProgressionDice(combatId, combatantId, rollProgressionCount) {
|
|
||||||
|
|
||||||
// Get all weapons from the actor
|
|
||||||
let weapons = this.parent.items.filter(i => i.type === "weapon" && i.system.weaponType === "melee")
|
|
||||||
let weaponsChoices = weapons.map(w => { return { id: w.id, name: `${w.name} (${w.system.combatProgressionDice.toUpperCase()})`, combatProgressionDice: w.system.combatProgressionDice.toUpperCase() } })
|
|
||||||
let rangeWeapons = this.parent.items.filter(i => i.type === "weapon" && i.system.weaponType === "ranged")
|
|
||||||
for (let w of rangeWeapons) {
|
|
||||||
weaponsChoices.push({ id: `${w.id}simpleAim`, name: `${w.name} (Simple Aim: ${w.system.speed.simpleAim.toUpperCase()})`, combatProgressionDice: w.system.speed.simpleAim.toUpperCase() })
|
|
||||||
weaponsChoices.push({ id: `${w.id}carefulAim`, name: `${w.name} (Careful Aim: ${w.system.speed.carefulAim.toUpperCase()})`, combatProgressionDice: w.system.speed.carefulAim.toUpperCase() })
|
|
||||||
weaponsChoices.push({ id: `${w.id}focusedAim`, name: `${w.name} (Focused Aim: ${w.system.speed.focusedAim.toUpperCase()})`, combatProgressionDice: w.system.speed.focusedAim.toUpperCase() })
|
|
||||||
}
|
}
|
||||||
if (this.biodata.magicUser || this.biodata.clericUser) {
|
|
||||||
let spells = this.parent.items.filter(i => i.type === "spell" || i.type === "miracle")
|
// Update the combatant's initiative if in combat
|
||||||
for (let s of spells) {
|
if (combatId && combatantId) {
|
||||||
let title = ""
|
let combat = game.combats.get(combatId)
|
||||||
let formula = ""
|
if (combat) {
|
||||||
if (s.type === "spell") {
|
await combat.updateEmbeddedDocuments("Combatant", [{
|
||||||
let dice = PrismRPGUtils.getLethargyDice(s.system.level)
|
_id: combatantId,
|
||||||
title = `${s.name} (Casting time: ${s.system.castingTime}, Lethargy: ${dice})`
|
initiative: initRoll.total
|
||||||
formula = `${s.system.castingTime}+${dice}`
|
}])
|
||||||
} else {
|
|
||||||
title = `${s.name} (Prayer time: ${s.system.prayerTime})`
|
|
||||||
formula = `${s.system.prayerTime}`
|
|
||||||
}
|
|
||||||
weaponsChoices.push({ id: s.id, name: title, combatProgressionDice: formula })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let roll = await PrismRPGRoll.promptCombatAction({
|
return initRoll
|
||||||
actorId: this.parent.id,
|
|
||||||
actorName: this.parent.name,
|
|
||||||
actorImage: this.parent.img,
|
|
||||||
weaponsChoices,
|
|
||||||
combatId,
|
|
||||||
combatantId,
|
|
||||||
rollProgressionCount,
|
|
||||||
type: "progression",
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -13,11 +13,6 @@ export default class PrismRPGUtils {
|
|||||||
return compendiumData.filter(filter)
|
return compendiumData.filter(filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static pushCombatOptions(html, options) {
|
|
||||||
options.push({ name: "Reset Progression", condition: true, icon: '<i class="fas fa-rotate-right"></i>', callback: target => { game.combat.resetProgression(target.data('combatant-id')); } })
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static setHookListeners() {
|
static setHookListeners() {
|
||||||
|
|
||||||
@@ -177,6 +172,11 @@ export default class PrismRPGUtils {
|
|||||||
return str ? str.toUpperCase() : '';
|
return str ? str.toUpperCase() : '';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('replace', function (str, search, replacement) {
|
||||||
|
if (!str) return '';
|
||||||
|
return str.replace(search, replacement);
|
||||||
|
})
|
||||||
|
|
||||||
Handlebars.registerHelper('isEnabled', function (configKey) {
|
Handlebars.registerHelper('isEnabled', function (configKey) {
|
||||||
return game.settings.get("bol", configKey);
|
return game.settings.get("bol", configKey);
|
||||||
})
|
})
|
||||||
|
|||||||
+6
-8
@@ -11,7 +11,7 @@ import * as models from "./module/models/_module.mjs"
|
|||||||
import * as documents from "./module/documents/_module.mjs"
|
import * as documents from "./module/documents/_module.mjs"
|
||||||
import * as applications from "./module/applications/_module.mjs"
|
import * as applications from "./module/applications/_module.mjs"
|
||||||
|
|
||||||
import { PrismRPGCombatTracker, PrismRPGCombat } from "./module/applications/combat.mjs"
|
import { PrismRPGCombat } from "./module/applications/combat.mjs"
|
||||||
import { Macros } from "./module/macros.mjs"
|
import { Macros } from "./module/macros.mjs"
|
||||||
import { setupTextEnrichers } from "./module/enrichers.mjs"
|
import { setupTextEnrichers } from "./module/enrichers.mjs"
|
||||||
import { default as PrismRPGUtils } from "./module/utils.mjs"
|
import { default as PrismRPGUtils } from "./module/utils.mjs"
|
||||||
@@ -36,8 +36,11 @@ Hooks.once("init", function () {
|
|||||||
documents,
|
documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG.ui.combat = PrismRPGCombatTracker
|
CONFIG.Combat.documentClass = PrismRPGCombat
|
||||||
CONFIG.Combat.documentClass = PrismRPGCombat;
|
CONFIG.Combat.initiative = {
|
||||||
|
formula: "1d20 + @subAttributes.initiative.value",
|
||||||
|
decimals: 2
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG.Actor.documentClass = documents.PrismRPGActor
|
CONFIG.Actor.documentClass = documents.PrismRPGActor
|
||||||
CONFIG.Actor.dataModels = {
|
CONFIG.Actor.dataModels = {
|
||||||
@@ -208,11 +211,6 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
await actor.prepareRoll("weapon-damage-medium", weaponId)
|
await actor.prepareRoll("weapon-damage-medium", weaponId)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
|
||||||
PrismRPGUtils.pushCombatOptions(html, options);
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a macro when dropping an entity on the hotbar
|
* Create a macro when dropping an entity on the hotbar
|
||||||
* Item - open roll dialog
|
* Item - open roll dialog
|
||||||
|
|||||||
@@ -411,4 +411,140 @@
|
|||||||
font-family: var(--font-secondary);
|
font-family: var(--font-secondary);
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
font-size: calc(var(--font-size-standard) * 1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Item Chat Card Styles
|
||||||
|
.prismrpg-item-chat-card {
|
||||||
|
font-family: var(--font-primary);
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.02) 100%);
|
||||||
|
border: 1px solid rgba(0,0,0,0.2);
|
||||||
|
margin: 2px 0;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
|
||||||
|
.item-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
|
||||||
|
border-bottom: 1px solid #444;
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.95em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #d4af37;
|
||||||
|
text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
|
||||||
|
font-family: var(--font-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-type {
|
||||||
|
padding: 1px 6px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 0.65em;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-image {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6px;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 50px;
|
||||||
|
max-height: 50px;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid rgba(212, 175, 55, 0.3);
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-description {
|
||||||
|
padding: 6px 8px;
|
||||||
|
color: #000;
|
||||||
|
font-size: 0.8em;
|
||||||
|
line-height: 1.3;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-details {
|
||||||
|
padding: 6px 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 3px;
|
||||||
|
|
||||||
|
.item-detail {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px 6px;
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border-left: 2px solid rgba(212, 175, 55, 0.5);
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
|
||||||
|
strong {
|
||||||
|
color: #d4af37;
|
||||||
|
margin-right: 6px;
|
||||||
|
min-width: 90px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(even) {
|
||||||
|
background: rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special styling for weapon items
|
||||||
|
&.weapon-item {
|
||||||
|
.item-header {
|
||||||
|
background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special styling for armor items
|
||||||
|
&.armor-item {
|
||||||
|
.item-header {
|
||||||
|
background: linear-gradient(135deg, #4a5cf7 0%, #2c3e9e 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special styling for spell items
|
||||||
|
&.spell-item {
|
||||||
|
.item-header {
|
||||||
|
background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special styling for skill items
|
||||||
|
&.skill-item {
|
||||||
|
.item-header {
|
||||||
|
background: linear-gradient(135deg, #16a085 0%, #0e6655 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special styling for equipment items
|
||||||
|
&.equipment-item {
|
||||||
|
.item-header {
|
||||||
|
background: linear-gradient(135deg, #f39c12 0%, #b8730f 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
class="item-img"
|
class="item-img"
|
||||||
src="{{item.img}}"
|
src="{{item.img}}"
|
||||||
data-tooltip="{{item.name}}"
|
data-tooltip="{{item.name}}"
|
||||||
|
data-action="postItemToChat"
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="name" data-tooltip="{{item.system.description}}">
|
<div class="name" data-tooltip="{{item.system.description}}">
|
||||||
@@ -88,6 +89,7 @@
|
|||||||
class="item-img"
|
class="item-img"
|
||||||
src="{{item.img}}"
|
src="{{item.img}}"
|
||||||
data-tooltip="{{item.name}}"
|
data-tooltip="{{item.name}}"
|
||||||
|
data-action="postItemToChat"
|
||||||
/>
|
/>
|
||||||
<div class="name" data-tooltip="{{item.system.description}}">
|
<div class="name" data-tooltip="{{item.system.description}}">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
@@ -137,6 +139,7 @@
|
|||||||
class="item-img"
|
class="item-img"
|
||||||
src="{{item.img}}"
|
src="{{item.img}}"
|
||||||
data-tooltip="{{item.name}}"
|
data-tooltip="{{item.name}}"
|
||||||
|
data-action="postItemToChat"
|
||||||
/>
|
/>
|
||||||
<div class="name" data-tooltip="{{item.system.description}}">
|
<div class="name" data-tooltip="{{item.system.description}}">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<div class="equipments">
|
<div class="equipments">
|
||||||
{{#each equipments as |item|}}
|
{{#each equipments as |item|}}
|
||||||
<div class="equipment" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
<div class="equipment" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
||||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" data-action="postItemToChat" />
|
||||||
<div class="name" data-tooltip="{{{item.system.description}}}">
|
<div class="name" data-tooltip="{{{item.system.description}}}">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="hp-item">
|
<div class="hp-item">
|
||||||
<div class="hp-label">ARMOR</div>
|
<div class="hp-label">ARMOR</div>
|
||||||
|
<a data-action="armorPointsMinus"><i class="fa-solid fa-minus"></i></a>
|
||||||
<div class="hp-value">
|
<div class="hp-value">
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.armorPoints.fields.value
|
systemFields.armorPoints.fields.value
|
||||||
@@ -93,6 +94,7 @@
|
|||||||
disabled=isPlayMode
|
disabled=isPlayMode
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
<a data-action="armorPointsPlus"><i class="fa-solid fa-plus"></i></a>
|
||||||
<div class="hp-separator">/</div>
|
<div class="hp-separator">/</div>
|
||||||
<div class="hp-max">
|
<div class="hp-max">
|
||||||
{{formInput
|
{{formInput
|
||||||
@@ -102,6 +104,26 @@
|
|||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="hp-item">
|
||||||
|
<div class="hp-label" data-tooltip="Action Points">AP</div>
|
||||||
|
<a data-action="actionPointsMinus"><i class="fa-solid fa-minus"></i></a>
|
||||||
|
<div class="hp-value">
|
||||||
|
{{formInput
|
||||||
|
systemFields.actionPoints.fields.value
|
||||||
|
value=system.actionPoints.value
|
||||||
|
disabled=isPlayMode
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<a data-action="actionPointsPlus"><i class="fa-solid fa-plus"></i></a>
|
||||||
|
<div class="hp-separator">/</div>
|
||||||
|
<div class="hp-max">
|
||||||
|
{{formInput
|
||||||
|
systemFields.actionPoints.fields.max
|
||||||
|
value=system.actionPoints.max
|
||||||
|
disabled=isPlayMode
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -270,7 +292,7 @@
|
|||||||
<div class="race-content">
|
<div class="race-content">
|
||||||
{{#if race}}
|
{{#if race}}
|
||||||
<div class="race-item" data-item-id="{{race.id}}" data-item-uuid="{{race.uuid}}">
|
<div class="race-item" data-item-id="{{race.id}}" data-item-uuid="{{race.uuid}}">
|
||||||
<img class="item-img" src="{{race.img}}" data-tooltip="{{race.name}}" />
|
<img class="item-img" src="{{race.img}}" data-tooltip="{{race.name}}" data-action="postItemToChat" />
|
||||||
<div class="race-name">{{race.name}}</div>
|
<div class="race-name">{{race.name}}</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{race.id}}"
|
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{race.id}}"
|
||||||
@@ -296,7 +318,7 @@
|
|||||||
<div class="class-content">
|
<div class="class-content">
|
||||||
{{#if classItem}}
|
{{#if classItem}}
|
||||||
<div class="class-item" data-item-id="{{classItem.id}}" data-item-uuid="{{classItem.uuid}}">
|
<div class="class-item" data-item-id="{{classItem.id}}" data-item-uuid="{{classItem.uuid}}">
|
||||||
<img class="item-img" src="{{classItem.img}}" data-tooltip="{{classItem.name}}" />
|
<img class="item-img" src="{{classItem.img}}" data-tooltip="{{classItem.name}}" data-action="postItemToChat" />
|
||||||
<div class="class-name">{{classItem.name}}</div>
|
<div class="class-name">{{classItem.name}}</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{classItem.id}}"
|
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{classItem.id}}"
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
<div class="skill {{#if item.system.isCoreSkill}}is-core-skill{{/if}}"
|
<div class="skill {{#if item.system.isCoreSkill}}is-core-skill{{/if}}"
|
||||||
data-item-id="{{item.id}}"
|
data-item-id="{{item.id}}"
|
||||||
data-item-uuid="{{item.uuid}}">
|
data-item-uuid="{{item.uuid}}">
|
||||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}\nClick to post to chat" data-action="postItemToChat" />
|
||||||
<div class="name">
|
<div class="name" data-tooltip="{{item.system.description}}">
|
||||||
<a class="rollable" data-roll-type="skill" data-roll-key="{{item.id}}">
|
<a class="rollable" data-roll-type="skill" data-roll-key="{{item.id}}">
|
||||||
<i class="lf-roll-small fa-duotone fa-solid fa-dice-d10"></i>
|
<i class="lf-roll-small fa-duotone fa-solid fa-dice-d10"></i>
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<div class="racial-abilities">
|
<div class="racial-abilities">
|
||||||
{{#each racialAbilities as |item|}}
|
{{#each racialAbilities as |item|}}
|
||||||
<div class="racial-ability " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
<div class="racial-ability " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
||||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}\nClick to post to chat" data-action="postItemToChat" />
|
||||||
<div class="name" data-tooltip="{{{item.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP">
|
<div class="name" data-tooltip="{{{item.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="spells">
|
<div class="spells">
|
||||||
{{#each spells as |item|}}
|
{{#each spells as |item|}}
|
||||||
<div class="spell" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">
|
<div class="spell" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">
|
||||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" data-action="postItemToChat" />
|
||||||
<div class="name">
|
<div class="name">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
<legend>{{localize "PRISMRPG.Label.classFeatures"}}</legend>
|
<legend>{{localize "PRISMRPG.Label.classFeatures"}}</legend>
|
||||||
|
|
||||||
{{#each system.features as |feature level|}}
|
{{#each system.features as |feature level|}}
|
||||||
<label>{{localize "PRISMRPG.Label.level"}} {{inc @key}}</label>
|
<label>{{localize "PRISMRPG.Label.level"}} {{replace @key "level" ""}}</label>
|
||||||
{{formInput
|
{{formInput
|
||||||
(lookup ../systemFields.features.fields @key)
|
(lookup ../systemFields.features.fields @key)
|
||||||
enriched=(lookup ../enrichedFeatures @key)
|
enriched=(lookup ../enrichedFeatures @key)
|
||||||
|
|||||||
Reference in New Issue
Block a user