Innate abilities
+ Added Perception as fixed innate ability + Added Drinking as fixed innate ability + Set Luckpoints to 0
This commit is contained in:
parent
1e27e135cf
commit
bcf6694de8
|
|
@ -197,6 +197,8 @@
|
||||||
"midgard5.enduranceBonus": "Ausdauerbonus",
|
"midgard5.enduranceBonus": "Ausdauerbonus",
|
||||||
"midgard5.lpProtection": "Rüstungsschutz (LP)",
|
"midgard5.lpProtection": "Rüstungsschutz (LP)",
|
||||||
"midgard5.apProtection": "Rüstungsschutz (AP)",
|
"midgard5.apProtection": "Rüstungsschutz (AP)",
|
||||||
|
"midgard5.perception" : "Wahrnehmung",
|
||||||
|
"midgard5.drinking" : "Trinken",
|
||||||
|
|
||||||
"midgard5.new-skill": "Neue Fertigkeit",
|
"midgard5.new-skill": "Neue Fertigkeit",
|
||||||
"midgard5.special": "Spezial",
|
"midgard5.special": "Spezial",
|
||||||
|
|
@ -305,6 +307,8 @@
|
||||||
"midgard5.mod-stat-ap": "Ausdauerpunkte",
|
"midgard5.mod-stat-ap": "Ausdauerpunkte",
|
||||||
"midgard5.mod-stat-lpProtection": "Rüstungsschutz (LP)",
|
"midgard5.mod-stat-lpProtection": "Rüstungsschutz (LP)",
|
||||||
"midgard5.mod-stat-apProtection": "Rüstungsschutz (AP)",
|
"midgard5.mod-stat-apProtection": "Rüstungsschutz (AP)",
|
||||||
|
"midgard.mod-stat-perception" : "Wahrnehmung",
|
||||||
|
"midgard.mod-stat-drinking" : "Trinken",
|
||||||
|
|
||||||
"midgard5.mod-type": "Typ der Modifikation",
|
"midgard5.mod-type": "Typ der Modifikation",
|
||||||
"midgard5.mod-id": "Was soll modifiziert werden",
|
"midgard5.mod-id": "Was soll modifiziert werden",
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@ export enum M5Stats {
|
||||||
AP = "ap",
|
AP = "ap",
|
||||||
PROTECTION_LP = "lpProtection",
|
PROTECTION_LP = "lpProtection",
|
||||||
PROTECTION_AP = "apProtection",
|
PROTECTION_AP = "apProtection",
|
||||||
|
PERCEPTION = "perception",
|
||||||
|
DRINKING = "Trinken"
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum M5ModType {
|
export enum M5ModType {
|
||||||
|
|
@ -166,6 +168,10 @@ export interface M5CharacterCalculatedData {
|
||||||
brawlEw: number;
|
brawlEw: number;
|
||||||
poisonResistance: M5ModResult;
|
poisonResistance: M5ModResult;
|
||||||
enduranceBonus: number;
|
enduranceBonus: number;
|
||||||
|
perception: M5ModResult;
|
||||||
|
perceptionEW: number;
|
||||||
|
drinking: M5ModResult;
|
||||||
|
drinkingEW: number;
|
||||||
};
|
};
|
||||||
skillMods: {};
|
skillMods: {};
|
||||||
skills: {
|
skills: {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,10 @@ export class M5Character extends Actor {
|
||||||
brawlEw: 0,
|
brawlEw: 0,
|
||||||
poisonResistance: { value: 0, mods: [] },
|
poisonResistance: { value: 0, mods: [] },
|
||||||
enduranceBonus: 0,
|
enduranceBonus: 0,
|
||||||
|
perception: {value: 0, mods: []},
|
||||||
|
perceptionEW: 0,
|
||||||
|
drinking: {value: 0, mods: []},
|
||||||
|
drinkingEW: 0,
|
||||||
},
|
},
|
||||||
skillMods: {},
|
skillMods: {},
|
||||||
skills: {
|
skills: {
|
||||||
|
|
@ -135,6 +139,10 @@ export class M5Character extends Actor {
|
||||||
ret.stats.brawlEw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
|
ret.stats.brawlEw = 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.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.enduranceBonus = Math.floor(ret.attributes.ko.value / 10) + Math.floor(ret.attributes.st.value / 20);
|
||||||
|
ret.stats.perception = this.modResult(0);
|
||||||
|
ret.stats.perceptionEW = 6;
|
||||||
|
ret.stats.drinking = this.modResult(Math.floor(ret.attributes.ko.value / 10));
|
||||||
|
ret.stats.drinkingEW = ret.stats.drinking.value;
|
||||||
|
|
||||||
if (!skip?.mods) {
|
if (!skip?.mods) {
|
||||||
const aggregate = new M5ModAggregate(data, ret);
|
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.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_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.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) {
|
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 { Evaluated } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/client/dice/roll";
|
||||||
import { M5Character } from "../actors/M5Character";
|
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 {
|
export class M5Roll {
|
||||||
// extends Roll<M5RollData>
|
// extends Roll<M5RollData>
|
||||||
|
|
@ -205,6 +206,48 @@ export class M5Roll {
|
||||||
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.brawl"));
|
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.brawl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static perception(actor: any) {
|
||||||
|
const rollData = actor.getRollData() as M5RollData;
|
||||||
|
rollData.i = {
|
||||||
|
fw: 6,
|
||||||
|
Bonus: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
rollData.rolls["0"] = {
|
||||||
|
formula: "1d20 + @c.calc.stats.perceptionEW + @i.bonus",
|
||||||
|
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.i = {
|
||||||
|
fw: M5Stats.DRINKING,
|
||||||
|
Bonus: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
rollData.rolls["0"] = {
|
||||||
|
formula: "1d20 + @c.calc.stats.drinkingEW + @i.bonus",
|
||||||
|
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) {
|
static defense(actor: any) {
|
||||||
const rollData = actor.getRollData() as M5RollData;
|
const rollData = actor.getRollData() as M5RollData;
|
||||||
rollData.i = {
|
rollData.i = {
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,16 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||||
await roll.toMessage();
|
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) => {
|
html.find(".roll-defense-button").on("click", async (event) => {
|
||||||
const roll = M5Roll.defense(this.actor);
|
const roll = M5Roll.defense(this.actor);
|
||||||
await roll.toMessage();
|
await roll.toMessage();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
"ep": 0,
|
"ep": 0,
|
||||||
"gg": 0,
|
"gg": 0,
|
||||||
"sg": 0,
|
"sg": 0,
|
||||||
"gp": 2
|
"gp": 0
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,23 @@
|
||||||
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
<tr data-item="{{itemId}}">
|
||||||
|
<td class="padding edit-item">{{localize "midgard5.perception"}}</td>
|
||||||
|
<td class="fixed-value">{{stats.fw}}</td>
|
||||||
|
<td class="fixed-value">{{stats.calc.bonus}}</td>
|
||||||
|
<td class="center">{{data.calc.stats.perceptionEW}}</td>
|
||||||
|
<td class="fixed-value"><button class="roll-button roll-perception-button"></button></td>
|
||||||
|
<td class="fixed-value"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr data-item="{{itemId}}">
|
||||||
|
<td class="padding edit-item">{{localize "midgard5.drinking"}}</td>
|
||||||
|
<td class="fixed-value">{{stats.drinking.value}}</td>
|
||||||
|
<td class="fixed-value">{{stats.calc.bonus}}</td>
|
||||||
|
<td class="center">{{data.calc.stats.drinkingEW}}</td>
|
||||||
|
<td class="fixed-value"><button class="roll-button roll-drinking-button"></button></td>
|
||||||
|
<td class="fixed-value"></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue