4 Commits

Author SHA1 Message Date
uberwald 7abea8e9d4 Add class adancement 2026-02-09 22:46:44 +01:00
uberwald 31573bd522 Fix initiative 2026-01-26 17:47:53 +01:00
uberwald abea77906d Add spells rolls and enhance CSS styling
- Add spell roll functionality to character sheets
- Enhance CSS and LESS styling for better visual presentation
- Update character templates and models
- Remove old backup files (roll-old.mjs, roll.mjs.backup)
- Improve character combat and equipment templates
- Update utility functions and actor documents

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-01-21 13:56:09 +01:00
uberwald 7283f5f15b Update skill sheet 2026-01-14 14:16:31 +01:00
37 changed files with 1318 additions and 2819 deletions
+19
View File
@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
<!-- Background circle -->
<circle cx="50" cy="50" r="48" fill="#f0f0f0" stroke="#333" stroke-width="2" />
<!-- Star for achievement/advancement -->
<path d="M 50 20 L 55 38 L 74 38 L 59 49 L 64 67 L 50 56 L 36 67 L 41 49 L 26 38 L 45 38 Z"
fill="#ffd700" stroke="#333" stroke-width="1.5" />
<!-- Upward arrow for progression -->
<path d="M 50 75 L 50 85" stroke="#333" stroke-width="3" stroke-linecap="round" />
<path d="M 45 78 L 50 73 L 55 78" fill="none" stroke="#333" stroke-width="3"
stroke-linecap="round" stroke-linejoin="round" />
<!-- Small accent dots for decoration -->
<circle cx="20" cy="30" r="2" fill="#666" />
<circle cx="80" cy="30" r="2" fill="#666" />
<circle cx="20" cy="70" r="2" fill="#666" />
<circle cx="80" cy="70" r="2" fill="#666" />
</svg>

After

Width:  |  Height:  |  Size: 891 B

