Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/music-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ column their rows have, in the order the rows first have them; when such a table
| `MasterSupportCardRank` | `_id` `_group` `_rank` `_limitLevel` `_cardTypeLinkBonusRate` `_supportSkill01Level` `_supportSkill02Level` `_gekisouSupportSkill01Level` `_gekisouSupportSkill02Level` |
| `MasterCharacter` | `_id` `_bandID` |
| `MasterBand` | `_id` |
| `MasterCharacterRank` | `_id` `_rank` `_bonus` |
| `MasterCharacterRank` | `_id` `_rank` `_exp` `_bonus` |
| `MasterCharacterTotalRank` | `_id` `_totalRank` `_bonus` |
| `MasterBandItemSkillEffect` | `_id` `_bandItemId` `_level` `_skillTargetIDs` `_skillEffectType` `_effectValue` |
| `MasterBandItem` | `_id` `_bandId` |
Expand Down
2 changes: 1 addition & 1 deletion src/nnnotes/deckdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"_supportSkill02Level _gekisouSupportSkill01Level _gekisouSupportSkill02Level"),
("MasterCharacter", "_id _bandID"),
("MasterBand", "_id"),
("MasterCharacterRank", "_id _rank _bonus"),
("MasterCharacterRank", "_id _rank _exp _bonus"),
("MasterCharacterTotalRank", "_id _totalRank _bonus"),
("MasterBandItemSkillEffect", "_id _bandItemId _level _skillTargetIDs _skillEffectType _effectValue"),
("MasterBandItem", "_id _bandId"),
Expand Down
18 changes: 18 additions & 0 deletions tests/test_deckdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,24 @@ def rows(name):
assert document["provenance"]["tables"]["MasterVip"] == hashlib.sha256((tmp_path / "m/MasterVip.bin").read_bytes()).hexdigest()


def test_character_rank_carries_its_experience_threshold(tmp_path):
def rows(name):
if name == "MasterCharacterRank":
return [{"_id": 1, "_rank": 1, "_exp": 0, "_bonus": 0}, {"_id": 2, "_rank": 2, "_exp": 3, "_bonus": 5}]
return rows_of(name)

ranks = export(tmp_path, rows=rows)["master"]["MasterCharacterRank"]
# A character's rank is the highest rank whose cumulative experience it has reached.
assert ranks == {"columns": ["_id", "_rank", "_exp", "_bonus"], "rows": [[1, 1, 0, 0], [2, 2, 3, 5]]}

def without_exp(name):
if name == "MasterCharacterRank":
return [{"_id": 1, "_rank": 1, "_bonus": 0}]
return rows_of(name)
failing(tmp_path, r"MasterCharacterRank: row 0 \(_id 1\) has no column _exp",
src=deckdata.master_files(master_dir(tmp_path, without_exp, name="p")))


def test_charts(tmp_path):
export(tmp_path)
charts = json.loads((tmp_path / "deck.json").read_bytes())["charts"]
Expand Down
Loading