Skip to content

Commit d1269e0

Browse files
committed
bugfixes and deprecations
1 parent ddd1910 commit d1269e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+176
-235
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you want to learn more checkout the [German](https://ulisses-spiele.de/virtua
1010
In the FVTT Game Systems Menu, click Install System and enter the Manifest URL:
1111

1212
```
13-
https://raw.githubusercontent.com/Plushtoast/dsa5-foundryVTT/foundry11/system.json
13+
https://raw.githubusercontent.com/Plushtoast/dsa5-foundryVTT/foundry12/system.json
1414
```
1515

1616
## Roadmap

icons/spellicons/license.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Base Icons made by the following authors.
2+
Borders made by Carina Wittrin.
3+
4+
Icons provided under the Creative Commons 3.0 BY or CC0 if mentioned below.
5+
6+
- Lorc, http://lorcblog.blogspot.com
7+
- Delapouite, https://delapouite.com
8+
- John Colburn, http://ninmunanmu.com
9+
- Felbrigg, http://blackdogofdoom.blogspot.co.uk
10+
- John Redman, http://www.uniquedicetowers.com
11+
- Carl Olsen, https://twitter.com/unstoppableCarl
12+
- Sbed, http://opengameart.org/content/95-game-icons
13+
- PriorBlue
14+
- Willdabeast, http://wjbstories.blogspot.com
15+
- Viscious Speed, http://viscious-speed.deviantart.com - CC0
16+
- Lord Berandas, http://berandas.deviantart.com
17+
- Irongamer, http://ecesisllc.wix.com/home
18+
- HeavenlyDog, http://www.gnomosygoblins.blogspot.com
19+
- Lucas
20+
- Faithtoken, http://fungustoken.deviantart.com
21+
- Skoll
22+
- Andy Meneely, http://www.se.rit.edu/~andy/
23+
- Cathelineau
24+
- Kier Heyl
25+
- Aussiesim
26+
- Sparker, http://citizenparker.com
27+
- Zeromancer - CC0
28+
- Rihlsul
29+
- Quoting
30+
- Guard13007, https://guard13007.com
31+
- DarkZaitzev, http://darkzaitzev.deviantart.com
32+
- SpencerDub
33+
- GeneralAce135
34+
- Zajkonur
35+
- Catsu
36+
- Starseeker
37+
- Pepijn Poolman
38+
- Pierre Leducq
39+
- Caro Asercion
40+
41+
More info and icons available at https://game-icons.net

lang/de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,8 @@
18101810
"tokenhotbarLayout": "Tokenhotbar Layout",
18111811
"tokenhotbarLayoutHint": "Layout und Ausklappausrichtung der Tokenhotbar",
18121812
"tokenhotbarLayout0": "Horizontal, nach oben",
1813-
"tokenhotbarLayout1": "Horizontal, nach unten",
1814-
"tokenhotbarLayout2": "Vertikal, nach links",
1813+
"tokenhotbarLayout1": "Vertikal, nach links",
1814+
"tokenhotbarLayout2": "Horizontal, nach unten",
18151815
"tokenhotbarLayout3": "Vertikal, nach rechts",
18161816
"resetTokenbar": "Reset Tokenhotbar",
18171817
"resetTokenbarHint": "Stelle die Position der Tokenhotbar auf den Ursprungswert",

lang/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,8 +1743,8 @@
17431743
"tokenhotbarLayout": "Tokenhotbar Layout",
17441744
"tokenhotbarLayoutHint": "Layout and direction of the token hotbar",
17451745
"tokenhotbarLayout0": "Horizontal, upwards",
1746-
"tokenhotbarLayout1": "Horizontal, downwards",
1747-
"tokenhotbarLayout2": "Vertical, left",
1746+
"tokenhotbarLayout1": "Vertical, left",
1747+
"tokenhotbarLayout2": "Horizontal, downwards",
17481748
"tokenhotbarLayout3": "Vertical, right",
17491749
"resetTokenbar": "Reset token hotbar",
17501750
"resetTokenbarHint": "Reset the position of the token hotbar",

modules/actor/actor-dsa5.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,43 +2731,44 @@ export default class Actordsa5 extends Actor {
27312731

27322732
_checkMaximumItemAdvancement(item, newValue) {
27332733
let max = 0
2734+
const maxBonus = AdvantageRulesDSA5.vantageStep(this, `${game.i18n.localize(`LocalizedIDs.${item.type == "combatskill" ? "exceptionalCombatTechnique" : "exceptionalSkill"}`)} (${item.name})`)
27342735
switch (item.type) {
27352736
case "combatskill":
2736-
max = Math.max(...(item.system.guidevalue.value.split("/").map(x => this.system.characteristics[x].value))) + 2 + AdvantageRulesDSA5.vantageStep(this, `${game.i18n.localize('LocalizedIDs.exceptionalCombatTechnique')} (${item.name})`)
2737+
max = Math.max(...(item.system.guidevalue.value.split("/").map(x => this.system.characteristics[x].value))) + 2 + maxBonus
27372738
break
27382739
case "spell":
27392740
case "ritual":
27402741
let focusValue = 0
27412742
for (const feature of item.system.feature.replace(/\(a-z äöü\-\)/gi, "").split(",").map(x => x.trim())) {
27422743
if (SpecialabilityRulesDSA5.hasAbility(this, `${game.i18n.localize('LocalizedIDs.propertyKnowledge')} (${feature})`)) {
2743-
focusValue = this.maxByAttr(item)
2744+
focusValue = this.maxByAttr(item, maxBonus)
27442745
break
27452746
}
27462747
}
2747-
max = Math.max(14 + AdvantageRulesDSA5.vantageStep(this, `${game.i18n.localize('LocalizedIDs.exceptionalSkill')} (${item.name})`), focusValue)
2748+
max = Math.max(14 + maxBonus, focusValue)
27482749
break
27492750
case "liturgy":
27502751
case "ceremony":
27512752
const aspect = new RegExp(`^${game.i18n.localize("LocalizedIDs.aspectKnowledge")}`)
27522753
let aspectValue = 0
27532754
if (this.items.filter(x => x.type == "specialability" && aspect.test(x.name)).some(x => item.system.distribution.value.includes(x.name.split("(")[1].split(")")[0]))) {
2754-
aspectValue = this.maxByAttr(item)
2755+
aspectValue = this.maxByAttr(item, maxBonus)
27552756
}
2756-
max = Math.max(14 + AdvantageRulesDSA5.vantageStep(this, `${game.i18n.localize('LocalizedIDs.exceptionalSkill')} (${item.name})`), aspectValue)
2757+
max = Math.max(14 + maxBonus, aspectValue)
27572758
break
27582759
case "skill":
2759-
max = this.maxByAttr(item)
2760+
max = this.maxByAttr(item, maxBonus)
27602761
break
27612762
}
27622763
const result = newValue <= max
27632764
if (!result)
27642765
ui.notifications.error(game.i18n.localize("DSAError.AdvanceMaximumReached"))
27652766

2766-
return { result, max }
2767+
return { result, max, maxBonus }
27672768
}
27682769

2769-
maxByAttr(item) {
2770-
return Math.max(...[this.system.characteristics[item.system.characteristic1.value].value, this.system.characteristics[item.system.characteristic2.value].value, this.system.characteristics[item.system.characteristic3.value].value]) + 2 + AdvantageRulesDSA5.vantageStep(this, `${game.i18n.localize('LocalizedIDs.exceptionalSkill')} (${item.name})`)
2770+
maxByAttr(item, advantageBonus) {
2771+
return Math.max(...[this.system.characteristics[item.system.characteristic1.value].value, this.system.characteristics[item.system.characteristic2.value].value, this.system.characteristics[item.system.characteristic3.value].value]) + 2 + advantageBonus
27712772
}
27722773

27732774
async basicTest({ testData, cardOptions }, options = {}) {

modules/actor/actor-sheet.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ export default class ActorSheetDsa5 extends ActorSheet {
130130
sheetData["sizeCategories"] = DSA5.sizeCategories
131131
sheetData.isGM = game.user.isGM;
132132
sheetData["initDies"] = { "": "-", "1d6": "1d6", "2d6": "2d6", "3d6": "3d6", "4d6": "4d6" }
133-
sheetData.horseSpeeds = Object.keys(Riding.speedKeys)
133+
sheetData.horseSpeeds = Object.keys(Riding.speedKeys).reduce((acc, key) => {
134+
acc[key] = game.i18n.localize(`RIDING.speeds.${key}`)
135+
return acc
136+
}, {})
134137
DSA5StatusEffects.prepareActiveEffects(this.actor, sheetData)
135138
sheetData.enrichedOwnerdescription = await TextEditor.enrichHTML(getProperty(this.actor.system, "details.notes.ownerdescription"), {secrets: this.object.isOwner, async: true})
136139
sheetData.enrichedGmdescription = await TextEditor.enrichHTML(getProperty(this.actor.system, "details.notes.gmdescription"), {secrets: this.object.isOwner, async: true})

modules/hooks/actor.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,15 @@ export default function() {
300300
}
301301

302302
Hooks.on("updateToken", (token, data, options) => {
303-
Riding.updateTokenHook(token, data, options);
303+
if ( !token.rendered ) return;
304+
305+
Riding.updateTokenHook(token, data, options);
304306

305-
(token.object.animationContexts.entries().next().value[1].promise || Promise.resolve()).then(() => {
306-
token.object.drawAuras();
307+
const animationName = options.animation?.name || token.object.animationName;
308+
const animationPromise = token.object.animationContexts.get(animationName)?.promise;
309+
310+
(animationPromise || Promise.resolve()).then(() => {
311+
token.object?.drawAuras();
307312
})
308313
})
309314

@@ -318,7 +323,7 @@ export default function() {
318323

319324
Hooks.on("canvasReady", canvas => {
320325
for(let token of canvas.scene.tokens){
321-
token.object.drawAuras();
326+
token.object?.drawAuras();
322327
}
323328
})
324329

@@ -355,7 +360,7 @@ export default function() {
355360
obfuscateName(token, {})
356361
randomWeaponSelection(token)
357362
Riding.createTokenHook(token, options, id)
358-
token.object.drawAuras();
363+
token.object?.drawAuras();
359364
})
360365

361366
Hooks.on('hoverToken', (token, hovered) => {

modules/hooks/configuration.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ export function setupConfiguration() {
316316
type: Number,
317317
choices: {
318318
0: game.i18n.localize('DSASETTINGS.tokenhotbarLayout0'),
319-
2: game.i18n.localize('DSASETTINGS.tokenhotbarLayout1'),
320-
1: game.i18n.localize('DSASETTINGS.tokenhotbarLayout2'),
319+
1: game.i18n.localize('DSASETTINGS.tokenhotbarLayout1'),
320+
2: game.i18n.localize('DSASETTINGS.tokenhotbarLayout2'),
321321
3: game.i18n.localize('DSASETTINGS.tokenhotbarLayout3')
322322
},
323323
onChange: async(val) => {
@@ -875,7 +875,8 @@ class ConfigureTokenHotbar extends FormApplication {
875875
tokenhotbaropacity: game.settings.get("dsa5", "tokenhotbaropacity"),
876876
hotbarv3: game.settings.get("dsa5", "hotbarv3"),
877877
isGM: game.user.isGM,
878-
gmButtons: game.dsa5.apps.tokenHotbar?.gmItems
878+
gmButtons: game.dsa5.apps.tokenHotbar?.gmItems,
879+
layoutChoices: game.settings.settings.get("dsa5.tokenhotbarLayout").choices
879880
})
880881
return data
881882
}

modules/hooks/tokenHUD.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Riding from "../system/riding.js";
22
import { TokenHoverHud } from "./actor.js";
3-
const { deepClone, getProperty } = foundry.utils
3+
const { getProperty } = foundry.utils
44

55
function addThirdBarToHUD(html, actor, app) {
66
if (actor.system.isPriest && actor.system.isMage) {
@@ -76,13 +76,14 @@ async function splitSwarm(actor, token) {
7676
label: game.i18n.localize("ok"),
7777
callback: async(dialog) => {
7878
const split = Number(dialog.find('input[type="range"]').val())
79-
const newtoken = deepClone(token)
79+
const newtokenData = token.toObject()
80+
delete newtokenData._id
8081

8182
const newHp = Math.floor(actor.system.status.wounds.value / actor.system.swarm.count * split)
8283
const oldHp = actor.system.status.wounds.value - newHp
8384

8485
await actor.update({ "system.swarm.count": actor.system.swarm.count - split, "system.status.wounds.value": oldHp }, {skipSwarmUpdate: true})
85-
await canvas.scene.createEmbeddedDocuments("Token", [newtoken])
86+
const newtoken = (await canvas.scene.createEmbeddedDocuments("Token", [newtokenData]))[0]
8687
await newtoken.actor.update({ "system.swarm.count": split, "system.status.wounds.value": newHp}, {skipSwarmUpdate: true})
8788
const axis = ["x", "y"][Math.floor(Math.random() * 2)]
8889
const dir = Math.random() > 0.5 ? 1 : -1

modules/item/item-dsa5.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,10 @@ export default class Itemdsa5 extends Item {
274274
/=\d+/.test(vals[0]) ||
275275
/\*\d(\.\d)*/.test(vals[0])
276276
) {
277-
if (itemModifiers[vals[1].toLowerCase()] == undefined) {
278-
itemModifiers[vals[1].toLowerCase()] = [vals[0]]
279-
} else {
280-
itemModifiers[vals[1].toLowerCase()].push(vals[0])
281-
}
277+
const key = vals[1].toLowerCase()
278+
if (itemModifiers[key] == undefined) itemModifiers[key] = []
279+
280+
itemModifiers[key].push(vals[0])
282281
}
283282
}
284283
}
@@ -525,14 +524,19 @@ export default class Itemdsa5 extends Item {
525524
mountedOptions = duplicate(DSA5.mountedRangeOptions)
526525
}
527526

527+
let finalMountedOptions = {}
528+
for(let key of Object.keys(mountedOptions)){
529+
finalMountedOptions[`${game.i18n.localize('mountedRangeOptions.' + key)} (${mountedOptions[key]})`] = mountedOptions[key]
530+
}
531+
528532
this.swarmModifiers(actor, "attack", situationalModifiers)
529533

530534
mergeObject(data, {
531535
rangeOptions,
532536
rangeDistance: Object.keys(rangeOptions)[DPS.distanceModifier(game.canvas.tokens.get(tokenId), source, currentAmmo)],
533537
sizeOptions: DSA5.rangeSizeCategories,
534538
visionOptions: DSA5.rangeVision,
535-
mountedOptions,
539+
mountedOptions: finalMountedOptions,
536540
shooterMovementOptions: DSA5.shooterMovementOptions,
537541
targetMovementOptions: DSA5.targetMomevementOptions,
538542
targetSize,

0 commit comments

Comments
 (0)