Skip to content

Commit

Permalink
Treants
Browse files Browse the repository at this point in the history
- Add Cultivation view
- Update "Mulchmuncher" condition for "Blood Treant"
  • Loading branch information
batstyx committed Sep 28, 2023
2 parents ed45b9e + b406220 commit e552d7b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions Graveyard/CultivationView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Hearthstone_Deck_Tracker.API;
using static HearthDb.CardIds.Collectible;

namespace HDT.Plugins.Graveyard
{
public class CultivationView
{
private static ViewConfig _Config;
internal static ViewConfig Config
{
get => _Config ?? (_Config = new ViewConfig(Druid.Cultivation)
{
ShowFirst = () => true,
CreateView = () => new NormalView(),
UpdateOn = GameEvents.OnPlayerPlay,
Condition = card => card.Name.Contains("Treant"),
});
}

internal class ViewConfig : Plugins.Graveyard.ViewConfig
{
public ViewConfig(params string[] showOn) : base(showOn) { }
public override void RegisterView(ViewBase view, bool isDefault = false)
{
base.RegisterView(view, isDefault);
Plugin.Events.OnPlayerCreateInPlay.Register(view.Update);
}
}
}
}
1 change: 1 addition & 0 deletions Graveyard/Graveyard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class Graveyard
TyrView.Config,
TyrsTearsView.Config,
MinionsCreatedView.Config,
CultivationView.Config,
};

private readonly StackPanel FriendlyPanel;
Expand Down
1 change: 1 addition & 0 deletions Graveyard/Graveyard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="MenagerieView.cs" />
<Compile Include="MinionsCreatedView.cs" />
<Compile Include="MixtapeView.cs" />
<Compile Include="CultivationView.cs" />
<Compile Include="PositionHelpers.cs" />
<Compile Include="Properties\LibraryInfo.cs" />
<Compile Include="SettingsUpgrades\SettingsUpgradev0111.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Graveyard/MulchmuncherView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static ViewConfig Config
ShowFirst = () => true,
CreateView = () => new NormalView(),
UpdateOn = GameEvents.OnPlayerPlayToGraveyard,
Condition = card => card.Name == "Treant",
Condition = card => card.Name.Contains("Treant"),
});
}
}
Expand Down

0 comments on commit e552d7b

Please sign in to comment.