Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update filters #32

Merged
merged 3 commits into from
Sep 6, 2019
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
5 changes: 4 additions & 1 deletion Procurement/Procurement.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<Compile Include="Utility\StashHelper.cs" />
<Compile Include="Utility\VersionChecker.cs" />
<Compile Include="ViewModel\AdvancedSearchCategory.cs" />
<Compile Include="ViewModel\Filters\ForumExport\AccurayFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\AccuracyFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CraftedModFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CurrencyFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\DamageChaos.cs" />
Expand Down Expand Up @@ -236,6 +236,8 @@
<Compile Include="ViewModel\DisplayModeStrategy\StringFormatStrategy.cs" />
<Compile Include="ViewModel\DisplayModeStrategy\ValuesPlusNameStrategy.cs" />
<Compile Include="ViewModel\Filters\ForumExport\EnergyShieldFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\ArmourFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\EvasionFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\IncreasedPhysicalDamageFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\ManaFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\ManaRegenFilter.cs" />
Expand Down Expand Up @@ -266,6 +268,7 @@
<Compile Include="ViewModel\Filters\ForumExport\ColdResistance.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CorruptedGemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CritChanceFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CritMultiplierFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\GlobalCritMultiplierFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CurseGemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\DamageCold.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace Procurement.ViewModel.Filters.ForumExport
{
internal class AccurayFilter : StatFilter
internal class AccuracyFilter : StatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Attacks; }
}

public AccurayFilter()
public AccuracyFilter()
: base("Increased Accuracy", "Increased Accuracy", "Accuracy")
{ }
}
Expand Down
19 changes: 19 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/ArmourFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class ArmourFilter : OrStatFilter
{
public ArmourFilter()
: base("Armour", "Items with additional or increased Armour", "to Armour", "increased Armour", "increased Global Armour", "increased Global Defences")
{ }

public override FilterGroup Group
{
get { return FilterGroup.Default; }
}
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/AttackSpeed.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class AttackSpeed : StatFilter
internal class AttackSpeed : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Attacks; }
}

public AttackSpeed()
: base("Increased Attack Speed", "Increased Attack Speed", "Increased Attack Speed")
: base("Increased Attack Speed", "Increased Attack Speed", "increased Attack Speed", "increased Attack and Cast Speed", "increased Attack, Cast and Movement Speed")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/CastSpeed.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class CastSpeed : StatFilter
internal class CastSpeed : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Attacks; }
}

public CastSpeed()
: base("Increased Cast Speed", "Increased Cast Speed", "Increased Cast Speed")
: base("Increased Cast Speed", "Increased Cast Speed", "increased Cast Speed", "increased Attack and Cast Speed", "increased Attack, Cast and Movement Speed")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/ChaosResistance.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters
{
internal class ChaosResistance : StatFilter
internal class ChaosResistance : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Resistances; }
}

public ChaosResistance()
: base("Chaos Resistance", "Chaos Resistance", "to Chaos Resistance")
: base("Chaos Resistance", "Chaos Resistance", "to Chaos Resistance", "to Fire and Chaos Resistances", "to Cold and Chaos Resistances", "to Lightning and Chaos Resistances")
{ }
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
class StrengthFilter : StatFilter
class StrengthFilter : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.CharacterAttributes; }
}

public StrengthFilter()
: base("Increased Strength", "Strength", "Strength")
: base("Increased Strength", "Increased Strength", "to Strength", "increased Strength", "to all Attributes", "increased Attributes")
{ }
}


class IntelligenceFilter : StatFilter
class IntelligenceFilter : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.CharacterAttributes; }
}

public IntelligenceFilter()
: base("Increased Intelligence", "Intelligence", "Intelligence")
: base("Increased Intelligence", "Increased Intelligence", "to Intelligence", "to Strength and Intelligence", "to Dexterity and Intelligence", "increased Intelligence", "to all Attributes", "increased Attributes")
{ }
}

class DexterityFilter : StatFilter
class DexterityFilter : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.CharacterAttributes; }
}

public DexterityFilter()
: base("Increased Dexterity", "Increased Dexterity", "Dexterity")
: base("Increased Dexterity", "Increased Dexterity", "to Dexterity", "to Strength and Dexterity", "increased Dexterity", "to all Attributes", "increased Attributes")
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public override FilterGroup Group
}

public ColdResistance()
: base("Cold Resistance", "Cold Resistance", "to Cold Resistance", "to Fire and Cold Resistances", "to Cold and Lightning Resistances")
: base("Cold Resistance", "Cold Resistance", "to Cold Resistance", "to Fire and Cold Resistances", "to Cold and Lightning Resistances", "to Cold and Chaos Resistances", "to all Elemental Resistances")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/CritChanceFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Procurement.ViewModel.Filters.ForumExport
public class CritChanceFilter : ExplicitModBase
{
public CritChanceFilter()
: base("increased Critical Strike Chance")
: base("Critical Strike Chance")
{ }

public override bool CanFormCategory
Expand All @@ -18,7 +18,7 @@ public override bool CanFormCategory

public override string Keyword
{
get { return "Crit Chance"; }
get { return "Critical Strike Chance"; }
}

public override string Help
Expand Down
34 changes: 34 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/CritMultiplierFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class CritMultiplierFilter : ExplicitModBase
{
public CritMultiplierFilter()
: base("Critical Strike Multiplier")
{ }

public override bool CanFormCategory
{
get { return false; }
}

public override string Keyword
{
get { return "Critical Strike Multiplier"; }
}

public override string Help
{
get { return "Items with additional Critical Strike Multiplier"; }
}

public override FilterGroup Group
{
get { return FilterGroup.Crit; }
}
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/DamageChaos.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class DamageChaos : StatFilter
internal class DamageChaos : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Damage; }
}

