Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TLNBS2405 committed Jan 14, 2024
1 parent 2c0aaf1 commit 9765417
Show file tree
Hide file tree
Showing 10 changed files with 1,274 additions and 1,265 deletions.
404 changes: 202 additions & 202 deletions src/json_movelist/asuka.json

Large diffs are not rendered by default.

318 changes: 159 additions & 159 deletions src/json_movelist/azucena.json

Large diffs are not rendered by default.

224 changes: 112 additions & 112 deletions src/json_movelist/bryan.json

Large diffs are not rendered by default.

234 changes: 117 additions & 117 deletions src/json_movelist/claudio.json

Large diffs are not rendered by default.

390 changes: 195 additions & 195 deletions src/json_movelist/jun.json

Large diffs are not rendered by default.

320 changes: 160 additions & 160 deletions src/json_movelist/kazuya.json

Large diffs are not rendered by default.

402 changes: 201 additions & 201 deletions src/json_movelist/raven.json

Large diffs are not rendered by default.

234 changes: 117 additions & 117 deletions src/json_movelist/yoshimitsu.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/wavu/test/test_wavu_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@ def test_get_move(self):

def test_complete_parent_input(self):
character_movelist = wavu_reader.get_wavu_character_movelist("Azucena")
move7 = wavu_reader.get_move("Azucena-BT.3",character_movelist)
move = wavu_reader.get_move("Azucena-df+1,4,1",character_movelist)
move2 = wavu_reader.get_move("Azucena-f+4,4~3",character_movelist)
move3 = wavu_reader.get_move("Azucena-LIB.1,2",character_movelist)
move4 = wavu_reader.get_move("Azucena-b+4,3,4,3",character_movelist)
move5 = wavu_reader.get_move("Azucena-df+1,4,1~2",character_movelist)
move6 = wavu_reader.get_move("Azucena-ws4,1,3",character_movelist)

self.assertEqual(move.input,"df+1,4,1")
self.assertEqual(move2.input,"f+4,4~3")
self.assertEqual(move3.damage,"14,20")
self.assertEqual(move4.damage,"10,10,16,23")
self.assertEqual(move5.input,"df+1,4,1~2")
self.assertEqual(move6.on_ch,"+27a")
self.assertEqual(move7.on_hit,"+4~+5")

character_movelist = wavu_reader.get_wavu_character_movelist("Bryan")
move7 = wavu_reader.get_move("Bryan-4,3,f+4",character_movelist)
Expand Down
10 changes: 8 additions & 2 deletions src/wavu/wavu_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ def _create_alias(input: str) -> List[str]:
result.append(input)
return result

def _empty_value_if_none(value):
if not value:
return ""
else:
return value

def _convert_json_movelist(move_list_json: list) -> List[Move]:
move_list = []
Expand Down Expand Up @@ -127,11 +132,12 @@ def _convert_json_movelist(move_list_json: list) -> List[Move]:


def _normalize_hit_ch_input(entry: str) -> str:
if entry and "|" in entry:
entry = _empty_value_if_none(entry)
if "|" in entry:
pattern = r'\|([^|]+)\]\]'
match = re.search(pattern, entry)
if match:
return match.group(1)
return entry
else:
return ""
return entry

0 comments on commit 9765417

Please sign in to comment.