Skip to content

Commit

Permalink
feat(twitch): send battlegrounds anomaly
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Aug 22, 2023
1 parent b1a941d commit e6147c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Hearthstone Deck Tracker/Live/BoardStateWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ private int DbfId(Entity? e)
return player.QuestRewards.FirstOrDefault(x => x.HasTag(GameTag.BACON_IS_HEROPOWER_QUESTREWARD) == heroPower)?.Card.DbfId;
}

private int? BgsAnomaly(Entity game)
{
var anomaly = game.GetTag(GameTag.BACON_GLOBAL_ANOMALY_DBID);
if (anomaly != 0)
{
return anomaly;
}
return null;
}

// Return the dbf id for an entity, but blacklisted against common hero cards we don't want want to show in the overlay.
private int HeroDbfId(Entity? entity)
{
Expand Down Expand Up @@ -242,6 +252,7 @@ private int HeroDbfId(Entity? entity)
Fatigue = Core.Game.OpponentEntity.GetTag(GameTag.FATIGUE)
},
GameType = gameType,
BattlegroundsAnomaly = BgsAnomaly(Core.Game.GameEntity),
BobsBuddyOutput = gameType == BnetGameType.BGT_BATTLEGROUNDS ? GetBobsBuddyState() : null
};
}
Expand Down
3 changes: 3 additions & 0 deletions Hearthstone Deck Tracker/Live/Data/BoardState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class BoardState
[JsonProperty("game_type")]
public BnetGameType GameType { get; set; }

[JsonProperty("battlegrounds_anomaly", DefaultValueHandling = DefaultValueHandling.Ignore)]
public int? BattlegroundsAnomaly { get; set; }

[JsonProperty("bobs_buddy_state", DefaultValueHandling = DefaultValueHandling.Ignore)]
public BobsBuddyState? BobsBuddyOutput { get; set; }

Expand Down

0 comments on commit e6147c1

Please sign in to comment.