Skip to content

Commit

Permalink
feat: set PlayerBattlecriesPlayed and OpponentBattlecriesPlayed BB in…
Browse files Browse the repository at this point in the history
…put values
  • Loading branch information
edipo2s committed Aug 23, 2023
1 parent 254e8a5 commit 185aa22
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Hearthstone Deck Tracker/BobsBuddy/BobsBuddyInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,18 @@ private void SnapshotBoardState(int turn)
input.availableRaces = BattlegroundsUtils.GetAvailableRaces(_currentGameId).ToList();
input.DamageCap = _game.GameEntity.GetTag(GameTag.BACON_COMBAT_DAMAGE_CAP);

var friendlyMurky = _game.Player.Board.FirstOrDefault(e => e.CardId == NonCollectible.Neutral.Murky);
var friendlyMurkyBuff = friendlyMurky?.GetTag(GameTag.TAG_SCRIPT_DATA_NUM_1) ?? 0;
input.PlayerBattlecriesPlayed = friendlyMurky != null && friendlyMurkyBuff > 0
? friendlyMurkyBuff / (friendlyMurky.HasTag(GameTag.PREMIUM) ? 2 : 1) - 1
: 0;

var opponentMurky = _game.Opponent.Board.FirstOrDefault(e => e.CardId == NonCollectible.Neutral.Murky);
var opponentMurkyBuff = opponentMurky?.GetTag(GameTag.TAG_SCRIPT_DATA_NUM_1) ?? 0;
input.OpponentBattlecriesPlayed = opponentMurky != null && opponentMurkyBuff > 0
? opponentMurkyBuff / (opponentMurky.HasTag(GameTag.PREMIUM) ? 2 : 1) - 1
: 0;

var opponentHero = _game.Opponent.Board.FirstOrDefault(x => x.IsHero);
var playerHero = _game.Player.Board.FirstOrDefault(x => x.IsHero);
if(opponentHero == null || playerHero == null)
Expand Down

0 comments on commit 185aa22

Please sign in to comment.