diff --git a/data/Data5.js b/data/Data5.js index 083a981..d4b8a8f 100644 --- a/data/Data5.js +++ b/data/Data5.js @@ -162,7 +162,6 @@ var arcana2Combos = [ { 'source': ['Chariot', 'Star'], 'result': 'Moon' }, { 'source': ['Chariot', 'Moon'], 'result': 'Lovers' }, { 'source': ['Chariot', 'Sun'], 'result': 'Priestess' }, - { 'source': ['Chariot', 'Judgement'], 'result': 'Hierophant' }, { 'source': ['Justice', 'Justice'], 'result': 'Justice' }, { 'source': ['Justice', 'Hermit'], 'result': 'Magician' }, { 'source': ['Justice', 'Fortune'], 'result': 'Emperor' }, @@ -175,7 +174,6 @@ var arcana2Combos = [ { 'source': ['Justice', 'Star'], 'result': 'Empress' }, { 'source': ['Justice', 'Moon'], 'result': 'Devil' }, { 'source': ['Justice', 'Sun'], 'result': 'Hanged Man' }, - { 'source': ['Justice', 'Judgement'], 'result': 'Tower' }, { 'source': ['Hermit', 'Hermit'], 'result': 'Hermit' }, { 'source': ['Hermit', 'Fortune'], 'result': 'Star' }, { 'source': ['Hermit', 'Strength'], 'result': 'Hierophant' }, @@ -208,7 +206,6 @@ var arcana2Combos = [ { 'source': ['Strength', 'Star'], 'result': 'Moon' }, { 'source': ['Strength', 'Moon'], 'result': 'Magician' }, { 'source': ['Strength', 'Sun'], 'result': 'Moon' }, - { 'source': ['Strength', 'Judgement'], 'result': 'Fortune' }, { 'source': ['Hanged Man', 'Hanged Man'], 'result': 'Hanged Man' }, { 'source': ['Hanged Man', 'Death'], 'result': 'Moon' }, { 'source': ['Hanged Man', 'Temperance'], 'result': 'Death' }, @@ -225,7 +222,6 @@ var arcana2Combos = [ { 'source': ['Death', 'Star'], 'result': 'Devil' }, { 'source': ['Death', 'Moon'], 'result': 'Hierophant' }, { 'source': ['Death', 'Sun'], 'result': 'Priestess' }, - { 'source': ['Death', 'Judgement'], 'result': 'Magician' }, { 'source': ['Temperance', 'Temperance'], 'result': 'Temperance' }, { 'source': ['Temperance', 'Devil'], 'result': 'Fool' }, { 'source': ['Temperance', 'Tower'], 'result': 'Fortune' }, diff --git a/data/Data5.ts b/data/Data5.ts index a4a0e7c..3c95b14 100644 --- a/data/Data5.ts +++ b/data/Data5.ts @@ -164,7 +164,6 @@ const arcana2Combos = [ {'source': ['Chariot', 'Star' ], 'result': 'Moon' }, {'source': ['Chariot', 'Moon' ], 'result': 'Lovers' }, {'source': ['Chariot', 'Sun' ], 'result': 'Priestess' }, - {'source': ['Chariot', 'Judgement' ], 'result': 'Hierophant' }, {'source': ['Justice', 'Justice' ], 'result': 'Justice' }, {'source': ['Justice', 'Hermit' ], 'result': 'Magician' }, {'source': ['Justice', 'Fortune' ], 'result': 'Emperor' }, @@ -177,7 +176,6 @@ const arcana2Combos = [ {'source': ['Justice', 'Star' ], 'result': 'Empress' }, {'source': ['Justice', 'Moon' ], 'result': 'Devil' }, {'source': ['Justice', 'Sun' ], 'result': 'Hanged Man' }, - {'source': ['Justice', 'Judgement' ], 'result': 'Tower' }, {'source': ['Hermit', 'Hermit' ], 'result': 'Hermit' }, {'source': ['Hermit', 'Fortune' ], 'result': 'Star' }, {'source': ['Hermit', 'Strength' ], 'result': 'Hierophant' }, @@ -210,7 +208,6 @@ const arcana2Combos = [ {'source': ['Strength', 'Star' ], 'result': 'Moon' }, {'source': ['Strength', 'Moon' ], 'result': 'Magician' }, {'source': ['Strength', 'Sun' ], 'result': 'Moon' }, - {'source': ['Strength', 'Judgement' ], 'result': 'Fortune' }, {'source': ['Hanged Man', 'Hanged Man' ], 'result': 'Hanged Man' }, {'source': ['Hanged Man', 'Death' ], 'result': 'Moon' }, {'source': ['Hanged Man', 'Temperance' ], 'result': 'Death' }, @@ -227,7 +224,6 @@ const arcana2Combos = [ {'source': ['Death', 'Star' ], 'result': 'Devil' }, {'source': ['Death', 'Moon' ], 'result': 'Hierophant' }, {'source': ['Death', 'Sun' ], 'result': 'Priestess' }, - {'source': ['Death', 'Judgement' ], 'result': 'Magician' }, {'source': ['Temperance', 'Temperance' ], 'result': 'Temperance' }, {'source': ['Temperance', 'Devil' ], 'result': 'Fool' }, {'source': ['Temperance', 'Tower' ], 'result': 'Fortune' }, diff --git a/src/FusionCalculator.js b/src/FusionCalculator.js index 60563f2..02d1bc9 100644 --- a/src/FusionCalculator.js +++ b/src/FusionCalculator.js @@ -86,6 +86,10 @@ var FusionCalculator = (function () { } var level = 1 + Math.floor((persona1.level + persona2.level) / 2); var arcana = getResultArcana(persona1.arcana, persona2.arcana); + if (!arcana) { + // only Judgement + [Justice/Strength/Chariot/Death] can result in this + return null; + } var personae = this.personaeByArcana[arcana]; var persona = null; var found = false; diff --git a/src/FusionCalculator.ts b/src/FusionCalculator.ts index bbdffc6..af06433 100644 --- a/src/FusionCalculator.ts +++ b/src/FusionCalculator.ts @@ -100,6 +100,11 @@ class FusionCalculator { let level = 1 + Math.floor((persona1.level + persona2.level) / 2); let arcana = getResultArcana(persona1.arcana, persona2.arcana); + if (!arcana) { + // only Judgement + [Justice/Strength/Chariot/Death] can result in this + return null; + } + let personae = this.personaeByArcana[arcana]; let persona: PersonaData = null; diff --git a/test/FusionTest.js b/test/FusionTest.js index 7b3bc2f..6a92aaf 100644 --- a/test/FusionTest.js +++ b/test/FusionTest.js @@ -74,7 +74,7 @@ describe('FusionCalculator', function () { expect(fuseTestWrapper("Crystal Skull", "Regent")).to.equal(personaMap["Mithra"]); }); }); - describe('special fusion)', function () { + describe('special fusion', function () { it('should return Alice when fusing Nebiros and Belial', function () { expect(fuseTestWrapper("Nebiros", "Belial")).to.equal(personaMap["Alice"]); }); @@ -99,6 +99,22 @@ describe('FusionCalculator', function () { expect(fuseTestWrapper("Orlov", "Neko Shogun")).to.equal(personaMap["Kaiwan"]); }); }); + describe('impossible fusions with Judgement', function () { + it('should return null when fusing Judgement + Death', function () { + expect(fuseTestWrapper("Messiah", "Mandrake")).to.equal(null); + expect(fuseTestWrapper("Trumpeter", "Hell Biker")).to.equal(null); + }); + it('should return null when fusing Judgement + Chariot', function () { + expect(fuseTestWrapper("Messiah", "Agathion")).to.equal(null); + }); + it('should return null when fusing Judgement + Strength', function () { + expect(fuseTestWrapper("Messiah Picaro", "Kelpie")).to.equal(null); + }); + it('should return null when fusing Judgement + Justice', function () { + expect(fuseTestWrapper("Messiah Picaro", "Angel")).to.equal(null); + expect(fuseTestWrapper("Power", "Anubis")).to.equal(null); + }); + }); }); describe('#getRecipes()', function () { describe('special fusions', function () { diff --git a/test/FusionTest.ts b/test/FusionTest.ts index d716ee8..ea4c686 100644 --- a/test/FusionTest.ts +++ b/test/FusionTest.ts @@ -94,7 +94,7 @@ describe('FusionCalculator', () => { }); }); - describe('special fusion)', function () { + describe('special fusion', function () { it('should return Alice when fusing Nebiros and Belial', () => { expect(fuseTestWrapper("Nebiros", "Belial")).to.equal(personaMap["Alice"]); }); @@ -125,6 +125,26 @@ describe('FusionCalculator', () => { expect(fuseTestWrapper("Orlov", "Neko Shogun")).to.equal(personaMap["Kaiwan"]); }); }); + + describe('impossible fusions with Judgement', function () { + it('should return null when fusing Judgement + Death', () => { + expect(fuseTestWrapper("Messiah", "Mandrake")).to.equal(null); + expect(fuseTestWrapper("Trumpeter", "Hell Biker")).to.equal(null); + }); + + it('should return null when fusing Judgement + Chariot', () => { + expect(fuseTestWrapper("Messiah", "Agathion")).to.equal(null); + }); + + it('should return null when fusing Judgement + Strength', () => { + expect(fuseTestWrapper("Messiah Picaro", "Kelpie")).to.equal(null); + }); + + it('should return null when fusing Judgement + Justice', () => { + expect(fuseTestWrapper("Messiah Picaro", "Angel")).to.equal(null); + expect(fuseTestWrapper("Power", "Anubis")).to.equal(null); + }); + }); }); describe('#getRecipes()', () => {