Skip to content

Commit

Permalink
5.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Plushtoast committed Nov 18, 2023
1 parent b223c7d commit b3ff38c
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bundle/dsa5.bundle.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
"halfDefenseShort": "Halbe Verteidigung",
"Hair_color": "Haarfarbe",
"Height": "Größe",
"extensionModifier": "Erweiterungsmodifikator",
"Home": "Heimatort",
"Initial": "Startwert",
"initDie": "Initiativewürfel",
Expand Down Expand Up @@ -404,7 +405,7 @@
"maintainedSpells": "Aufrechterhaltene Zauber/Liturgien (je -1)",
"manual": "Händisch",
"mageLevel": "Magieart",
"minorghostsappear": "Lästige Mindergeister werden durch den Zauber angelockt",
"minorghostsappear": "{creature} werden durch den Zauber angelockt",
"stunnedByCounterAttack": "Gegenhalten versursacht 1 Stufe Betäubung",
"maxSpellMods": "Maximale Modifikatorenanzahl",
"misc": "Sonstiges",
Expand Down Expand Up @@ -1410,7 +1411,8 @@
"servantCloud": "Diener der Wolken",
"servantOre": "Diener des Erzes",
"immuneTo": "Immunität gegen",
"enemySense": "Feindgespür"
"enemySense": "Feindgespür",
"winhallStyle": "Winhall-Stil"
},
"LocalizedCTs": {
"Blasrohre": "Blowpipes",
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"Advances": "Advances",
"attributes": "Attributes",
"botchCritEffect": "Botch/Crit",
"extensionModifier": "Extension modifier",
"astralenergy": "Arcane energy",
"fallingHeight": "Falling height",
"fallingFloor": "Ground condition",
Expand Down Expand Up @@ -465,7 +466,7 @@
"maintainedSpells": "Maintained Spells/Chants (each -1)",
"manual": "Manual",
"mageLevel": "Magic type",
"minorghostsappear": "Annoying Minor spirits are attracted by the spell",
"minorghostsappear": "{creature} are attracted by the spell",
"stunnedByCounterAttack": "Counterattack causes 1 level of stunned",
"maxSpellMods": "Max modifier count",
"misc": "Misc",
Expand Down
23 changes: 17 additions & 6 deletions modules/dialog/dialog-combat-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,24 @@ export default class DSA5CombatDialog extends DialogShared {
value,
});
const enemySense = game.i18n.localize("LocalizedIDs.enemySense")
const winhallStyle = game.i18n.localize("LocalizedIDs.winhallStyle")
game.user.targets.forEach((target) => {
if (target.actor?.items.find((x) => x.type == "specialability" && x.name == enemySense)) {
situationalModifiers.push({
name: enemySense,
value,
});
return;
for(const item of target.actor?.items || []){
if(item.type == "specialability"){
if(item.name == enemySense){
situationalModifiers.push({
name: enemySense,
value: -4,
});
}
else if(item.name == winhallStyle){
situationalModifiers.push({
name: winhallStyle,
value: -2,
});
}

}
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions modules/dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ Hooks.once("init", () => {
SpeciesWizard
},
view: {
tinyNotification: tinyNotification,
tabSlider: tabSlider,
clickableAbility: clickableAbility
tinyNotification,
tabSlider,
clickableAbility
},
dialogs: {
DialogReactDSA5,
Expand Down
4 changes: 2 additions & 2 deletions modules/hooks/combat_tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class DSA5Combatant extends Combatant {

brawlingChange() {
const actor = DSA5_Utility.getSpeaker({actor: this.actor.id, scene: this.sceneId, token: this.token.id})
const tokenChange = getProperty(actor, "system.config.autoBar") ? actor.getActiveTokens().map(x => {return { _id: x.id, bar1: { attribute: "status.temporaryLeP" } }}) : [{}]
const tokenChange = getProperty(actor, "system.config.autoBar") ? actor.getActiveTokens().map(x => {return { _id: x.id, bar1: { attribute: "status.temporaryLeP" } }}) : []
const actorChange = {
_id: actor.id,
system: {
Expand Down Expand Up @@ -256,7 +256,7 @@ export class DSA5Combatant extends Combatant {

async undoBrawlingChange() {
const actor = DSA5_Utility.getSpeaker({actor: this.actor.id, scene: this.sceneId, token: this.token.id})
const tokenChange = getProperty(actor, "system.config.autoBar") ? actor.getActiveTokens().map(x => { return { _id: x.id, bar1: { attribute: "status.wounds" } }}) : [{}]
const tokenChange = getProperty(actor, "system.config.autoBar") ? actor.getActiveTokens().map(x => { return { _id: x.id, bar1: { attribute: "status.wounds" } }}) : []
const lostLP = Math.max(0, actor.system.status.temporaryLeP.max - actor.system.status.temporaryLeP.value)
let brawlDamage = 0

Expand Down
14 changes: 7 additions & 7 deletions modules/status/active_effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ async function callMacro(packName, name, actor, item, qs, args = {}) {

Hooks.once("i18nInit", () => {
DSAActiveEffectConfig.effectDurationRegexes = [
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.combatRounds"), "gi"), seconds: 5 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.minutes"), "gi"), seconds: 60 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.hours"), "gi"), seconds: 3600 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.days"), "gi"), seconds: 3600 * 24 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.weeks"), "gi"), seconds: 3600 * 24 * 7 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.months"), "gi"), seconds: 3600 * 24 * 30 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.years"), "gi"), seconds: 3600 * 24 * 350 }
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.combatRounds"), "i"), seconds: 5 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.minutes"), "i"), seconds: 60 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.hours"), "i"), seconds: 3600 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.days"), "i"), seconds: 3600 * 24 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.weeks"), "i"), seconds: 3600 * 24 * 7 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.months"), "i"), seconds: 3600 * 24 * 30 },
{ regEx: new RegExp(game.i18n.localize("DSAREGEX.years"), "i"), seconds: 3600 * 24 * 350 }
];
})