+215
View File
@@ -3227,6 +3227,118 @@ i.prismrpg {
.prismrpg .class-content label {
flex: 10%;
}
.prismrpg .class-content .advancement-level {
margin-bottom: 1.5rem;
padding: 0.5rem;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 4px;
}
.prismrpg .class-content .advancement-level h3 {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0 0.5rem 0;
padding-bottom: 0.5rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.prismrpg .class-content .advancement-level h3 .level-title {
color: #000000;
font-weight: bold;
font-size: 80%;
}
.prismrpg .class-content .advancement-level h3 .add-advancement {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
}
.prismrpg .class-content .advancement-level h3 .add-advancement:hover {
background: var(--color-control-bg-hover);
}
.prismrpg .class-content .advancement-level h3 .add-advancement i {
margin: 0;
}
.prismrpg .class-content .advancement-level .empty-advancements {
font-style: italic;
color: rgba(0, 0, 0, 0.5);
margin: 0.5rem 0;
}
.prismrpg .class-content .advancement-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.prismrpg .class-content .advancement-item {
padding: 0.75rem;
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
.prismrpg .class-content .advancement-item .advancement-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
}
.prismrpg .class-content .advancement-item .advancement-header .advancement-icon {
width: 40px;
height: 40px;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
}
.prismrpg .class-content .advancement-item .advancement-header .advancement-icon:hover {
border-color: var(--color-border-highlight);
}
.prismrpg .class-content .advancement-item .advancement-header input[type="text"] {
flex: 1;
font-weight: bold;
}
.prismrpg .class-content .advancement-item .advancement-header .toggle-advancement-description {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
margin-left: 0.25rem;
}
.prismrpg .class-content .advancement-item .advancement-header .toggle-advancement-description:hover {
background: var(--color-control-bg-hover);
}
.prismrpg .class-content .advancement-item .advancement-header .toggle-advancement-description i {
margin: 0;
color: rgba(0, 0, 0, 0.7);
}
.prismrpg .class-content .advancement-item .advancement-header .delete-advancement {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
}
.prismrpg .class-content .advancement-item .advancement-header .delete-advancement:hover {
background: rgba(255, 0, 0, 0.1);
border-color: rgba(255, 0, 0, 0.5);
}
.prismrpg .class-content .advancement-item .advancement-header .delete-advancement i {
margin: 0;
color: rgba(255, 0, 0, 0.7);
}
.prismrpg .class-content .advancement-item .advancement-description {
margin-top: 0.5rem;
overflow: hidden;
transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
max-height: 500px;
opacity: 1;
}
.prismrpg .class-content .advancement-item .advancement-description.collapsed {
max-height: 0;
opacity: 0;
margin-top: 0;
}
.prismrpg .character-path-content {
font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1);
@@ -4102,6 +4214,109 @@ i.prismrpg {
font-family: var(--font-secondary);
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 {
color: var(--color-dark-1);
}
+9 -1
View File
@@ -516,6 +516,8 @@
"skills": "Skills",
"sub-attribute": "Sub-Attribute",
"subattributes": "Sub-Attributes",
"subAttribute1": "Sub-Attribute 1",
"subAttribute2": "Sub-Attribute 2",
"spells": "Spells",
"str": "STR",
"titleChallenge": "Challenge",
@@ -686,7 +688,13 @@
"spellcastingTypeMana": "Mana",
"spellcastingTypeFaith": "Faith",
"attributeBonuses": "Attribute Bonuses",
"classFeatures": "Class Features"
"classFeatures": "Class Features",
"advancement": "Advancement",
"addAdvancement": "Add Advancement",
"deleteAdvancement": "Delete Advancement",
"advancementName": "Advancement Name",
"noAdvancements": "No advancements defined for this level",
"toggleDescription": "Toggle Description"
},
"CoreSkill": {
"acrobatics": "Acrobatics",
-191
View File
@@ -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 {
/**
* 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) {
console.log("%%%%%%%%% Roll Initiative", ids, options);
@@ -123,98 +25,5 @@ export class PrismRPGCombat extends Combat {
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;
}
}
+184 -7
View File
@@ -18,10 +18,15 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
rollInitiative: PrismRPGCharacterSheet.#onRollInitiative,
armorHitPointsPlus: PrismRPGCharacterSheet.#onArmorHitPointsPlus,
armorHitPointsMinus: PrismRPGCharacterSheet.#onArmorHitPointsMinus,
armorPointsPlus: PrismRPGCharacterSheet.#onArmorPointsPlus,
armorPointsMinus: PrismRPGCharacterSheet.#onArmorPointsMinus,
actionPointsPlus: PrismRPGCharacterSheet.#onActionPointsPlus,
actionPointsMinus: PrismRPGCharacterSheet.#onActionPointsMinus,
manaPointsPlus: PrismRPGCharacterSheet.#onManaPointsPlus,
manaPointsMinus: PrismRPGCharacterSheet.#onManaPointsMinus,
hpPlus: PrismRPGCharacterSheet.#onHpPlus,
hpMinus: PrismRPGCharacterSheet.#onHpMinus,
postItemToChat: PrismRPGCharacterSheet.#onPostItemToChat,
},
}
@@ -158,43 +163,215 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
await this.document.system.rollInitiative()
}
static #onArmorHitPointsPlus(event, target) {
static async #onArmorHitPointsPlus(event, target) {
let armorHP = this.actor.system.combat.armorHitPoints
armorHP += 1
this.actor.update({ "system.combat.armorHitPoints": armorHP })
}
static #onArmorHitPointsMinus(event, target) {
static async #onArmorHitPointsMinus(event, target) {
let armorHP = this.actor.system.combat.armorHitPoints
armorHP -= 1
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
mana += 1
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
mana -= 1
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
hp += 1
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
hp -= 1
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) {
+137
View File
@@ -32,6 +32,7 @@ export default class PrismRPGClassSheet extends PrismRPGItemSheet {
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "PRISMRPG.Label.details" },
advancements: { id: "advancements", group: "primary", label: "PRISMRPG.Label.advancement" },
description: { id: "description", group: "primary", label: "PRISMRPG.Label.description" },
}
for (const v of Object.values(tabs)) {
@@ -56,6 +57,142 @@ export default class PrismRPGClassSheet extends PrismRPGItemSheet {
context.enrichedFeatures[key] = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.features[key], { async: true })
}
// Enrich all advancement descriptions
context.enrichedAdvancements = {}
context.advancementsByLevel = []
for (let i = 1; i <= 10; i++) {
const key = `level${i}`
const advancements = this.document.system.advancements[key] || []
context.enrichedAdvancements[key] = []
const enrichedAdvancementsList = []
for (let j = 0; j < advancements.length; j++) {
const enrichedDesc = await foundry.applications.ux.TextEditor.implementation.enrichHTML(advancements[j].description, { async: true })
const enrichedAdv = {
...advancements[j],
enrichedDescription: enrichedDesc,
index: j,
levelKey: key
}
context.enrichedAdvancements[key].push(enrichedAdv)
enrichedAdvancementsList.push(enrichedAdv)
}
context.advancementsByLevel.push({
level: i,
levelKey: key,
advancements: enrichedAdvancementsList
})
}
return context
}
/** @override */
_onRender(context, options) {
super._onRender(context, options)
// Add advancement button listeners
this.element.querySelectorAll(".add-advancement").forEach(btn => {
btn.addEventListener("click", this._onAddAdvancement.bind(this))
})
// Delete advancement button listeners
this.element.querySelectorAll(".delete-advancement").forEach(btn => {
btn.addEventListener("click", this._onDeleteAdvancement.bind(this))
})
// Edit advancement icon listeners
this.element.querySelectorAll(".advancement-icon").forEach(img => {
img.addEventListener("click", this._onEditAdvancementIcon.bind(this))
})
// Toggle advancement description listeners
this.element.querySelectorAll(".toggle-advancement-description").forEach(btn => {
btn.addEventListener("click", this._onToggleAdvancementDescription.bind(this))
})
}
/**
* Handle toggling advancement description visibility
* @param {Event} event
*/
_onToggleAdvancementDescription(event) {
event.preventDefault()
const button = event.currentTarget
const item = button.closest(".advancement-item")
const description = item.querySelector(".advancement-description")
const icon = button.querySelector("i")
description.classList.toggle("collapsed")
if (description.classList.contains("collapsed")) {
icon.classList.remove("fa-chevron-up")
icon.classList.add("fa-chevron-down")
} else {
icon.classList.remove("fa-chevron-down")
icon.classList.add("fa-chevron-up")
}
}
/**
* Handle adding a new advancement to a level
* @param {Event} event
*/
async _onAddAdvancement(event) {
event.preventDefault()
const level = event.currentTarget.dataset.level
const advancements = foundry.utils.deepClone(this.document.system.advancements[level] || [])
advancements.push({
icon: "systems/fvtt-prism-rpg/assets/icons/advancement.svg",
name: "",
description: ""
})
await this.document.update({
[`system.advancements.${level}`]: advancements
})
}
/**
* Handle deleting an advancement from a level
* @param {Event} event
*/
async _onDeleteAdvancement(event) {
event.preventDefault()
const level = event.currentTarget.dataset.level
const index = parseInt(event.currentTarget.dataset.index)
const advancements = foundry.utils.deepClone(this.document.system.advancements[level] || [])
advancements.splice(index, 1)
await this.document.update({
[`system.advancements.${level}`]: advancements
})
}
/**
* Handle editing an advancement icon
* @param {Event} event
*/
async _onEditAdvancementIcon(event) {
event.preventDefault()
const level = event.currentTarget.dataset.level
const index = parseInt(event.currentTarget.dataset.index)
const fp = new FilePicker({
type: "image",
current: this.document.system.advancements[level][index].icon,
callback: async (path) => {
const advancements = foundry.utils.deepClone(this.document.system.advancements[level] || [])
advancements[index].icon = path
await this.document.update({
[`system.advancements.${level}`]: advancements
})
}
})
fp.render(true)
}
}
+23 -9
View File
@@ -261,15 +261,29 @@ export const CHOICE_MODIFIERS = {
}
export const ASCII = `
······················································································································
: :
:@@@ @@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@ @@@@@@@@ @@@@@@ @@@ @@@ @@@@@@@ @@@@@@ @@@@@@ @@@ @@@ :
:@@! @@! @!! @@! @@@ @@! @@@ @@! @@! @@! @@@ @@!@!@@@ @!! @@! @@@ !@@ @@! !@@ :
:@!! @!!!:! @!! @!@!@!@! @!@!@!@! @!! @!!!:! @!@!@!@! @!@@!!@! @!! @!@!@!@! !@@!! !@!@! :
:!!: !!: !!: !!: !!! !!: !!! !!: !!: !!: !!! !!: !!! !!: !!: !!! !:! !!: :
:: ::.: : : :: :: : : : : : : : : ::.: : : : : : :: : : : : : ::.: : .: :
: :
······················································································································
┌─────────────────────────────────────────────────────┐
│8888888b. 8888888b. 8888888 .d8888b. 888b d888│
│888 Y88b 888 Y88b 888 d88P Y88b 8888b d8888│
│888 888 888 888 888 Y88b. 88888b.d88888│
│888 d88P 888 d88P 888 "Y888b. 888Y88888P888│
│8888888P" 8888888P" 888 "Y88b. 888 Y888P 888│
│888 888 T88b 888 "888 888 Y8P 888│
│888 888 T88b 888 Y88b d88P 888 " 888│
│888 888 T88b 8888888 "Y8888P" 888 888│
│ │
│ │
│ │
│8888888b. 8888888b. .d8888b. │
│888 Y88b 888 Y88b d88P Y88b │
│888 888 888 888 888 888 │
│888 d88P 888 d88P 888 │
│8888888P" 8888888P" 888 88888 │
│888 T88b 888 888 888 │
│888 T88b 888 Y88b d88P │
│888 T88b 888 "Y8888P88 │
└─────────────────────────────────────────────────────┘
`
/**
+15 -30
View File
@@ -119,18 +119,27 @@ export default class PrismRPGActor extends Actor {
rollTarget = this.items.find((i) => i.type === "miracle" && i.id === rollKey)
rollTarget.rollKey = rollKey
break
case "skill":
case "skill": {
rollTarget = this.items.find((i) => i.type === "skill" && i.id === rollKey)
rollTarget.rollKey = rollKey
if (rollTarget.system.category === "weapon") {
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.rollFromWeapon"))
return
}
// Get the primary attribute for D&D 5e style rolls
const attrKey = rollTarget.system.primaryAttribute || "dex"
rollTarget.characteristicValue = this.system.characteristics[attrKey].value
// Get the two sub-attributes for this skill
const subAttr1 = rollTarget.system.subAttribute1 || "prowess"
const subAttr2 = rollTarget.system.subAttribute2 || "initiative"
// Store both sub-attribute values for the dialog to choose from
rollTarget.subAttribute1 = subAttr1
rollTarget.subAttribute2 = subAttr2
rollTarget.subAttribute1Value = this.system.subAttributes?.[subAttr1]?.value || 0
rollTarget.subAttribute2Value = this.system.subAttributes?.[subAttr2]?.value || 0
rollTarget.subAttribute1Label = game.i18n.localize(SYSTEM.SUB_ATTRIBUTES?.[subAttr1]?.label || subAttr1)
rollTarget.subAttribute2Label = game.i18n.localize(SYSTEM.SUB_ATTRIBUTES?.[subAttr2]?.label || subAttr2)
rollTarget.proficiencyBonus = rollTarget.system.modifier
break
}
case "spell-attack":
case "spell-power":
case "spell-cast":
@@ -150,38 +159,14 @@ export default class PrismRPGActor extends Actor {
case "weapon-damage-medium":
case "weapon-attack": {
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
let skill
let skills = this.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
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)
if (!weapon) {
console.error("Weapon not found", weapon, skill)
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
return
}
// Create a plain object for rollTarget to ensure weapon data is preserved
rollTarget = {
...skill.toObject(),
weapon: weapon.toObject(),
rollKey: rollKey,
combat: foundry.utils.duplicate(this.system.combat),
File diff suppressed because it is too large Load Diff
+39 -12
View File
@@ -127,11 +127,10 @@ export default class PrismRPGRoll extends Roll {
case "skill":
options.rollName = options.rollTarget.name
// D&D 5e style: ability modifier + proficiency bonus
const skillCharValue = options.rollTarget.characteristicValue
const skillAbilityMod = this.getAbilityModifier(skillCharValue)
// D&D 5e style: sub-attribute modifier + proficiency bonus
// Default to first sub-attribute, will be recalculated if player chooses different one
const proficiency = options.rollTarget.proficiencyBonus || 0
options.rollTarget.value = skillAbilityMod + proficiency
options.rollTarget.value = options.rollTarget.subAttribute1Value + proficiency
break
case "weapon-attack":
@@ -158,7 +157,7 @@ export default class PrismRPGRoll extends Roll {
const chaMod = this.getAbilityModifier(actor.system.characteristics.cha.value)
const bestMentalMod = Math.max(intMod, wisMod, chaMod)
options.rollTarget.value = bestMentalMod
// Store which characteristic is being used
if (bestMentalMod === intMod) {
options.rollTarget.mentalCharacteristic = "INT"
@@ -284,7 +283,8 @@ export default class PrismRPGRoll extends Roll {
attackerAimChoices,
hasTarget: options.hasTarget,
modifier: "+0",
advantage: "none"
advantage: "none",
config: SYSTEM
}
const content = await foundry.applications.handlebars.renderTemplate(
@@ -342,6 +342,15 @@ export default class PrismRPGRoll extends Roll {
}
}
// Recalculate bonus if player chose different sub-attribute for skill
if (rollContext.skillSubAttribute && options.rollType === "skill") {
const chosenSubAttrValue = rollContext.skillSubAttribute === options.rollTarget.subAttribute1 ?
options.rollTarget.subAttribute1Value :
options.rollTarget.subAttribute2Value
const proficiencyBonus = options.rollTarget.proficiencyBonus || 0
bonus = chosenSubAttrValue + proficiencyBonus
}
let extraModifier = rollContext.modifier === "" ? 0 : Number.parseInt(rollContext.modifier, 10)
totalModifier = bonus + extraModifier
@@ -388,12 +397,27 @@ export default class PrismRPGRoll extends Roll {
totalManaCost = options.rollTarget.system.manaCost + upcastLevel
totalAPC = options.rollTarget.system.apc + upcastLevel
manaUpkeep = options.rollTarget.system.manaUpkeep
// Get mental characteristic info from rollTarget
mentalCharacteristic = options.rollTarget.mentalCharacteristic
mentalCharValue = options.rollTarget.mentalCharValue
}
// Store skill sub-attribute information
let skillSubAttribute = null
let skillSubAttributeLabel = null
let skillSubAttributeValue = null
if (options.rollType === "skill" && rollContext.skillSubAttribute) {
skillSubAttribute = rollContext.skillSubAttribute
const subAttrConfig = SYSTEM.SUB_ATTRIBUTES?.[skillSubAttribute]
if (subAttrConfig) {
skillSubAttributeLabel = game.i18n.localize(subAttrConfig.label)
}
skillSubAttributeValue = rollContext.skillSubAttribute === options.rollTarget.subAttribute1 ?
options.rollTarget.subAttribute1Value :
options.rollTarget.subAttribute2Value
}
const rollData = {
type: options.rollType,
rollType: options.rollType,
@@ -411,6 +435,9 @@ export default class PrismRPGRoll extends Roll {
manaUpkeep,
mentalCharacteristic,
mentalCharValue,
skillSubAttribute,
skillSubAttributeLabel,
skillSubAttributeValue,
...rollContext,
}
@@ -420,7 +447,7 @@ export default class PrismRPGRoll extends Roll {
if (options.rollType === "spell-cast" && totalManaCost > 0) {
const actor = game.actors.get(options.actorId)
const currentMana = actor.system.manaPoints.value
// Check if enough mana
if (currentMana < totalManaCost) {
ui.notifications.error(
@@ -428,12 +455,12 @@ export default class PrismRPGRoll extends Roll {
)
return null
}
// Spend mana
await actor.update({
"system.manaPoints.value": currentMana - totalManaCost
await actor.update({
"system.manaPoints.value": currentMana - totalManaCost
})
ui.notifications.info(
`Spent ${totalManaCost} Mana (${currentMana}${currentMana - totalManaCost})`
)
File diff suppressed because it is too large Load Diff
-2
View File
@@ -6,9 +6,7 @@ export { default as PrismRPGSkill } from "./skill.mjs"
export { default as PrismRPGArmor } from "./armor.mjs"
export { default as PrismRPGShield } from "./shield.mjs"
export { default as PrismRPGRacialAbility } from "./racial-ability.mjs"
export { default as PrismRPGVulnerability } from "./vulnerability.mjs"
export { default as PrismRPGEquipment } from "./equipment.mjs"
export { default as PrismRPGMiracle } from "./miracle.mjs"
export { default as PrismRPGRace } from "./race.mjs"
export { default as PrismRPGClass } from "./class.mjs"
export { default as PrismRPGCharacterPath } from "./character-path.mjs"
+25
View File
@@ -32,4 +32,29 @@ export default class PrismRPGArmor extends foundry.abstract.TypeDataModel {
/** @override */
static LOCALIZATION_PREFIXES = ["PRISMRPG.Armor"]
static migrateData(data) {
// Migrate old money types to new ones
if (data?.money) {
const moneyMigration = {
"tinbit": "coppercoin",
"copper": "coppercoin",
"silver": "silvercoin",
"gold": "goldcoin",
"platinum": "note"
}
if (moneyMigration[data.money]) {
data.money = moneyMigration[data.money]
}
// If still invalid, default to coppercoin
if (!SYSTEM.MONEY[data.money]) {
console.warn(`Prism RPG | Migrate armor: Invalid money type "${data.money}", defaulting to coppercoin`)
data.money = "coppercoin"
}
}
return super.migrateData(data)
}
}
+51 -51
View File
@@ -89,6 +89,11 @@ export default class PrismRPGCharacter extends foundry.abstract.TypeDataModel {
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({
level: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
alignment: new fields.StringField({ required: true, nullable: false, initial: "" }),
@@ -165,6 +170,21 @@ export default class PrismRPGCharacter extends foundry.abstract.TypeDataModel {
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
// Sub-attribute = lowest ability modifier between the two parent characteristics
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 })
}
/**
* 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) {
const hasTarget = false
let actorClass = this.biodata.class;
// Get the initiative sub-attribute modifier
const initiativeModifier = this.subAttributes.initiative.value
let wisDef = SYSTEM.CHARACTERISTICS_TABLES.wis.find((c) => c.value === this.characteristics.wis.value)
let maxInit = Number(wisDef.init_cap) || 1000
// Create the roll formula: 1d20 + initiative modifier
const formula = `1d20 + ${initiativeModifier}`
let roll = await PrismRPGRoll.promptInitiative({
actorId: this.parent.id,
actorName: this.parent.name,
actorImage: this.parent.img,
combatId,
combatantId,
actorClass,
maxInit,
// Roll the initiative
let initRoll = new Roll(formula)
await initRoll.evaluate()
// Create the chat message
let msg = await initRoll.toMessage({
flavor: `${game.i18n.localize("PRISMRPG.Label.initiative")} - ${this.parent.name}`,
speaker: ChatMessage.getSpeaker({ actor: this.parent })
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
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() })
// Wait for 3D dice animation if enabled
if (game?.dice3d) {
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
}
if (this.biodata.magicUser || this.biodata.clericUser) {
let spells = this.parent.items.filter(i => i.type === "spell" || i.type === "miracle")
for (let s of spells) {
let title = ""
let formula = ""
if (s.type === "spell") {
let dice = PrismRPGUtils.getLethargyDice(s.system.level)
title = `${s.name} (Casting time: ${s.system.castingTime}, Lethargy: ${dice})`
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 })
// Update the combatant's initiative if in combat
if (combatId && combatantId) {
let combat = game.combats.get(combatId)
if (combat) {
await combat.updateEmbeddedDocuments("Combatant", [{
_id: combatantId,
initiative: initRoll.total
}])
}
}
let roll = await PrismRPGRoll.promptCombatAction({
actorId: this.parent.id,
actorName: this.parent.name,
actorImage: this.parent.img,
weaponsChoices,
combatId,
combatantId,
rollProgressionCount,
type: "progression",
})
return initRoll
}
}
+67
View File
@@ -68,6 +68,41 @@ export default class PrismRPGClass extends foundry.abstract.TypeDataModel {
level10: new fields.HTMLField({ initial: "" })
})
// Advancements (list of advancements per level with icon, name and description)
const advancementSchema = () => new fields.ArrayField(
new fields.SchemaField({
icon: new fields.StringField({
required: true,
initial: "",
label: "Icon"
}),
name: new fields.StringField({
required: true,
initial: "",
label: "Name"
}),
description: new fields.HTMLField({
required: true,
initial: "",
label: "Description"
})
}),
{ initial: [] }
)
schema.advancements = new fields.SchemaField({
level1: advancementSchema(),
level2: advancementSchema(),
level3: advancementSchema(),
level4: advancementSchema(),
level5: advancementSchema(),
level6: advancementSchema(),
level7: advancementSchema(),
level8: advancementSchema(),
level9: advancementSchema(),
level10: advancementSchema()
})
// Proficiencies granted by this class
schema.weaponProficiencies = new fields.StringField({
required: true,
@@ -156,4 +191,36 @@ export default class PrismRPGClass extends foundry.abstract.TypeDataModel {
}
return features
}
/**
* Get the current level's advancements
*/
get currentLevelAdvancements() {
return this.advancements[`level${this.level}`] || []
}
/**
* Get all advancements up to current level
*/
get allAdvancementsUpToLevel() {
const advancements = []
for (let i = 1; i <= this.level; i++) {
const levelAdvancements = this.advancements[`level${i}`]
if (levelAdvancements && levelAdvancements.length > 0) {
advancements.push({
level: i,
advancements: levelAdvancements
})
}
}
return advancements
}
/**
* Get advancements for a specific level
*/
getAdvancementsForLevel(level) {
if (level < 1 || level > 10) return []
return this.advancements[`level${level}`] || []
}
}
-124
View File
@@ -1,124 +0,0 @@
import { SYSTEM } from "../config/system.mjs"
export default class PrismRPGMiracle extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields
const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {}
schema.description = new fields.HTMLField({
required: false,
blank: true,
initial: "",
textSearch: true,
})
// Miracle level (1-7+)
schema.level = new fields.NumberField({
...requiredInteger,
initial: 1,
min: 1,
max: 25,
})
// Miracle type
schema.miracleType = new fields.StringField({
required: true,
initial: "combat",
choices: SYSTEM.MIRACLE_TYPES
})
// APC to pray
schema.apc = new fields.NumberField({
...requiredInteger,
required: true,
initial: 1,
min: 0,
label: "Action Point Cost"
})
// Faith cost (if applicable in Prism RPG)
schema.faithCost = new fields.NumberField({
...requiredInteger,
required: true,
initial: 0,
min: 0,
label: "Faith Cost"
})
// Divine favor required
schema.divineFavor = new fields.StringField({
required: true,
initial: "",
label: "Divine Favor"
})
// Components (Miracles have 'religious' component)
schema.components = new fields.SchemaField({
verbal: new fields.BooleanField({ initial: false }),
somatic: new fields.BooleanField({ initial: false }),
material: new fields.BooleanField({ initial: false }),
catalyst: new fields.BooleanField({ initial: false }),
religious: new fields.BooleanField({ initial: true })
})
schema.materialComponent = new fields.StringField({
required: true,
initial: ""
})
schema.catalyst = new fields.StringField({
required: true,
initial: ""
})
// Prayer parameters
schema.prayerTime = new fields.StringField({
required: true,
initial: "1 action"
})
schema.miracleRange = new fields.StringField({
required: true,
initial: "Touch"
})
schema.areaAffected = new fields.StringField({
required: true,
initial: "Single target"
})
schema.duration = new fields.StringField({
required: true,
initial: "Instantaneous"
})
schema.savingThrow = new fields.StringField({
required: true,
initial: ""
})
// Keywords
schema.keywords = new fields.ArrayField(
new fields.StringField()
)
// Miracle augment (if applicable)
schema.augment = new fields.StringField({
required: true,
initial: "",
label: "Miracle Augment"
})
schema.augmentDescription = new fields.HTMLField({
required: true,
initial: "",
label: "Augment Description"
})
return schema
}
/** @override */
static LOCALIZATION_PREFIXES = ["PRISMRPG.Miracle"]
}
+25
View File
@@ -69,4 +69,29 @@ export default class PrismRPGShield extends foundry.abstract.TypeDataModel {
/** @override */
static LOCALIZATION_PREFIXES = ["PRISMRPG.Shield"]
static migrateData(data) {
// Migrate old money types to new ones
if (data?.money) {
const moneyMigration = {
"tinbit": "coppercoin",
"copper": "coppercoin",
"silver": "silvercoin",
"gold": "goldcoin",
"platinum": "note"
}
if (moneyMigration[data.money]) {
data.money = moneyMigration[data.money]
}
// If still invalid, default to coppercoin
if (!SYSTEM.MONEY[data.money]) {
console.warn(`Prism RPG | Migrate shield: Invalid money type "${data.money}", defaulting to coppercoin`)
data.money = "coppercoin"
}
}
return super.migrateData(data)
}
}
+30 -23
View File
@@ -1,4 +1,5 @@
import { CORE_SKILLS_CHOICES, CORE_SKILL_BONUS, CORE_SKILLS } from "../config/skill.mjs"
import { SUB_ATTRIBUTES } from "../config/character.mjs"
/**
* Core Skill data model for Prism RPG
@@ -21,14 +22,6 @@ export default class PrismRPGSkill extends foundry.abstract.TypeDataModel {
initial: ""
})
// Core Skill type (from the 18 available Core Skills)
schema.coreSkill = new fields.StringField({
required: true,
initial: "acrobatics",
choices: CORE_SKILLS_CHOICES,
label: "Core Skill"
})
// Is this the character's chosen Core Skill?
schema.isCoreSkill = new fields.BooleanField({
required: true,
@@ -36,18 +29,18 @@ export default class PrismRPGSkill extends foundry.abstract.TypeDataModel {
label: "Is Core Skill"
})
// Primary attribute for this skill (str, dex, con, int, wis, cha)
schema.primaryAttribute = new fields.StringField({
// First sub-attribute for this skill
schema.subAttribute1 = new fields.StringField({
required: true,
initial: "dex",
label: "Primary Attribute"
initial: "prowess",
label: "Sub-Attribute 1"
})
// If Core Skill, which attribute receives the +2 bonus?
schema.attributeBonus = new fields.StringField({
// Second sub-attribute for this skill
schema.subAttribute2 = new fields.StringField({
required: true,
initial: "",
label: "Attribute Bonus"
initial: "initiative",
label: "Sub-Attribute 2"
})
// Skill modifier (includes Core Skill bonus if applicable)
@@ -114,9 +107,9 @@ export default class PrismRPGSkill extends foundry.abstract.TypeDataModel {
prepareDerivedData() {
super.prepareDerivedData()
// D&D 5e style: Core Skill gives +2 proficiency bonus
// Core Skill gives +5 proficiency bonus
if (this.isCoreSkill) {
this.modifier = 2
this.modifier = 5
this.canAdvancedCheck = true
} else {
this.modifier = 0
@@ -126,16 +119,30 @@ export default class PrismRPGSkill extends foundry.abstract.TypeDataModel {
/**
* Calculate skill check bonus
* @param {string} attributeKey The attribute to use (str, dex, con, int, wis, cha)
* @param {string} subAttributeKey The sub-attribute to use (prowess, vigor, etc.)
* @returns {number} Total skill check bonus
*/
getSkillCheckBonus(attributeKey) {
getSkillCheckBonus(subAttributeKey) {
let actor = this.parent?.actor
if (!actor) return this.modifier
const attribute = actor.system.characteristics?.[attributeKey]
const attributeMod = attribute?.mod || 0
const subAttribute = actor.system.subAttributes?.[subAttributeKey]
const subAttributeMod = subAttribute?.value || 0
return attributeMod + this.modifier
return subAttributeMod + this.modifier
}
/**
* Get the available sub-attribute choices for this skill
*/
get subAttributeChoices() {
const choices = {}
if (this.subAttribute1) {
choices[this.subAttribute1] = SUB_ATTRIBUTES[this.subAttribute1]?.label || this.subAttribute1
}
if (this.subAttribute2) {
choices[this.subAttribute2] = SUB_ATTRIBUTES[this.subAttribute2]?.label || this.subAttribute2
}
return choices
}
}
-17
View File
@@ -1,17 +0,0 @@
export default class PrismRPGVulnerability extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields
const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {}
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.gainedPoints = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
return schema
}
/** @override */
static LOCALIZATION_PREFIXES = ["PRISMRPG.Vulnerability"]
}
+25
View File
@@ -133,4 +133,29 @@ export default class PrismRPGWeapon extends foundry.abstract.TypeDataModel {
/** @override */
static LOCALIZATION_PREFIXES = ["PRISMRPG.Weapon"]
static migrateData(data) {
// Migrate old money types to new ones
if (data?.money) {
const moneyMigration = {
"tinbit": "coppercoin",
"copper": "coppercoin",
"silver": "silvercoin",
"gold": "goldcoin",
"platinum": "note"
}
if (moneyMigration[data.money]) {
data.money = moneyMigration[data.money]
}
// If still invalid, default to coppercoin
if (!SYSTEM.MONEY[data.money]) {
console.warn(`Prism RPG | Migrate weapon: Invalid money type "${data.money}", defaulting to coppercoin`)
data.money = "coppercoin"
}
}
return super.migrateData(data)
}
}
+5 -5
View File
@@ -13,11 +13,6 @@ export default class PrismRPGUtils {
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() {
@@ -177,6 +172,11 @@ export default class PrismRPGUtils {
return str ? str.toUpperCase() : '';
})
Handlebars.registerHelper('replace', function (str, search, replacement) {
if (!str) return '';
return str.replace(search, replacement);
})
Handlebars.registerHelper('isEnabled', function (configKey) {
return game.settings.get("bol", configKey);
})
+9 -13
View File
@@ -11,7 +11,7 @@ import * as models from "./module/models/_module.mjs"
import * as documents from "./module/documents/_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 { setupTextEnrichers } from "./module/enrichers.mjs"
import { default as PrismRPGUtils } from "./module/utils.mjs"
@@ -36,8 +36,11 @@ Hooks.once("init", function () {
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.dataModels = {
@@ -53,9 +56,7 @@ Hooks.once("init", function () {
armor: models.PrismRPGArmor,
shield: models.PrismRPGShield,
spell: models.PrismRPGSpell,
// Vulnerability: models.PrismRPGVulnerability, // Disabled - Legacy from Lethal Fantasy
equipment: models.PrismRPGEquipment,
// Miracle: models.PrismRPGMiracle // Disabled - Legacy from Lethal Fantasy, PRISM uses Divine class features instead
race: models.PrismRPGRace,
class: models.PrismRPGClass,
"character-path": models.PrismRPGCharacterPath,
@@ -69,7 +70,6 @@ Hooks.once("init", function () {
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ActorSheet)
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGSkillSheet, { types: ["skill"], makeDefault: true })
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGRacialAbilitySheet, { types: ["racial-ability"], makeDefault: true })
// Foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGVulnerabilitySheet, { types: ["vulnerability"], makeDefault: true }) // Disabled - Legacy from Lethal Fantasy
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGWeaponSheet, { types: ["weapon"], makeDefault: true })
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGSpellSheet, { types: ["spell"], makeDefault: true })
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGArmorSheet, { types: ["armor"], makeDefault: true })
@@ -78,7 +78,6 @@ Hooks.once("init", function () {
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGRaceSheet, { types: ["race"], makeDefault: true })
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGClassSheet, { types: ["class"], makeDefault: true })
foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGCharacterPathSheet, { types: ["character-path"], makeDefault: true })
// Foundry.documents.collections.Items.registerSheet("prismRPG", applications.PrismRPGMiracleSheet, { types: ["miracle"], makeDefault: true }) // Disabled - Legacy from Lethal Fantasy
// Other Document Configuration
CONFIG.ChatMessage.documentClass = documents.PrismRPGChatMessage
@@ -133,9 +132,11 @@ function preLocalizeConfig() {
for (const choice of choicesToLocalize) {
if (CONFIG.PRISMRPG[choice]) {
const localized = {}
for (const [key, label] of Object.entries(CONFIG.PRISMRPG[choice])) {
CONFIG.PRISMRPG[choice][key] = game.i18n.localize(label)
localized[key] = game.i18n.localize(label)
}
CONFIG.PRISMRPG[choice] = localized
}
}
}
@@ -210,11 +211,6 @@ Hooks.on(hookName, (message, html, data) => {
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
* Item - open roll dialog
+136
View File
@@ -411,4 +411,140 @@
font-family: var(--font-secondary);
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%);
}
}
}
}
+135
View File
@@ -13,4 +13,139 @@
label {
flex: 10%;
}
.advancement-level {
margin-bottom: 1.5rem;
padding: 0.5rem;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 4px;
h3 {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0 0.5rem 0;
padding-bottom: 0.5rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
.level-title {
color: #000000;
font-weight: bold;
font-size: 80%;
}
.add-advancement {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
&:hover {
background: var(--color-control-bg-hover);
}
i {
margin: 0;
}
}
}
.empty-advancements {
font-style: italic;
color: rgba(0, 0, 0, 0.5);
margin: 0.5rem 0;
}
}
.advancement-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.advancement-item {
padding: 0.75rem;
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
.advancement-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
.advancement-icon {
width: 40px;
height: 40px;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
&:hover {
border-color: var(--color-border-highlight);
}
}
input[type="text"] {
flex: 1;
font-weight: bold;
}
.toggle-advancement-description {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
margin-left: 0.25rem;
&:hover {
background: var(--color-control-bg-hover);
}
i {
margin: 0;
color: rgba(0, 0, 0, 0.7);
}
}
.delete-advancement {
padding: 0.25rem 0.5rem;
background: var(--color-control-bg);
border: 1px solid var(--color-border-dark);
border-radius: 3px;
cursor: pointer;
flex-shrink: 0;
&:hover {
background: rgba(255, 0, 0, 0.1);
border-color: rgba(255, 0, 0, 0.5);
}
i {
margin: 0;
color: rgba(255, 0, 0, 0.7);
}
}
}
.advancement-description {
margin-top: 0.5rem;
overflow: hidden;
transition:
max-height 0.3s ease-out,
opacity 0.3s ease-out;
max-height: 500px;
opacity: 1;
&.collapsed {
max-height: 0;
opacity: 0;
margin-top: 0;
}
}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
"download": "#{DOWNLOAD}#",
"url": "#{URL}#",
"license": "LICENSE",
"version": "13.0.0",
"version": "13.0.1",
"authors": [
{
"name": "Uberwald",
+2 -59
View File
@@ -8,13 +8,7 @@
<fieldset>
<legend>{{localize "PRISMRPG.Label.biodata"}}</legend>
<div class="biodata">
<div class="biodata-elem">
<span class="name">Class</span>
{{formInput
systemFields.biodata.fields.class
value=system.biodata.class
}}
</div>
{{!-- Class and Mortal fields removed - don't exist in DataModel --}}
<div class="biodata-elem">
<span class="name">Level</span>
{{formInput
@@ -22,13 +16,6 @@
value=system.biodata.level
}}
</div>
<div class="biodata-elem">
<span class="name">Mortal</span>
{{formInput
systemFields.biodata.fields.mortal
value=system.biodata.mortal
}}
</div>
<div class="biodata-elem">
<span class="name">Age</span>
{{formInput systemFields.biodata.fields.age value=system.biodata.age}}
@@ -82,51 +69,7 @@
value=system.biodata.magicUser
}}
</div>
<!-- <div class="biodata-elem">
<span class="name">Cleric User</span>
{{formInput
systemFields.biodata.fields.clericUser
value=system.biodata.clericUser
}}
</div> -->
<div class="biodata-elem">
<span class="name">Save bonus (1/5levels)</span>
{{formInput
systemFields.modifiers.fields.saveModifier
value=system.modifiers.saveModifier
disabled=true
}}
</div>
{{#if system.biodata.magicUser}}
<div class="biodata-elem">
<span class="name">Spell bonus (1/5levels)</span>
{{formInput
systemFields.modifiers.fields.levelSpellModifier
value=system.modifiers.levelSpellModifier
disabled=true
}}
</div>
{{/if}}
{{#if system.biodata.clericUser}}
<div class="biodata-elem">
<span class="name">Miracle bonus (1/5levels)</span>
{{formInput
systemFields.modifiers.fields.levelMiracleModifier
value=system.modifiers.levelMiracleModifier
disabled=true
}}
</div>
{{/if}}
<div class="biodata-elem">
<span class="name">Last HD roll</span>
{{formInput
systemFields.biodata.fields.hpPerLevel
value=system.biodata.hpPerLevel
disabled=true
}}
</div>
{{!-- Cleric User, modifiers, and hpPerLevel fields removed - don't exist in DataModel --}}
</div>
</fieldset>
+3
View File
@@ -21,6 +21,7 @@
class="item-img"
src="{{item.img}}"
data-tooltip="{{item.name}}"
data-action="postItemToChat"
/>
{{/if}}
<div class="name" data-tooltip="{{item.system.description}}">
@@ -88,6 +89,7 @@
class="item-img"
src="{{item.img}}"
data-tooltip="{{item.name}}"
data-action="postItemToChat"
/>
<div class="name" data-tooltip="{{item.system.description}}">
{{item.name}}
@@ -137,6 +139,7 @@
class="item-img"
src="{{item.img}}"
data-tooltip="{{item.name}}"
data-action="postItemToChat"
/>
<div class="name" data-tooltip="{{item.system.description}}">
{{item.name}}
+1 -1
View File
@@ -17,7 +17,7 @@
<div class="equipments">
{{#each equipments as |item|}}
<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}}}">
{{item.name}}
</div>
+24 -2
View File
@@ -86,6 +86,7 @@
</div>
<div class="hp-item">
<div class="hp-label">ARMOR</div>
<a data-action="armorPointsMinus"><i class="fa-solid fa-minus"></i></a>
<div class="hp-value">
{{formInput
systemFields.armorPoints.fields.value
@@ -93,6 +94,7 @@
disabled=isPlayMode
}}
</div>
<a data-action="armorPointsPlus"><i class="fa-solid fa-plus"></i></a>
<div class="hp-separator">/</div>
<div class="hp-max">
{{formInput
@@ -102,6 +104,26 @@
}}
</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>
@@ -270,7 +292,7 @@
<div class="race-content">
{{#if race}}
<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="controls">
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{race.id}}"
@@ -296,7 +318,7 @@
<div class="class-content">
{{#if classItem}}
<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="controls">
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{classItem.id}}"
-52
View File
@@ -1,52 +0,0 @@
<section class="tab character-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
<div class="main-div">
<fieldset>
<legend>{{localize "PRISMRPG.Label.manaPoints"}}</legend>
<div class="miracle-details">
<div class="miracle-detail">
<span>Current</span>
{{formField systemFields.manaPoints.fields.value value=system.manaPoints.value localize=true}}
<a data-action="manaPointsPlus"><i class="fa-solid fa-hexagon-plus"></i></a>
<a data-action="manaPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
<span>Max</span>
{{formField systemFields.manaPoints.fields.max value=system.manaPoints.max localize=true
disabled=isPlayMode}}
</div>
</div>
</fieldset>
<fieldset>
<legend>{{localize "PRISMRPG.Label.miracles"}}{{#if isEditMode}}<a class="action" data-tooltip="{{localize "
PRISMRPG.Tooltip.addMiracle"}}" data-tooltip-direction="UP"><i class="fas fa-plus"
data-action="createMiracle"></i></a>{{/if}}</legend>
<div class="miracles">
{{#each miracles as |item|}}
<div class="miracle" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="name">
{{item.name}}
</div>
<a class="rollable" data-roll-type="miracle-attack" data-roll-key="{{item.id}}" data-tooltip="Miracle Attack">
<i class="lf-roll-small fa-solid fa-swords" data-roll-type="miracle-attack" data-roll-key="{{item.id}}"></i>
</a>
<a class="rollable" data-roll-type="miracle-power" data-roll-key="{{item.id}}" data-tooltip="Miracle Power">
<i class="fa-duotone fa-solid fa-stars" data-roll-type="miracle-power" data-roll-key="{{item.id}}"></i>
</a>
<div class="controls">
<a data-tooltip="{{localize 'PRISMRPG.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
<a data-tooltip="{{localize 'PRISMRPG.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</div>
</section>
+3 -3
View File
@@ -11,8 +11,8 @@
<div class="skill {{#if item.system.isCoreSkill}}is-core-skill{{/if}}"
data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="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.system.description}}">
<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>
{{item.name}}
@@ -46,7 +46,7 @@
<div class="racial-abilities">
{{#each racialAbilities as |item|}}
<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">
{{item.name}}
</div>
+1 -1
View File
@@ -8,7 +8,7 @@
<div class="spells">
{{#each spells as |item|}}
<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">
{{item.name}}
</div>
+17 -1
View File
@@ -111,6 +111,22 @@
</div>
{{/if}}
{{#if (eq rollType "skill")}}
{{#if rollData.skillSubAttributeLabel}}
<div class="skill-info-card">
<div class="skill-header">
<strong class="skill-name">Skill Check</strong>
</div>
<div class="skill-stats">
<div class="stat-item subattribute">
<i class="fas fa-diagram-project"></i>
<span>{{rollData.skillSubAttributeLabel}} (+{{rollData.skillSubAttributeValue}})</span>
</div>
</div>
</div>
{{/if}}
{{/if}}
{{#if rollData.letItFly}}
<div class="special-badge">Let It Fly!</div>
{{/if}}
@@ -180,7 +196,7 @@
{{/if}}
</div>
{{/if}}
{{#if isResource}}
<div class="result-badge {{resultType}}">
{{#if isPrivate}}
+55 -1
View File
@@ -7,6 +7,7 @@
{{! Navigation des onglets }}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item {{tabs.details.cssClass}}" data-tab="details">{{localize "PRISMRPG.Label.details"}}</a>
<a class="item {{tabs.advancements.cssClass}}" data-tab="advancements">{{localize "PRISMRPG.Label.advancement"}}</a>
<a class="item {{tabs.description.cssClass}}" data-tab="description">{{localize "PRISMRPG.Label.description"}}</a>
</nav>
@@ -61,7 +62,7 @@
<legend>{{localize "PRISMRPG.Label.classFeatures"}}</legend>
{{#each system.features as |feature level|}}
<label>{{localize "PRISMRPG.Label.level"}} {{inc @key}}</label>
<label>{{localize "PRISMRPG.Label.level"}} {{replace @key "level" ""}}</label>
{{formInput
(lookup ../systemFields.features.fields @key)
enriched=(lookup ../enrichedFeatures @key)
@@ -73,6 +74,59 @@
</fieldset>
</div>
{{! Onglet Advancements }}
<div class="tab {{tabs.advancements.cssClass}}" data-group="primary" data-tab="advancements">
<fieldset>
<legend>{{localize "PRISMRPG.Label.advancement"}}</legend>
{{#each advancementsByLevel as |levelData|}}
<div class="advancement-level">
<h3>
<span class="level-title">{{localize "PRISMRPG.Label.level"}} {{levelData.level}}</span>
<button type="button" class="add-advancement" data-level="{{levelData.levelKey}}" data-tooltip="{{localize 'PRISMRPG.Label.addAdvancement'}}">
<i class="fas fa-plus"></i>
</button>
</h3>
{{#if levelData.advancements.length}}
<div class="advancement-list">
{{#each levelData.advancements as |advancement|}}
<div class="advancement-item">
<div class="advancement-header">
<img class="advancement-icon" src="{{advancement.icon}}" data-level="{{advancement.levelKey}}" data-index="{{advancement.index}}" />
{{formInput
../../systemFields.advancements.fields.level1.element.fields.name
value=advancement.name
name=(concat "system.advancements." advancement.levelKey "." advancement.index ".name")
placeholder=(localize "PRISMRPG.Label.advancementName")
}}
<button type="button" class="toggle-advancement-description" data-tooltip="{{localize 'PRISMRPG.Label.toggleDescription'}}">
<i class="fas fa-chevron-down"></i>
</button>
<button type="button" class="delete-advancement" data-level="{{advancement.levelKey}}" data-index="{{advancement.index}}" data-tooltip="{{localize 'PRISMRPG.Label.deleteAdvancement'}}">
<i class="fas fa-trash"></i>
</button>
</div>
<div class="advancement-description collapsed">
{{formInput
../../systemFields.advancements.fields.level1.element.fields.description
enriched=advancement.enrichedDescription
value=advancement.description
name=(concat "system.advancements." advancement.levelKey "." advancement.index ".description")
toggled=true
}}
</div>
</div>
{{/each}}
</div>
{{else}}
<p class="empty-advancements">{{localize "PRISMRPG.Label.noAdvancements"}}</p>
{{/if}}
</div>
{{/each}}
</fieldset>
</div>
{{! Onglet Description }}
<div class="tab {{tabs.description.cssClass}}" data-group="primary" data-tab="description">
<fieldset>
+23
View File
@@ -149,6 +149,29 @@
{{/if}}
{{/if}}
{{! Skill Options }}
{{#if (eq rollType "skill")}}
<div class="option-section skill-section">
<div class="section-title">
<i class="fas fa-dice-d20"></i>
<span>Skill Options</span>
</div>
{{! Choose which sub-attribute to use }}
<div class="option-row">
<label>Use Sub-Attribute:</label>
<select name="skillSubAttribute" class="styled-select">
<option value="{{rollTarget.subAttribute1}}" selected>
{{rollTarget.subAttribute1Label}} (+{{rollTarget.subAttribute1Value}})
</option>
<option value="{{rollTarget.subAttribute2}}">
{{rollTarget.subAttribute2Label}} (+{{rollTarget.subAttribute2Value}})
</option>
</select>
</div>
</div>
{{/if}}
{{! Advantage/Disadvantage }}
{{#if hasAdvantage}}
<div class="option-section">
+21 -1
View File
@@ -89,7 +89,7 @@
{{! Spell-specific options }}
<fieldSet class="dialog-spell-options">
<legend>Spell Options</legend>
<div class="dialog-save" style="font-size: 0.9em; color: #666; margin-bottom: 0.5em;">
<span>Casting with: {{rollTarget.mentalCharacteristic}} ({{rollTarget.mentalCharValue}}, +{{rollTarget.value}})</span>
<br><span>Base Cost: {{rollTarget.system.manaCost}} Mana, {{rollTarget.system.apc}} APC</span>
@@ -117,6 +117,26 @@
{{/if}}
{{/if}}
{{! Skill Options }}
{{#if (eq rollType "skill")}}
<fieldSet class="dialog-skill-options">
<legend>Skill Options</legend>
{{! Choose which sub-attribute to use }}
<div class="dialog-save">
<label>Use Sub-Attribute:</label>
<select name="skillSubAttribute" data-tooltip-direction="UP">
<option value="{{rollTarget.subAttribute1}}" selected>
{{rollTarget.subAttribute1Label}} (+{{rollTarget.subAttribute1Value}})
</option>
<option value="{{rollTarget.subAttribute2}}">
{{rollTarget.subAttribute2Label}} (+{{rollTarget.subAttribute2Value}})
</option>
</select>
</div>
</fieldSet>
{{/if}}
{{#if hasAdvantage}}
<fieldSet class="dialog-advantage">
<legend>{{localize "PRISMRPG.Roll.advantageDisadvantage"}}</legend>
+18 -22
View File
@@ -11,35 +11,31 @@
<p class="hint">{{localize "PRISMRPG.Hint.isCoreSkill"}}</p>
</div>
{{!-- Primary Attribute for Skill Checks --}}
{{!-- First Sub-Attribute for Skill Checks --}}
<div class="form-group">
<label>{{localize "PRISMRPG.Label.primaryAttribute"}}</label>
<select name="system.primaryAttribute">
{{#each config.CHARACTERISTICS}}
<option value="{{@key}}" {{#if (eq ../system.primaryAttribute @key)}}selected{{/if}}>
<label>{{localize "PRISMRPG.Label.subAttribute1"}}</label>
<select name="system.subAttribute1">
{{#each config.SUB_ATTRIBUTES}}
<option value="{{@key}}" {{#if (eq ../system.subAttribute1 @key)}}selected{{/if}}>
{{localize this.label}}
</option>
{{/each}}
</select>
<p class="hint">Primary attribute used for skill checks (D&D 5e style: ability modifier + proficiency)</p>
<p class="hint">First sub-attribute used for skill checks</p>
</div>
{{#if system.isCoreSkill}}
{{!-- Attribute Bonus Selection --}}
<div class="form-group">
<label>{{localize "PRISMRPG.Label.attributeBonusChoice"}}</label>
<select name="system.attributeBonus">
<option value="">{{localize "PRISMRPG.Label.selectAttribute"}}</option>
{{#each config.CHARACTERISTICS}}
<option value="{{@key}}" {{#if (eq ../system.attributeBonus @key)}}selected{{/if}}>
{{localize this.label}}
</option>
{{/each}}
</select>
<p class="hint">{{localize "PRISMRPG.Hint.attributeBonus"}}</p>
</div>
{{/if}}
{{!-- Second Sub-Attribute for Skill Checks --}}
<div class="form-group">
<label>{{localize "PRISMRPG.Label.subAttribute2"}}</label>
<select name="system.subAttribute2">
{{#each config.SUB_ATTRIBUTES}}
<option value="{{@key}}" {{#if (eq ../system.subAttribute2 @key)}}selected{{/if}}>
{{localize this.label}}
</option>
{{/each}}
</select>
<p class="hint">Second sub-attribute used for skill checks</p>
</div>
{{!-- Notes --}}
<fieldset>