Merge branch 'develop' into entbehrungen
This commit is contained in:
@@ -1,18 +1,5 @@
|
||||
import { M5Item } from "../items/M5Item";
|
||||
import {
|
||||
M5Attribute,
|
||||
M5CharacterCalculatedData,
|
||||
M5ItemMod,
|
||||
M5ItemType,
|
||||
M5ModOperation,
|
||||
M5ModResult,
|
||||
M5ModType,
|
||||
M5RollData,
|
||||
M5Skill,
|
||||
M5SkillCalculated,
|
||||
M5SkillLearned,
|
||||
M5SkillType,
|
||||
} from "../M5Base";
|
||||
import { M5Attribute, M5CharacterCalculatedData, M5ItemMod, M5ItemType, M5ModOperation, M5ModResult, M5RollData, M5Skill, M5SkillCalculated } from "../M5Base";
|
||||
import M5ModAggregate from "./M5ModAggregate";
|
||||
export class M5Character extends Actor {
|
||||
// constructor(
|
||||
@@ -94,6 +81,7 @@ export class M5Character extends Actor {
|
||||
containers?: boolean;
|
||||
kampfkuenste?: boolean;
|
||||
encumbrance?: boolean;
|
||||
class?: boolean;
|
||||
} = {}
|
||||
): M5CharacterCalculatedData {
|
||||
let ret: M5CharacterCalculatedData = {
|
||||
@@ -193,12 +181,8 @@ export class M5Character extends Actor {
|
||||
ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus);
|
||||
ret.stats.defenseBonus = this.modResult(ret.attributes.gw.bonus);
|
||||
ret.stats.movement = this.modResult(data.movement);
|
||||
ret.stats.resistanceMind = this.modResult(
|
||||
(data.info.magicUsing ? 2 : 0) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race))
|
||||
);
|
||||
ret.stats.resistanceBody = this.modResult(
|
||||
(data.info.magicUsing ? 2 : 1) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.ko.bonus : this.raceBonus(data.info.race))
|
||||
);
|
||||
ret.stats.resistanceMind = this.modResult(ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race)));
|
||||
ret.stats.resistanceBody = this.modResult(ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.ko.bonus : this.raceBonus(data.info.race)));
|
||||
ret.stats.spellCasting = this.modResult((data.info.magicUsing ? M5Character.spellCastingFromLevel(ret.level) : 3) + ret.attributes.zt.bonus);
|
||||
ret.stats.brawl = this.modResult(Math.floor((ret.attributes.st.value + ret.attributes.gw.value) / 20));
|
||||
ret.stats.brawlFw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
|
||||
@@ -221,7 +205,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.type === "container") && item.system.equipped)
|
||||
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped)
|
||||
.forEach((item) => {
|
||||
const mods = item.system.mods;
|
||||
//console.log("Actor item mods", mods)
|
||||
@@ -498,6 +482,25 @@ export class M5Character extends Actor {
|
||||
//}
|
||||
}
|
||||
|
||||
if (!skip?.class) {
|
||||
context.items
|
||||
?.filter((item) => item.type === "class")
|
||||
.sort((a, b) => b?.system.magicUsing - a?.system.magicUsing)
|
||||
.forEach((item, index) => {
|
||||
if (index !== 0) {
|
||||
item.system.equipped = false;
|
||||
} else {
|
||||
item.system.equipped = true;
|
||||
data.info.magicUsing = item.system.magicUsing;
|
||||
}
|
||||
|
||||
if (typeof data.info.class === "string") {
|
||||
data.info.class = {};
|
||||
}
|
||||
data.info.class[item.id] = item.name;
|
||||
});
|
||||
}
|
||||
|
||||
if (!skip?.effects) {
|
||||
context.items
|
||||
?.filter((item) => item.type === "effect")
|
||||
@@ -579,7 +582,7 @@ export class M5Character extends Actor {
|
||||
type: item.system.type,
|
||||
castDuration: item.system.castDuration || 0,
|
||||
ap: item.system.ap || 0,
|
||||
range: item.system.range|| 0,
|
||||
range: item.system.range || 0,
|
||||
effectTarget: item.system.effectTarget,
|
||||
effectArea: item.system.effectArea,
|
||||
effectDuration: item.system.effectDuration || 0,
|
||||
|
||||
Reference in New Issue
Block a user