Skip to content

Instantly share code, notes, and snippets.

@Chase-san
Created October 24, 2024 03:58
Show Gist options
  • Save Chase-san/f7424a758e5353302832e04c51adac96 to your computer and use it in GitHub Desktop.
Save Chase-san/f7424a758e5353302832e04c51adac96 to your computer and use it in GitHub Desktop.
Infinite Fusion script for determing the fusion with the best combined BST.
Arceus 120 120 120 120 120 120
Kyurem 120 90 95 170 100 125
Dialga 120 120 90 150 100 100
Palkia 120 100 100 150 120 90
Giratina 120 100 90 120 100 150
Reshiram 120 100 90 150 120 100
Ho-Oh 130 90 90 110 154 106
Zekrom 150 120 90 120 100 100
Mewtwo 110 90 130 154 90 106
Rayquaza 150 90 95 150 90 105
Lugia 90 130 110 90 154 106
Regigigas 160 110 100 80 110 110
Slaking 160 100 100 95 65 150
Kyogre 100 90 90 150 140 100
Groudon 150 140 90 100 90 100
Genesect 120 95 99 120 95 71
Metagross 135 130 70 95 90 80
Jirachi 100 100 100 100 100 100
Meloetta 128 90 128 77 77 100
Darkrai 90 90 125 135 90 70
Goodra 100 70 80 110 150 90
Deoxys 150 50 150 150 50 50
Mew 100 100 100 100 100 100
Necrozma 107 101 79 127 89 97
Cresselia 70 120 85 75 130 120
Salamence 135 80 100 110 80 95
Dragonite 134 95 80 100 100 91
Garchomp 130 95 102 80 85 108
Hydreigon 105 90 98 125 90 92
Latias 80 90 110 110 130 80
Latios 90 80 110 130 110 80
Tyranitar 134 110 61 95 100 100
Celebi 100 100 100 100 100 100
Registeel 75 150 50 75 150 80
Zapdos 90 85 100 125 90 90
Raikou 85 75 115 115 100 90
Entei 115 85 100 90 75 115
Suicune 75 115 85 90 115 100
Moltres 100 90 90 125 85 90
Regirock 100 200 50 50 100 80
Regice 50 100 50 100 200 80
Articuno 85 100 85 95 125 90
Arcanine 110 80 95 100 80 90
Volcarona 60 65 100 135 105 85
Togekiss 50 95 80 120 115 85
Electivire 123 67 95 95 85 75
Kingdra 95 95 85 95 95 75
Magmortar 95 67 83 125 95 75
Milotic 60 79 81 100 125 95
Snorlax 110 65 30 65 110 160
Blissey 10 10 55 75 135 255
Gyarados 125 79 81 60 100 95
Haxorus 147 90 97 60 70 76
Magnezone 70 115 60 130 90 70
Crobat 90 80 130 70 80 85
Swampert 110 90 60 85 90 100
Porygon-Z 80 70 90 135 75 85
Noivern 70 80 123 97 80 85
Lapras 85 80 60 85 95 130
Tangrowth 100 125 50 110 50 100
Rhyperior 140 130 40 55 55 115
Typhlosion 84 78 100 109 85 78
Charizard 84 78 100 109 85 78
Infernape 104 71 108 104 71 76
Empoleon 86 88 60 111 101 84
Feraligatr 105 100 78 79 83 85
Blastoise 83 100 78 85 105 79
Blaziken 120 70 80 110 70 80
Aggron 110 180 50 60 60 70
Sceptile 85 65 120 105 85 70
Mamoswine 130 80 80 70 60 110
Exeggutor 105 85 45 125 75 95
Lucario 110 70 90 115 70 70
Dusknoir 100 135 45 65 135 45
Jolteon 65 60 130 110 95 65
Sylveon 65 65 60 110 130 95
Flareon 130 60 65 95 110 65
Vaporeon 65 60 65 110 95 130
Umbreon 65 110 65 60 130 95
Venusaur 82 83 80 100 100 80
Probopass 55 145 40 75 150 60
Espeon 65 60 110 130 95 65
Cloyster 95 180 70 85 45 50
Leafeon 110 130 95 60 65 65
Meganium 82 100 80 83 100 80
Glaceon 60 110 65 130 95 65
Torterra 109 105 56 75 85 95
Luxray 120 79 70 95 79 80
Tyrantrum 121 119 71 69 59 82
Aurorus 77 72 58 99 92 123
Aegislash 150 50 60 150 50 60
Klinklang 100 115 90 70 85 60
Rotom 65 107 86 105 107 50
Chandelure 55 90 80 145 90 60
Starmie 75 85 115 100 85 60
Flygon 100 80 100 80 80 80
Krookodile 117 80 92 65 70 95
Gardevoir 65 65 80 125 115 68
Gallade 125 65 80 65 115 68
Dhelmise 131 100 40 86 90 70
Tentacruel 70 65 100 80 120 80
Lickilicky 85 95 50 80 95 110
Porygon2 80 90 60 105 95 85
Roserade 70 65 90 125 105 60
Aerodactyl 105 65 130 60 75 80
Yanmega 76 86 95 116 56 86
Steelix 85 200 30 55 65 75
Gliscor 95 125 95 45 75 75
Zoroark 105 60 105 120 60 60
Poliwrath 95 95 70 70 90 90
Weavile 120 65 125 45 85 70
Ninetales 67 75 109 81 100 73
Nidoking 102 77 85 85 75 81
Nidoqueen 92 87 76 75 85 90
Honchkrow 125 52 71 105 52 100
Machamp 130 80 55 65 85 90
Shuckle 10 230 5 10 230 20
Scizor 130 100 65 55 80 70
Gengar 65 60 110 130 75 60
Muk 105 75 50 65 100 105
Ampharos 75 75 55 115 90 90
Rapidash 100 70 105 80 80 65
Ursaring 130 75 55 75 75 90
Golduck 82 78 85 95 80 80
Houndoom 90 50 95 110 80 75
Politoed 75 75 70 90 100 90
Wailord 90 45 60 90 45 170
Donphan 120 120 50 60 60 90
Pinsir 125 100 85 55 70 65
Bewear 125 80 60 55 60 120
Hawlucha 92 75 118 74 63 78
Heracross 125 75 85 40 95 80
Scyther 110 80 105 55 80 70
Talonflame 81 71 126 74 69 78
Drifblim 80 44 80 90 54 150
Toxapex 63 152 35 53 142 50
Mismagius 60 60 105 105 105 60
Magmar 95 57 93 100 85 65
Bastiodon 52 168 30 47 138 60
Armaldo 125 100 45 70 80 75
Rampardos 165 60 58 65 50 97
Cradily 81 97 43 81 107 86
Kabutops 115 105 80 65 70 60
Omastar 60 125 55 115 70 70
Golem 120 130 45 55 65 80
Bisharp 125 100 70 60 70 65
Weezing 90 120 60 85 70 65
Electrode 50 70 150 80 80 60
Electabuzz 83 57 105 95 85 65
Tauros 100 95 110 40 70 75
Miltank 80 105 100 40 70 95
Kangaskhan 95 80 90 40 80 105
Victreebel 105 65 70 100 70 80
Vileplume 80 85 50 110 90 75
Slowbro 75 110 30 100 80 95
Alakazam 50 45 120 135 85 55
Slowking 75 80 30 100 110 95
Reuniclus 65 75 30 125 85 110
Altaria 70 90 80 70 105 75
Bellossom 80 95 50 90 100 75
Ferrothorn 94 131 20 54 116 74
Lycanroc 115 75 82 55 75 85
Spiritomb 92 108 35 92 108 50
Raichu 85 50 110 95 85 60
Mantine 40 70 70 80 140 85
Scolipede 100 89 112 55 69 60
Rhydon 130 120 40 45 45 105
Cofagrigus 50 145 30 95 105 58
Clefable 70 73 60 95 90 95
Golurk 124 80 55 55 80 89
Hypno 73 70 67 73 115 85
Ambipom 100 66 115 60 66 75
Lopunny 76 84 105 54 96 65
Octillery 105 75 45 105 75 75
Palossand 75 110 35 100 75 85
Froslass 80 70 110 80 70 70
Whimsicott 67 85 116 77 75 60
Glalie 80 80 80 80 80 80
Mimikyu 90 80 96 50 105 55
Oricorio 70 70 93 98 70 75
Kingler 130 115 75 50 50 55
Bruxish 105 70 92 70 70 68
Dewgong 70 80 70 70 95 90
Cacturne 115 60 55 115 60 70
Garbodor 95 82 75 60 82 80
Trevenant 110 76 56 65 82 85
Galvantula 77 60 108 97 60 70
Stunfisk 66 84 32 81 99 109
Klefki 80 91 75 80 87 57
Dodrio 110 70 110 60 60 60
Xatu 75 70 95 95 70 65
Pidgeot 80 75 91 70 70 83
Skarmory 80 140 70 40 70 65
Forretress 90 140 40 60 60 75
Magneton 60 95 70 120 70 50
Stantler 95 62 85 85 65 73
Absol 130 60 75 75 60 65
Lanturn 58 58 67 76 76 125
Mr. Mime 45 65 90 100 120 40
Sharpedo 120 40 95 95 40 70
Jumpluff 55 70 110 55 95 75
Breloom 130 80 70 60 60 60
Ninjask 90 45 160 50 50 61
Banette 115 65 65 83 63 64
Dusclops 70 130 25 60 130 40
Golbat 80 70 90 65 75 75
Girafarig 80 65 85 90 65 70
Hitmontop 95 95 70 35 110 50
Primeape 105 60 95 60 70 65
Hitmonlee 120 53 87 35 110 50
Hitmonchan 105 79 76 35 110 50
Jynx 50 35 95 115 95 65
Noctowl 50 50 70 86 96 100
Sliggoo 75 53 60 83 113 68
Granbull 120 75 45 60 60 90
Seaking 92 65 68 65 80 80
Chansey 5 5 50 35 105 250
Sandslash 100 120 65 25 65 75
Venomoth 65 60 90 90 75 70
Piloswine 100 80 50 60 60 100
Doublade 110 150 35 45 49 59
Arbok 95 69 80 65 79 60
Fearow 90 65 100 61 61 65
Klang 80 95 50 70 85 60
Qwilfish 95 85 85 55 55 65
Vigoroth 80 80 90 55 55 80
Seadra 65 95 85 95 45 55
Persian 60 60 115 75 65 65
Kecleon 90 70 40 60 120 60
Misdreavus 60 60 85 85 85 60
Wigglytuff 70 45 45 85 50 140
Tangela 55 115 60 100 40 65
Quagsire 85 85 35 65 65 95
Gligar 75 105 85 35 65 65
Lairon 90 140 40 50 50 60
Magcargo 50 120 30 90 80 60
Sneasel 95 55 115 35 75 55
Dugtrio 100 60 110 50 70 35
Marowak 80 110 45 50 80 60
Sunflora 75 55 30 105 85 75
Metang 75 100 50 55 80 60
Azumarill 50 80 50 60 80 100
Shelgon 95 100 50 60 50 65
Dragonair 84 65 70 70 70 61
Zweilous 85 70 58 65 70 72
Furret 76 64 90 45 55 85
Dunsparce 70 70 45 65 65 100
Raticate 71 70 77 40 80 75
Ponyta 85 55 90 65 65 50
Bibarel 85 60 71 55 60 79
Pyukumuku 60 130 5 30 130 55
Fraxure 117 70 67 40 50 66
Gabite 90 65 82 50 55 68
Sudowoodo 100 115 30 30 65 70
Corsola 55 95 35 65 95 65
Pupitar 84 70 51 65 70 70
Haunter 50 45 95 115 55 45
Croconaw 80 80 58 59 63 65
Marshtomp 85 70 50 60 70 70
Quilava 64 58 80 80 65 58
Charmeleon 64 58 80 80 65 58
Wartortle 63 80 58 65 80 59
Prinplup 66 68 50 81 76 64
Murkrow 85 42 91 85 42 60
Togetic 40 85 40 80 105 55
Monferno 78 52 81 78 52 64
Combusken 85 60 55 85 60 60
Ivysaur 62 63 60 80 80 60
Machoke 100 70 45 50 60 80
Wobbuffet 33 58 33 33 58 190
Grotle 89 85 36 55 65 75
Grovyle 65 45 95 85 65 50
Bayleef 62 80 60 63 80 60
Parasect 95 80 30 60 80 60
Wailmer 70 35 60 70 35 130
Ariados 90 70 40 60 70 70
Roselia 60 45 65 100 80 50
Kadabra 35 30 105 120 70 40
Porygon 60 70 40 85 75 65
Gloom 65 70 40 85 75 60
Butterfree 45 50 70 90 80 60
Munchlax 85 40 5 40 85 135
Weepinbell 90 50 55 85 45 65
Yanma 65 45 95 75 45 65
Ledian 35 50 85 55 110 55
Graveler 95 115 35 45 45 55
Poliwhirl 65 65 90 50 50 65
Lickitung 55 75 30 60 75 90
Beedrill 80 40 75 45 80 65
Onix 45 160 70 30 45 35
Fletchinder 73 55 84 56 52 62
Mawile 85 85 50 55 55 50
Sableye 75 75 50 65 65 50
Farfetch'd 90 55 60 58 62 52
Nosepass 45 135 30 45 90 30
Lampent 40 60 55 95 60 60
Duosion 40 50 30 125 60 65
Nidorino 72 57 65 55 55 61
Nidorina 62 67 56 55 55 70
Flaaffy 55 55 45 80 60 70
Magby 75 37 83 70 55 45
Luxio 85 49 60 60 49 60
Tyrunt 89 77 48 45 45 58
Amaura 59 50 46 67 63 77
Elekid 63 37 95 65 55 45
Aipom 70 55 85 40 55 55
Whirlipede 55 99 47 40 79 40
Larvesta 85 55 60 50 55 55
Anorith 95 50 75 40 50 45
Lileep 41 77 23 61 87 66
Kabuto 80 90 55 55 45 30
Omanyte 40 100 35 90 55 35
Krokorok 82 45 74 45 45 60
Buneary 66 44 85 44 56 55
Growlithe 70 45 60 70 50 55
Shieldon 42 118 30 42 88 30
Cranidos 125 40 58 30 30 67
Pidgeotto 60 55 71 50 50 63
Drifloon 50 34 70 60 44 90
Mantyke 20 50 50 60 120 45
Rhyhorn 85 95 25 30 30 80
Pawniard 85 70 60 40 40 45
Koffing 65 95 35 60 45 40
Staryu 45 55 85 70 55 30
Stufful 75 50 50 45 50 70
Vibrava 70 50 70 50 50 50
Skiploom 45 50 80 45 65 55
Unown 72 48 48 72 48 48
Tentacool 40 35 70 50 100 40
Cacnea 85 40 35 85 40 50
Chinchou 38 38 67 56 56 75
Voltorb 30 50 100 55 55 40
Teddiursa 80 50 40 50 50 60
Houndour 60 30 65 80 50 45
Zorua 65 40 65 80 40 40
Phanpy 60 60 40 40 40 90
Aron 70 100 30 40 40 50
Delibird 55 45 75 65 45 45
Trubbish 50 62 65 40 62 50
Drowzee 48 45 42 43 90 60
Honedge 80 100 28 35 37 45
Magnemite 35 70 45 95 55 25
Grimer 80 50 25 40 50 80
Krabby 105 90 50 25 25 30
Eevee 55 50 55 45 65 55
Seel 45 55 45 45 70 65
Exeggcute 40 80 40 60 45 60
Clefairy 45 48 35 60 65 70
Pikachu 55 40 90 50 50 35
Goldeen 67 60 63 35 50 45
Psyduck 52 48 55 65 50 50
Sandygast 55 80 15 70 45 55
Axew 87 60 57 30 40 46
Cubone 50 95 35 40 50 50
Oddish 50 55 30 75 65 45
Natu 50 45 70 70 45 40
Joltik 47 50 65 57 50 50
Bulbasaur 49 49 45 65 65 45
Turtwig 68 64 31 45 55 55
Chikorita 49 65 45 49 65 45
Slowpoke 65 65 15 40 40 90
Totodile 65 64 43 44 48 50
Squirtle 48 65 43 50 64 44
Piplup 51 53 40 61 56 53
Gastly 35 30 80 100 35 30
Doduo 85 45 75 35 35 35
Mudkip 70 50 40 50 50 50
Swablu 40 60 50 40 75 45
Torchic 60 40 45 70 50 45
Mime Jr. 25 45 60 70 90 20
Abra 20 15 90 105 55 25
Treecko 45 35 70 65 55 40
Chimchar 58 44 61 58 44 44
Cyndaquil 52 43 65 60 50 39
Charmander 52 43 65 60 50 39
Phantump 70 48 38 50 60 43
Ferroseed 50 91 10 24 86 44
Mareanie 53 62 45 43 52 50
Shellder 65 100 40 45 25 30
Carvanha 90 20 65 65 20 45
Venonat 55 50 45 40 55 60
Mankey 80 35 70 35 45 40
Machop 80 50 35 35 35 70
Smoochum 30 15 65 85 65 45
Yamask 30 85 30 55 65 38
Golett 74 50 35 35 50 59
Klink 55 70 30 45 60 40
Beldum 55 80 30 35 60 40
Snubbull 80 50 30 40 40 60
Poliwag 50 40 90 40 40 40
Remoraid 65 35 65 65 35 35
Sandshrew 75 90 40 10 35 50
Bagon 75 60 50 40 30 45
Goomy 50 35 40 55 75 45
Dratini 64 45 50 50 50 41
Bellsprout 75 35 40 70 30 50
Gible 70 45 42 40 45 58
Deino 65 50 38 45 50 52
Snorunt 50 50 50 50 50 50
Geodude 80 100 20 30 30 40
Larvitar 64 50 41 45 50 50
Vulpix 41 40 65 50 65 38
Shuppet 75 35 45 63 33 44
Duskull 40 90 25 30 90 20
Horsea 40 70 60 70 25 30
Shroomish 40 60 35 40 60 60
Sandile 72 35 65 35 35 50
Meowth 35 35 90 50 40 40
Trapinch 100 45 10 45 45 45
Pineco 65 90 15 35 35 50
Solosis 30 40 20 105 50 45
Bonsly 80 95 10 10 45 50
Ekans 60 44 55 40 54 35
Ditto 48 48 48 48 48 48
Riolu 70 40 60 35 40 40
Paras 70 55 25 45 55 35
Mareep 40 40 35 65 45 55
Slakoth 60 60 30 35 35 60
Budew 30 35 55 50 70 40
Cottonee 27 60 66 37 50 40
Rockruff 65 40 60 30 40 45
Fletchling 50 43 62 40 38 45
Kirlia 35 35 50 65 55 38
Litwick 30 55 20 65 55 50
Nidoran♀ 47 52 41 40 40 55
Nidoran♂ 57 40 50 40 40 46
Jigglypuff 45 20 20 45 25 115
Nincada 45 90 40 30 30 31
Diglett 55 30 90 35 45 10
Ledyba 20 30 55 40 80 40
Shinx 65 34 45 40 34 45
Spearow 60 30 70 31 31 40
Hoothoot 30 30 50 36 56 60
Venipede 45 59 57 30 39 30
Wynaut 23 48 23 23 48 95
Rattata 56 35 72 25 35 30
Pidgey 45 40 56 35 35 40
Marill 20 50 40 20 50 70
Smeargle 20 35 75 20 45 55
Bidoof 45 40 31 35 40 59
Slugma 40 40 20 70 40 40
Spinarak 60 40 30 40 40 40
Swinub 50 40 50 30 30 50
Hoppip 35 40 50 35 55 35
Togepi 20 65 20 40 65 35
Zubat 45 35 55 30 40 40
Noibat 30 35 55 45 40 40
Shedinja 90 45 40 30 30 1
Happiny 5 5 30 15 65 100
Cleffa 25 28 15 45 55 50
Sentret 46 34 20 35 45 35
Igglybuff 30 15 15 40 20 90
Wooper 45 45 15 25 25 55
Tyrogue 35 35 35 35 35 35
Pichu 40 15 60 35 35 20
Kakuna 25 50 35 25 25 45
Metapod 20 55 30 25 25 50
Magikarp 10 55 80 15 20 20
Feebas 15 20 80 10 55 20
Ralts 25 25 40 45 35 28
Weedle 35 30 50 20 20 40
Caterpie 30 35 45 20 20 45
Azurill 20 40 20 20 40 50
Sunkern 30 30 30 30 30 30
#!/usr/bin/python3
# Copyright (c) 2024, Robert Maupin. Free for personal use. No warranty or liability is provided.
import csv
import heapq
import sys
STAT_ATK=0
STAT_DEF=1
STAT_SPEED=2
STAT_SATK=3
STAT_SDEF=4
STAT_HP=5
# damerau levenshtein
def string_distance(str1: str, str2: str) -> int:
len1, len2 = len(str1), len(str2)
dp = [[0] * (len2 + 1) for _ in range(len1 + 1)]
for i in range(len1 + 1):
dp[i][0] = i
for j in range(len2 + 1):
dp[0][j] = j
for i in range(1, len1 + 1):
for j in range(1, len2 + 1):
cost = 0 if str1[i - 1] == str2[j - 1] else 1
dp[i][j] = min(
dp[i - 1][j] + 1, # Deletion
dp[i][j - 1] + 1, # Insertion
dp[i - 1][j - 1] + cost # Substitution
)
if i > 1 and j > 1 and str1[i - 1] == str2[j - 2] and str1[i - 2] == str2[j - 1]:
dp[i][j] = min(dp[i][j], dp[i - 2][j - 2] + 1)
return dp[len1][len2]
def load_base_stats(filename: str) -> dict:
data_map = {}
with open(filename, mode='r', newline='') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
#name,atk,def,spd,satk,sdef,hp
key = row[0].lower()
values = list(map(int, row[1:]))
data_map[key] = values
return data_map
def fusion(head: list, body: list) -> list:
values = [0,0,0,0,0,0]
values[STAT_ATK] = int(2 * body[STAT_ATK] / 3 + head[STAT_ATK] / 3)
values[STAT_DEF] = int(2 * body[STAT_DEF] / 3 + head[STAT_DEF] / 3)
values[STAT_SPEED] = int(2 * body[STAT_SPEED] / 3 + head[STAT_SPEED] / 3)
values[STAT_SDEF] = int(2 * head[STAT_SDEF] / 3 + body[STAT_SDEF] / 3)
values[STAT_SATK] = int(2 * head[STAT_SATK] / 3 + body[STAT_SATK] / 3)
values[STAT_HP] = int(2 * head[STAT_HP] / 3 + body[STAT_HP] / 3)
return values
def stat_total(entry: list) -> int:
return entry[STAT_ATK]+entry[STAT_DEF]+entry[STAT_SPEED]+entry[STAT_SDEF]+entry[STAT_SATK]+entry[STAT_HP]
argc = len(sys.argv)
if argc != 2:
print("Syntax: fusion_check.py <pokemon name>")
quit()
db = load_base_stats("base_stats.csv")
#find matching pokemon
target = sys.argv[1]
target = target.lower()
if not target in db:
best_score = 999
best_name = ""
for name in db:
score = string_distance(target, name)
if score < best_score:
best_score = score
best_name = name
target = best_name
print("Calculating ideal fusions for:", target)
t_data = db[target]
t_bst = stat_total(t_data)
best_fusions = []
for entry in db:
e_data = db[entry]
e_bst = stat_total(e_data)
fused_as_head = fusion(t_data, e_data)
head_bst = stat_total(fused_as_head)
diff = min(head_bst - t_bst, head_bst - e_bst)
heapq.heappush(best_fusions, (-diff, target, entry, head_bst))
#print(target, t_bst, entry, e_bst, "fusion", head_bst, diff)
fused_as_body = fusion(e_data, t_data)
body_bst = stat_total(fused_as_body)
diff = min(body_bst - t_bst, body_bst - e_bst)
#print(entry, e_bst, target, t_bst, "fusion", body_bst, diff)
heapq.heappush(best_fusions, (-diff, entry, target, body_bst))
print("Best Fusions:")
for index in range(30):
entry = heapq.heappop(best_fusions)
head = entry[1]
body = entry[2]
diff = -entry[0]
bst = entry[3]
if diff > 0:
diff = "+" + str(diff)
print(f"{head:>15} / {body:<15}: {diff:<4} @ {bst:<4} BST")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment