-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
402 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
HSTracker/Hearthstone/CounterSystem/Counters/ColossusCounter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// ColossusCounter.swift | ||
// HSTracker | ||
// | ||
// Created by Francisco Moraes on 1/22/25. | ||
// Copyright © 2025 Benjamin Michotte. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class ColossusCounter: NumericCounter { | ||
override var cardIdToShowInUI: String? { | ||
return CardIds.Collectible.Mage.Colossus | ||
} | ||
|
||
override var relatedCards: [String] { | ||
return [CardIds.Collectible.Mage.Colossus] | ||
} | ||
|
||
required init(controlledByPlayer: Bool, game: Game) { | ||
super.init(controlledByPlayer: controlledByPlayer, game: game) | ||
} | ||
|
||
override func shouldShow() -> Bool { | ||
guard game.isTraditionalHearthstoneMatch else { return false } | ||
if isPlayerCounter { | ||
return inPlayerDeckOrKnown(cardIds: relatedCards) | ||
} | ||
return counter > 2 && opponentMayHaveRelevantCards() | ||
} | ||
|
||
override func getCardsToDisplay() -> [String] { | ||
if isPlayerCounter { | ||
return getCardsInDeckOrKnown(cardIds: relatedCards) | ||
} | ||
return filterCardsByClassAndFormat(cardIds: relatedCards, playerClass: game.opponent.originalClass) | ||
} | ||
|
||
override func valueToShow() -> String { | ||
return String(format: String.localizedString("Counter_AsteroidDamage_Damage", comment: ""), "2x \(counter + 1)") | ||
} | ||
|
||
override func handleTagChange(tag: GameTag, entity: Entity, value: Int, prevValue: Int) { | ||
guard game.isTraditionalHearthstoneMatch else { return } | ||
guard tag == .zone, (value == Zone.play.rawValue || value == Zone.secret.rawValue), entity.isSpell, entity.has(tag: .protoss) else { return } | ||
|
||
let controller = entity[.controller] | ||
if (controller == game.player.id && isPlayerCounter) || (controller == game.opponent.id && !isPlayerCounter) { | ||
counter += 1 | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
HSTracker/Hearthstone/EffectSystem/Effects/DeathKnight/InfestorEnchantment.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// InfestorEnchantment.swift | ||
// HSTracker | ||
// | ||
// Created by Francisco Moraes on 1/22/25. | ||
// Copyright © 2025 Benjamin Michotte. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class InfestorEnchantment: EntityBasedEffect { | ||
|
||
override var cardId: String { | ||
return CardIds.NonCollectible.Deathknight.Infestor_ForTheSwarmEnchantment1 | ||
} | ||
|
||
override var cardIdToShowInUI: String { | ||
return CardIds.Collectible.Deathknight.Infestor | ||
} | ||
|
||
required init(entityId: Int, isControlledByPlayer: Bool) { | ||
super.init(entityId: entityId, isControlledByPlayer: isControlledByPlayer) | ||
} | ||
|
||
override var effectDuration: EffectDuration { | ||
return .permanent | ||
} | ||
|
||
override var effectTag: EffectTag { | ||
return .minionModification | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
HSTracker/Hearthstone/RelatedCardsSystem/Cards/Mage/ResonanceCoil.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// ResonanceCoil.swift | ||
// HSTracker | ||
// | ||
// Created by Francisco Moraes on 1/22/25. | ||
// Copyright © 2025 Benjamin Michotte. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class ResonanceCoil: ICardWithRelatedCards { | ||
required init() { | ||
|
||
} | ||
|
||
private var cache: [Card?]? | ||
|
||
func getCardId() -> String { | ||
return CardIds.Collectible.Mage.ResonanceCoil | ||
} | ||
|
||
func shouldShowForOpponent(opponent: Player) -> Bool { | ||
return false | ||
} | ||
|
||
func getRelatedCards(player: Player) -> [Card?] { | ||
if let cached = cache { | ||
return cached | ||
} | ||
|
||
let cardId = getCardId() | ||
|
||
cache = Cards.collectible() | ||
.filter { card in | ||
card.faction == .protoss && | ||
card.type == .spell && | ||
card.id != cardId | ||
} | ||
.compactMap { $0.copy() } | ||
.sorted { $0.cost < $1.cost } | ||
|
||
return cache ?? [] | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
HSTracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/JimRaynor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// JimRaynor.swift | ||
// HSTracker | ||
// | ||
// Created by Francisco Moraes on 1/22/25. | ||
// Copyright © 2025 Benjamin Michotte. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class JimRaynor: ICardWithRelatedCards { | ||
required init() { | ||
// Required initializer | ||
} | ||
|
||
func getCardId() -> String { | ||
return CardIds.Collectible.Invalid.JimRaynor | ||
} | ||
|
||
func shouldShowForOpponent(opponent: Player) -> Bool { | ||
guard let card = Cards.by(cardId: getCardId()) else { return false } | ||
return CardUtils.mayCardBeRelevant(card: card, format: AppDelegate.instance().coreManager.game.currentFormat, playerClass: opponent.originalClass) && !getRelatedCards(player: opponent).isEmpty | ||
} | ||
|
||
func getRelatedCards(player: Player) -> [Card?] { | ||
return player.launchedStarships.compactMap { Cards.any(byId: $0 ?? "") } | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
HSTracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/LiftOff.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// LiftOff.swift | ||
// HSTracker | ||
// | ||
// Created by Francisco Moraes on 1/22/25. | ||
// Copyright © 2025 Benjamin Michotte. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class LiftOff: ICardWithRelatedCards { | ||
private let starshipPieces: [Card?] = [ | ||
Cards.any(byId: CardIds.NonCollectible.Invalid.Starport_Viking), | ||
Cards.any(byId: CardIds.NonCollectible.Invalid.Starport_Liberator), | ||
Cards.any(byId: CardIds.NonCollectible.Invalid.Starport_Raven2), | ||
Cards.any(byId: CardIds.NonCollectible.Invalid.Starport_Banshee2), | ||
Cards.any(byId: CardIds.NonCollectible.Invalid.Starport_Medivac2) | ||
] | ||
|
||
required init() { | ||
// Required initializer | ||
} | ||
|
||
func getCardId() -> String { | ||
return CardIds.Collectible.Invalid.LiftOff | ||
} | ||
|
||
func shouldShowForOpponent(opponent: Player) -> Bool { | ||
return false | ||
} | ||
|
||
func getRelatedCards(player: Player) -> [Card?] { | ||
return starshipPieces | ||
} | ||
} |
Oops, something went wrong.