Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion amiibo/amiibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class UnknownMask(Hex):


class Amiibo:
def __init__(self, manager, head, tail, name, release, games3DS, gamesWiiU, gamesSwitch):
def __init__(self, manager, head, tail, name, release, games3DS, gamesWiiU, gamesSwitch, gamesSwitch2):
self.manager = manager
self.head = Hex(head)
self.tail = Hex(tail)
Expand All @@ -139,6 +139,7 @@ def __init__(self, manager, head, tail, name, release, games3DS, gamesWiiU, game
self.games3DS = games3DS
self.gamesWiiU = gamesWiiU
self.gamesSwitch = gamesSwitch
self.gamesSwitch2 = gamesSwitch2

@cached_property
def id(self):
Expand Down
4 changes: 4 additions & 0 deletions amiibo/filterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def filter_game_series_name(self, value):
def filter_switch_titleid(self, value):
return lambda x: any(value in game.get("gameID") for game in x.gamesSwitch)

@filterable('switch2_titleid')
def filter_switch2_titleid(self, value):
return lambda x: any(value in game.get("gameID") for game in x.gamesSwitch2)

@filterable('wiiu_titleid')
def filter_wiiu_titleid(self, value):
return lambda x: any(value in game.get("gameID") for game in x.gamesWiiU)
Expand Down
16 changes: 12 additions & 4 deletions amiibo/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def to_json(self, file='database/amiibo.json'):
},
'games3DS': amiibo.games3DS,
'gamesWiiU': amiibo.gamesWiiU,
'gamesSwitch': amiibo.gamesSwitch
'gamesSwitch': amiibo.gamesSwitch,
'gamesSwitch2': amiibo.gamesSwitch2
}
for amiibo in self.amiibosfull
},
Expand Down Expand Up @@ -83,7 +84,7 @@ def from_json(self, file='database/amiibo.json', file1='database/games_info.json
jp=AmiiboManager._parse_date(amiibo['release']['jp']),
eu=AmiiboManager._parse_date(amiibo['release']['eu']),
au=AmiiboManager._parse_date(amiibo['release']['au']),
), data1['amiibos'][id_]['games3DS'], data1['amiibos'][id_]['gamesWiiU'], data1['amiibos'][id_]['gamesSwitch'])
), data1['amiibos'][id_]['games3DS'], data1['amiibos'][id_]['gamesWiiU'], data1['amiibos'][id_]['gamesSwitch'], data1['amiibos'][id_]['gamesSwitch2'])
for id_, amiibo in data['amiibos'].items()
)

Expand All @@ -93,10 +94,16 @@ def from_json(self, file='database/amiibo.json', file1='database/games_info.json
jp=AmiiboManager._parse_date(amiibo['release']['jp']),
eu=AmiiboManager._parse_date(amiibo['release']['eu']),
au=AmiiboManager._parse_date(amiibo['release']['au']),
), data1['amiibos'][id_]['games3DS'], data1['amiibos'][id_]['gamesWiiU'], data1['amiibos'][id_]['gamesSwitch'])
), data1['amiibos'][id_]['games3DS'], data1['amiibos'][id_]['gamesWiiU'], data1['amiibos'][id_]['gamesSwitch'], data1['amiibos'][id_]['gamesSwitch2'])
for id_, amiibo in data['amiibos'].items()
)
for amiibo in self.amiibosfullwithoutusage:
amiibo.gamesSwitch2 = copy.deepcopy(amiibo.gamesSwitch2)
for game in amiibo.gamesSwitch2:
try:
del game['amiiboUsage']
except:
pass
amiibo.gamesSwitch = copy.deepcopy(amiibo.gamesSwitch)
for game in amiibo.gamesSwitch:
try:
Expand All @@ -123,11 +130,12 @@ def from_json(self, file='database/amiibo.json', file1='database/games_info.json
jp=self._parse_date(amiibo['release']['jp']),
eu=self._parse_date(amiibo['release']['eu']),
au=self._parse_date(amiibo['release']['au']),
), None, None, None) # TODO: add custom Amiibo class that doesn't need the games
), None, None, None, None) # TODO: add custom Amiibo class that doesn't need the games
for id_, amiibo in data['amiibos'].items()
)
for amiibo in self.amiibos:
try:
del amiibo.gamesSwitch2
del amiibo.gamesSwitch
del amiibo.games3DS
del amiibo.gamesWiiU
Expand Down
1 change: 1 addition & 0 deletions checkfulldatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def validateGamePlatform(platform, key):
validateGamePlatform('games3DS', key)
validateGamePlatform('gamesWiiU', key)
validateGamePlatform('gamesSwitch', key)
validateGamePlatform('gamesSwitch2', key)
else:
printError(1, 'Formatting error on game info key: ' + key)

Expand Down
2 changes: 1 addition & 1 deletion commons/amiibo_json_encounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def default(self, obj):
'release': obj.release
}
try:
returner.update({'games3DS': obj.games3DS, 'gamesWiiU': obj.gamesWiiU, 'gamesSwitch': obj.gamesSwitch})
returner.update({'games3DS': obj.games3DS, 'gamesWiiU': obj.gamesWiiU, 'gamesSwitch': obj.gamesSwitch, 'gamesSwitch2': obj.gamesSwitch2})
except AttributeError:
pass
return returner
Expand Down
Loading