Skip to content

Commit

Permalink
Add Overload Saurfang view
Browse files Browse the repository at this point in the history
  • Loading branch information
batstyx committed May 31, 2021
1 parent e40a4c7 commit a529115
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 5 deletions.
9 changes: 8 additions & 1 deletion Graveyard/Graveyard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Graveyard
public LadyLiadrinView LadyLiadrin;
public NZothGotDView NZothGotD;
public RallyView Rally;
public SaurfangView Saurfang;

private StackPanel _friendlyPanel;
private StackPanel _enemyPanel;
Expand Down Expand Up @@ -310,6 +311,11 @@ public void Reset()
{
Rally = new RallyView();
_friendlyPanel.Children.Add(Rally);
}
if (Settings.Default.SaurfangEnabled && SaurfangView.isValid())
{
Saurfang = new SaurfangView();
_friendlyPanel.Children.Add(Saurfang);
}
}

Expand All @@ -327,7 +333,8 @@ public void PlayerGraveyardUpdate(Card card)
var hoardpillager = HoardPillager?.Update(card) ?? false;
var nzothgotd = NZothGotD?.Update(card) ?? false;
var rally = Rally?.Update(card) ?? false;
if (!(any || deathrattle || nzoth || hadr || guldan || rez || mulch || kangor || witching || hoardpillager || nzothgotd || rally))
var saurfang = Saurfang?.Update(card) ?? false;
if (!(any || deathrattle || nzoth || hadr || guldan || rez || mulch || kangor || witching || hoardpillager || nzothgotd || rally || saurfang))
{
Normal?.Update(card);
}
Expand Down
1 change: 1 addition & 0 deletions Graveyard/Graveyard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="SaurfangView.cs" />
<Compile Include="Strings.cs" />
<Compile Include="ResurrectView.cs" />
<Compile Include="NZothView.cs" />
Expand Down
6 changes: 3 additions & 3 deletions Graveyard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Graveyard")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.10.0")]
[assembly: AssemblyFileVersion("1.8.10.0")]
[assembly: AssemblyVersion("1.8.11.0")]
[assembly: AssemblyFileVersion("1.8.11.0")]
18 changes: 18 additions & 0 deletions Graveyard/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Graveyard/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@
<data name="ResurrectDescription" xml:space="preserve">
<value>When the deck contains 'Resurrect', 'Onyx Bishop', 'Eternal Servitude', or 'Lesser Diamond Spellstone', show the resurrect chance of friendly minions that have died</value>
</data>
<data name="Saurfang" xml:space="preserve">
<value>Overlord Saurfang</value>
</data>
<data name="SaurfangDescription" xml:space="preserve">
<value>When the deck contains 'Overload Saurfang', show summon chance of Frenzy minions that have died.</value>
</data>
<data name="Scale" xml:space="preserve">
<value>Scale</value>
</data>
Expand Down
33 changes: 33 additions & 0 deletions Graveyard/SaurfangView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Hearthstone_Deck_Tracker;
using Hearthstone_Deck_Tracker.Hearthstone;
using System.Linq;

namespace HDT.Plugins.Graveyard
{
public class SaurfangView : NormalView
{
private ChancesTracker _chances = new ChancesTracker();

public static bool isValid()
{
return Core.Game.Player.PlayerCardList.FindIndex(card => card.Id == HearthDb.CardIds.Collectible.Warrior.OverlordSaurfang) > -1;
}

public SaurfangView()
{
Label.Text = Strings.GetLocalized("Saurfang");
}

public bool Update(Card card)
{
if (!((card.Text?.Contains("Frenzy:") ?? false) && base.Update(card)))
{
return false;
}

_chances.Update(card, Cards, View);

return true;
}
}
}
12 changes: 12 additions & 0 deletions Graveyard/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Graveyard/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,8 @@
<Setting Name="FriendlyOrientation" Type="System.Windows.Controls.Orientation" Scope="User">
<Value Profile="(Default)">Vertical</Value>
</Setting>
<Setting Name="SaurfangEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
6 changes: 5 additions & 1 deletion Graveyard/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,17 @@
Content="{lex:Loc NZothGotD}"
ToolTip="{lex:Loc NZothGotDDescription}"
Style="{StaticResource ToggleStyle}" />
<mah:ToggleSwitch IsChecked="{Binding SaurfangEnabled, Source={x:Static local:Settings.Default}}"
Content="{lex:Loc Saurfang}"
ToolTip="{lex:Loc SaurfangDescription}"
Style="{StaticResource ToggleStyle}" />
<mah:ToggleSwitch IsChecked="{Binding RallyEnabled, Source={x:Static local:Settings.Default}}"
Content="{lex:Loc Rally}"
ToolTip="{lex:Loc RallyDescription}"
Style="{StaticResource TitleToggleStyle}" />
<mah:ToggleSwitch IsChecked="{Binding AlwaysRallySeparately, Source={x:Static local:Settings.Default}}"
Content="{lex:Loc AlwaysRallySeparately}"
ToolTip="{lex:Loc AlwaysRallySeparatelyDescription}"
Style="{StaticResource ToggleStyle}" />
Style="{StaticResource ToggleStyle}" />
</StackPanel>
</ScrollViewer>
3 changes: 3 additions & 0 deletions Graveyard/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
<setting name="FriendlyOrientation" serializeAs="String">
<value>Vertical</value>
</setting>
<setting name="SaurfangEnabled" serializeAs="String">
<value>True</value>
</setting>
</HDT.Plugins.Graveyard.Settings>
</userSettings>
</configuration>

0 comments on commit a529115

Please sign in to comment.