@@ -59,6 +59,9 @@ const modifierDirectory = './src/assets/modifierdata/';
5959const allTraitIds = new Set ( ) ;
6060const allExtrasIds = new Set ( ) ;
6161
62+ const allByAddOrMult = Object . fromEntries ( allDamageModes . map ( ( mode ) => [ mode , [ ] ] ) ) ;
63+ const allByConvertedOrBuff = Object . fromEntries ( allAttributePointModes . map ( ( mode ) => [ mode , [ ] ] ) ) ;
64+
6265const testModifiers = async ( ) => {
6366 const specializationDataJSON = await fs . readFile ( './src/utils/mapping/specializations.json' ) ;
6467 const specializationData = JSON . parse ( specializationDataJSON . toString ( ) ) ;
@@ -313,7 +316,7 @@ const testModifiers = async () => {
313316 }
314317
315318 if ( attributes ) {
316- parseAttributes ( attributes , id , amountData ) ;
319+ parseAttributes ( attributes , id , amountData , fileIsExtra ) ;
317320 }
318321
319322 if ( conversion ) {
@@ -340,6 +343,19 @@ const testModifiers = async () => {
340343 }
341344 }
342345 }
346+
347+ /*
348+ Object.entries(allByAddOrMult).forEach(([mode, entries]) => {
349+ console.log();
350+ console.log(`all damage modifiers with mode ${mode}:`);
351+ [...new Set(entries)].forEach((entry) => console.log(entry));
352+ });
353+ Object.entries(allByConvertedOrBuff).forEach(([mode, entries]) => {
354+ console.log();
355+ console.log(`all attribute bonuses with mode ${mode}:`);
356+ [...new Set(entries)].forEach((entry) => console.log(entry));
357+ });
358+ */
343359} ;
344360
345361const testBlacklist = ( amountData , key , id ) => {
@@ -373,6 +389,8 @@ function parseDamage(damage, id, amountData) {
373389 while ( allPairsMut . length ) {
374390 const [ amount , mode ] = allPairsMut . splice ( 0 , 2 ) ;
375391
392+ allByAddOrMult [ mode ] ?. push ( ` - ${ key } in ${ id } ` ) ;
393+
376394 parsePercent ( amount , key , id ) ;
377395 gentleAssert ( allDamageModes . includes ( mode ) , `invalid val ${ allPairs } for ${ key } in ${ id } ` ) ;
378396 gentleAssert (
@@ -417,7 +435,7 @@ function parseDamage(damage, id, amountData) {
417435 }
418436}
419437
420- function parseAttributes ( attributes , id , amountData ) {
438+ function parseAttributes ( attributes , id , amountData , fileIsExtra ) {
421439 for ( const [ key , allPairs ] of Object . entries ( attributes ) ) {
422440 if ( allAttributePointKeys . includes ( key ) ) {
423441 gentleAssert (
@@ -435,6 +453,10 @@ function parseAttributes(attributes, id, amountData) {
435453 while ( allPairsMut . length ) {
436454 const [ amount , mode ] = allPairsMut . splice ( 0 , 2 ) ;
437455
456+ if ( ! fileIsExtra ) {
457+ allByConvertedOrBuff [ mode ] ?. push ( ` - ${ key } in ${ id } ` ) ;
458+ }
459+
438460 parseNumber ( amount , key , id ) ;
439461 gentleAssert (
440462 allAttributePointModes . includes ( mode ) ,
0 commit comments