26 perception drinking all abilities (#56)
* Innate abilities + Added Perception as fixed innate ability + Added Drinking as fixed innate ability + Set Luckpoints to 0 * Duration Update + Added Duration to Effects + Added Perception to Eye & Ear Injury * Fixed like recommended + Fixed M5Base +Fixed M5Character + Fixed M5Rolls + Fixed Skills HBS + Fixed BrawlFw + Fixed Effect (not saved already) * fix minor issues --------- Co-authored-by: Byroks <byroks@gmail.com>
This commit is contained in:
@@ -84,6 +84,8 @@ export enum M5Stats {
|
||||
AP = "ap",
|
||||
PROTECTION_LP = "lpProtection",
|
||||
PROTECTION_AP = "apProtection",
|
||||
PERCEPTION = "perception",
|
||||
DRINKING = "drinking"
|
||||
}
|
||||
|
||||
export enum M5ModType {
|
||||
@@ -163,9 +165,13 @@ export interface M5CharacterCalculatedData {
|
||||
resistanceBody: M5ModResult;
|
||||
spellCasting: M5ModResult;
|
||||
brawl: M5ModResult;
|
||||
brawlEw: number;
|
||||
brawlFw: number;
|
||||
poisonResistance: M5ModResult;
|
||||
enduranceBonus: number;
|
||||
perception: M5ModResult;
|
||||
perceptionFW: number;
|
||||
drinking: M5ModResult;
|
||||
drinkingFW: number;
|
||||
};
|
||||
skillMods: {};
|
||||
skills: {
|
||||
|
||||
@@ -64,9 +64,13 @@ export class M5Character extends Actor {
|
||||
resistanceBody: { value: 0, mods: [] },
|
||||
spellCasting: { value: 0, mods: [] },
|
||||
brawl: { value: 0, mods: [] },
|
||||
brawlEw: 0,
|
||||
brawlFw: 0,
|
||||
poisonResistance: { value: 0, mods: [] },
|
||||
enduranceBonus: 0,
|
||||
perception: {value: 0, mods: []},
|
||||
perceptionFW: 0,
|
||||
drinking: {value: 0, mods: []},
|
||||
drinkingFW: 0,
|
||||
},
|
||||
skillMods: {},
|
||||
skills: {
|
||||
@@ -132,9 +136,13 @@ export class M5Character extends Actor {
|
||||
);
|
||||
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.brawlEw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
|
||||
ret.stats.brawlFw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
|
||||
ret.stats.poisonResistance = this.modResult(30 + Math.floor(ret.attributes.ko.value / 2));
|
||||
ret.stats.enduranceBonus = Math.floor(ret.attributes.ko.value / 10) + Math.floor(ret.attributes.st.value / 20);
|
||||
ret.stats.perception = this.modResult(0);
|
||||
ret.stats.perceptionFW = 6;
|
||||
ret.stats.drinking = this.modResult(0);
|
||||
ret.stats.drinkingFW = Math.floor(ret.attributes.ko.value / 10);
|
||||
|
||||
if (!skip?.mods) {
|
||||
const aggregate = new M5ModAggregate(data, ret);
|
||||
|
||||
@@ -41,6 +41,8 @@ export default class M5ModAggregate {
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.AP, operation: M5ModOperation.SET, value: calc.stats.ap.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_LP, operation: M5ModOperation.SET, value: calc.stats.lpProtection.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_AP, operation: M5ModOperation.SET, value: calc.stats.apProtection.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.PERCEPTION, operation: M5ModOperation.SET, value: calc.stats.perception.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.DRINKING, operation: M5ModOperation.SET, value: calc.stats.drinking.value }, characterString);
|
||||
}
|
||||
|
||||
push(mod: M5ItemMod, source: string) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Evaluated } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/client/dice/roll";
|
||||
import { M5Character } from "../actors/M5Character";
|
||||
import { M5EwResult, M5RollData, M5RollResult, M5SkillUnlearned } from "../M5Base";
|
||||
import { M5EwResult, M5RollData, M5RollResult, M5SkillUnlearned, M5Stats } from "../M5Base";
|
||||
import { stat } from "fs";
|
||||
|
||||
export class M5Roll {
|
||||
// extends Roll<M5RollData>
|
||||
@@ -181,7 +182,7 @@ export class M5Roll {
|
||||
};
|
||||
|
||||
rollData.rolls["0"] = {
|
||||
formula: "1d20 + @c.calc.stats.brawlEw",
|
||||
formula: "1d20 + @c.calc.stats.brawlFw",
|
||||
enabled: true,
|
||||
label: (game as Game).i18n.localize("midgard5.attack"),
|
||||
result: "",
|
||||
@@ -205,6 +206,40 @@ export class M5Roll {
|
||||
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.brawl"));
|
||||
}
|
||||
|
||||
static perception(actor: any) {
|
||||
const rollData = actor.getRollData() as M5RollData;
|
||||
|
||||
rollData.rolls["0"] = {
|
||||
formula: "1d20 + @c.calc.stats.perception.value + @c.calc.stats.perceptionFW",
|
||||
enabled: true,
|
||||
label: (game as Game).i18n.localize("midgard5.perception"),
|
||||
result: "",
|
||||
total: 0,
|
||||
totalStr: "",
|
||||
dice: {},
|
||||
css: "",
|
||||
} as M5RollResult;
|
||||
|
||||
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.perception"));
|
||||
}
|
||||
|
||||
static drinking(actor: any) {
|
||||
const rollData = actor.getRollData() as M5RollData;
|
||||
|
||||
rollData.rolls["0"] = {
|
||||
formula: "1d20 + @c.calc.stats.drinking.value + @c.calc.stats.drinkingFW",
|
||||
enabled: true,
|
||||
label: (game as Game).i18n.localize("midgard5.drinking"),
|
||||
result: "",
|
||||
total: 0,
|
||||
totalStr: "",
|
||||
dice: {},
|
||||
css: "",
|
||||
} as M5RollResult;
|
||||
|
||||
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.drinking"));
|
||||
}
|
||||
|
||||
static defense(actor: any) {
|
||||
const rollData = actor.getRollData() as M5RollData;
|
||||
rollData.i = {
|
||||
|
||||
@@ -168,6 +168,16 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
await roll.toMessage();
|
||||
});
|
||||
|
||||
html.find(".roll-perception-button").on("click", async (event) => {
|
||||
const roll = M5Roll.perception(this.actor);
|
||||
await roll.toMessage();
|
||||
});
|
||||
|
||||
html.find(".roll-drinking-button").on("click", async (event) => {
|
||||
const roll = M5Roll.drinking(this.actor);
|
||||
await roll.toMessage();
|
||||
});
|
||||
|
||||
html.find(".roll-defense-button").on("click", async (event) => {
|
||||
const roll = M5Roll.defense(this.actor);
|
||||
await roll.toMessage();
|
||||
|
||||
Reference in New Issue
Block a user