Skip to content

Commit

Permalink
adapt cleaning strings
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 committed Dec 9, 2023
1 parent 33943be commit 7c11630
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/aspects_unique.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"blood_artisans_cuirass": "when you pick up blood orbs, a free bone spirit is spawned, dealing bonus damage based on your current life percent.",
"blood_moon_breeches": "your minions have a chance to curse enemies. enemies affected by at least of your curses take (multiplicative damage) increased overpower damage from you.",
"bloodless_scream": "your darkness skills chill enemies for up to. lucky hit your darkness skills have up to a chance to generate additional essence against frozen targets. darkness skills deal xx bonus damage to frozen enemies",
"deathless_visage": "bone spear leaves behind echoes as it travels that explode, dealing damage. echoes deal increased damage based on your critical strike bonus damage stat",
"deathless_visage": "bone spear leaves behind echoes as it travels that explode, dealing damage, increased by for every of your critical strike damage bonus.",
"deathspeakers_pendant": "blood surge casts a mini nova on your minions, dealing damage. damage is increased by per target drained by the initial cast, up to.",
"greaves_of_the_empty_tomb": "create desecrated ground beneath your sever spectrers as they travel, damaging enemies for shadow damage over seconds.",
"howl_from_below": "instead of detonating immediately, corpse explosion summons a volatile skeleton that charges at a random enemy and explodes. corpse explosions damage is increased by.",
Expand Down
13 changes: 9 additions & 4 deletions config/profiles/rogue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Aspects:
# offensive
- [bladedancers_aspect, 15]
- [aspect_of_branching_volleys, 25]
- [trickshot_aspect, 25]
- [trickshot_aspect, 20]
- [aspect_of_corruption, 40]
- [aspect_of_bursting_venoms, 10000]
- [aspect_of_repeating, 45]
- [aspect_of_pestilent_points, 150]

# defensive
- [umbrous_aspect, 58]
- [umbrous_aspect, 55]
- [cheats_aspect, 25]
- [enshrouding_aspect, 4]
- [aspect_of_elusive_menace, 7]
Expand All @@ -27,9 +27,9 @@ Aspects:
- [assimilation_aspect, 10]

# general
- [accelerating_aspect, 25]
- [accelerating_aspect, 24]
- [aspect_of_might, 6]
- [aspect_of_disobedience, 1.1]
- [aspect_of_disobedience, 1.0]
- [aspect_of_inner_calm, 10]
- [aspect_of_retribution, 20]
- [aspect_of_the_expectant, 10]
Expand Down Expand Up @@ -77,6 +77,11 @@ Affixes:
- [dodge_chance, 5]
- [energy_cost_reduction, 6]
- [dodge_chance_against_distant_enemies]
- [fire_resistance]
- [shadow_resistance]
- [poison_resistance]
- [lightning_resistance]
- [cold_resistance]
minAffixCount: 3

- Amulet:
Expand Down
4 changes: 3 additions & 1 deletion src/item/read_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def _remove_text_after_first_keyword(text, keywords):


def _clean_str(s):
cleaned_str = re.sub(r"(\+)?\d+(\.\d+)?%?", "", s) # Remove numbers and trailing % or preceding +
cleaned_str = re.sub(r"(\d)[, ]+(\d)", r"\1\2", s) # Remove , between numbers (large number seperator)
cleaned_str = re.sub(r"(\+)?\d+(\.\d+)?%?", "", cleaned_str) # Remove numbers and trailing % or preceding +
cleaned_str = cleaned_str.replace("[x]", "") # Remove all [x]
cleaned_str = re.sub(r"[\[\]+\-:%\']", "", cleaned_str) # Remove [ and ] and leftover +, -, %, :, '
cleaned_str = re.sub(
r"\((rogue|barbarian|druid|sorcerer|necromancer) only\)", "", cleaned_str
Expand Down
Binary file added test/assets/item/read_descr_unique_1080p_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions test/item/read_descr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@
],
),
),
(
(1920, 1080),
f"{BASE_PATH}/read_descr_unique_1080p_2.png",
Item(
ItemRarity.Unique,
ItemType.Helm,
942,
Aspect("deathless_visage", 2254),
[
Affix("critical_strike_damage_with_bone_skills", 26.2),
Affix("physical_damage", 22.5),
Affix("maximum_essence", 18),
Affix("damage_reduction", 9.4),
],
),
),
],
)
def test_read_descr(img_res: tuple[int, int], input_img: str, expected_item: Item):
Expand Down

0 comments on commit 7c11630

Please sign in to comment.