Zwergenhort revised
This commit is contained in:
@@ -88,6 +88,8 @@ export enum M5Stats {
|
||||
DRINKING = "drinking",
|
||||
HOARD = "hoard",
|
||||
HOARD_NEXT = "hoardNext",
|
||||
HOARD_MIN = "hoardMin",
|
||||
WEALTH = "wealth",
|
||||
}
|
||||
|
||||
export enum M5ModType {
|
||||
@@ -177,6 +179,8 @@ export interface M5CharacterCalculatedData {
|
||||
drinkingFW: number;
|
||||
hoard: number;
|
||||
hoardNext: number;
|
||||
hoardMin: number;
|
||||
wealth: number;
|
||||
};
|
||||
skillMods: {};
|
||||
skills: {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { M5Item } from "../items/M5Item";
|
||||
import { M5Attribute, M5CharacterCalculatedData, M5ItemMod, M5ModOperation, M5ModResult, M5RollData, M5Skill, M5SkillCalculated, M5SkillLearned } from "../M5Base";
|
||||
import M5ModAggregate from "./M5ModAggregate";
|
||||
|
||||
export class M5Character extends Actor {
|
||||
// constructor(
|
||||
// data: ConstructorParameters<typeof foundry.documents.BaseActor>[0],
|
||||
@@ -144,8 +143,10 @@ export class M5Character extends Actor {
|
||||
ret.stats.perceptionFW = 6;
|
||||
ret.stats.drinking = this.modResult(0);
|
||||
ret.stats.drinkingFW = Math.floor(ret.attributes.ko.value / 10);
|
||||
ret.stats.hoard = M5Character.hoardFromExp(data.es);
|
||||
ret.stats.hoardNext = M5Character.hoardNextFromExp(data.es);
|
||||
ret.stats.hoardMin = M5Character.levelThreshold.at (ret.level - 1)/2;
|
||||
ret.stats.hoardNext = M5Character.levelThreshold.at (ret.level)/2;
|
||||
ret.stats.wealth = data.info.gold + data.info.silver/10 + data.info.copper/100 - (data.info.race === "Zwerg" ? (ret.stats.hoardMin) : 0);
|
||||
ret.stats.hoard = ret.stats.wealth + (data.info.race === "Zwerg" ? (ret.stats.hoardMin) : 0);
|
||||
|
||||
if (!skip?.mods) {
|
||||
const aggregate = new M5ModAggregate(data, ret);
|
||||
@@ -173,7 +174,13 @@ export class M5Character extends Actor {
|
||||
let label = item.name;
|
||||
if (item.system.magic) {
|
||||
label += "*";
|
||||
};
|
||||
if (item.system.valuable) {
|
||||
label += "€";
|
||||
ret.stats.wealth += item.system.value || 0;
|
||||
ret.stats.hoard += item.system.value || 0;
|
||||
}
|
||||
|
||||
let rollable = false;
|
||||
|
||||
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
|
||||
@@ -183,9 +190,11 @@ export class M5Character extends Actor {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ret.gear.items[item.id] = {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
valuable: item.system?.valuable,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
value: item.system.value || 0,
|
||||
@@ -193,6 +202,7 @@ export class M5Character extends Actor {
|
||||
quantity: item.system.quantity || 0,
|
||||
rollExist: rollable,
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -205,8 +215,8 @@ export class M5Character extends Actor {
|
||||
let label = item.name;
|
||||
if (item.system.magic) {
|
||||
label += "*";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ret.gear.effects[item.id] = {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
@@ -249,12 +259,19 @@ export class M5Character extends Actor {
|
||||
(item.system.stats.damageBonus < 0 ? "" : "+") +
|
||||
item.system.stats.damageBonus +
|
||||
")";
|
||||
}
|
||||
|
||||
};
|
||||
if (item.system.valuable) {
|
||||
label += "€";
|
||||
ret.stats.wealth += item.system.value || 0;
|
||||
ret.stats.hoard += item.system.value || 0;
|
||||
}
|
||||
|
||||
ret.gear.weapons[item.id] = {
|
||||
label: label,
|
||||
skillId: item.system.skillId,
|
||||
magic: item.system.magic,
|
||||
valuable: item.system?.valuable,
|
||||
value: item.system.value || 0,
|
||||
calc: item.system.calc,
|
||||
};
|
||||
});
|
||||
@@ -269,12 +286,19 @@ export class M5Character extends Actor {
|
||||
let label = item.name;
|
||||
if (item.system.magic) {
|
||||
label += "*(" + (item.system.stats.defenseBonus < 0 ? "" : "+") + item.system.stats.defenseBonus + ")";
|
||||
};
|
||||
if (item.system.valuable) {
|
||||
label += "€";
|
||||
ret.stats.wealth += item.system.value || 0;
|
||||
ret.stats.hoard += item.system.value || 0;
|
||||
}
|
||||
|
||||
|
||||
ret.gear.defensiveWeapons[item.id] = {
|
||||
label: label,
|
||||
skillId: item.system.skillId,
|
||||
magic: item.system.magic,
|
||||
valuable: item.system?.valuable,
|
||||
value: item.system.value || 0,
|
||||
calc: item.system.calc,
|
||||
};
|
||||
});
|
||||
@@ -289,11 +313,18 @@ export class M5Character extends Actor {
|
||||
let label = item.name;
|
||||
if (item.system.magic) {
|
||||
label += "*";
|
||||
}
|
||||
|
||||
};
|
||||
if (item.system.valuable) {
|
||||
label += "€";
|
||||
ret.stats.wealth += item.system.value || 0;
|
||||
ret.stats.hoard += item.system.value || 0;
|
||||
}
|
||||
|
||||
ret.gear.armor[item.id] = {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
valuable: item.system?.valuable,
|
||||
value: item.system.value || 0,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
};
|
||||
@@ -374,21 +405,7 @@ export class M5Character extends Actor {
|
||||
const ret = M5Character.levelThreshold.findIndex((val) => val > exp);
|
||||
return ret === -1 ? M5Character.levelThreshold.length : ret;
|
||||
}
|
||||
|
||||
static hoardFromExp(exp: number): number {
|
||||
const ret = M5Character.levelThreshold.findIndex((val) => val > exp);
|
||||
const hoard = Math.floor(exp / 2)
|
||||
return hoard;
|
||||
}
|
||||
|
||||
static hoardNextFromExp(exp: number): number {
|
||||
const ret = M5Character.levelThreshold.findIndex((val) => val > exp);
|
||||
const currentLevel = ret === -1 ? M5Character.levelThreshold.length : ret;
|
||||
const nextLevelExp = M5Character.levelThreshold[currentLevel];
|
||||
const hoardNext = (nextLevelExp /2);
|
||||
return hoardNext;
|
||||
}
|
||||
|
||||
|
||||
static readonly defenseThreshold: Array<[number, number]> = [
|
||||
[30, 18],
|
||||
[25, 17],
|
||||
|
||||
@@ -66,19 +66,6 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hoard {
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 0);
|
||||
font-weight: bold;
|
||||
font-size: larger;
|
||||
}
|
||||
.hoardNext {
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 255);
|
||||
font-weight: bold;
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
table {
|
||||
background-color: beige;
|
||||
}
|
||||
|
||||
+11
-4
@@ -200,6 +200,10 @@
|
||||
"equippable": false,
|
||||
"equipped": true
|
||||
},
|
||||
"valuable": {
|
||||
"valuable": false,
|
||||
"item-wealth": true
|
||||
},
|
||||
"physical": {
|
||||
"value": 0,
|
||||
"magic": false
|
||||
@@ -297,7 +301,7 @@
|
||||
"calc": {}
|
||||
},
|
||||
"item": {
|
||||
"templates": ["itemDescription", "equippable", "physical"],
|
||||
"templates": ["itemDescription", "equippable", "physical","valuable"],
|
||||
"rolls": {
|
||||
"formulas": {},
|
||||
"output": ""
|
||||
@@ -315,9 +319,10 @@
|
||||
"calc": {}
|
||||
},
|
||||
"weapon": {
|
||||
"templates": ["itemDescription", "stats", "equippable", "physical"],
|
||||
"templates": ["itemDescription", "stats", "equippable", "physical","valuable"],
|
||||
"special": false,
|
||||
"ranged": false,
|
||||
"valuable": false,
|
||||
"skillId": "",
|
||||
"damageBase": "1d6",
|
||||
"rolls": {
|
||||
@@ -338,8 +343,9 @@
|
||||
"calc": {}
|
||||
},
|
||||
"defensiveWeapon": {
|
||||
"templates": ["itemDescription", "stats", "equippable", "physical"],
|
||||
"templates": ["itemDescription", "stats", "equippable", "physical","valuable"],
|
||||
"special": false,
|
||||
"valuable": false,
|
||||
"skillId": "",
|
||||
"rolls": {
|
||||
"formulas": {
|
||||
@@ -354,9 +360,10 @@
|
||||
"calc": {}
|
||||
},
|
||||
"armor": {
|
||||
"templates": ["itemDescription", "stats", "equippable", "attributeMod", "physical"],
|
||||
"templates": ["itemDescription", "stats", "equippable", "attributeMod", "physical","valuable"],
|
||||
"lpProtection": 0,
|
||||
"apProtection": 0,
|
||||
"valuable": false,
|
||||
"rolls": {
|
||||
"formulas": {},
|
||||
"output": ""
|
||||
|
||||
Reference in New Issue
Block a user