Skip to content

Commit

Permalink
Showdown in the Badlands
Browse files Browse the repository at this point in the history
- Azerite Rat view added
- Kingpin Pud view added
  • Loading branch information
batstyx committed Nov 22, 2023
2 parents 4c4285b + 9ecc1a0 commit 5c2d738
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: "${{ steps.set_version.outputs.buildVersion }}: ${{ steps.get_head_commit.outputs.title }}"
name: "v${{ steps.set_version.outputs.buildVersion }}: ${{ steps.get_head_commit.outputs.title }}"
bodyFile: Release.md
tag: v${{ steps.set_version.outputs.buildVersion }}
draft: false
Expand Down
39 changes: 39 additions & 0 deletions Graveyard/AzeriteRatView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Hearthstone_Deck_Tracker.API;
using Hearthstone_Deck_Tracker.Hearthstone;
using System.Windows;
using static HearthDb.CardIds.Collectible;

namespace HDT.Plugins.Graveyard
{
internal class AzeriteRatView : NormalView
{
private static ViewConfig _Config;
internal static ViewConfig Config
{
get => _Config ?? (_Config = new ViewConfig(
Deathknight.ReapWhatYouSow,
Deathknight.SkeletonCrew)
{
Name = Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Deathknight.KoboldMiner_TheAzeriteRatToken)?.LocalizedName ?? "AzeriteRat",
CreateView = () => new AzeriteRatView(),
UpdateOn = GameEvents.OnPlayerPlayToGraveyard,
Condition = card => card.Type == "Minion",
});
}

public override bool Update(Card card)
{
if (!Condition(card)) return false;

var removed = Cards.RemoveAll(c => c.Cost < card.Cost);
if (removed > 0 || Cards.Count == 0)
{
Cards.Add(card.Clone() as Card);
View.Update(Cards, true);
Visibility = Visibility.Visible;
}
#warning Always return false to pass card onto GraveyardView, other unwanted side effects?
return false;
}
}
}
2 changes: 2 additions & 0 deletions Graveyard/Graveyard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class Graveyard
TyrsTearsView.Config,
MinionsCreatedView.Config,
CultivationView.Config,
OgreGangView.Config,
AzeriteRatView.Config,
};

private readonly StackPanel FriendlyPanel;
Expand Down
2 changes: 2 additions & 0 deletions Graveyard/Graveyard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AnimateDeadView.cs" />
<Compile Include="AzeriteRatView.cs" />
<Compile Include="FizzleView.cs" />
<Compile Include="FourHorsemenView.cs" />
<Compile Include="HighCultistBasalephView.cs" />
Expand All @@ -80,6 +81,7 @@
<Compile Include="MinionsCreatedView.cs" />
<Compile Include="MixtapeView.cs" />
<Compile Include="CultivationView.cs" />
<Compile Include="OgreGangView.cs" />
<Compile Include="PositionHelpers.cs" />
<Compile Include="Properties\LibraryInfo.cs" />
<Compile Include="SettingsUpgrades\SettingsUpgradev0111.cs" />
Expand Down
27 changes: 27 additions & 0 deletions Graveyard/OgreGangView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Hearthstone_Deck_Tracker.API;
using System.Collections.Generic;
using static HearthDb.CardIds.Collectible;

namespace HDT.Plugins.Graveyard
{
internal class OgreGangView
{
private static ViewConfig _Config;
internal static ViewConfig Config
{
get => _Config ?? (_Config = new ViewConfig(Neutral.KingpinPud)
{
CreateView = () => new NormalView(),
UpdateOn = GameEvents.OnPlayerPlayToGraveyard,
Condition = card => GangMembers.Contains(card.Id),
});
}

internal static readonly List<string> GangMembers = new List<string>
{
Neutral.OgreGangAce,
Neutral.OgreGangOutlaw,
Neutral.OgreGangRider,
};
}
}
4 changes: 2 additions & 2 deletions Graveyard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.12.1.0")]
[assembly: AssemblyFileVersion("1.12.1.0")]
[assembly: AssemblyVersion("1.13.0.0")]
[assembly: AssemblyFileVersion("1.13.0.0")]

0 comments on commit 5c2d738

Please sign in to comment.