Entbehrungen #89

Merged
Byroks merged 10 commits from entbehrungen into develop 2024-03-24 20:02:26 +01:00
10 changed files with 146 additions and 54 deletions
Showing only changes of commit 570d4c83da - Show all commits

View File

@ -211,7 +211,9 @@
"midgard5.thaumagraphie": "Thaumagraphie",
"midgard5.thaumalogie": "Thaumalogie",
"midgard5.tierkunde": "Tierkunde",
"midgard5.ueberleben": "Überleben",
"midgard5.ueberlebenWald": "Überleben (Wald)",
"midgard5.ueberlebenSteppe": "Überleben (Steppe)",
"midgard5.ueberlebenGebirge": "Überleben (Gebirge)",
"midgard5.verfuehren": "Verführen",
"midgard5.verhoeren": "Verhören",
"midgard5.verstellen": "Verstellen",
@ -239,8 +241,11 @@
"midgard5.enduranceBonus": "Ausdauerbonus",
"midgard5.lpProtection": "Rüstungsschutz (LP)",
"midgard5.apProtection": "Rüstungsschutz (AP)",
"midgard5.perception": "Wahrnehmung",
"midgard5.drinking": "Trinken",
"midgard5.deprivation": "Entbehrung",
"midgard5.deprivations": "Entbehrungen",
"midgard5.deprivationCold": "Zähigkeit Kälte",
"midgard5.deprivationHeat": "Zähigkeit Hitze",
"midgard5.deprivationFood": "Zähigkeit Hunger & Durst",
"midgard5.new-skill": "Neue Fertigkeit",
"midgard5.special": "Spezial",
@ -391,8 +396,8 @@
"midgard5.mod-stat-ap": "Ausdauerpunkte",
"midgard5.mod-stat-lpProtection": "Rüstungsschutz (LP)",
"midgard5.mod-stat-apProtection": "Rüstungsschutz (AP)",
"midgard5.mod-stat-perception": "Wahrnehmung",
"midgard5.mod-stat-drinking": "Trinken",
"midgard5.mod-stat-deprivationCold": "Entbehrungen Kälte",
"midgard5.mod-stat-deprivationHeat": "Entbehrungen Hitze",
"midgard5.mod-type": "Typ der Modifikation",
"midgard5.mod-id": "Was soll modifiziert werden",

View File