Expand Down
18 changes: 9 additions & 9 deletions modules/system/dice-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,16 +1068,16 @@ export default class DiceDSA5 {

await this.calculateEnergyCost(isClerical, res, testData)

if (
AdvantageRulesDSA5.hasVantage(testData.extra.actor, game.i18n.localize("CONDITION.minorSpirits")) &&
!testData.extra.actor.effects.find((x) => x.name == game.i18n.localize("CONDITION.minorSpirits"))
) {
const ghostroll = await new Roll("1d20").evaluate({ async: true })
if (ghostroll.total <= res.preData.calculatedSpellModifiers.finalcost) {
res.description += ", " + game.i18n.localize("minorghostsappear")
DSA5_Utility.getSpeaker(testData.extra.speaker).addCondition("minorSpirits")
for(const creature of ["minorFairies", "minorSpirits"]){
const name = game.i18n.localize("CONDITION." + creature)
if (AdvantageRulesDSA5.hasVantage(testData.extra.actor, name) && !testData.extra.actor.effects.find((x) => x.name == name)) {
const ghostroll = await new Roll("1d20").evaluate({ async: true })
if (ghostroll.total <= res.preData.calculatedSpellModifiers.finalcost) {
res.description += ", " + game.i18n.format("minorghostsappear", { creature: name})
DSA5_Utility.getSpeaker(testData.extra.speaker).addCondition(creature)
}
}
}
}

return res
}
Expand Down
2 changes: 0 additions & 2 deletions modules/system/opposed-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ export default class OpposedDsa5 {
attackerTest.successLevel = 1
}

console.log(defenderTest, attackerTest)

if (defenderTest.successLevel != undefined) {
switch (attackerTest.rollType) {
case "combatskill":
Expand Down
12 changes: 10 additions & 2 deletions modules/system/triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default class DSATriggers {

static async callMacro(item, packName, name, args = {}) {
const onUseEffect = new OnUseEffect(item);
return await onUseEffect.callMacro(packName, name, args);
const res = await onUseEffect.callMacro(packName, name, args);
return res
}

static async runMacro(actor, testData, type, data) {
Expand All @@ -34,7 +35,14 @@ export default class DSATriggers {
const source = actor.items.get(key)
const ef = source.effects.get(value)
const macro = ef.getFlag("dsa5", "args3")
await eval(`(async () => {${macro}})()`);
const body = `(async () => { ${macro} })()`;
const fn = Function("actor", "testData", "type", "data", "source", "ef", body);
try {
await Promise.all([fn.call(this, actor, testData, type, data, source, ef)])
} catch (err) {
ui.notifications.error(`There was an error in your macro syntax. See the console (F12) for details`);
console.error(err);
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"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": "5.2.1",
"version": "5.2.2",
"authors": [{
"name": "Plushtoast"
},{
Expand Down Expand Up @@ -91,7 +91,7 @@
},
"url": "https://github.com/Plushtoast/dsa5-foundryVTT",
"manifest": "https://raw.githubusercontent.com/Plushtoast/dsa5-foundryVTT/foundry11/system.json",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/5.2.1/dsa5-foundryVTT-5.2.1.zip",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/5.2.2/dsa5-foundryVTT-5.2.2.zip",
"name": "dsa5",
"minimumCoreVersion": "11.306",
"packFolders": [
Expand Down

0 comments on commit b3ff38c

Please sign in to comment.