This is now officially support fan-material
Add Ship sheet
Layout fix for adversaries
Ability to remove skills on adversaries, useful when duplicating a adversary
Option to automatically apply spell cost when rolled
Added Armor compendium
Added Weapons compendium
Skills compendium updated with descriptions
Co-Authored-By: erebus <erebus@rikspolisen.se>
Co-Committed-By: erebus <erebus@rikspolisen.se>
This commit was merged in pull request #3.
This commit is contained in:
2020-12-04 19:50:46 +00:00
parent 2e389704ea
commit c103fac27c
26 changed files with 559 additions and 76 deletions

View File

@@ -72,6 +72,8 @@ export class ActorSheetKH extends ActorSheet {
const gear = [];
const spells = [];
const attacks = [];
const shipweapons = [];
const shiptalents = [];
// Iterate through items, allocating to containers
for (let i of sheetData.items) {
@@ -96,6 +98,10 @@ export class ActorSheetKH extends ActorSheet {
spells.push(i);
} else if (i.type === "adversaryAttack") {
attacks.push(i);
} else if (i.type === "shiptalent") {
shiptalents.push(i);
} else if (i.type === "shipweapon") {
shipweapons.push(i);
}
}
@@ -109,8 +115,11 @@ export class ActorSheetKH extends ActorSheet {
actorData.gear = gear;
actorData.spells = spells;
actorData.attacks = attacks;
actorData.shiptalents = shiptalents;
actorData.shipweapons = shipweapons;
}
/* -------------------------------------------- */
/** @override */

View File

@@ -14,6 +14,12 @@ export default class KHDiceRoller {
const html = await renderTemplate("systems/kopparhavet/templates/dice/roll.html", rollData);
if(game.settings.get("kopparhavet", "applySpellCost")) {
let totalCostForActor = speaker.data.data.mana.value + roll.total
speaker.update({ ["data.mana.value"]: totalCostForActor });
}
await roll.toMessage({
create: true,
content: html,

View File

@@ -94,6 +94,41 @@ export class ItemSheetKH extends ItemSheet {
skillList.push(item)
}
}
<<<<<<< HEAD
this.position.width = 450;
this.position.height = 605;
break;
case "shipweapon":
// Load Skills Compendium skills
let skillList4
if(game.settings.get("kopparhavet", "gameSystem") === "hjaltarnas-tid") {
skillList4 = await game.packs.get("kopparhavet.skills-ht").getContent();
} else {
skillList4 = await game.packs.get("kopparhavet.skills").getContent();
}
for (let item of skillList4) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
}
}
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
}
}
this.position.width = 530;
this.position.height = 750;
break;
case "shiptalent":
this.position.width = 405;
this.position.height = 570;
break;
=======
>>>>>>> master
default:
this.position.width = 450;
this.position.height = 605;

View File