@ -103,8 +103,9 @@ export enum M5Stats {
AP = "ap",
PROTECTION_LP = "lpProtection",
PROTECTION_AP = "apProtection",
PERCEPTION = "perception",
DRINKING = "drinking",
DEPRIVATION_COLD = "cold",
DEPRIVATION_HEAT = "heat",
DEPRIVATION_FOOD = "food",
HOARD = "hoard",
HOARD_NEXT = "hoardNext",
HOARD_MIN = "hoardMin",
@ -197,10 +198,12 @@ export interface M5CharacterCalculatedData {
brawlFw: number;
poisonResistance: M5ModResult;
enduranceBonus: number;
perception: M5ModResult;
perceptionFW: number;
drinking: M5ModResult;
drinkingFW: number;
deprivationCold: M5ModResult;
deprivationColdPw: number;
deprivationHeat: M5ModResult;
deprivationHeatPw: number;
deprivationFood: M5ModResult;
deprivationFoodPw: number;
hoard: number;
hoardNext: number;
hoardMin: number;

View File

@ -126,10 +126,12 @@ export class M5Character extends Actor {
brawlFw: 0,
poisonResistance: { value: 0, mods: [] },
enduranceBonus: 0,
perception: { value: 0, mods: [] },
perceptionFW: 0,
drinking: { value: 0, mods: [] },
drinkingFW: 0,
deprivationCold: { value: 0, mods: [] },
deprivationColdPw: 0,
deprivationHeat: { value: 0, mods: [] },
deprivationHeatPw: 0,
deprivationFood: { value: 0, mods: [] },
deprivationFoodPw: 0,
hoard: 0,
encumbrance: 0,
load: 0,
@ -205,10 +207,12 @@ export class M5Character extends Actor {
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);
ret.stats.deprivationCold = this.modResult(0);
ret.stats.deprivationColdPw = Math.min(100, Math.max(0, Math.floor(ret.attributes.ko.value / 2)));
ret.stats.deprivationHeat = this.modResult(0);
ret.stats.deprivationHeatPw = Math.min(100, Math.max(0, Math.floor(ret.attributes.ko.value / 2)));
ret.stats.deprivationFood = this.modResult(0);
ret.stats.deprivationFoodPw = Math.min(100, Math.max(0, Math.floor(40 + (ret.attributes.ko.value / 2))));
ret.stats.hoardMin = M5Character.levelThreshold.at(ret.level - 1) / 2;
ret.stats.hoardNext = M5Character.levelThreshold.at(ret.level) / 2;
ret.stats.wealth = parseFloat((data.info.gold + data.info.silver / 10 + data.info.copper / 100).toPrecision(3));
@ -558,6 +562,21 @@ export class M5Character extends Actor {
if (item.name === "Laufen") {
ret.stats.movement.value += Math.floor(item.system.fw / 3);
}
// Adjust stat Kälte based on Überleben (Gebirge) skill
if (item.name === "Überleben (Gebirge)") {
ret.stats.deprivationCold.value += Math.floor(item.system.fw * 5);
}
// Adjust stat Kälte based on Überleben (Steppe) skill
if (item.name === "Überleben (Steppe)") {
ret.stats.deprivationHeat.value += Math.floor(item.system.fw * 5);
}
// Adjust stat Durst & Hunger based on Robustheit skill
if (item.name === "Robustheit") {
ret.stats.deprivationFood.value += Math.floor(item.system.fw + 10);
}
});
}

View File

@ -41,8 +41,9 @@ 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);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_COLD, operation: M5ModOperation.SET, value: calc.stats.deprivationCold.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_HEAT, operation: M5ModOperation.SET, value: calc.stats.deprivationHeat.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_FOOD, operation: M5ModOperation.SET, value: calc.stats.deprivationFood.value }, characterString);
}
push(mod: M5ItemMod, source: string) {

View File

@ -56,7 +56,7 @@ export class M5Roll {
//if (rollResult.type === "ew") {
if (d.total === 1) rowRes = M5EwResult.FUMBLE;
else if (d.total === 20) rowRes = M5EwResult.CRITICAL;
else if (d.total >= 16) rowRes = M5EwResult.HIGH;
else if (d.total === 16, 17, 18, 19) rowRes = M5EwResult.HIGH;
} else if (d.faces === 100) {
face100 = d.total as number;
}
@ -195,13 +195,13 @@ export class M5Roll {
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.brawl"));
}
static perception(actor: any) {
static deprivationCold (actor: any) {
const rollData = actor.getRollData() as M5RollData;
rollData.rolls["0"] = {
formula: "1d20 + @c.calc.stats.perception.value + @c.calc.stats.perceptionFW",
formula: "1d100 + @c.calc.stats.deprivationCold.value + @c.calc.stats.deprivationColdPw -100",
enabled: true,
label: (game as Game).i18n.localize("midgard5.perception"),
label: (game as Game).i18n.localize("midgard5.deprivationCold"),
result: "",
total: 0,
totalStr: "",
@ -209,16 +209,16 @@ export class M5Roll {
css: "",
} as M5RollResult;
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.perception"));
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.deprivationCold"));
}
static drinking(actor: any) {
static deprivationHeat(actor: any) {
const rollData = actor.getRollData() as M5RollData;
rollData.rolls["0"] = {
formula: "1d20 + @c.calc.stats.drinking.value + @c.calc.stats.drinkingFW",
formula: "1d100 + @c.calc.stats.deprivationHeat.value + @c.calc.stats.deprivationHeatPw -100",
enabled: true,
label: (game as Game).i18n.localize("midgard5.drinking"),
label: (game as Game).i18n.localize("midgard5.deprivationHeat"),
result: "",
total: 0,
totalStr: "",
@ -226,7 +226,24 @@ export class M5Roll {
css: "",
} as M5RollResult;
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.drinking"));
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.deprivationHeat"));
}
static deprivationFood(actor: any) {
const rollData = actor.getRollData() as M5RollData;
rollData.rolls["0"] = {
formula: "1d100 + @c.calc.stats.deprivationFood.value + @c.calc.stats.deprivationFoodPw -100",
enabled: true,
label: (game as Game).i18n.localize("midgard5.deprivationFood"),
result: "",
total: 0,
totalStr: "",
dice: {},
css: "",
} as M5RollResult;
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.deprivationFood"));
}
static defense(actor: any) {

View File

@ -247,13 +247,18 @@ export default class M5CharacterSheet extends ActorSheet {
await roll.toMessage();
});
html.find(".roll-perception-button").on("click", async (event) => {
const roll = M5Roll.perception(this.actor);
html.find(".roll-deprivationCold-button").on("click", async (event) => {
const roll = M5Roll.deprivationCold(this.actor);
await roll.toMessage();
});
html.find(".roll-drinking-button").on("click", async (event) => {
const roll = M5Roll.drinking(this.actor);
html.find(".roll-deprivationHeat-button").on("click", async (event) => {
const roll = M5Roll.deprivationHeat(this.actor);
await roll.toMessage();
});
html.find(".roll-deprivationFood-button").on("click", async (event) => {
const roll = M5Roll.deprivationFood(this.actor);
await roll.toMessage();
});

View File

@ -131,7 +131,9 @@
"tauchen": { "fw": 6, "attribute": "ko", "initial": 8, "pp": 0 },
"tanzen": { "fw": 6, "attribute": "ko", "initial": 8, "pp": 0 },
"tierkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 },
"ueberleben": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 },
"ueberlebenWald": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 },
"ueberlebenSteppe": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 },
"ueberlebenGebirge": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 },
"verfuehren": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 },
"verhoeren": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 },
"verstellen": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 },

View File

@ -55,6 +55,62 @@
</div>
</div>
<div class="flexcolumn-2">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/skills/wounds/injury-body-pain-gray.webp" class="flexpart-icon">{{localize "midgard5.deprivations"}}</div>
<table>
<thead>
<tr>
<th></th>
<th class="title">{{localize "midgard5.deprivation"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title">{{localize "midgard5.bonus"}}</th>
<th class="title">{{localize "midgard5.pw"}}</th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
</tr>
</thead>
<tbody class="items-list">
<tr data-item-id="{{itemId}}">
<td class="fixed-value"></td>
<td class="padding edit-item">{{localize "midgard5.deprivationCold"}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationCold.value}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationColdPw}}</td>
{{#if (gt (add data.calc.stats.deprivationCold.value data.calc.stats.deprivationColdPw) 100)}}
<td class="fixed-value">100</td>
{{else}}
<td class="fixed-value">{{add data.calc.stats.deprivationCold.value data.calc.stats.deprivationColdPw}}</td>
{{/if}}
<td><button class="roll-button roll-deprivationCold-button"></button></td>
</tr>
<tr data-item-id="{{itemId}}">
<td class="fixed-value"></td>
<td class="padding edit-item">{{localize "midgard5.deprivationHeat"}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationHeat.value}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationHeatPw}}</td>
{{#if (gt (add data.calc.stats.deprivationCold.value data.calc.stats.deprivationHeatPw) 100)}}
<td class="fixed-value">100</td>
{{else}}
<td class="fixed-value">{{add data.calc.stats.deprivationHeat.value data.calc.stats.deprivationHeatPw}}</td>
{{/if}}
<td><button class="roll-button roll-deprivationHeat-button"></button></td>
</tr>
<tr data-item-id="{{itemId}}">
<td class="fixed-value"></td>
<td class="padding edit-item">{{localize "midgard5.deprivationFood"}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationFoodPw}}</td>
<td class="fixed-value">{{data.calc.stats.deprivationFood.value}}</td>
{{#if (gt (add data.calc.stats.deprivationFood.value data.calc.stats.deprivationFoodPw) 100)}}
<td class="fixed-value">100</td>
{{else}}
<td class="fixed-value">{{add data.calc.stats.deprivationFood.value data.calc.stats.deprivationFoodPw}}</td>
{{/if}}
<td><button class="roll-button roll-deprivationFood-button"></button></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="flexcolumn-2">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/magic/time/arrows-circling-pink.webp" class="flexpart-icon">{{localize "midgard5.calculated-values"}}</div>

View File

@ -48,9 +48,9 @@
<tr height = 10px></tr>
<tr>
<td class="fixed-value"><input type="number" disabled="true" name="data.info.load" value="{{data.calc.stats.load}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gte data.calc.stats.encumbrance data.calc.stats.heavyLoad) }}style="background:#FF6666"{{/if}} name="data.info.heavyLoad" value="{{data.calc.stats.heavyLoad}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gte data.calc.stats.encumbrance data.calc.stats.loadMax) }}style="background:#FF6666"{{/if}} name="data.info.loadMax" value="{{data.calc.stats.loadMax}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gte data.calc.stats.encumbrance data.calc.stats.thrustLoad) }}style="background:#FF6666"{{/if}} name="data.info.thrustLoad" value="{{data.calc.stats.thrustLoad}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gt data.calc.stats.encumbrance data.calc.stats.heavyLoad) }}style="background:#FF6666"{{/if}} name="data.info.heavyLoad" value="{{data.calc.stats.heavyLoad}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gt data.calc.stats.encumbrance data.calc.stats.loadMax) }}style="background:#FF6666"{{/if}} name="data.info.loadMax" value="{{data.calc.stats.loadMax}}"></td>
<td class="fixed-value"><input type="number" disabled="true" {{#if (gt data.calc.stats.encumbrance data.calc.stats.thrustLoad) }}style="background:#FF6666"{{/if}} name="data.info.thrustLoad" value="{{data.calc.stats.thrustLoad}}"></td>
<td class="fixed-value"><input type="number" disabled="true" name="data.info.encumbrance" value="{{data.calc.stats.encumbrance}}"></td>
</tr>
</tfoot>

View File

@ -25,22 +25,6 @@
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
<tr data-item-id="{{itemId}}">
<td class="padding edit-item">{{localize "midgard5.perception"}}</td>
<td class="fixed-value">{{data.calc.stats.perceptionFW}}</td>
<td class="fixed-value">{{data.calc.stats.perception.value}}</td>
<td class="fixed-value">{{add data.calc.stats.perception.value data.calc.stats.perceptionFW}}</td>
<td><button class="roll-button roll-perception-button"></button></td>
<td class="fixed-value"></td>
</tr>
<tr data-item-id="{{itemId}}">
<td class="padding edit-item">{{localize "midgard5.drinking"}}</td>
<td class="fixed-value">{{data.calc.stats.drinkingFW}}</td>
<td class="fixed-value">{{data.calc.stats.drinking.value}}</td>
<td class="fixed-value">{{add data.calc.stats.drinking.value data.calc.stats.drinkingFW}}</td>
<td><button class="roll-button roll-drinking-button"></button></td>
<td class="fixed-value"></td>
</tr>
</tbody>
</table>
</div>