Skip to content

Commit

Permalink
6.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Plushtoast committed Oct 21, 2024
1 parent da91747 commit cbd4f13
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
![Version](https://img.shields.io/github/v/tag/Plushtoast/dsa5-foundryVTT?label=Version&style=flat-square&color=2577a1) ![Foundry Core Compatible Version](https://img.shields.io/badge/dynamic/json.svg?url=https%3A%2F%2Fraw.githubusercontent.com%2FPlushtoast%2Fdsa5-foundryVTT%2Ffoundry12%2Fsystem.json&label=Foundry%20Core%20Compatible%20Version&query=$.compatibility.verified&style=flat-square&color=ff6400)

# Official Das Schwarze Auge/The Dark Eye system for Foundry
![](https://repository-images.githubusercontent.com/311655339/4d523800-55a9-11eb-9e2e-6bbc2b71d8a4)

## Current Version and Compatibility:
6.0.x - FoundryVTT 12.+
This system is intended for usage with [Foundry Virtual Tabletop](https://foundryvtt.com/) to play "Das Schwarze Auge" 5th edition.
If you want to learn more checkout the [German](https://ulisses-spiele.de/virtual-tabletop-dsa-vtt/) or [English](https://ulisses-us.com/ulisses-virtual-tabletops/virtual-tabletop-dsa-vtt/) VTT Page by Ulisses Spiele.

Expand Down
26 changes: 13 additions & 13 deletions bundle/modules/dsa5.js

Large diffs are not rendered by default.

33 changes: 22 additions & 11 deletions modules/actor/actor-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1821,17 +1821,22 @@ export default class Actordsa5 extends Actor {
await DiceDSA5.showDiceSoNice(newRoll, newTestData.rollMode);

let ind = 0;
let changedRolls = [];
const changedRolls = [];
const changes = [];

newTestData.roll = Roll.fromData(newTestData.roll);
for (let k of diesToReroll) {
const characteristic = newTestData.source.system[`characteristic${k + 1}`];
const attr = characteristic ? game.i18n.localize(`CHARAbbrev.${characteristic.value.toUpperCase()}`) + ' - ' : '';

changedRolls.push(`${attr}${newTestData.roll.terms[k * 2].results[0].result}/${newRoll.terms[ind * 2].results[0].result}`);
newTestData.roll.terms[k * 2].results[0].result = Math.min(newRoll.terms[ind * 2].results[0].result, newTestData.roll.terms[k * 2].results[0].result);
let val = newRoll.terms[ind * 2].results[0].result;
changedRolls.push(`${attr}${newTestData.roll.terms[k * 2].results[0].result}/${val}`);
val = Math.min(val, newTestData.roll.terms[k * 2].results[0].result);

changes.push({ index: k, val });
ind += 1;
}
newTestData.roll.editRollAtIndex(changes);
infoMsg += `<b>${game.i18n.localize('Roll')}</b>: ${changedRolls.join(', ')}`;
ChatMessage.create(DSA5_Utility.chatDataSetup(infoMsg));

Expand Down Expand Up @@ -1888,17 +1893,21 @@ export default class Actordsa5 extends Actor {
const phexTradition = game.i18n.localize('LocalizedIDs.traditionPhex');
const isPhex = actor.items.some((x) => x.type == 'specialability' && x.name == phexTradition);

//todo replace with roll.editrollatindex & istalented
newTestData.roll = Roll.fromData(newTestData.roll);

const changes = [];
for (let k of diesToReroll) {
const characteristic = newTestData.source.system[`characteristic${k + 1}`];
const attr = characteristic ? `${game.i18n.localize(`CHARAbbrev.${characteristic.value.toUpperCase()}`)} - ` : '';
changedRolls.push(`${attr}${newTestData.roll.terms[k * 2].results[0].result}/${newRoll.terms[ind * 2].results[0].result}`);
if (isPhex) newTestData.roll.terms[k * 2].results[0].result = Math.min(newRoll.terms[ind * 2].results[0].result, newTestData.roll.terms[k * 2].results[0].result);
else newTestData.roll.terms[k * 2].results[0].result = newRoll.terms[ind * 2].results[0].result;

let val = newRoll.terms[ind * 2].results[0].result;
changedRolls.push(`${attr}${newTestData.roll.terms[k * 2].results[0].result}/${val}`);

if (isPhex) val = Math.min(val, newTestData.roll.terms[k * 2].results[0].result);
changes.push({ index: k, val });
ind += 1;
}

newTestData.roll.editRollAtIndex(changes);
infoMsg += `<br><b>${game.i18n.localize('Roll')}</b>: ${changedRolls.join(', ')}`;
ChatMessage.create(DSA5_Utility.chatDataSetup(infoMsg));
newTestData.fateUsed = true;
Expand Down Expand Up @@ -1971,7 +1980,8 @@ export default class Actordsa5 extends Actor {
value: fws.join('|'),
type: 'roll',
};
newTestData.roll.terms[diesToUpgrade * 2].results[0].result = Math.max(1, newTestData.roll.terms[diesToUpgrade * 2].results[0].result - 2);
newTestData.roll = Roll.fromData(newTestData.roll);
newTestData.roll.editRollAtIndex([{ index: diesToUpgrade, val: Math.max(1, newTestData.roll.terms[diesToUpgrade * 2].results[0].result - 2) }]);
newTestData.situationalModifiers.push(modifier);
this[`${data.postData.postFunction}`]({ testData: newTestData, cardOptions }, { rerenderMessage: message });
await message.update({ 'flags.data.fateImproved': true });
Expand All @@ -1993,7 +2003,8 @@ export default class Actordsa5 extends Actor {
type: 'roll',
};
newTestData.situationalModifiers.push(modifier);
newTestData.roll.terms[0].results[0].result = Math.max(1, newTestData.roll.terms[0].results[0].result - 2);
newTestData.roll = Roll.fromData(newTestData.roll);
newTestData.roll.editRollAtIndex([{ index: 0, val: Math.max(1, newTestData.roll.terms[0].results[0].result - 2) }]);
this[`${data.postData.postFunction}`]({ testData: newTestData, cardOptions }, { rerenderMessage: message });
await message.update({ 'flags.data.fateImproved': true });
await this.reduceSchips(schipsource);
Expand Down Expand Up @@ -2471,7 +2482,7 @@ export default class Actordsa5 extends Actor {
if (item.system.guidevalue.value != '-') {
let val = Math.max(...item.system.guidevalue.value.split('/').map((x) => Number(actorData.system.characteristics[x].value)));
let extra = Math.max(val - Number(item.system.damageThreshold.value), 0) + gripDamageMod;
if (extra > 0) {
if (extra != 0) {
item.extraDamage = extra;
item.damageAdd = Roll.safeEval(item.damageAdd + ' + ' + Number(extra));
item.damageAdd = (item.damageAdd > 0 ? '+' : '') + item.damageAdd;
Expand Down
8 changes: 6 additions & 2 deletions modules/system/opposed-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ export default class OpposedDsa5 {
opposeResult.winner = 'attacker';

const title = [
damage.armorMod != 0 ? `${damage.armorMod + ' ' + game.i18n.localize('Modifier')}` : '',
damage.armorMultiplier != 1 ? '*' + damage.armorMultiplier + ' ' + game.i18n.localize('Modifier') : '',
damage.armorMod != 0 ? `${damage.armorMod} ${game.i18n.localize('Modifier')}` : '',
damage.armorMultiplier != 1 ? `*${damage.armorMultiplier} ${game.i18n.localize('Modifier')}` : '',
damage.spellArmor != 0 ? `${damage.spellArmor} ${game.i18n.localize('spellArmor')}` : '',
damage.liturgyArmor != 0 ? `${damage.liturgyArmor} ${game.i18n.localize('liturgyArmor')}` : '',
].join('');
Expand All @@ -477,6 +477,10 @@ export default class OpposedDsa5 {
description,
value: damage.sum,
sp: damage.damage,
armorMod: damage.armorMod,
armorMultiplier: damage.armorMultiplier,
spellArmor: damage.spellArmor,
liturgyArmor: damage.liturgyArmor,
};
} else {
opposeResult.winner = 'defender';
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"id": "dsa5",
"title": "Das Schwarze Auge/The Dark Eye (5th Edition)",
"description": "The \"Das Schwarze Auge\" system for Foundry VTT. Includes all relevant mechanisms to play in the wonderous world of Aventuria and Das Schwarze Auge/The Dark Eye.",
"version": "6.1.3",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/6.1.3/dsa5-foundryVTT-6.1.3.zip",
"version": "6.1.4",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/6.1.4/dsa5-foundryVTT-6.1.4.zip",
"authors": [
{
"name": "Plushtoast"
Expand Down

0 comments on commit cbd4f13

Please sign in to comment.