Skip to content

Commit

Permalink
Merge pull request #211 from Sidekick-Poe/feature/corpse
Browse files Browse the repository at this point in the history
Added support to parse tinctures and corpses.
  • Loading branch information
leMicin committed Jul 30, 2024
2 parents d2912b4 + b5da275 commit 601a593
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Sidekick.Apis.Poe/Metadatas/MetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ public async Task Initialize()
Category.MemoryLine,
useRegex: true);

FillPattern(
result.Result,
"tincture",
Category.Tincture,
useRegex: true);

FillPattern(
result.Result,
"corpse",
Category.Corpse,
useRegex: true);

//FillPattern(result.Result, "azmeri", Category.Affliction, useRegex: true);
//FillPattern(result.Result, "necropolis", Category.EmbersOfTheAllflame, useRegex: true);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Sidekick.Common/Game/Items/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ public enum Category
MemoryLine = 16,
Affliction = 17,
EmbersOfTheAllflame = 18,
Tincture = 19,
Corpse = 20,
}
27 changes: 27 additions & 0 deletions tests/Sidekick.Apis.Poe.Tests/Parser/FlaskParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,32 @@ Currently has 0 Charges
Assert.Equal("Sacred Hybrid Flask", actual.Metadata.Type);
Assert.Equal(13, actual.Properties.Quality);
}

[Fact]
public void Tincture()
{
var actual = parser.ParseItem(@"Item Class: Tinctures
Rarity: Normal
Poisonberry Tincture
--------
Inflicts Mana Burn every 0.70 Seconds
6 Second Cooldown when Deactivated
--------
Requirements:
Level: 45
--------
Item Level: 82
--------
20% chance to Poison with Melee Weapons (implicit)
70% increased Damage with Poison from Melee Weapons (implicit)
--------
Right click to activate. Only one Tincture in your belt can be active at a time. Mana Burn causes you to lose 1% of your maximum Mana per stack per second. Can be deactivated manually, or will automatically deactivate when you reach 0 Mana.
");

Assert.Equal(Class.AfflictionTinctures, actual.Header.Class);
Assert.Equal(Rarity.Normal, actual.Metadata.Rarity);
Assert.Equal(Category.Tincture, actual.Metadata.Category);
Assert.Equal("Poisonberry Tincture", actual.Metadata.Type);
}
}
}
27 changes: 27 additions & 0 deletions tests/Sidekick.Apis.Poe.Tests/Parser/RitualParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,32 @@ Ritual Vessel
Assert.Equal(Category.Currency, actual.Metadata.Category);
Assert.Equal("Ritual Vessel", actual.Metadata.Type);
}

[Fact]
public void Corpse()
{
var actual = parser.ParseItem(@"Item Class: Corpses
Rarity: Currency
Perfect Needle Horror
--------
Corpse Level: 83
Monster Category: Demon
--------
Item Level: 83
--------
Throws Physical Projectiles (implicit)
100% increased Impale Effect (implicit)
Owner gains 10% increased Impale Effect (implicit)
--------
Right click this item to create this corpse.
--------
Note: ~price 3 chaos
");

Assert.Equal(Class.AfflictionCorpses, actual.Header.Class);
Assert.Equal(Rarity.Currency, actual.Metadata.Rarity);
Assert.Equal(Category.Corpse, actual.Metadata.Category);
Assert.Equal("Perfect Needle Horror", actual.Metadata.Type);
}
}
}

0 comments on commit 601a593

Please sign in to comment.