@@ -21,6 +21,8 @@ export class ItemKH extends Item {
itemData.isSpell = itemData.type === "spell";
itemData.isTalent = itemData.type === "talent";
itemData.isWeapon = itemData.type === "weapon";
itemData.isShipWeapon = itemData.type === "shipweapon";
itemData.isShipTalent = itemData.type === "shiptalent";
const html = await renderTemplate("systems/kopparhavet/templates/chat/item-card.html", itemData);
@@ -56,6 +58,8 @@ export class ItemKH extends Item {
itemData.isSpell = itemData.type === "spell";
itemData.isTalent = itemData.type === "talent";
itemData.isWeapon = itemData.type === "weapon";
itemData.isShipWeapon = itemData.type === "shipweapon";
itemData.isShipTalent = itemData.type === "shiptalent";
return itemData
}

View File

@@ -38,6 +38,14 @@ Hooks.once("init", () => {
window.location.reload();
},
});
game.settings.register("kopparhavet", "applySpellCost", {
name: "Apply Spell Cost",
hint: "Automatically add spell cost to the character when rolled.",
scope: "world",
config: true,
default: false,
type: Boolean,
});
//registerFonts();
registerSheets();
@@ -63,6 +71,7 @@ function registerSheets() {
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("kopparhavet", ActorSheetKH, { types: ["character"], makeDefault: true });
Actors.registerSheet("kopparhavet", ActorSheetKH, { types: ["adversary"], makeDefault: true });
Actors.registerSheet("kopparhavet", ActorSheetKH, { types: ["ship"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["weapon"], makeDefault: true });
@@ -72,6 +81,8 @@ function registerSheets() {
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["spell"], makeDefault: true });
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["talent"], makeDefault: true });
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["adversaryAttack"], makeDefault: true });
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["shiptalent"], makeDefault: true });
Items.registerSheet("kopparhavet", ItemSheetKH, { types: ["shipweapon"], makeDefault: true });
}
function preloadHandlebarsTemplates() {
@@ -79,6 +90,7 @@ function preloadHandlebarsTemplates() {
"systems/kopparhavet/templates/chat/item-card.html",
"systems/kopparhavet/templates/actors/adversary-sheet.html",
"systems/kopparhavet/templates/actors/character-sheet.html",
"systems/kopparhavet/templates/actors/ship-sheet.html",
"systems/kopparhavet/templates/dice/roll.html",
"systems/kopparhavet/templates/items/adversaryAttack-sheet.html",
"systems/kopparhavet/templates/items/armor-sheet.html",
@@ -87,6 +99,8 @@ function preloadHandlebarsTemplates() {
"systems/kopparhavet/templates/items/spell-sheet.html",
"systems/kopparhavet/templates/items/talent-sheet.html",
"systems/kopparhavet/templates/items/weapon-sheet.html",
"systems/kopparhavet/templates/items/shipweapon-sheet.html",
"systems/kopparhavet/templates/items/shiptalent-sheet.html",
"systems/kopparhavet/templates/parts/actor/main.html",
"systems/kopparhavet/templates/parts/actor/bio.html",
"systems/kopparhavet/templates/parts/actor/combat.html",
@@ -94,6 +108,8 @@ function preloadHandlebarsTemplates() {
"systems/kopparhavet/templates/parts/actor/skills.html",
"systems/kopparhavet/templates/parts/actor/talent.html",
"systems/kopparhavet/templates/parts/shared/modifications.html",
"systems/kopparhavet/templates/parts/actor/ship-main.html",
"systems/kopparhavet/templates/parts/actor/ship-combat.html",
];
return loadTemplates(templatePaths);
}
@@ -103,6 +119,7 @@ function preloadHandlebarsTemplatesHT() {
"systems/kopparhavet/templates/chat/item-card.html",
"systems/kopparhavet/templates/actors/ht-adversary-sheet.html",
"systems/kopparhavet/templates/actors/ht-character-sheet.html",
"systems/kopparhavet/templates/actors/ht-ship-sheet.html",
"systems/kopparhavet/templates/dice/roll.html",
"systems/kopparhavet/templates/items/adversaryAttack-sheet.html",
"systems/kopparhavet/templates/items/armor-sheet.html",
@@ -111,12 +128,16 @@ function preloadHandlebarsTemplatesHT() {
"systems/kopparhavet/templates/items/spell-sheet.html",
"systems/kopparhavet/templates/items/talent-sheet.html",
"systems/kopparhavet/templates/items/weapon-sheet.html",
"systems/kopparhavet/templates/items/shipweapon-sheet.html",
"systems/kopparhavet/templates/items/shiptalent-sheet.html",
"systems/kopparhavet/templates/parts/actor/ht-main.html",
"systems/kopparhavet/templates/parts/actor/ht-combat.html",
"systems/kopparhavet/templates/parts/actor/gear.html",
"systems/kopparhavet/templates/parts/actor/ht-skills.html",
"systems/kopparhavet/templates/parts/actor/talent.html",
"systems/kopparhavet/templates/parts/shared/modifications.html",
"systems/kopparhavet/templates/parts/actor/ship-main.html",
"systems/kopparhavet/templates/parts/actor/ship-combat.html",
];
return loadTemplates(templatePaths);
}