Skip to content

Commit

Permalink
Fixed and added blighted map test case
Browse files Browse the repository at this point in the history
Related to #6
  • Loading branch information
leMicin committed Sep 3, 2021
1 parent 5299a42 commit b19c1e8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sidekick.Apis.Poe/Parser/ItemParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private Properties ParseMapProperties(ParsingItem parsingItem)
ItemLevel = GetInt(patterns.ItemLevel, parsingItem),
Identified = !GetBool(patterns.Unidentified, parsingItem),
Corrupted = GetBool(patterns.Corrupted, parsingItem),
Blighted = patterns.Blighted.IsMatch(parsingItem.Blocks[0].Lines[2].Text),
Blighted = patterns.Blighted.IsMatch(parsingItem.Blocks[0].Lines[^1].Text),

ItemQuantity = GetInt(patterns.ItemQuantity, propertyBlock),
ItemRarity = GetInt(patterns.ItemRarity, propertyBlock),
Expand Down
36 changes: 36 additions & 0 deletions tests/Sidekick.Apis.Poe.Tests/Parser/BlightParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,41 @@ Shift click to unstack.
Assert.Equal("Clear Oil", actual.Metadata.Type);
}

[Fact]
public void BlightedSpiderForestMap()
{
var actual = parser.ParseItem(@"Item Class: Maps
Rarity: Rare
Nightmare Spires
Blighted Spider Forest Map
--------
Map Tier: 2
Atlas Region: Lex Proxima
Item Quantity: +55% (augmented)
Item Rarity: +32% (augmented)
Monster Pack Size: +21% (augmented)
--------
Item Level: 69
--------
Area is infested with Fungal Growths
Map's Item Quantity Modifiers also affect Blight Chest count at 20% value (implicit)
Natural inhabitants of this area have been removed (implicit)
--------
Monsters deal 54% extra Physical Damage as Lightning
Unique Boss has 25% increased Life
Unique Boss has 45% increased Area of Effect
Slaying Enemies close together has a 13% chance to attract monsters from Beyond
Players have 20% less Recovery Rate of Life and Energy Shield
--------
Travel to this Map by using it in a personal Map Device.Maps can only be used once.
");

Assert.Equal(Class.Maps, actual.Metadata.Class);
Assert.Equal(Rarity.Rare, actual.Metadata.Rarity);
Assert.Equal(Category.Map, actual.Metadata.Category);
Assert.Equal("Spider Forest Map", actual.Metadata.Type);
Assert.True(actual.Properties.Blighted);
}

}
}

0 comments on commit b19c1e8

Please sign in to comment.