Merge branch 'develop' into lefrique
This commit is contained in:
@@ -195,6 +195,7 @@ export interface M5CharacterCalculatedData {
|
||||
defensiveWeapons: {};
|
||||
armor: {};
|
||||
items: {};
|
||||
containers: {};
|
||||
effects: {};
|
||||
};
|
||||
spells: {};
|
||||
|
||||
@@ -31,6 +31,7 @@ export class M5Character extends Actor {
|
||||
defensiveWeapons?: boolean;
|
||||
armor?: boolean;
|
||||
items?: boolean;
|
||||
containers?: boolean;
|
||||
spells?: boolean;
|
||||
effects?: boolean;
|
||||
kampfkuenste?: boolean;
|
||||
@@ -85,6 +86,7 @@ export class M5Character extends Actor {
|
||||
defensiveWeapons: {},
|
||||
armor: {},
|
||||
items: {},
|
||||
containers: {},
|
||||
effects: {},
|
||||
},
|
||||
spells: {},
|
||||
@@ -153,7 +155,7 @@ export class M5Character extends Actor {
|
||||
const aggregate = new M5ModAggregate(data, ret);
|
||||
|
||||
context.items
|
||||
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor") && item.system.equipped)
|
||||
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container") && item.system.equipped)
|
||||
.forEach((item) => {
|
||||
const mods = item.system.mods;
|
||||
//console.log("Actor item mods", mods)
|
||||
@@ -185,6 +187,7 @@ export class M5Character extends Actor {
|
||||
ret.stats.hoard += item.system.value || 0;
|
||||
}
|
||||
|
||||
let icon = item.img;
|
||||
let rollable = false;
|
||||
|
||||
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
|
||||
@@ -197,11 +200,50 @@ export class M5Character extends Actor {
|
||||
|
||||
ret.gear.items[item.id] = {
|
||||
label: label,
|
||||
icon: icon,
|
||||
magic: item.system.magic,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
weight: item.system.weight || 0,
|
||||
containerId: item.system.containerId || "",
|
||||
value: item.system.value || 0,
|
||||
currency: item.system.currency || "",
|
||||
quantity: item.system.quantity || 0,
|
||||
rollExist: rollable,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
if (!skip?.containers) {
|
||||
context.items
|
||||
?.filter((item) => item.type === "container")
|
||||
.forEach((item) => {
|
||||
item.prepareDerivedData();
|
||||
|
||||
let label = item.name;
|
||||
if (item.system.magic) {
|
||||
label += "*";
|
||||
}
|
||||
let icon = item.img;
|
||||
let rollable = false;
|
||||
|
||||
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
|
||||
for (let key in item.system.rolls.formulas) {
|
||||
rollable = item.system.rolls.formulas[key].enabled;
|
||||
if (rollable) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret.gear.containers[item.id] = {
|
||||
label: label,
|
||||
icon: icon,
|
||||
magic: item.system.magic,
|
||||
valuable: item.system?.valuable,
|
||||
hoarded: item.system?.hoarded,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
weight: item.system.weight || 0,
|
||||
containerId: item.system.containerId || "",
|
||||
value: item.system.value || 0,
|
||||
currency: item.system.currency || "",
|
||||
quantity: item.system.quantity || 0,
|
||||
|
||||
@@ -14,7 +14,22 @@ export class M5Item extends Item {
|
||||
const itemData = (this as any).system;
|
||||
const calc = itemData.calc;
|
||||
|
||||
if (itemType === "skill") {
|
||||
if (itemType === "item") {
|
||||
calc.containers = null;
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = actor.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
if (actorCalc) {
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
} else if (itemType === "skill") {
|
||||
calc.fw = itemData.fw;
|
||||
calc.bonus = 0;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
template: "systems/midgard5/templates/sheets/character/main.hbs",
|
||||
width: 800,
|
||||
width: 1200,
|
||||
height: 800,
|
||||
classes: ["midgard5", "sheet", "character"],
|
||||
tabs: [{ navSelector: ".sheet-navigation", contentSelector: ".sheet-content", initial: "base_values" }],
|
||||
@@ -270,7 +270,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
const item = this.actor.items.get(li.dataset.itemId);
|
||||
|
||||
// limit transfer on personal weapons/armour/gear
|
||||
if (["skill", "item", "weapon", "defensiveWeapon", "armor", "spell", "effect", "kampfkunst"].includes(item.type)) {
|
||||
if (["skill", "item", "weapon", "defensiveWeapon", "armor", "spell", "effect", "kampfkunst", "container"].includes(item.type)) {
|
||||
const dragData = {
|
||||
type: "Transfer",
|
||||
actorId: this.actor.id,
|
||||
|
||||
@@ -30,7 +30,7 @@ export class M5ItemSheet extends ItemSheet {
|
||||
context.rollData = {}
|
||||
let actor = this.object?.parent ?? null
|
||||
if (actor) {
|
||||
context.rollData = actor.getRollData()
|
||||
context.rollData = actor.getRollData()
|
||||
}
|
||||
|
||||
context.data = itemData.system
|
||||
|
||||
@@ -3,6 +3,37 @@
|
||||
@attributeBorderColor: rgba(0, 0, 0, 0.5);
|
||||
|
||||
.midgard5 {
|
||||
.flexbox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap
|
||||
}
|
||||
|
||||
.flexcolumn-2 {
|
||||
flex: 50%;
|
||||
}
|
||||
|
||||
.flexpart {
|
||||
gap: 0;
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
background-color: beige;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
.flexpart-header {
|
||||
font-weight: bold;
|
||||
font-size: large;
|
||||
text-align: center;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.flexpart-icon {
|
||||
height: 2rem;
|
||||
float: left;
|
||||
border: 0px solid transparent;
|
||||
}
|
||||
|
||||
.flexrow {
|
||||
align-items: center;
|
||||
}
|
||||
@@ -33,7 +64,7 @@
|
||||
|
||||
.profile-img {
|
||||
max-width: 128px;
|
||||
height: 160px;
|
||||
height: 128px;
|
||||
border: 0px solid black;
|
||||
}
|
||||
|
||||
@@ -68,6 +99,7 @@
|
||||
|
||||
table {
|
||||
background-color: beige;
|
||||
border: 0px solid transparent;
|
||||
}
|
||||
|
||||
td,
|
||||
@@ -104,10 +136,16 @@
|
||||
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
background-color: dimgray;
|
||||
}
|
||||
}
|
||||
|
||||
.table-icon {
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
float: left;
|
||||
border: 0px solid transparent;
|
||||
}
|
||||
|
||||
input.skill {
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
+18
-3
@@ -138,17 +138,21 @@
|
||||
"wahrsagen": { "fw": 0, "attribute": "zt", "initial": 8, "pp": 0 },
|
||||
"wasserkampf": { "fw": 0, "attribute": "gw", "initial": 8, "pp": 0 },
|
||||
"zauberkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"gear": {
|
||||
"gear": {
|
||||
}
|
||||
}
|
||||
},
|
||||
"character": {
|
||||
"templates": ["characterBars", "attributes", "characterDescription", "characterHeader", "skills"],
|
||||
"templates": ["characterBars", "attributes", "characterDescription", "characterHeader", "skills", "gear"],
|
||||
"calc": {}
|
||||
}
|
||||
},
|
||||
"Item": {
|
||||
"types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "kampfkunst", "item", "effect"],
|
||||
"types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "kampfkunst", "item", "effect", "container"],
|
||||
"templates": {
|
||||
"itemDescription": {
|
||||
"description": ""
|
||||
@@ -210,6 +214,8 @@
|
||||
},
|
||||
"physical": {
|
||||
"value": 0,
|
||||
"weight": 0,
|
||||
"containerId": "",
|
||||
"magic": false
|
||||
},
|
||||
"durationSelection": {
|
||||
@@ -313,6 +319,15 @@
|
||||
"mods": {},
|
||||
"calc": {}
|
||||
},
|
||||
"container": {
|
||||
"templates": ["itemDescription", "equippable", "physical"],
|
||||
"rolls": {
|
||||
"formulas": {},
|
||||
"output": ""
|
||||
},
|
||||
"mods": {},
|
||||
"calc": {}
|
||||
},
|
||||
"effect": {
|
||||
"templates": ["itemDescription", "equippable", "physical", "durationSelection"],
|
||||
"rolls": {
|
||||
|
||||
Reference in New Issue
Block a user