public DamageChaos()
: base("Adds Chaos Damage", "Adds Chaos Damage", "Adds \\d+ to \\d+ Chaos Damage")
: base("Adds Chaos Damage", "Adds Chaos Damage", "Adds \\d+ to \\d+ Chaos Damage", "as Extra Chaos Damage")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/DamageCold.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class DamageCold : StatFilter
internal class DamageCold : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Damage; }
}

public DamageCold()
: base("Adds Cold Damage", "Adds Cold Damage", "Adds \\d+ to \\d+ Cold Damage")
: base("Adds Cold Damage", "Adds Cold Damage", "Adds \\d+ to \\d+ Cold Damage", "as Extra Cold Damage", "as Extra Damage of each Element", "as Extra Damage of a random Element")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/DamageFire.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class DamageFire : StatFilter
internal class DamageFire : OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Damage; }
}

public DamageFire()
: base("Adds Fire Damage", "Adds Fire Damage", "Adds \\d+ to \\d+ Fire Damage")
: base("Adds Fire Damage", "Adds Fire Damage", "Adds \\d+ to \\d+ Fire Damage", "as Extra Fire Damage", "as Extra Damage of each Element", "as Extra Damage of a random Element")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/DamageLightning.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Procurement.ViewModel.Filters.ForumExport
{
internal class DamageLightning: StatFilter
internal class DamageLightning: OrStatFilter
{
public override FilterGroup Group
{
get { return FilterGroup.Damage; }
}

public DamageLightning()
: base("Adds Lightning Damage", "Adds Lightning Damage", "Adds \\d+ to \\d+ Lightning Damage")
: base("Adds Lightning Damage", "Adds Lightning Damage", "Adds \\d+ to \\d+ Lightning Damage", "as Extra Lightning Damage", "as Extra Damage of each Element", "as Extra Damage of a random Element")
{ }
}
}
4 changes: 2 additions & 2 deletions Procurement/ViewModel/Filters/ForumExport/DamageTriple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Procurement.ViewModel.Filters.ForumExport
{
internal class DamageTriple : IFilter
{
private List<StatFilter> resistances;
private List<OrStatFilter> resistances;

public FilterGroup Group
{
Expand All @@ -15,7 +15,7 @@ public FilterGroup Group

public DamageTriple()
{
resistances = new List<StatFilter>();
resistances = new List<OrStatFilter>();
resistances.Add(new DamageCold());
resistances.Add(new DamageFire());
resistances.Add(new DamageLightning());
Expand Down
19 changes: 19 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/EvasionFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class EvasionFilter : OrStatFilter
{
public EvasionFilter()
: base("Evasion", "Items with additional or increased Evasion", "Evasion Rating", "increased Armour and Evasion", "increased Evasion and Energy Shield", "increased Armour, Evasion and Energy Shield", "increased Global Defences")
{ }

public override FilterGroup Group
{
get { return FilterGroup.Default; }
}
}
}
25 changes: 21 additions & 4 deletions Procurement/ViewModel/Filters/ForumExport/ExplicitModBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,29 @@ public ExplicitModBase(string keyword)

public bool Applicable(Item item)
{
if (item.Explicitmods == null || !(item is Gear))
Gear gear = item as Gear;
if (gear == null)
return false;

foreach (var mod in item.Explicitmods)
if (mod.Contains(keyword))
return true;
if (gear.Explicitmods != null)
foreach (var mod in gear.Explicitmods)
if (mod.Contains(keyword))
return true;

if (gear.FracturedMods != null)
foreach (var mod in gear.FracturedMods)
if (mod.Contains(keyword))
return true;

if (gear.CraftedMods != null)
foreach (var mod in gear.CraftedMods)
if (mod.Contains(keyword))
return true;

if (gear.EnchantMods != null)
foreach (var mod in gear.EnchantMods)
if (mod.Contains(keyword))
return true;

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public override FilterGroup Group
}

public FireResistance()
: base("Fire Resistance", "Fire Resistance", "to Fire Resistance", "to Fire and Lightning Resistances", "to Fire and Cold Resistances")
: base("Fire Resistance", "Fire Resistance", "to Fire Resistance", "to Fire and Lightning Resistances", "to Fire and Cold Resistances", "to Fire and Chaos Resistances", "to all Elemental Resistances")
{ }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public string Keyword
{
get
{
return "Full Bestiary Orb";
return "Captured Beasts";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Procurement.ViewModel.Filters.ForumExport
public class GlobalCritChanceFilter : ExplicitModBase
{
public GlobalCritChanceFilter()
: base("increased Global Critical Strike Chance")
: base("Global Critical Strike Chance")
{ }

public override bool CanFormCategory
Expand All @@ -18,7 +18,7 @@ public override bool CanFormCategory

public override string Keyword
{
get { return "Global Crit Chance"; }
get { return "Global Critical Strike Chance"; }
}

public override string Help
Expand Down
Loading