Skip to content

Commit

Permalink
Version 2.3.6
Browse files Browse the repository at this point in the history
Support for patch 25.2
  • Loading branch information
fmoraes74 committed Jan 18, 2023
1 parent f98afd2 commit 9d2b88e
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 238 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.3.6
## New
- Updated for patch 25.2.0
**Note:**
- There are likely still issues with some new cards in Bob's Buddy. We will update these in the coming days.

# 2.3.5
## Fixes
- Fix detection of decks containing signature cards
Expand Down
4 changes: 2 additions & 2 deletions HSTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3666,7 +3666,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.3.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
Expand Down Expand Up @@ -3711,7 +3711,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.3.6;
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = net.hearthsim.hstracker;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "tribe_undead.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion HSTracker/BobsBuddy-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.12
1.9.0
22 changes: 22 additions & 0 deletions HSTracker/BobsBuddy/BobsBuddyInvoker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,28 @@ class BobsBuddyInvoker {
for m in opponentSide {
MonoHelper.addToList(list: inputOpponentSide, element: m)
}

let playerAttached = BobsBuddyInvoker.getAttachedEntities(game: game, entityId: game.player.id)
let pEternalLegion = playerAttached.first { x in x.cardId == CardIds.NonCollectible.Neutral.EternalKnight_EternalKnightPlayerEnchant }
if let pEternalLegion {
input.playerEternalKnightCounter = Int32(pEternalLegion[.tag_script_data_num_1])
}
let pUndeadBonus = playerAttached.first { x in x.cardId == CardIds.NonCollectible.Neutral.NerubianDeathswarmer_UndeadBonusAttackPlayerEnchantDnt }
if let pUndeadBonus {
input.playerUndeadAttackBonus = Int32(pUndeadBonus[.tag_script_data_num_1])
}

let opponentAttached = BobsBuddyInvoker.getAttachedEntities(game: game, entityId: game.opponent.id)
let oEternalLegion = opponentAttached.first { x in x.cardId == CardIds.NonCollectible.Neutral.EternalKnight_EternalKnightPlayerEnchant }
if let oEternalLegion {
input.opponentEternalKnightCounter = Int32(oEternalLegion[.tag_script_data_num_1])
}
let oUndeadBonus = opponentAttached.first { x in x.cardId == CardIds.NonCollectible.Neutral.NerubianDeathswarmer_UndeadBonusAttackPlayerEnchantDnt }
if let oUndeadBonus {
input.opponentUndeadAttackBonus = Int32(oUndeadBonus[.tag_script_data_num_1])
}

logger.info("pEternal=\(input.playerEternalKnightCounter), pUndead=\(input.playerUndeadAttackBonus) | oEternal={\(input.opponentEternalKnightCounter), oUndead=\(input.opponentUndeadAttackBonus)");

self.input = input
self._turn = turn
Expand Down
6 changes: 6 additions & 0 deletions HSTracker/Core/Extensions/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ extension Array {
func take(_ count: Int) -> [Element] {
return Array(prefix(count))
}

func chunks(_ chunkSize: Int) -> [[Element]] {
return stride(from: 0, to: self.count, by: chunkSize).map {
Array(self[$0..<Swift.min($0 + chunkSize, self.count)])
}
}
}

extension Sequence where Iterator.Element: Hashable {
Expand Down
23 changes: 19 additions & 4 deletions HSTracker/Database/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,27 @@ class Database {
if let overload = jsonCard["overload"] as? Int {
card.overload = overload
}
if let collectible = jsonCard["collectible"] as? Bool {
card.collectible = collectible
}
if let race = jsonCard["race"] as? String,
let cardRace = Race(rawValue: race.lowercased()) {
card.race = cardRace
if !Database.deckManagerRaces.contains(cardRace) {
if card.collectible && !Database.deckManagerRaces.contains(cardRace) {
Database.deckManagerRaces.append(cardRace)
}
}
if let races = jsonCard["races"] as? [String] {
card.races = races.compactMap { x in Race(rawValue: x.lowercased()) }
for race in card.races {
if card.collectible && !Database.deckManagerRaces.contains(race) {
Database.deckManagerRaces.append(race)
}
}
}
if let flavor = jsonCard["flavor"] as? String {
card.flavor = flavor
}
if let collectible = jsonCard["collectible"] as? Bool {
card.collectible = collectible
}
if let name = jsonCard["name"] as? String {
card.name = name
if lang == .enUS && langs.count == 1 {
Expand Down Expand Up @@ -220,6 +228,13 @@ class Database {
if card.race != .invalid && card.race != .all && !Database.battlegroundRaces.contains(card.race) {
Database.battlegroundRaces.append(card.race)
}
if card.races.count > 0 && card.races[0] != .all {
for race in card.races {
if !Database.battlegroundRaces.contains(race) {
Database.battlegroundRaces.append(race)
}
}
}
}
for card in Cards.battlegroundsMinions.filter({ x in x.race == .invalid }) {
let race = Database.getRace(card: card)
Expand Down
2 changes: 2 additions & 0 deletions HSTracker/Database/Models/Card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ final class Card {
var enText = ""
var race: Race = .invalid
var bgRace: Race = .invalid
var races: [Race] = []
var type: CardType = .invalid
var mechanics: [CardMechanic] = []
var isStandard = false
Expand Down Expand Up @@ -195,6 +196,7 @@ extension Card: NSCopying {
copy.battlegroundsPoolMinion = self.battlegroundsPoolMinion
copy.deckListIndex = self.deckListIndex
copy.battlegroundsSkinParentId = self.battlegroundsSkinParentId
copy.races = self.races

return copy
}
Expand Down
2 changes: 2 additions & 0 deletions HSTracker/Logging/CardIds/Neutral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ extension CardIds.NonCollectible {
static let Chameleos_ShiftingEnchantment = "GIL_142e"
static let QueenAzsharaBATTLEGROUNDS = "BG22_HERO_007"
static let QueenAzshara_NagaQueenAzsharaToken = "BG22_HERO_007t"
static let EternalKnight_EternalKnightPlayerEnchant = "BG25_008pe"
static let NerubianDeathswarmer_UndeadBonusAttackPlayerEnchantDnt = "BG25_011pe"
}
}

2 changes: 1 addition & 1 deletion HSTracker/Logging/Game.swift
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ class Game: NSObject, PowerEventHandler {
newRaces.append(race)
}
}
if newRaces.count == 4 {
if newRaces.count == 5 {
logger.info("Battlegrounds unavailable races: \(newRaces) - all races \(races)")
_unavailableRaces = newRaces
return _unavailableRaces
Expand Down
14 changes: 13 additions & 1 deletion HSTracker/Mono/InputProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class InputProxy: MonoHandle, MonoClassInitializer {
InputProxy._setOpponentHeroPower = MonoHelper.getMethod(InputProxy._class, "SetOpponentHeroPower", 3)

// fields
initializeFields(fields: [ "opponentSide", "playerSide", "PlayerSecrets", "OpponentSecrets", "DamageCap", "PlayerHeroPower", "OpponentHeroPower", "PlayerHeroPower", "PlayerQuests", "OpponentQuests" ])
initializeFields(fields: [ "opponentSide", "playerSide", "PlayerSecrets", "OpponentSecrets", "DamageCap", "PlayerHeroPower", "OpponentHeroPower", "PlayerHeroPower", "PlayerQuests", "OpponentQuests", "PlayerUndeadAttackBonus", "OpponentUndeadAttackBonus", "PlayerEternalKnightCounter", "OpponentEternalKnightCounter" ])
}
}

Expand Down Expand Up @@ -153,4 +153,16 @@ class InputProxy: MonoHandle, MonoClassInitializer {

@MonoHandleField(field: "OpponentQuests", owner: InputProxy.self)
var opponentQuests: MonoHandle

@MonoPrimitiveField(field: "PlayerEternalKnightCounter", owner: InputProxy.self)
var playerEternalKnightCounter: Int32

@MonoPrimitiveField(field: "OpponentEternalKnightCounter", owner: InputProxy.self)
var opponentEternalKnightCounter: Int32

@MonoPrimitiveField(field: "PlayerUndeadAttackBonus", owner: InputProxy.self)
var playerUndeadAttackBonus: Int32

@MonoPrimitiveField(field: "OpponentUndeadAttackBonus", owner: InputProxy.self)
var opponentUndeadAttackBonus: Int32
}
Loading

0 comments on commit 9d2b88e

Please sign in to comment.