add auto-sync for Ikonis features and implement documentation via README.md
This commit is contained in:
parent
7bffeacaac
commit
5e77008c23
3 changed files with 111 additions and 32 deletions
|
|
@ -4,10 +4,10 @@ export const DEFAULT_AUGMENTS = [
|
|||
{ id: "shock", name: "Static Coil", effect: "Targets hit are Dazed", cost: "3 Copper", precompile: 2 },
|
||||
{ id: "shield", name: "Reactive Plating", effect: "+1 Armor while equipped", cost: "2 Steel", precompile: 1 },
|
||||
{ id: "range", name: "Long-Range Optics", effect: "Increases Range by 1 step", cost: "1 Lens", precompile: 2 },
|
||||
{ id: "crit", "name": "Precision Chip", "effect": "+1 to Crit range", "cost": "1 Gold", "precompile": 3 },
|
||||
{ id: "multi", "name": "Burst Module", "effect": "Can target 2 enemies (Half damage)", "cost": "2 Gears", "precompile": 4 },
|
||||
{ id: "drain", "name": "Siphon Link", "effect": "Recover 1 Hope on kill", "cost": "1 Soul Gem", "precompile": 4 },
|
||||
{ id: "weight", "name": "Gravity Plate", "effect": "Weapon is Heavy (more damage)", "cost": "4 Lead", "precompile": 2 }
|
||||
{ id: "crit", name: "Precision Chip", effect: "+1 to Crit range", cost: "1 Gold", precompile: 3 },
|
||||
{ id: "multi", name: "Burst Module", effect: "Can target 2 enemies (Half damage)", cost: "2 Gears", precompile: 4 },
|
||||
{ id: "drain", name: "Siphon Link", effect: "Recover 1 Hope on kill", cost: "1 Soul Gem", precompile: 4 },
|
||||
{ id: "weight", name: "Gravity Plate", effect: "Weapon is Heavy (more damage)", cost: "4 Lead", precompile: 2 }
|
||||
];
|
||||
|
||||
export function getAugments() {
|
||||
|
|
@ -18,20 +18,13 @@ export function getSlotCount(item) {
|
|||
const flags = item.getFlag('dh-ikonis') || {};
|
||||
if (typeof flags.slotOverride === "number") return flags.slotOverride;
|
||||
|
||||
// Daggerheart Tier detection (can be system.tier.value or system.tier)
|
||||
let tier = item.system?.tier?.value;
|
||||
if (tier === undefined) tier = item.system?.tier;
|
||||
|
||||
// Ensure we have a number
|
||||
const tierNum = parseInt(tier) || 1;
|
||||
|
||||
console.log(`DH-Ikonis | Detecting slots for Tier ${tierNum} (Raw: ${tier})`);
|
||||
|
||||
const settingKey = `slotsTier${tierNum}`;
|
||||
try {
|
||||
const slots = game.settings.get('dh-ikonis', settingKey);
|
||||
console.log(`DH-Ikonis | Setting [${settingKey}] returned: ${slots}`);
|
||||
return slots;
|
||||
return game.settings.get('dh-ikonis', settingKey);
|
||||
} catch (e) {
|
||||
return tierNum >= 2 ? 3 : 2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue