@firestone-hs/simulate-bgs-battle 1.1.543 → 1.1.545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cards/card.interface.d.ts +1 -1
- package/dist/cards/card.interface.js +1 -1
- package/dist/cards/card.interface.js.map +1 -1
- package/dist/cards/cards-data.js +1 -1
- package/dist/cards/cards-data.js.map +1 -1
- package/dist/cards/impl/hero-power/aim-high.js +2 -1
- package/dist/cards/impl/hero-power/aim-high.js.map +1 -1
- package/dist/cards/impl/hero-power/aim-left.js +2 -1
- package/dist/cards/impl/hero-power/aim-left.js.map +1 -1
- package/dist/cards/impl/hero-power/aim-low.js +2 -1
- package/dist/cards/impl/hero-power/aim-low.js.map +1 -1
- package/dist/cards/impl/hero-power/aim-right.js +2 -1
- package/dist/cards/impl/hero-power/aim-right.js.map +1 -1
- package/dist/cards/impl/hero-power/earth-invocation.js +2 -1
- package/dist/cards/impl/hero-power/earth-invocation.js.map +1 -1
- package/dist/cards/impl/hero-power/embrace-your-rage.js +2 -1
- package/dist/cards/impl/hero-power/embrace-your-rage.js.map +1 -1
- package/dist/cards/impl/hero-power/fire-invocation.js +2 -1
- package/dist/cards/impl/hero-power/fire-invocation.js.map +1 -1
- package/dist/cards/impl/hero-power/fragrant-phylactery.js +2 -1
- package/dist/cards/impl/hero-power/fragrant-phylactery.js.map +1 -1
- package/dist/cards/impl/hero-power/glorious-gloop.js +1 -1
- package/dist/cards/impl/hero-power/glorious-gloop.js.map +1 -1
- package/dist/cards/impl/hero-power/lightning-invocation.js +2 -1
- package/dist/cards/impl/hero-power/lightning-invocation.js.map +1 -1
- package/dist/cards/impl/hero-power/rapid-reanimation.js +2 -1
- package/dist/cards/impl/hero-power/rapid-reanimation.js.map +1 -1
- package/dist/cards/impl/hero-power/reborn-rites.js +2 -1
- package/dist/cards/impl/hero-power/reborn-rites.js.map +1 -1
- package/dist/cards/impl/hero-power/water-invocation.js +2 -1
- package/dist/cards/impl/hero-power/water-invocation.js.map +1 -1
- package/dist/cards/impl/hero-power/wax-warband.js +2 -1
- package/dist/cards/impl/hero-power/wax-warband.js.map +1 -1
- package/dist/cards/impl/minion/admiral-eliza-goreblade.js +1 -1
- package/dist/cards/impl/minion/admiral-eliza-goreblade.js.map +1 -1
- package/dist/cards/impl/minion/arcane-cannoneer.js +1 -1
- package/dist/cards/impl/minion/arcane-cannoneer.js.map +1 -1
- package/dist/cards/impl/minion/battlecruiser.js +5 -2
- package/dist/cards/impl/minion/battlecruiser.js.map +1 -1
- package/dist/cards/impl/minion/colossus.js +1 -1
- package/dist/cards/impl/minion/colossus.js.map +1 -1
- package/dist/cards/impl/minion/corrupted-myrmidon.js +1 -1
- package/dist/cards/impl/minion/corrupted-myrmidon.js.map +1 -1
- package/dist/cards/impl/minion/holo-rover.js +1 -1
- package/dist/cards/impl/minion/holo-rover.js.map +1 -1
- package/dist/cards/impl/minion/hydralisk.js +1 -1
- package/dist/cards/impl/minion/hydralisk.js.map +1 -1
- package/dist/cards/impl/minion/mutalisk.js +3 -0
- package/dist/cards/impl/minion/mutalisk.js.map +1 -1
- package/dist/cards/impl/minion/neon-agent.js +1 -1
- package/dist/cards/impl/minion/neon-agent.js.map +1 -1
- package/dist/cards/impl/minion/niuzao.js +1 -1
- package/dist/cards/impl/minion/niuzao.js.map +1 -1
- package/dist/cards/impl/minion/ripsnarl-captain.js +1 -1
- package/dist/cards/impl/minion/ripsnarl-captain.js.map +1 -1
- package/dist/cards/impl/minion/sinodorei-straight-shot.js +1 -1
- package/dist/cards/impl/minion/sinodorei-straight-shot.js.map +1 -1
- package/dist/cards/impl/minion/transmuted-bramblewitch.js +1 -1
- package/dist/cards/impl/minion/transmuted-bramblewitch.js.map +1 -1
- package/dist/cards/impl/minion/ultralisk.js +1 -1
- package/dist/cards/impl/minion/ultralisk.js.map +1 -1
- package/dist/cards/impl/minion/void-ray.js +1 -1
- package/dist/cards/impl/minion/void-ray.js.map +1 -1
- package/dist/cards/impl/minion/wildfire-elemental.js +3 -0
- package/dist/cards/impl/minion/wildfire-elemental.js.map +1 -1
- package/dist/input-clone.js +2 -1
- package/dist/input-clone.js.map +1 -1
- package/dist/simulation/on-attack.js +1 -1
- package/dist/simulation/on-attack.js.map +1 -1
- package/dist/simulation/spectator/game-action.js +8 -8
- package/dist/simulation/spectator/game-action.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export interface StartOfCombatCard extends Card {
|
|
|
36
36
|
export declare const hasStartOfCombat: (card: Card) => card is StartOfCombatCard;
|
|
37
37
|
export type StartOfCombatTiming = 'start-of-combat' | 'pre-combat' | 'illidan';
|
|
38
38
|
export interface OnAttackCard extends Card {
|
|
39
|
-
|
|
39
|
+
onAnyMinionAttack: (minion: BoardEntity, input: OnAttackInput) => {
|
|
40
40
|
dmgDoneByAttacker: number;
|
|
41
41
|
dmgDoneByDefender: number;
|
|
42
42
|
};
|
|
@@ -5,7 +5,7 @@ const hasDefaultCharges = (card) => (card === null || card === void 0 ? void 0 :
|
|
|
5
5
|
exports.hasDefaultCharges = hasDefaultCharges;
|
|
6
6
|
const hasStartOfCombat = (card) => (card === null || card === void 0 ? void 0 : card.startOfCombat) !== undefined;
|
|
7
7
|
exports.hasStartOfCombat = hasStartOfCombat;
|
|
8
|
-
const hasOnAttack = (card) => (card === null || card === void 0 ? void 0 : card.
|
|
8
|
+
const hasOnAttack = (card) => (card === null || card === void 0 ? void 0 : card.onAnyMinionAttack) !== undefined;
|
|
9
9
|
exports.hasOnAttack = hasOnAttack;
|
|
10
10
|
const hasOnSpawned = (card) => (card === null || card === void 0 ? void 0 : card.onSpawned) !== undefined;
|
|
11
11
|
exports.hasOnSpawned = hasOnSpawned;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.interface.js","sourceRoot":"","sources":["../../src/cards/card.interface.ts"],"names":[],"mappings":";;;AAsCO,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAA8B,EAAE,CAC3E,CAAC,IA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uBAAJ,IAAI,CAA4B,iBAAiB,MAAK,SAAS,CAAC;AADrD,QAAA,oBAAoB,wBACiC;AAK3D,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAA8B,EAAE,CAC3E,CAAC,IAA2B,aAA3B,IAAI,uBAAJ,IAAI,CAAyB,cAAc,MAAK,SAAS,CAAC;AAD/C,QAAA,iBAAiB,qBAC8B;AAKrD,MAAM,mBAAmB,GAAG,CAAC,IAAU,EAAgC,EAAE,CAC/E,CAAC,IAA6B,aAA7B,IAAI,uBAAJ,IAAI,CAA2B,gBAAgB,MAAK,SAAS,CAAC;AADnD,QAAA,mBAAmB,uBACgC;AAKzD,MAAM,UAAU,GAAG,CAAC,IAAU,EAAuB,EAAE,CAAC,CAAC,IAAoB,aAApB,IAAI,uBAAJ,IAAI,CAAkB,OAAO,MAAK,SAAS,CAAC;AAA/F,QAAA,UAAU,cAAqF;AAQrG,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAA8B,EAAE,CAC3E,CAAC,IAA2B,aAA3B,IAAI,uBAAJ,IAAI,CAAyB,cAAc,MAAK,SAAS,CAAC;AAD/C,QAAA,iBAAiB,qBAC8B","sourcesContent":["import { BgsPlayerEntity, BgsQuestEntity, BoardTrinket } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { BoardSecret } from '../board-secret';\r\nimport { OnDivineShieldUpdatedInput } from '../keywords/divine-shield';\r\nimport { OnRebornUpdatedInput } from '../keywords/reborn';\r\nimport { OnStealthUpdatedInput } from '../keywords/stealth';\r\nimport { OnTauntUpdatedInput } from '../keywords/taunt';\r\nimport { OnVenomousUpdatedInput } from '../keywords/venomous';\r\nimport { OnWindfuryUpdatedInput } from '../keywords/windfury';\r\nimport {\r\n\tOnDespawnInput,\r\n\tOnOtherSpawnAuraInput,\r\n\tOnOtherSpawnInput,\r\n\tOnSpawnInput,\r\n} from '../simulation/add-minion-to-board';\r\nimport { OnDeathInput, OnMinionKilledInput } from '../simulation/attack';\r\nimport { AvengeInput } from '../simulation/avenge';\r\nimport { BattlecryInput, OnBattlecryTriggeredInput } from '../simulation/battlecries';\r\nimport { OnCardAddedToHandInput } from '../simulation/cards-in-hand';\r\nimport { AfterHeroDamagedInput } from '../simulation/damage-to-hero';\r\nimport { DeathrattleTriggeredInput } from '../simulation/deathrattle-on-trigger';\r\nimport { OnAttackInput } from '../simulation/on-attack';\r\nimport { RebornEffectInput } from '../simulation/reborn';\r\nimport { SoCInput } from '../simulation/start-of-combat/start-of-combat-input';\r\nimport { OnStatsChangedInput } from '../simulation/stats';\r\n\r\nexport interface Card {\r\n\t// Maybe should make this mandatory\r\n\tcardIds?: readonly string[];\r\n\tstartOfCombat?: (\r\n\t\ttrinket: BoardEntity | BoardTrinket | BgsPlayerEntity | BoardSecret,\r\n\t\tinput: SoCInput,\r\n\t) => boolean | { hasTriggered: boolean; shouldRecomputeCurrentAttacker: boolean };\r\n}\r\n\r\nexport interface DefaultChargesCard extends Card {\r\n\tdefaultCharges: (entity: BoardEntity) => number;\r\n}\r\nexport const hasDefaultCharges = (card: Card): card is DefaultChargesCard =>\r\n\t(card as DefaultChargesCard)?.defaultCharges !== undefined;\r\n\r\nexport interface StartOfCombatCard extends Card {\r\n\tstartOfCombatTiming?: StartOfCombatTiming;\r\n\tstartOfCombat: NonNullable<Card['startOfCombat']>;\r\n}\r\nexport const hasStartOfCombat = (card: Card): card is StartOfCombatCard =>\r\n\t(card as StartOfCombatCard)?.startOfCombat !== undefined;\r\nexport type StartOfCombatTiming = 'start-of-combat' | 'pre-combat' | 'illidan';\r\n\r\n// Whenever this attacks\r\nexport interface OnAttackCard extends Card {\r\n\tonAttack: (minion: BoardEntity, input: OnAttackInput) => { dmgDoneByAttacker: number; dmgDoneByDefender: number };\r\n}\r\nexport const hasOnAttack = (card: Card): card is OnAttackCard => (card as OnAttackCard)?.onAttack !== undefined;\r\n\r\nexport interface OnSpawnedCard extends Card {\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => void;\r\n}\r\nexport const hasOnSpawned = (card: Card): card is OnSpawnedCard => (card as OnSpawnedCard)?.onSpawned !== undefined;\r\n\r\nexport interface OnOtherSpawnedAuraCard extends Card {\r\n\tonOtherSpawnedAura: (minion: BoardEntity, input: OnOtherSpawnAuraInput) => void;\r\n}\r\nexport const hasOnOtherAuraSpawned = (card: Card): card is OnOtherSpawnedAuraCard =>\r\n\t(card as OnOtherSpawnedAuraCard)?.onOtherSpawnedAura !== undefined;\r\n\r\nexport interface OnOtherSpawnedCard extends Card {\r\n\tonOtherSpawned: (minion: BoardEntity, input: OnOtherSpawnInput) => void;\r\n}\r\nexport const hasOnOtherSpawned = (card: Card): card is OnOtherSpawnedCard =>\r\n\t(card as OnOtherSpawnedCard)?.onOtherSpawned !== undefined;\r\n\r\nexport interface AfterOtherSpawnedCard extends Card {\r\n\tafterOtherSpawned: (minion: BoardEntity, input: OnOtherSpawnInput) => void;\r\n}\r\nexport const hasAfterOtherSpawned = (card: Card): card is AfterOtherSpawnedCard =>\r\n\t(card as AfterOtherSpawnedCard)?.afterOtherSpawned !== undefined;\r\n\r\nexport interface OnDespawnedCard extends Card {\r\n\tonDespawned: (minion: BoardEntity, input: OnDespawnInput) => void;\r\n}\r\nexport const hasOnDespawned = (card: Card): card is OnDespawnedCard =>\r\n\t(card as OnDespawnedCard)?.onDespawned !== undefined;\r\n\r\nexport interface DeathrattleSpawnCard extends Card {\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput) => readonly BoardEntity[];\r\n}\r\nexport const hasDeathrattleSpawn = (card: Card): card is DeathrattleSpawnCard =>\r\n\t(card as DeathrattleSpawnCard)?.deathrattleSpawn !== undefined;\r\n\r\nexport interface BattlecryCard extends Card {\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => void;\r\n}\r\nexport const hasBattlecry = (card: Card): card is BattlecryCard => (card as BattlecryCard)?.battlecry !== undefined;\r\n\r\nexport interface RebornEffectCard extends Card {\r\n\trebornEffect: (minion: BoardEntity, input: RebornEffectInput) => void;\r\n}\r\nexport const hasRebornEffect = (card: Card): card is RebornEffectCard =>\r\n\t(card as RebornEffectCard)?.rebornEffect !== undefined;\r\n\r\nexport interface OnBattlecryTriggeredCard extends Card {\r\n\tonBattlecryTriggered: (minion: BoardEntity, input: OnBattlecryTriggeredInput) => void;\r\n}\r\nexport const hasOnBattlecryTriggered = (card: Card): card is OnBattlecryTriggeredCard =>\r\n\t(card as OnBattlecryTriggeredCard)?.onBattlecryTriggered !== undefined;\r\n\r\nexport interface AvengeCard extends Card {\r\n\tavenge: (minion: BoardEntity, input: AvengeInput) => void;\r\n\tbaseAvengeValue: (cardId: string) => number;\r\n}\r\nexport const hasAvenge = (card: Card): card is AvengeCard => (card as AvengeCard)?.avenge !== undefined;\r\n\r\nexport interface DeathrattleEffectCard extends Card {\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => void;\r\n}\r\nexport const hasDeathrattleEffect = (card: Card): card is DeathrattleEffectCard =>\r\n\t(card as DeathrattleEffectCard)?.deathrattleEffect !== undefined;\r\n\r\nexport interface DeathrattleEnchantmentEffectCard extends Card {\r\n\tdeathrattleEffectEnchantmentEffect: (\r\n\t\tminion: { cardId: string; originEntityId?: number; repeats?: number },\r\n\t\tinput: DeathrattleTriggeredInput,\r\n\t) => void;\r\n\tcardIds: readonly string[];\r\n}\r\nexport const hasDeathrattleEnchantmentEffect = (card: Card): card is DeathrattleEnchantmentEffectCard =>\r\n\t(card as DeathrattleEnchantmentEffectCard)?.deathrattleEffectEnchantmentEffect !== undefined;\r\n\r\nexport interface DeathrattleSpawnEnchantmentCard extends Card {\r\n\tdeathrattleSpawnEnchantmentEffect: (\r\n\t\tminion: { cardId: string; originEntityId?: number; repeats?: number },\r\n\t\tinput: DeathrattleTriggeredInput,\r\n\t) => readonly BoardEntity[];\r\n\tcardIds: readonly string[];\r\n}\r\nexport const hasDeathrattleSpawnEnchantment = (card: Card): card is DeathrattleSpawnEnchantmentCard =>\r\n\t(card as DeathrattleSpawnEnchantmentCard)?.deathrattleSpawnEnchantmentEffect !== undefined;\r\n\r\nexport interface OnCardAddedToHandCard extends Card {\r\n\tonCardAddedToHand: (entity: BoardEntity | BgsQuestEntity, input: OnCardAddedToHandInput) => void;\r\n}\r\nexport const hasOnCardAddedToHand = (card: Card): card is OnCardAddedToHandCard =>\r\n\t(card as OnCardAddedToHandCard)?.onCardAddedToHand !== undefined;\r\n\r\nexport interface EndOfTurnCard extends Card {\r\n\t// Use BattlecryInput because it's the only way end of turn effects are triggered\r\n\tendOfTurn: (entity: BoardEntity, input: EndOfTurnInput) => void;\r\n}\r\nexport const hasEndOfTurn = (card: Card): card is EndOfTurnCard => (card as EndOfTurnCard)?.endOfTurn !== undefined;\r\nexport type EndOfTurnInput = BattlecryInput;\r\n\r\nexport interface OnDivineShieldUpdatedCard extends Card {\r\n\tonDivineShieldUpdated: (entity: BoardEntity, input: OnDivineShieldUpdatedInput) => void;\r\n}\r\nexport const hasOnDivineShieldUpdated = (card: Card): card is OnDivineShieldUpdatedCard =>\r\n\t(card as OnDivineShieldUpdatedCard)?.onDivineShieldUpdated !== undefined;\r\n\r\nexport interface OnTauntUpdatedCard extends Card {\r\n\tonTauntUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnTauntUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnTauntUpdated = (card: Card): card is OnTauntUpdatedCard =>\r\n\t(card as OnTauntUpdatedCard)?.onTauntUpdated !== undefined;\r\n\r\nexport interface OnRebornUpdatedCard extends Card {\r\n\tonRebornUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnRebornUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnRebornUpdated = (card: Card): card is OnRebornUpdatedCard =>\r\n\t(card as OnRebornUpdatedCard)?.onRebornUpdated !== undefined;\r\n\r\nexport interface OnStealthUpdatedCard extends Card {\r\n\tonStealthUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnStealthUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnStealthUpdated = (card: Card): card is OnStealthUpdatedCard =>\r\n\t(card as OnStealthUpdatedCard)?.onStealthUpdated !== undefined;\r\n\r\nexport interface OnVenomousUpdatedCard extends Card {\r\n\tonVenomousUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnVenomousUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnVenomousUpdated = (card: Card): card is OnVenomousUpdatedCard =>\r\n\t(card as OnVenomousUpdatedCard)?.onVenomousUpdated !== undefined;\r\n\r\nexport interface OnWindfuryUpdatedCard extends Card {\r\n\tonWindfuryUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnWindfuryUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnWindfuryUpdated = (card: Card): card is OnWindfuryUpdatedCard =>\r\n\t(card as OnWindfuryUpdatedCard)?.onWindfuryUpdated !== undefined;\r\n\r\nexport interface OnStatsChangedCard extends Card {\r\n\tonStatsChanged: (entity: BoardEntity, input: OnStatsChangedInput) => void;\r\n}\r\nexport const hasOnStatsChanged = (card: Card): card is OnStatsChangedCard =>\r\n\t(card as OnStatsChangedCard)?.onStatsChanged !== undefined;\r\n\r\nexport interface AfterHeroDamagedCard extends Card {\r\n\tafterHeroDamaged: (entity: BoardEntity, input: AfterHeroDamagedInput) => void;\r\n}\r\nexport const hasAfterHeroDamaged = (card: Card): card is AfterHeroDamagedCard =>\r\n\t(card as AfterHeroDamagedCard)?.afterHeroDamaged !== undefined;\r\n\r\nexport interface OnDeathCard extends Card {\r\n\tonDeath: (entity: BoardEntity, input: OnDeathInput) => void;\r\n}\r\nexport const hasOnDeath = (card: Card): card is OnDeathCard => (card as OnDeathCard)?.onDeath !== undefined;\r\n\r\nexport interface OnMinionKilledCard extends Card {\r\n\tonMinionKilled: (\r\n\t\tentity: BoardEntity,\r\n\t\tinput: OnMinionKilledInput,\r\n\t) => { dmgDoneByAttacker: number; dmgDoneByDefender: number };\r\n}\r\nexport const hasOnMinionKilled = (card: Card): card is OnMinionKilledCard =>\r\n\t(card as OnMinionKilledCard)?.onMinionKilled !== undefined;\r\n"]}
|
|
1
|
+
{"version":3,"file":"card.interface.js","sourceRoot":"","sources":["../../src/cards/card.interface.ts"],"names":[],"mappings":";;;AAsCO,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAA8B,EAAE,CAC3E,CAAC,IAA2B,aAA3B,IAAI,uBAAJ,IAAI,CAAyB,cAAc,MAAK,SAAS,CAAC;AAD/C,QAAA,iBAAiB,qBAC8B;AAMrD,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAA6B,EAAE,CACzE,CAAC,IAA0B,aAA1B,IAAI,uBAAJ,IAAI,CAAwB,aAAa,MAAK,SAAS,CAAC;AAD7C,QAAA,gBAAgB,oBAC6B;AAUnD,MAAM,WAAW,GAAG,CAAC,IAAU,EAAwB,EAAE,CAC/D,CAAC,IAAqB,aAArB,IAAI,uBAAJ,IAAI,CAAmB,iBAAiB,MAAK,SAAS,CAAC;AAD5C,QAAA,WAAW,eACiC;AAKlD,MAAM,YAAY,GAAG,CAAC,IAAU,EAAyB,EAAE,CAAC,CAAC,IAAsB,aAAtB,IAAI,uBAAJ,IAAI,CAAoB,SAAS,MAAK,SAAS,CAAC;AAAvG,QAAA,YAAY,gBAA2F;AAK7G,MAAM,qBAAqB,GAAG,CAAC,IAAU,EAAkC,EAAE,CACnF,CAAC,IAA+B,aAA/B,IAAI,uBAAJ,IAAI,CAA6B,kBAAkB,MAAK,SAAS,CAAC;AADvD,QAAA,qB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B","sourcesContent":["import { BgsPlayerEntity, BgsQuestEntity, BoardTrinket } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { BoardSecret } from '../board-secret';\r\nimport { OnDivineShieldUpdatedInput } from '../keywords/divine-shield';\r\nimport { OnRebornUpdatedInput } from '../keywords/reborn';\r\nimport { OnStealthUpdatedInput } from '../keywords/stealth';\r\nimport { OnTauntUpdatedInput } from '../keywords/taunt';\r\nimport { OnVenomousUpdatedInput } from '../keywords/venomous';\r\nimport { OnWindfuryUpdatedInput } from '../keywords/windfury';\r\nimport {\r\n\tOnDespawnInput,\r\n\tOnOtherSpawnAuraInput,\r\n\tOnOtherSpawnInput,\r\n\tOnSpawnInput,\r\n} from '../simulation/add-minion-to-board';\r\nimport { OnDeathInput, OnMinionKilledInput } from '../simulation/attack';\r\nimport { AvengeInput } from '../simulation/avenge';\r\nimport { BattlecryInput, OnBattlecryTriggeredInput } from '../simulation/battlecries';\r\nimport { OnCardAddedToHandInput } from '../simulation/cards-in-hand';\r\nimport { AfterHeroDamagedInput } from '../simulation/damage-to-hero';\r\nimport { DeathrattleTriggeredInput } from '../simulation/deathrattle-on-trigger';\r\nimport { OnAttackInput } from '../simulation/on-attack';\r\nimport { RebornEffectInput } from '../simulation/reborn';\r\nimport { SoCInput } from '../simulation/start-of-combat/start-of-combat-input';\r\nimport { OnStatsChangedInput } from '../simulation/stats';\r\n\r\nexport interface Card {\r\n\t// Maybe should make this mandatory\r\n\tcardIds?: readonly string[];\r\n\tstartOfCombat?: (\r\n\t\ttrinket: BoardEntity | BoardTrinket | BgsPlayerEntity | BoardSecret,\r\n\t\tinput: SoCInput,\r\n\t) => boolean | { hasTriggered: boolean; shouldRecomputeCurrentAttacker: boolean };\r\n}\r\n\r\nexport interface DefaultChargesCard extends Card {\r\n\tdefaultCharges: (entity: BoardEntity) => number;\r\n}\r\nexport const hasDefaultCharges = (card: Card): card is DefaultChargesCard =>\r\n\t(card as DefaultChargesCard)?.defaultCharges !== undefined;\r\n\r\nexport interface StartOfCombatCard extends Card {\r\n\tstartOfCombatTiming?: StartOfCombatTiming;\r\n\tstartOfCombat: NonNullable<Card['startOfCombat']>;\r\n}\r\nexport const hasStartOfCombat = (card: Card): card is StartOfCombatCard =>\r\n\t(card as StartOfCombatCard)?.startOfCombat !== undefined;\r\nexport type StartOfCombatTiming = 'start-of-combat' | 'pre-combat' | 'illidan';\r\n\r\n// Whenever this attacks\r\nexport interface OnAttackCard extends Card {\r\n\tonAnyMinionAttack: (\r\n\t\tminion: BoardEntity,\r\n\t\tinput: OnAttackInput,\r\n\t) => { dmgDoneByAttacker: number; dmgDoneByDefender: number };\r\n}\r\nexport const hasOnAttack = (card: Card): card is OnAttackCard =>\r\n\t(card as OnAttackCard)?.onAnyMinionAttack !== undefined;\r\n\r\nexport interface OnSpawnedCard extends Card {\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => void;\r\n}\r\nexport const hasOnSpawned = (card: Card): card is OnSpawnedCard => (card as OnSpawnedCard)?.onSpawned !== undefined;\r\n\r\nexport interface OnOtherSpawnedAuraCard extends Card {\r\n\tonOtherSpawnedAura: (minion: BoardEntity, input: OnOtherSpawnAuraInput) => void;\r\n}\r\nexport const hasOnOtherAuraSpawned = (card: Card): card is OnOtherSpawnedAuraCard =>\r\n\t(card as OnOtherSpawnedAuraCard)?.onOtherSpawnedAura !== undefined;\r\n\r\nexport interface OnOtherSpawnedCard extends Card {\r\n\tonOtherSpawned: (minion: BoardEntity, input: OnOtherSpawnInput) => void;\r\n}\r\nexport const hasOnOtherSpawned = (card: Card): card is OnOtherSpawnedCard =>\r\n\t(card as OnOtherSpawnedCard)?.onOtherSpawned !== undefined;\r\n\r\nexport interface AfterOtherSpawnedCard extends Card {\r\n\tafterOtherSpawned: (minion: BoardEntity, input: OnOtherSpawnInput) => void;\r\n}\r\nexport const hasAfterOtherSpawned = (card: Card): card is AfterOtherSpawnedCard =>\r\n\t(card as AfterOtherSpawnedCard)?.afterOtherSpawned !== undefined;\r\n\r\nexport interface OnDespawnedCard extends Card {\r\n\tonDespawned: (minion: BoardEntity, input: OnDespawnInput) => void;\r\n}\r\nexport const hasOnDespawned = (card: Card): card is OnDespawnedCard =>\r\n\t(card as OnDespawnedCard)?.onDespawned !== undefined;\r\n\r\nexport interface DeathrattleSpawnCard extends Card {\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput) => readonly BoardEntity[];\r\n}\r\nexport const hasDeathrattleSpawn = (card: Card): card is DeathrattleSpawnCard =>\r\n\t(card as DeathrattleSpawnCard)?.deathrattleSpawn !== undefined;\r\n\r\nexport interface BattlecryCard extends Card {\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => void;\r\n}\r\nexport const hasBattlecry = (card: Card): card is BattlecryCard => (card as BattlecryCard)?.battlecry !== undefined;\r\n\r\nexport interface RebornEffectCard extends Card {\r\n\trebornEffect: (minion: BoardEntity, input: RebornEffectInput) => void;\r\n}\r\nexport const hasRebornEffect = (card: Card): card is RebornEffectCard =>\r\n\t(card as RebornEffectCard)?.rebornEffect !== undefined;\r\n\r\nexport interface OnBattlecryTriggeredCard extends Card {\r\n\tonBattlecryTriggered: (minion: BoardEntity, input: OnBattlecryTriggeredInput) => void;\r\n}\r\nexport const hasOnBattlecryTriggered = (card: Card): card is OnBattlecryTriggeredCard =>\r\n\t(card as OnBattlecryTriggeredCard)?.onBattlecryTriggered !== undefined;\r\n\r\nexport interface AvengeCard extends Card {\r\n\tavenge: (minion: BoardEntity, input: AvengeInput) => void;\r\n\tbaseAvengeValue: (cardId: string) => number;\r\n}\r\nexport const hasAvenge = (card: Card): card is AvengeCard => (card as AvengeCard)?.avenge !== undefined;\r\n\r\nexport interface DeathrattleEffectCard extends Card {\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => void;\r\n}\r\nexport const hasDeathrattleEffect = (card: Card): card is DeathrattleEffectCard =>\r\n\t(card as DeathrattleEffectCard)?.deathrattleEffect !== undefined;\r\n\r\nexport interface DeathrattleEnchantmentEffectCard extends Card {\r\n\tdeathrattleEffectEnchantmentEffect: (\r\n\t\tminion: { cardId: string; originEntityId?: number; repeats?: number },\r\n\t\tinput: DeathrattleTriggeredInput,\r\n\t) => void;\r\n\tcardIds: readonly string[];\r\n}\r\nexport const hasDeathrattleEnchantmentEffect = (card: Card): card is DeathrattleEnchantmentEffectCard =>\r\n\t(card as DeathrattleEnchantmentEffectCard)?.deathrattleEffectEnchantmentEffect !== undefined;\r\n\r\nexport interface DeathrattleSpawnEnchantmentCard extends Card {\r\n\tdeathrattleSpawnEnchantmentEffect: (\r\n\t\tminion: { cardId: string; originEntityId?: number; repeats?: number },\r\n\t\tinput: DeathrattleTriggeredInput,\r\n\t) => readonly BoardEntity[];\r\n\tcardIds: readonly string[];\r\n}\r\nexport const hasDeathrattleSpawnEnchantment = (card: Card): card is DeathrattleSpawnEnchantmentCard =>\r\n\t(card as DeathrattleSpawnEnchantmentCard)?.deathrattleSpawnEnchantmentEffect !== undefined;\r\n\r\nexport interface OnCardAddedToHandCard extends Card {\r\n\tonCardAddedToHand: (entity: BoardEntity | BgsQuestEntity, input: OnCardAddedToHandInput) => void;\r\n}\r\nexport const hasOnCardAddedToHand = (card: Card): card is OnCardAddedToHandCard =>\r\n\t(card as OnCardAddedToHandCard)?.onCardAddedToHand !== undefined;\r\n\r\nexport interface EndOfTurnCard extends Card {\r\n\t// Use BattlecryInput because it's the only way end of turn effects are triggered\r\n\tendOfTurn: (entity: BoardEntity, input: EndOfTurnInput) => void;\r\n}\r\nexport const hasEndOfTurn = (card: Card): card is EndOfTurnCard => (card as EndOfTurnCard)?.endOfTurn !== undefined;\r\nexport type EndOfTurnInput = BattlecryInput;\r\n\r\nexport interface OnDivineShieldUpdatedCard extends Card {\r\n\tonDivineShieldUpdated: (entity: BoardEntity, input: OnDivineShieldUpdatedInput) => void;\r\n}\r\nexport const hasOnDivineShieldUpdated = (card: Card): card is OnDivineShieldUpdatedCard =>\r\n\t(card as OnDivineShieldUpdatedCard)?.onDivineShieldUpdated !== undefined;\r\n\r\nexport interface OnTauntUpdatedCard extends Card {\r\n\tonTauntUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnTauntUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnTauntUpdated = (card: Card): card is OnTauntUpdatedCard =>\r\n\t(card as OnTauntUpdatedCard)?.onTauntUpdated !== undefined;\r\n\r\nexport interface OnRebornUpdatedCard extends Card {\r\n\tonRebornUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnRebornUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnRebornUpdated = (card: Card): card is OnRebornUpdatedCard =>\r\n\t(card as OnRebornUpdatedCard)?.onRebornUpdated !== undefined;\r\n\r\nexport interface OnStealthUpdatedCard extends Card {\r\n\tonStealthUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnStealthUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnStealthUpdated = (card: Card): card is OnStealthUpdatedCard =>\r\n\t(card as OnStealthUpdatedCard)?.onStealthUpdated !== undefined;\r\n\r\nexport interface OnVenomousUpdatedCard extends Card {\r\n\tonVenomousUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnVenomousUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnVenomousUpdated = (card: Card): card is OnVenomousUpdatedCard =>\r\n\t(card as OnVenomousUpdatedCard)?.onVenomousUpdated !== undefined;\r\n\r\nexport interface OnWindfuryUpdatedCard extends Card {\r\n\tonWindfuryUpdated: (\r\n\t\tentity: BoardEntity,\r\n\t\timpactedEntity: BoardEntity,\r\n\t\tpreviousValue: boolean,\r\n\t\tinput: OnWindfuryUpdatedInput,\r\n\t) => void;\r\n}\r\nexport const hasOnWindfuryUpdated = (card: Card): card is OnWindfuryUpdatedCard =>\r\n\t(card as OnWindfuryUpdatedCard)?.onWindfuryUpdated !== undefined;\r\n\r\nexport interface OnStatsChangedCard extends Card {\r\n\tonStatsChanged: (entity: BoardEntity, input: OnStatsChangedInput) => void;\r\n}\r\nexport const hasOnStatsChanged = (card: Card): card is OnStatsChangedCard =>\r\n\t(card as OnStatsChangedCard)?.onStatsChanged !== undefined;\r\n\r\nexport interface AfterHeroDamagedCard extends Card {\r\n\tafterHeroDamaged: (entity: BoardEntity, input: AfterHeroDamagedInput) => void;\r\n}\r\nexport const hasAfterHeroDamaged = (card: Card): card is AfterHeroDamagedCard =>\r\n\t(card as AfterHeroDamagedCard)?.afterHeroDamaged !== undefined;\r\n\r\nexport interface OnDeathCard extends Card {\r\n\tonDeath: (entity: BoardEntity, input: OnDeathInput) => void;\r\n}\r\nexport const hasOnDeath = (card: Card): card is OnDeathCard => (card as OnDeathCard)?.onDeath !== undefined;\r\n\r\nexport interface OnMinionKilledCard extends Card {\r\n\tonMinionKilled: (\r\n\t\tentity: BoardEntity,\r\n\t\tinput: OnMinionKilledInput,\r\n\t) => { dmgDoneByAttacker: number; dmgDoneByDefender: number };\r\n}\r\nexport const hasOnMinionKilled = (card: Card): card is OnMinionKilledCard =>\r\n\t(card as OnMinionKilledCard)?.onMinionKilled !== undefined;\r\n"]}
|
package/dist/cards/cards-data.js
CHANGED
|
@@ -50,7 +50,7 @@ class CardsData {
|
|
|
50
50
|
const poolWithGolden = this.allCards
|
|
51
51
|
.getCards()
|
|
52
52
|
.filter((card) => (0, reference_data_1.isBattlegroundsCard)(card))
|
|
53
|
-
.filter((card) => card.isBaconPool)
|
|
53
|
+
.filter((card) => { var _a; return card.isBaconPool || ((_a = this.allCards.getCard(card.battlegroundsNormalDbfId)) === null || _a === void 0 ? void 0 : _a.isBaconPool); })
|
|
54
54
|
.filter((card) => !!card.techLevel)
|
|
55
55
|
.filter((card) => { var _a; return ((_a = card.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === reference_data_1.CardType[reference_data_1.CardType.MINION]; })
|
|
56
56
|
.filter((card) => !(0, utils_2.hasMechanic)(card, reference_data_1.GameTag[reference_data_1.GameTag.BACON_BUDDY]))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards-data.js","sourceRoot":"","sources":["../../src/cards/cards-data.ts"],"names":[],"mappings":";;;AAAA,iEAQsC;AAEtC,6CAAgE;AAChE,oCAAoE;AACpE,qDAA6C;AAC7C,0DAAqD;AAExC,QAAA,cAAc,GAAG;;;;CAI7B,CAAC;AAEW,QAAA,kBAAkB,GAAG;IACjC,wBAAO,CAAC,KAAK;IACb,wBAAO,CAAC,aAAa;IACrB,wBAAO,CAAC,QAAQ;IAChB,wBAAO,CAAC,SAAS;IACjB,wBAAO,CAAC,QAAQ;IAChB,wBAAO,CAAC,OAAO;IACf,wBAAO,CAAC,MAAM;CACd,CAAC;AAEK,MAAM,UAAU,GAAG,CAAC,MAAmB,EAAE,OAAgB,EAAE,EAAE;IACnE,QAAQ,OAAO,EAAE;QAChB,KAAK,wBAAO,CAAC,KAAK;YACjB,OAAO,MAAM,CAAC,KAAK,CAAC;QACrB,KAAK,wBAAO,CAAC,aAAa;YACzB,OAAO,MAAM,CAAC,YAAY,CAAC;QAC5B,KAAK,wBAAO,CAAC,QAAQ;YACpB,OAAO,MAAM,CAAC,QAAQ,CAAC;QACxB,KAAK,wBAAO,CAAC,QAAQ;YACpB,OAAO,MAAM,CAAC,QAAQ,CAAC;QACxB,KAAK,wBAAO,CAAC,OAAO;YACnB,OAAO,MAAM,CAAC,OAAO,CAAC;QACvB,KAAK,wBAAO,CAAC,MAAM;YAClB,OAAO,MAAM,CAAC,MAAM,CAAC;QACtB;YACC,OAAO,KAAK,CAAC;KACd;AACF,CAAC,CAAC;AAjBW,QAAA,UA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X,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvG,CAAC;CACD;AA5PD,8BA4PC","sourcesContent":["import {\r\n\tAllCardsService,\r\n\tCardIds,\r\n\tCardType,\r\n\tGameTag,\r\n\tisBattlegroundsCard,\r\n\tRace,\r\n\tReferenceCard,\r\n} from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { groupByFunction, pickRandom } from '../services/utils';\r\nimport { getRaceEnum, hasMechanic, isCorrectTribe } from '../utils';\r\nimport { hasAvenge } from './card.interface';\r\nimport { cardMappings } from './impl/_card-mappings';\r\n\r\nexport const WHELP_CARD_IDS = [\r\n\tCardIds.RedWhelp_BGS_019,\r\n\tCardIds.RedWhelp_TB_BaconUps_102,\r\n\tCardIds.Onyxia_OnyxianWhelpToken,\r\n];\r\n\r\nexport const validBonusKeywords = [\r\n\tGameTag.TAUNT,\r\n\tGameTag.DIVINE_SHIELD,\r\n\tGameTag.VENOMOUS,\r\n\tGameTag.POISONOUS,\r\n\tGameTag.WINDFURY,\r\n\tGameTag.STEALTH,\r\n\tGameTag.REBORN,\r\n];\r\n\r\nexport const hasKeyword = (entity: BoardEntity, keyword: GameTag) => {\r\n\tswitch (keyword) {\r\n\t\tcase GameTag.TAUNT:\r\n\t\t\treturn entity.taunt;\r\n\t\tcase GameTag.DIVINE_SHIELD:\r\n\t\t\treturn entity.divineShield;\r\n\t\tcase GameTag.VENOMOUS:\r\n\t\t\treturn entity.venomous;\r\n\t\tcase GameTag.WINDFURY:\r\n\t\t\treturn entity.windfury;\r\n\t\tcase GameTag.STEALTH:\r\n\t\t\treturn entity.stealth;\r\n\t\tcase GameTag.REBORN:\r\n\t\t\treturn entity.reborn;\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n};\r\n\r\nexport class CardsData {\r\n\tpublic ghastcoilerSpawns: readonly string[];\r\n\tpublic impMamaSpawns: readonly string[];\r\n\tpublic demonSpawns: readonly string[];\r\n\tpublic gentleDjinniSpawns: readonly string[];\r\n\tpublic kilrekSpawns: readonly string[];\r\n\tpublic battlecryMinions: readonly string[];\r\n\tpublic deathrattleMinions: readonly string[];\r\n\tpublic pirateSpawns: readonly string[];\r\n\tpublic beastSpawns: readonly string[];\r\n\tpublic scrapScraperSpawns: readonly string[];\r\n\tpublic endOfTurnMinions: readonly string[];\r\n\r\n\tpublic putricidePool1: readonly string[];\r\n\tpublic putricidePool2: readonly string[];\r\n\tpublic putridicePool2ForEternalSummoner: readonly string[];\r\n\r\n\tprivate pool: readonly ReferenceCard[];\r\n\tprivate minionsForTier: { [key: string]: readonly ReferenceCard[] };\r\n\r\n\tconstructor(private readonly allCards: AllCardsService, init = true) {\r\n\t\tif (init) {\r\n\t\t\tthis.inititialize();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic inititialize(validTribes?: readonly Race[], anomalies?: readonly string[]): void {\r\n\t\tconst poolWithGolden = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => isBattlegroundsCard(card))\r\n\t\t\t.filter((card) => card.isBaconPool)\r\n\t\t\t.filter((card) => !!card.techLevel)\r\n\t\t\t.filter((card) => card.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((card) => !hasMechanic(card, GameTag[GameTag.BACON_BUDDY]))\r\n\t\t\t.filter((card) => card.set !== 'Vanilla')\r\n\t\t\t.filter((card) =>\r\n\t\t\t\tanomalies?.includes(CardIds.BigLeague_BG27_Anomaly_100)\r\n\t\t\t\t\t? card.techLevel >= 3\r\n\t\t\t\t\t: anomalies?.includes(CardIds.LittleLeague_BG27_Anomaly_800)\r\n\t\t\t\t\t? card.techLevel <= 4\r\n\t\t\t\t\t: true,\r\n\t\t\t);\r\n\t\tthis.pool = poolWithGolden\r\n\t\t\t.filter((card) => this.isValidTribe(validTribes, card.races))\r\n\t\t\t.filter((card) =>\r\n\t\t\t\tanomalies?.includes(CardIds.TheGoldenArena_BG27_Anomaly_801)\r\n\t\t\t\t\t? this.isGolden(card)\r\n\t\t\t\t\t: !this.isGolden(card),\r\n\t\t\t);\r\n\t\tthis.minionsForTier = groupByFunction((card: ReferenceCard) => card.techLevel)(this.pool);\r\n\t\tthis.ghastcoilerSpawns = this.pool\r\n\t\t\t.filter((card) => card.id !== 'BGS_008')\r\n\t\t\t.filter((card) => hasMechanic(card, 'DEATHRATTLE'))\r\n\t\t\t.filter((card) => this.isValidTribe(validTribes, card.races))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.demonSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.DEMON)).map((card) => card.id);\r\n\t\tthis.impMamaSpawns = this.demonSpawns.filter((cardId) => cardId !== CardIds.ImpMama_BGS_044);\r\n\t\tthis.gentleDjinniSpawns = this.pool\r\n\t\t\t.filter((card) => isCorrectTribe(card.races, Race.ELEMENTAL))\r\n\t\t\t.filter((card) => card.id !== CardIds.GentleDjinni_BGS_121)\r\n\t\t\t.map((card) => card.id);\r\n\t\t// FIXME: just spawn a random undead instead of an Undead Creation\r\n\t\t// this.festergutSpawns = pool\r\n\t\t// \t.filter((card) => !this.isGolden(card))\r\n\t\t// \t.filter((card) => isCorrectTribe(card.races, Race.UNDEAD))\r\n\t\t// \t.filter((card) => card.id !== CardIds.Festergut_BG25_HERO_100_Buddy)\r\n\t\t// \t// .filter((card) => REMOVED_CARD_IDS.indexOf(card.id) === -1)\r\n\t\t// \t.map((card) => card.id);\r\n\t\tthis.kilrekSpawns = this.pool\r\n\t\t\t.filter((card) => isCorrectTribe(card.races, Race.DEMON))\r\n\t\t\t.filter((card) => card.id !== CardIds.Kilrek_TB_BaconShop_HERO_37_Buddy)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.battlecryMinions = this.pool.filter((card) => hasMechanic(card, 'BATTLECRY')).map((card) => card.id);\r\n\t\tthis.deathrattleMinions = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.DEATHRATTLE]))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.pirateSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.PIRATE)).map((card) => card.id);\r\n\t\tthis.beastSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.BEAST)).map((card) => card.id);\r\n\t\tthis.scrapScraperSpawns = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.MAGNETIC]))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.endOfTurnMinions = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.END_OF_TURN]))\r\n\t\t\t.map((card) => card.id);\r\n\r\n\t\tthis.putricidePool1 = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool1)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.putricidePool2 = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool2)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.putridicePool2ForEternalSummoner = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool2)\r\n\t\t\t.filter((card) => !card.battlegroundsPutridiceSummonerExclusion)\r\n\t\t\t.map((card) => card.id);\r\n\t}\r\n\r\n\tpublic avengeValue(cardId: string): number {\r\n\t\tconst avengeImpl = cardMappings[cardId];\r\n\t\tif (hasAvenge(avengeImpl)) {\r\n\t\t\treturn avengeImpl.baseAvengeValue(cardId);\r\n\t\t}\r\n\t\tswitch (cardId) {\r\n\t\t\tcase CardIds.HungeringAbomination_BG25_014:\r\n\t\t\tcase CardIds.HungeringAbomination_BG25_014_G:\r\n\t\t\t// Not technically an avenge, but behaves as if\r\n\t\t\t// case CardIds.ShadowyConstruct_BG25_HERO_103_Buddy:\r\n\t\t\t// case CardIds.ShadowyConstruct_BG25_HERO_103_Buddy_G:\r\n\t\t\tcase CardIds.IceSickle:\r\n\t\t\t\treturn 1;\r\n\t\t\tcase CardIds.GhoulOfTheFeast_BG25_002:\r\n\t\t\tcase CardIds.GhoulOfTheFeast_BG25_002_G:\r\n\t\t\tcase CardIds.MechanoTank_BG21_023:\r\n\t\t\tcase CardIds.MechanoTank_BG21_023_G:\r\n\t\t\tcase CardIds.PalescaleCrocolisk_BG21_001:\r\n\t\t\tcase CardIds.PalescaleCrocolisk_BG21_001_G:\r\n\t\t\tcase CardIds.StormpikeLieutenant_BG22_HERO_003_Buddy:\r\n\t\t\tcase CardIds.StormpikeLieutenant_BG22_HERO_003_Buddy_G:\r\n\t\t\tcase CardIds.VanndarStormpike_LeadTheStormpikes:\r\n\t\t\tcase CardIds.Drekthar_LeadTheFrostwolves:\r\n\t\t\tcase CardIds.Bristlebach_BG26_157:\r\n\t\t\tcase CardIds.Bristlebach_BG26_157_G:\r\n\t\t\t\treturn 2;\r\n\t\t\tcase CardIds.BuddingGreenthumb_BG21_030:\r\n\t\t\tcase CardIds.BuddingGreenthumb_BG21_030_G:\r\n\t\t\t// case CardIds.FrostwolfLieutenant:\r\n\t\t\t// case CardIds.FrostwolfLieutenantBattlegrounds:\r\n\t\t\tcase CardIds.PashmarTheVengeful_BG23_014:\r\n\t\t\tcase CardIds.PashmarTheVengeful_BG23_014_G:\r\n\t\t\tcase CardIds.WitchwingNestmatron_BG21_038:\r\n\t\t\tcase CardIds.WitchwingNestmatron_BG21_038_G:\r\n\t\t\tcase CardIds.BoomSquad_BG27_Reward_502:\r\n\t\t\tcase CardIds.TremblingTrolley_BG28_967:\r\n\t\t\tcase CardIds.TremblingTrolley_BG28_967_G:\r\n\t\t\tcase CardIds.FridgeMagnet_BG30_MagicItem_545:\r\n\t\t\t\treturn 3;\r\n\t\t\tcase CardIds.GilneanThornedRose_BG30_MagicItem_864:\r\n\t\t\tcase CardIds.Onyxia_Broodmother:\r\n\t\t\tcase CardIds.ImpatientDoomsayer_BG21_007:\r\n\t\t\tcase CardIds.ImpatientDoomsayer_BG21_007_G:\r\n\t\t\tcase CardIds.Sisefin_BG21_009:\r\n\t\t\tcase CardIds.Sisefin_BG21_009_G:\r\n\t\t\tcase CardIds.TonyTwoTusk_BG21_031:\r\n\t\t\tcase CardIds.TonyTwoTusk_BG21_031_G:\r\n\t\t\t// case CardIds.ScrapScraper_BG26_148:\r\n\t\t\t// case CardIds.ScrapScraper_BG26_148_G:\r\n\t\t\tcase CardIds.RelentlessSentry_BG25_003:\r\n\t\t\tcase CardIds.RelentlessSentry_BG25_003_G:\r\n\t\t\tcase CardIds.PhaerixWrathOfTheSun_BG28_403:\r\n\t\t\tcase CardIds.PhaerixWrathOfTheSun_BG28_403_G:\r\n\t\t\tcase CardIds.TumblingDisaster_BG28_Reward_505:\r\n\t\t\tcase CardIds.CycleOfEnergy_BG28_Reward_504:\r\n\t\t\tcase CardIds.AugmentedLaborer_BG28_740:\r\n\t\t\tcase CardIds.AugmentedLaborer_BG28_740_G:\r\n\t\t\tcase CardIds.MurglMkIi_BG29_991:\r\n\t\t\tcase CardIds.MurglMkIi_BG29_991_G:\r\n\t\t\tcase CardIds.QuilligraphySet_QuilligraphySetToken_BG30_MagicItem_410t2:\r\n\t\t\tcase CardIds.QuilligraphySet_BG30_MagicItem_410:\r\n\t\t\t\treturn 4;\r\n\t\t\tcase CardIds.RelentlessMurghoul_BG27_010:\r\n\t\t\tcase CardIds.RelentlessMurghoul_BG27_010_G:\r\n\t\t\tcase CardIds.StaffOfTheScourge_BG30_MagicItem_437:\r\n\t\t\t\treturn 5;\r\n\t\t\tcase CardIds.BleedingHeart_BG30_MagicItem_713:\r\n\t\t\tcase CardIds.StableAmalgamation_BG28_Reward_518:\r\n\t\t\t\treturn 7;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic defaultScriptDataNum(cardId: string): number {\r\n\t\tswitch (cardId) {\r\n\t\t\tcase CardIds.TumblingDisaster_BG28_Reward_505:\r\n\t\t\tcase CardIds.TwinSkyLanterns_BG30_MagicItem_822:\r\n\t\t\tcase CardIds.TwinSkyLanterns_TwinSkyLanternsToken_BG30_MagicItem_822t2:\r\n\t\t\tcase CardIds.BoomController_BG30_MagicItem_440:\r\n\t\t\tcase CardIds.AllianceKeychain_BG30_MagicItem_433:\r\n\t\t\tcase CardIds.AllianceKeychain_AllianceKeychainToken_BG30_MagicItem_433t:\r\n\t\t\tcase CardIds.DeathlyPhylactery_BG30_MagicItem_700:\r\n\t\t\tcase CardIds.PromoPortrait_BG30_MagicItem_918:\r\n\t\t\t\treturn 1;\r\n\t\t\tcase CardIds.JarOGems_BG30_MagicItem_546:\r\n\t\t\tcase CardIds.BloodGolemSticker_BG30_MagicItem_442:\r\n\t\t\t\treturn 2;\r\n\t\t\tcase CardIds.MechagonAdapter_BG30_MagicItem_910:\r\n\t\t\t\treturn 3;\r\n\t\t\tcase CardIds.ReinforcedShield_BG30_MagicItem_886:\r\n\t\t\t\treturn 4;\r\n\t\t\tdefault:\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getTavernLevel(cardId: string): number {\r\n\t\treturn this.allCards.getCard(cardId).techLevel ?? 1;\r\n\t}\r\n\r\n\tpublic getRandomMinionForTavernTier(tavernTier: number): string {\r\n\t\t// Tzvern tier can be undefined for hero-power specific tokens, like the Amalgam, or when\r\n\t\t// for some reason tokens end up in the shop. For now, defaulting to 1 for tavern\r\n\t\t// level seems to work in all cases\r\n\t\tconst minionsForTier = this.minionsForTier[tavernTier ?? 1];\r\n\t\tif (!minionsForTier?.length) {\r\n\t\t\tconsole.error('incorrect minions for tier', tavernTier);\r\n\t\t}\r\n\t\treturn pickRandom(this.minionsForTier[tavernTier ?? 1])?.id;\r\n\t}\r\n\r\n\tpublic getRandomMechToMagnetize(tavernLimitUpper: number): string {\r\n\t\tconst magneticMechs = this.pool\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => hasMechanic(m, GameTag[GameTag.MODULAR]));\r\n\t\tconst pool = magneticMechs.filter((m) => m.techLevel <= tavernLimitUpper);\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic getRandomMinionForTribe(\r\n\t\ttribe: Race,\r\n\t\ttavernLimitUpper: number,\r\n\t\texcludedCards: readonly string[] = [],\r\n\t): string {\r\n\t\tconst pool = this.pool\r\n\t\t\t.filter((m) => this.isValidTribe([tribe], m.races, false))\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => m.techLevel <= tavernLimitUpper)\r\n\t\t\t.filter((m) => !excludedCards.includes(m.id));\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic getRandomProtossMinion(tavernLimitUpper: number): string {\r\n\t\tconst pool = this.pool\r\n\t\t\t.filter((m) => m.mechanics?.includes(GameTag[GameTag.PROTOSS]))\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => m.techLevel <= tavernLimitUpper);\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic isGolden(card: ReferenceCard): boolean {\r\n\t\treturn card.premium;\r\n\t}\r\n\r\n\tprivate isValidTribe(validTribes: readonly Race[], cardRaces: readonly string[], allowEmptyRaces = true): boolean {\r\n\t\tif (!cardRaces?.length && allowEmptyRaces) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (cardRaces ?? [])\r\n\t\t\t.map((race) => getRaceEnum(race))\r\n\t\t\t.some((raceEnum) => raceEnum === Race.ALL || !validTribes?.length || validTribes.includes(raceEnum));\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"cards-data.js","sourceRoot":"","sources":["../../src/cards/cards-data.ts"],"names":[],"mappings":";;;AAAA,iEAQsC;AAEtC,6CAAgE;AAChE,oCAAoE;AACpE,qDAA6C;AAC7C,0DAAqD;AAExC,QAAA,cAAc,GAAG;;;;CAI7B,CAAC;AAEW,QAAA,kBAAkB,GAAG;IACjC,wBA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AAM,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,WAAW,EAAE,MAAK,yBAAQ,CAAC,yBAAQ,CAAC,MAAM,CAAC,CAAA,EAAA,CAAC;aAClE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,gBAAgB,CAAC,CAAC;QACjD,OAAO,MAAA,IAAA,kBAAU,EAAC,IAAI,CAAC,0CAAE,EAAE,CAAC;IAC7B,CAAC;IAEM,QAAQ,CAAC,IAAmB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEO,YAAY,CAAC,WAA4B,EAAE,SAA4B,EAAE,eAAe,GAAG,IAAI;QACtG,IAAI,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAA,IAAI,eAAe,EAAE;YAC1C,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC;aACtB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;aAChC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,qBAAI,CAAC,GAAG,IAAI,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvG,CAAC;CACD;AA7PD,8BA6PC","sourcesContent":["import {\r\n\tAllCardsService,\r\n\tCardIds,\r\n\tCardType,\r\n\tGameTag,\r\n\tisBattlegroundsCard,\r\n\tRace,\r\n\tReferenceCard,\r\n} from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { groupByFunction, pickRandom } from '../services/utils';\r\nimport { getRaceEnum, hasMechanic, isCorrectTribe } from '../utils';\r\nimport { hasAvenge } from './card.interface';\r\nimport { cardMappings } from './impl/_card-mappings';\r\n\r\nexport const WHELP_CARD_IDS = [\r\n\tCardIds.RedWhelp_BGS_019,\r\n\tCardIds.RedWhelp_TB_BaconUps_102,\r\n\tCardIds.Onyxia_OnyxianWhelpToken,\r\n];\r\n\r\nexport const validBonusKeywords = [\r\n\tGameTag.TAUNT,\r\n\tGameTag.DIVINE_SHIELD,\r\n\tGameTag.VENOMOUS,\r\n\tGameTag.POISONOUS,\r\n\tGameTag.WINDFURY,\r\n\tGameTag.STEALTH,\r\n\tGameTag.REBORN,\r\n];\r\n\r\nexport const hasKeyword = (entity: BoardEntity, keyword: GameTag) => {\r\n\tswitch (keyword) {\r\n\t\tcase GameTag.TAUNT:\r\n\t\t\treturn entity.taunt;\r\n\t\tcase GameTag.DIVINE_SHIELD:\r\n\t\t\treturn entity.divineShield;\r\n\t\tcase GameTag.VENOMOUS:\r\n\t\t\treturn entity.venomous;\r\n\t\tcase GameTag.WINDFURY:\r\n\t\t\treturn entity.windfury;\r\n\t\tcase GameTag.STEALTH:\r\n\t\t\treturn entity.stealth;\r\n\t\tcase GameTag.REBORN:\r\n\t\t\treturn entity.reborn;\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n};\r\n\r\nexport class CardsData {\r\n\tpublic ghastcoilerSpawns: readonly string[];\r\n\tpublic impMamaSpawns: readonly string[];\r\n\tpublic demonSpawns: readonly string[];\r\n\tpublic gentleDjinniSpawns: readonly string[];\r\n\tpublic kilrekSpawns: readonly string[];\r\n\tpublic battlecryMinions: readonly string[];\r\n\tpublic deathrattleMinions: readonly string[];\r\n\tpublic pirateSpawns: readonly string[];\r\n\tpublic beastSpawns: readonly string[];\r\n\tpublic scrapScraperSpawns: readonly string[];\r\n\tpublic endOfTurnMinions: readonly string[];\r\n\r\n\tpublic putricidePool1: readonly string[];\r\n\tpublic putricidePool2: readonly string[];\r\n\tpublic putridicePool2ForEternalSummoner: readonly string[];\r\n\r\n\tprivate pool: readonly ReferenceCard[];\r\n\tprivate minionsForTier: { [key: string]: readonly ReferenceCard[] };\r\n\r\n\tconstructor(private readonly allCards: AllCardsService, init = true) {\r\n\t\tif (init) {\r\n\t\t\tthis.inititialize();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic inititialize(validTribes?: readonly Race[], anomalies?: readonly string[]): void {\r\n\t\tconst poolWithGolden = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => isBattlegroundsCard(card))\r\n\t\t\t// Premiums are not in bacon pool\r\n\t\t\t.filter((card) => card.isBaconPool || this.allCards.getCard(card.battlegroundsNormalDbfId)?.isBaconPool)\r\n\t\t\t.filter((card) => !!card.techLevel)\r\n\t\t\t.filter((card) => card.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((card) => !hasMechanic(card, GameTag[GameTag.BACON_BUDDY]))\r\n\t\t\t.filter((card) => card.set !== 'Vanilla')\r\n\t\t\t.filter((card) =>\r\n\t\t\t\tanomalies?.includes(CardIds.BigLeague_BG27_Anomaly_100)\r\n\t\t\t\t\t? card.techLevel >= 3\r\n\t\t\t\t\t: anomalies?.includes(CardIds.LittleLeague_BG27_Anomaly_800)\r\n\t\t\t\t\t? card.techLevel <= 4\r\n\t\t\t\t\t: true,\r\n\t\t\t);\r\n\t\tthis.pool = poolWithGolden\r\n\t\t\t.filter((card) => this.isValidTribe(validTribes, card.races))\r\n\t\t\t.filter((card) =>\r\n\t\t\t\tanomalies?.includes(CardIds.TheGoldenArena_BG27_Anomaly_801)\r\n\t\t\t\t\t? this.isGolden(card)\r\n\t\t\t\t\t: !this.isGolden(card),\r\n\t\t\t);\r\n\t\tthis.minionsForTier = groupByFunction((card: ReferenceCard) => card.techLevel)(this.pool);\r\n\t\tthis.ghastcoilerSpawns = this.pool\r\n\t\t\t.filter((card) => card.id !== 'BGS_008')\r\n\t\t\t.filter((card) => hasMechanic(card, 'DEATHRATTLE'))\r\n\t\t\t.filter((card) => this.isValidTribe(validTribes, card.races))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.demonSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.DEMON)).map((card) => card.id);\r\n\t\tthis.impMamaSpawns = this.demonSpawns.filter((cardId) => cardId !== CardIds.ImpMama_BGS_044);\r\n\t\tthis.gentleDjinniSpawns = this.pool\r\n\t\t\t.filter((card) => isCorrectTribe(card.races, Race.ELEMENTAL))\r\n\t\t\t.filter((card) => card.id !== CardIds.GentleDjinni_BGS_121)\r\n\t\t\t.map((card) => card.id);\r\n\t\t// FIXME: just spawn a random undead instead of an Undead Creation\r\n\t\t// this.festergutSpawns = pool\r\n\t\t// \t.filter((card) => !this.isGolden(card))\r\n\t\t// \t.filter((card) => isCorrectTribe(card.races, Race.UNDEAD))\r\n\t\t// \t.filter((card) => card.id !== CardIds.Festergut_BG25_HERO_100_Buddy)\r\n\t\t// \t// .filter((card) => REMOVED_CARD_IDS.indexOf(card.id) === -1)\r\n\t\t// \t.map((card) => card.id);\r\n\t\tthis.kilrekSpawns = this.pool\r\n\t\t\t.filter((card) => isCorrectTribe(card.races, Race.DEMON))\r\n\t\t\t.filter((card) => card.id !== CardIds.Kilrek_TB_BaconShop_HERO_37_Buddy)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.battlecryMinions = this.pool.filter((card) => hasMechanic(card, 'BATTLECRY')).map((card) => card.id);\r\n\t\tthis.deathrattleMinions = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.DEATHRATTLE]))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.pirateSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.PIRATE)).map((card) => card.id);\r\n\t\tthis.beastSpawns = this.pool.filter((card) => isCorrectTribe(card.races, Race.BEAST)).map((card) => card.id);\r\n\t\tthis.scrapScraperSpawns = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.MAGNETIC]))\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.endOfTurnMinions = this.pool\r\n\t\t\t.filter((card) => hasMechanic(card, GameTag[GameTag.END_OF_TURN]))\r\n\t\t\t.map((card) => card.id);\r\n\r\n\t\tthis.putricidePool1 = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool1)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.putricidePool2 = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool2)\r\n\t\t\t.map((card) => card.id);\r\n\t\tthis.putridicePool2ForEternalSummoner = this.allCards\r\n\t\t\t.getCards()\r\n\t\t\t.filter((card) => card.battlegroundsPutridicePool2)\r\n\t\t\t.filter((card) => !card.battlegroundsPutridiceSummonerExclusion)\r\n\t\t\t.map((card) => card.id);\r\n\t}\r\n\r\n\tpublic avengeValue(cardId: string): number {\r\n\t\tconst avengeImpl = cardMappings[cardId];\r\n\t\tif (hasAvenge(avengeImpl)) {\r\n\t\t\treturn avengeImpl.baseAvengeValue(cardId);\r\n\t\t}\r\n\t\tswitch (cardId) {\r\n\t\t\tcase CardIds.HungeringAbomination_BG25_014:\r\n\t\t\tcase CardIds.HungeringAbomination_BG25_014_G:\r\n\t\t\t// Not technically an avenge, but behaves as if\r\n\t\t\t// case CardIds.ShadowyConstruct_BG25_HERO_103_Buddy:\r\n\t\t\t// case CardIds.ShadowyConstruct_BG25_HERO_103_Buddy_G:\r\n\t\t\tcase CardIds.IceSickle:\r\n\t\t\t\treturn 1;\r\n\t\t\tcase CardIds.GhoulOfTheFeast_BG25_002:\r\n\t\t\tcase CardIds.GhoulOfTheFeast_BG25_002_G:\r\n\t\t\tcase CardIds.MechanoTank_BG21_023:\r\n\t\t\tcase CardIds.MechanoTank_BG21_023_G:\r\n\t\t\tcase CardIds.PalescaleCrocolisk_BG21_001:\r\n\t\t\tcase CardIds.PalescaleCrocolisk_BG21_001_G:\r\n\t\t\tcase CardIds.StormpikeLieutenant_BG22_HERO_003_Buddy:\r\n\t\t\tcase CardIds.StormpikeLieutenant_BG22_HERO_003_Buddy_G:\r\n\t\t\tcase CardIds.VanndarStormpike_LeadTheStormpikes:\r\n\t\t\tcase CardIds.Drekthar_LeadTheFrostwolves:\r\n\t\t\tcase CardIds.Bristlebach_BG26_157:\r\n\t\t\tcase CardIds.Bristlebach_BG26_157_G:\r\n\t\t\t\treturn 2;\r\n\t\t\tcase CardIds.BuddingGreenthumb_BG21_030:\r\n\t\t\tcase CardIds.BuddingGreenthumb_BG21_030_G:\r\n\t\t\t// case CardIds.FrostwolfLieutenant:\r\n\t\t\t// case CardIds.FrostwolfLieutenantBattlegrounds:\r\n\t\t\tcase CardIds.PashmarTheVengeful_BG23_014:\r\n\t\t\tcase CardIds.PashmarTheVengeful_BG23_014_G:\r\n\t\t\tcase CardIds.WitchwingNestmatron_BG21_038:\r\n\t\t\tcase CardIds.WitchwingNestmatron_BG21_038_G:\r\n\t\t\tcase CardIds.BoomSquad_BG27_Reward_502:\r\n\t\t\tcase CardIds.TremblingTrolley_BG28_967:\r\n\t\t\tcase CardIds.TremblingTrolley_BG28_967_G:\r\n\t\t\tcase CardIds.FridgeMagnet_BG30_MagicItem_545:\r\n\t\t\t\treturn 3;\r\n\t\t\tcase CardIds.GilneanThornedRose_BG30_MagicItem_864:\r\n\t\t\tcase CardIds.Onyxia_Broodmother:\r\n\t\t\tcase CardIds.ImpatientDoomsayer_BG21_007:\r\n\t\t\tcase CardIds.ImpatientDoomsayer_BG21_007_G:\r\n\t\t\tcase CardIds.Sisefin_BG21_009:\r\n\t\t\tcase CardIds.Sisefin_BG21_009_G:\r\n\t\t\tcase CardIds.TonyTwoTusk_BG21_031:\r\n\t\t\tcase CardIds.TonyTwoTusk_BG21_031_G:\r\n\t\t\t// case CardIds.ScrapScraper_BG26_148:\r\n\t\t\t// case CardIds.ScrapScraper_BG26_148_G:\r\n\t\t\tcase CardIds.RelentlessSentry_BG25_003:\r\n\t\t\tcase CardIds.RelentlessSentry_BG25_003_G:\r\n\t\t\tcase CardIds.PhaerixWrathOfTheSun_BG28_403:\r\n\t\t\tcase CardIds.PhaerixWrathOfTheSun_BG28_403_G:\r\n\t\t\tcase CardIds.TumblingDisaster_BG28_Reward_505:\r\n\t\t\tcase CardIds.CycleOfEnergy_BG28_Reward_504:\r\n\t\t\tcase CardIds.AugmentedLaborer_BG28_740:\r\n\t\t\tcase CardIds.AugmentedLaborer_BG28_740_G:\r\n\t\t\tcase CardIds.MurglMkIi_BG29_991:\r\n\t\t\tcase CardIds.MurglMkIi_BG29_991_G:\r\n\t\t\tcase CardIds.QuilligraphySet_QuilligraphySetToken_BG30_MagicItem_410t2:\r\n\t\t\tcase CardIds.QuilligraphySet_BG30_MagicItem_410:\r\n\t\t\t\treturn 4;\r\n\t\t\tcase CardIds.RelentlessMurghoul_BG27_010:\r\n\t\t\tcase CardIds.RelentlessMurghoul_BG27_010_G:\r\n\t\t\tcase CardIds.StaffOfTheScourge_BG30_MagicItem_437:\r\n\t\t\t\treturn 5;\r\n\t\t\tcase CardIds.BleedingHeart_BG30_MagicItem_713:\r\n\t\t\tcase CardIds.StableAmalgamation_BG28_Reward_518:\r\n\t\t\t\treturn 7;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic defaultScriptDataNum(cardId: string): number {\r\n\t\tswitch (cardId) {\r\n\t\t\tcase CardIds.TumblingDisaster_BG28_Reward_505:\r\n\t\t\tcase CardIds.TwinSkyLanterns_BG30_MagicItem_822:\r\n\t\t\tcase CardIds.TwinSkyLanterns_TwinSkyLanternsToken_BG30_MagicItem_822t2:\r\n\t\t\tcase CardIds.BoomController_BG30_MagicItem_440:\r\n\t\t\tcase CardIds.AllianceKeychain_BG30_MagicItem_433:\r\n\t\t\tcase CardIds.AllianceKeychain_AllianceKeychainToken_BG30_MagicItem_433t:\r\n\t\t\tcase CardIds.DeathlyPhylactery_BG30_MagicItem_700:\r\n\t\t\tcase CardIds.PromoPortrait_BG30_MagicItem_918:\r\n\t\t\t\treturn 1;\r\n\t\t\tcase CardIds.JarOGems_BG30_MagicItem_546:\r\n\t\t\tcase CardIds.BloodGolemSticker_BG30_MagicItem_442:\r\n\t\t\t\treturn 2;\r\n\t\t\tcase CardIds.MechagonAdapter_BG30_MagicItem_910:\r\n\t\t\t\treturn 3;\r\n\t\t\tcase CardIds.ReinforcedShield_BG30_MagicItem_886:\r\n\t\t\t\treturn 4;\r\n\t\t\tdefault:\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getTavernLevel(cardId: string): number {\r\n\t\treturn this.allCards.getCard(cardId).techLevel ?? 1;\r\n\t}\r\n\r\n\tpublic getRandomMinionForTavernTier(tavernTier: number): string {\r\n\t\t// Tzvern tier can be undefined for hero-power specific tokens, like the Amalgam, or when\r\n\t\t// for some reason tokens end up in the shop. For now, defaulting to 1 for tavern\r\n\t\t// level seems to work in all cases\r\n\t\tconst minionsForTier = this.minionsForTier[tavernTier ?? 1];\r\n\t\tif (!minionsForTier?.length) {\r\n\t\t\tconsole.error('incorrect minions for tier', tavernTier);\r\n\t\t}\r\n\t\treturn pickRandom(this.minionsForTier[tavernTier ?? 1])?.id;\r\n\t}\r\n\r\n\tpublic getRandomMechToMagnetize(tavernLimitUpper: number): string {\r\n\t\tconst magneticMechs = this.pool\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => hasMechanic(m, GameTag[GameTag.MODULAR]));\r\n\t\tconst pool = magneticMechs.filter((m) => m.techLevel <= tavernLimitUpper);\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic getRandomMinionForTribe(\r\n\t\ttribe: Race,\r\n\t\ttavernLimitUpper: number,\r\n\t\texcludedCards: readonly string[] = [],\r\n\t): string {\r\n\t\tconst pool = this.pool\r\n\t\t\t.filter((m) => this.isValidTribe([tribe], m.races, false))\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => m.techLevel <= tavernLimitUpper)\r\n\t\t\t.filter((m) => !excludedCards.includes(m.id));\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic getRandomProtossMinion(tavernLimitUpper: number): string {\r\n\t\tconst pool = this.pool\r\n\t\t\t.filter((m) => m.mechanics?.includes(GameTag[GameTag.PROTOSS]))\r\n\t\t\t.filter((m) => m.type?.toUpperCase() === CardType[CardType.MINION])\r\n\t\t\t.filter((m) => m.techLevel <= tavernLimitUpper);\r\n\t\treturn pickRandom(pool)?.id;\r\n\t}\r\n\r\n\tpublic isGolden(card: ReferenceCard): boolean {\r\n\t\treturn card.premium;\r\n\t}\r\n\r\n\tprivate isValidTribe(validTribes: readonly Race[], cardRaces: readonly string[], allowEmptyRaces = true): boolean {\r\n\t\tif (!cardRaces?.length && allowEmptyRaces) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (cardRaces ?? [])\r\n\t\t\t.map((race) => getRaceEnum(race))\r\n\t\t\t.some((raceEnum) => raceEnum === Race.ALL || !validTribes?.length || validTribes.includes(raceEnum));\r\n\t}\r\n}\r\n"]}
|
|
@@ -5,10 +5,11 @@ const utils_1 = require("../../../services/utils");
|
|
|
5
5
|
const attack_1 = require("../../../simulation/attack");
|
|
6
6
|
exports.AimHigh = {
|
|
7
7
|
startOfCombatTiming: 'start-of-combat',
|
|
8
|
+
cardIds: ["BG22_HERO_000p_t3"],
|
|
8
9
|
startOfCombat: (trinket, input) => {
|
|
9
10
|
var _a;
|
|
10
11
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
11
|
-
if (heroPower.used) {
|
|
12
|
+
if (exports.AimHigh.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
12
13
|
const highestHealthMinion = [...input.opponentBoard].sort((a, b) => b.health - a.health)[0];
|
|
13
14
|
const target = (0, utils_1.pickRandom)(input.opponentBoard.filter((e) => e.health === highestHealthMinion.health));
|
|
14
15
|
const damageDone = (0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, null, (_a = heroPower.info2) !== null && _a !== void 0 ? _a : 0, input.playerBoard, input.playerEntity, input.gameState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aim-high.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-high.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aim-high.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-high.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,uDAAgE;AAInD,QAAA,OAAO,GAAsB;IACzC,mBAAmB,EAAE,iBAAiB;IACtC,OAAO,EAAE,qBAAsB;IAC/B,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,eAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACjE,MAAM,mBAAmB,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5F,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;gBACtG,MAAM,UAAU,GAAG,IAAA,2BAAkB,EACpC,MAAM,EACN,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,IAAI,EACJ,MAAA,SAAS,CAAC,KAAK,mCAAI,CAAC,EACpB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;gBAEF,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,UAAU,CAAC;gBAClD,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const AimHigh: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tcardIds: [CardIds.AimHighToken],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (AimHigh.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst highestHealthMinion = [...input.opponentBoard].sort((a, b) => b.health - a.health)[0];\r\n\t\t\t\tconst target = pickRandom(input.opponentBoard.filter((e) => e.health === highestHealthMinion.health));\r\n\t\t\t\tconst damageDone = dealDamageToMinion(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\theroPower.info2 ?? 0,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\t// processMinionDeath(playerBoard, playerEntity, opponentBoard, opponentEntity, allCards, cardsData, sharedState, spectator);\r\n\t\t\t\tinput.playerEntity.deadEyeDamageDone = damageDone;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,10 +4,11 @@ exports.AimLeft = void 0;
|
|
|
4
4
|
const attack_1 = require("../../../simulation/attack");
|
|
5
5
|
exports.AimLeft = {
|
|
6
6
|
startOfCombatTiming: 'start-of-combat',
|
|
7
|
+
cardIds: ["BG22_HERO_000p_t1"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
var _a;
|
|
9
10
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
10
|
-
if (heroPower.used) {
|
|
11
|
+
if (exports.AimLeft.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
11
12
|
const target = input.opponentBoard[0];
|
|
12
13
|
const damageDone = (0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, null, (_a = heroPower.info2) !== null && _a !== void 0 ? _a : 0, input.playerBoard, input.playerEntity, input.gameState);
|
|
13
14
|
input.playerEntity.deadEyeDamageDone = damageDone;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aim-left.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-left.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aim-left.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-left.ts"],"names":[],"mappings":";;;AAEA,uDAAgE;AAInD,QAAA,OAAO,GAAsB;IACzC,mBAAmB,EAAE,iBAAiB;IACtC,OAAO,EAAE,qBAAsB;IAC/B,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,eAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACjE,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;gBACtC,MAAM,UAAU,GAAG,IAAA,2BAAkB,EACpC,MAAM,EACN,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,IAAI,EACJ,MAAA,SAAS,CAAC,KAAK,mCAAI,CAAC,EACpB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,UAAU,CAAC;gBAClD,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const AimLeft: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tcardIds: [CardIds.AimLeftToken],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (AimLeft.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst target = input.opponentBoard[0];\r\n\t\t\t\tconst damageDone = dealDamageToMinion(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\theroPower.info2 ?? 0,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tinput.playerEntity.deadEyeDamageDone = damageDone;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -5,10 +5,11 @@ const utils_1 = require("../../../services/utils");
|
|
|
5
5
|
const attack_1 = require("../../../simulation/attack");
|
|
6
6
|
exports.AimLow = {
|
|
7
7
|
startOfCombatTiming: 'start-of-combat',
|
|
8
|
+
cardIds: ["BG22_HERO_000p_t2"],
|
|
8
9
|
startOfCombat: (trinket, input) => {
|
|
9
10
|
var _a;
|
|
10
11
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
11
|
-
if (heroPower.used) {
|
|
12
|
+
if (exports.AimLow.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
12
13
|
const smallestHealthMinion = [...input.opponentBoard].sort((a, b) => a.health - b.health)[0];
|
|
13
14
|
const target = (0, utils_1.pickRandom)(input.opponentBoard.filter((e) => e.health === smallestHealthMinion.health));
|
|
14
15
|
const damageDone = (0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, null, (_a = heroPower.info2) !== null && _a !== void 0 ? _a : 0, input.playerBoard, input.playerEntity, input.gameState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aim-low.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-low.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aim-low.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-low.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,uDAAgE;AAInD,QAAA,MAAM,GAAsB;IACxC,mBAAmB,EAAE,iBAAiB;IACtC,OAAO,EAAE,qBAAqB;IAC9B,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,cAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBAChE,MAAM,oBAAoB,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7F,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;gBACvG,MAAM,UAAU,GAAG,IAAA,2BAAkB,EACpC,MAAM,EACN,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,IAAI,EACJ,MAAA,SAAS,CAAC,KAAK,mCAAI,CAAC,EACpB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;gBAEF,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,UAAU,CAAC;gBAClD,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const AimLow: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tcardIds: [CardIds.AimLowToken],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (AimLow.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst smallestHealthMinion = [...input.opponentBoard].sort((a, b) => a.health - b.health)[0];\r\n\t\t\t\tconst target = pickRandom(input.opponentBoard.filter((e) => e.health === smallestHealthMinion.health));\r\n\t\t\t\tconst damageDone = dealDamageToMinion(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\theroPower.info2 ?? 0,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\t// processMinionDeath(playerBoard, playerEntity, opponentBoard, opponentEntity, allCards, cardsData, sharedState, spectator);\r\n\t\t\t\tinput.playerEntity.deadEyeDamageDone = damageDone;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,10 +4,11 @@ exports.AimRight = void 0;
|
|
|
4
4
|
const attack_1 = require("../../../simulation/attack");
|
|
5
5
|
exports.AimRight = {
|
|
6
6
|
startOfCombatTiming: 'start-of-combat',
|
|
7
|
+
cardIds: ["BG22_HERO_000p_t4"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
var _a;
|
|
9
10
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
10
|
-
if (heroPower.used) {
|
|
11
|
+
if (exports.AimRight.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
11
12
|
const target = input.opponentBoard[input.opponentBoard.length - 1];
|
|
12
13
|
const damageDone = (0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, null, (_a = heroPower.info2) !== null && _a !== void 0 ? _a : 0, input.playerBoard, input.playerEntity, input.gameState);
|
|
13
14
|
input.playerEntity.deadEyeDamageDone = damageDone;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aim-right.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-right.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aim-right.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/aim-right.ts"],"names":[],"mappings":";;;AAEA,uDAAgE;AAInD,QAAA,QAAQ,GAAsB;IAC1C,mBAAmB,EAAE,iBAAiB;IACtC,OAAO,EAAE,qBAAuB;IAChC,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBAClE,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBACnE,MAAM,UAAU,GAAG,IAAA,2BAAkB,EACpC,MAAM,EACN,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,IAAI,EACJ,MAAA,SAAS,CAAC,KAAK,mCAAI,CAAC,EACpB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,UAAU,CAAC;gBAClD,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const AimRight: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tcardIds: [CardIds.AimRightToken],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (AimRight.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst target = input.opponentBoard[input.opponentBoard.length - 1];\r\n\t\t\t\tconst damageDone = dealDamageToMinion(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\theroPower.info2 ?? 0,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tinput.playerEntity.deadEyeDamageDone = damageDone;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,9 +4,10 @@ exports.EarthInvocation = void 0;
|
|
|
4
4
|
const deathrattle_effects_1 = require("../../../simulation/deathrattle-effects");
|
|
5
5
|
exports.EarthInvocation = {
|
|
6
6
|
startOfCombatTiming: 'pre-combat',
|
|
7
|
+
cardIds: ["BG22_HERO_001p_t1", "BG22_HERO_001p_t1_s"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
9
|
-
if (heroPower.used) {
|
|
10
|
+
if (exports.EarthInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
10
11
|
(0, deathrattle_effects_1.applyEarthInvocationEnchantment)(input.playerBoard, null, input.playerEntity, input.gameState);
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earth-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/earth-invocation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"earth-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/earth-invocation.ts"],"names":[],"mappings":";;;AAEA,iFAA0F;AAI7E,QAAA,eAAe,GAAsB;IACjD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,4CAAuD;IAChE,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,uBAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACzE,IAAA,qDAA+B,EAAC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;gBAC9F,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { applyEarthInvocationEnchantment } from '../../../simulation/deathrattle-effects';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const EarthInvocation: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.EarthInvocationToken, CardIds.EarthInvocation],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (EarthInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tapplyEarthInvocationEnchantment(input.playerBoard, null, input.playerEntity, input.gameState);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -6,9 +6,10 @@ const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
|
|
|
6
6
|
const spawns_1 = require("../../../simulation/spawns");
|
|
7
7
|
exports.EmbraceYourRage = {
|
|
8
8
|
startOfCombatTiming: 'pre-combat',
|
|
9
|
+
cardIds: ["TB_BaconShop_HP_103"],
|
|
9
10
|
startOfCombat: (trinket, input) => {
|
|
10
11
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
11
|
-
if (heroPower.used) {
|
|
12
|
+
if (exports.EmbraceYourRage.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
12
13
|
const createdCardId = heroPower.info;
|
|
13
14
|
if (!(createdCardId === null || createdCardId === void 0 ? void 0 : createdCardId.length)) {
|
|
14
15
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embrace-your-rage.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/embrace-your-rage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"embrace-your-rage.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/embrace-your-rage.ts"],"names":[],"mappings":";;;AAEA,qEAAmE;AACnE,+EAAuE;AACvE,uDAAiE;AAIpD,QAAA,eAAe,GAAsB;IACjD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,uBAAyB;IAClC,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,uBAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACzE,MAAM,aAAa,GAAG,SAAS,CAAC,IAAc,CAAC;gBAC/C,IAAI,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAA,EAAE;oBAC3B,OAAO,KAAK,CAAC;iBACb;gBAED,MAAM,MAAM,GAAG,IAAA,kCAAa,EAC3B,aAAa,EACb,CAAC,EACD,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,CAAC,QAAQ,EACxB,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,SAAS,CAAC,WAAW,EAC3B,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,YAAY,CAAC,QAAQ,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,CACL,CAAC;gBACF,MAAM,cAAc,GAAG,CAAC,CAAC;gBACzB,MAAM,OAAO,GAAG,IAAA,4BAAmB,EAClC,MAAM,EACN,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,YAAY,EAClB,cAAc,EACd,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;oBACpB,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,MAAM,CAAC,CAAC,CAAC,EACT,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;oBACF,IAAA,8BAAc,EAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBAC/E,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,MAAM,CAAC,CAAC,CAAC,EACT,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;oBACF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC;iBACpE;aACD;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { addCardsInHand } from '../../../simulation/cards-in-hand';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const EmbraceYourRage: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.EmbraceYourRage],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (EmbraceYourRage.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst createdCardId = heroPower.info as string;\r\n\t\t\t\tif (!createdCardId?.length) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst spawns = spawnEntities(\r\n\t\t\t\t\tcreatedCardId,\r\n\t\t\t\t\t1,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tinput.gameState.allCards,\r\n\t\t\t\t\tinput.gameState.cardsData,\r\n\t\t\t\t\tinput.gameState.sharedState,\r\n\t\t\t\t\tinput.gameState.spectator,\r\n\t\t\t\t\tinput.playerEntity.friendly,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t);\r\n\t\t\t\tconst indexFromRight = 0;\r\n\t\t\t\tconst spawned = performEntitySpawns(\r\n\t\t\t\t\tspawns,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tindexFromRight,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tif (spawned?.length) {\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tspawns[0],\r\n\t\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t);\r\n\t\t\t\t\taddCardsInHand(input.playerEntity, input.playerBoard, spawns, input.gameState);\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tspawns[0],\r\n\t\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: true };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,9 +4,10 @@ exports.FireInvocation = void 0;
|
|
|
4
4
|
const deathrattle_effects_1 = require("../../../simulation/deathrattle-effects");
|
|
5
5
|
exports.FireInvocation = {
|
|
6
6
|
startOfCombatTiming: 'pre-combat',
|
|
7
|
+
cardIds: ["BG22_HERO_001p_t2", "BG22_HERO_001p_t2_s"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
9
|
-
if (heroPower.used) {
|
|
10
|
+
if (exports.FireInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
10
11
|
(0, deathrattle_effects_1.applyFireInvocationEnchantment)(input.playerBoard, input.playerEntity, null, input.playerEntity, input.gameState);
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fire-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/fire-invocation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fire-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/fire-invocation.ts"],"names":[],"mappings":";;;AAEA,iFAAyF;AAI5E,QAAA,cAAc,GAAsB;IAChD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,4CAAqD;IAC9D,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,sBAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACxE,IAAA,oDAA8B,EAC7B,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,IAAI,EACJ,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { applyFireInvocationEnchantment } from '../../../simulation/deathrattle-effects';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const FireInvocation: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.FireInvocationToken, CardIds.FireInvocation],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (FireInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tapplyFireInvocationEnchantment(\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -5,9 +5,10 @@ const utils_1 = require("../../../services/utils");
|
|
|
5
5
|
const stats_1 = require("../../../simulation/stats");
|
|
6
6
|
exports.FragrantPhylactery = {
|
|
7
7
|
startOfCombatTiming: 'pre-combat',
|
|
8
|
+
cardIds: ["BG20_HERO_282p"],
|
|
8
9
|
startOfCombat: (trinket, input) => {
|
|
9
10
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
10
|
-
if (heroPower.used) {
|
|
11
|
+
if (exports.FragrantPhylactery.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
11
12
|
const chosenEntity = (0, utils_1.pickRandomLowestHealth)(input.playerBoard);
|
|
12
13
|
if (!chosenEntity) {
|
|
13
14
|
console.warn('could not pick any entity for tamsin');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragrant-phylactery.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/fragrant-phylactery.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fragrant-phylactery.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/fragrant-phylactery.ts"],"names":[],"mappings":";;;AAEA,mDAAiE;AAEjE,qDAAwD;AAG3C,QAAA,kBAAkB,GAAsB;IACpD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,kBAAwC;IACjD,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,0BAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBAC5E,MAAM,YAAY,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAC/D,IAAI,CAAC,YAAY,EAAE;oBAClB,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;oBACrD,OAAO,KAAK,CAAC;iBACb;gBAED,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,YAAY,EACZ,KAAK,CAAC,WAAW,EACjB,IAAI,EACJ,IAAI,CACJ,CAAC;gBACF,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAEvF,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC;gBACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;oBACtB,IAAA,mBAAW,EACV,CAAC,EACD,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,EACnB,QAAQ,EACR,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;oBACF,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,YAAY,EACZ,CAAC,EACD,QAAQ,EACR,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;gBACH,CAAC,CAAC,CAAC;gBAIH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC;aACpE;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { pickRandomLowestHealth } from '../../../services/utils';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const FragrantPhylactery: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.TamsinRoame_FragrantPhylactery],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (FragrantPhylactery.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst chosenEntity = pickRandomLowestHealth(input.playerBoard);\r\n\t\t\t\tif (!chosenEntity) {\r\n\t\t\t\t\tconsole.warn('could not pick any entity for tamsin');\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tchosenEntity,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t);\r\n\t\t\t\tconst newBoard = input.playerBoard.filter((e) => e.entityId !== chosenEntity.entityId);\r\n\t\t\t\t// How to mark the minion as dead\r\n\t\t\t\tchosenEntity.definitelyDead = true;\r\n\t\t\t\tnewBoard.forEach((e) => {\r\n\t\t\t\t\tmodifyStats(\r\n\t\t\t\t\t\te,\r\n\t\t\t\t\t\tchosenEntity.attack,\r\n\t\t\t\t\t\tchosenEntity.health,\r\n\t\t\t\t\t\tnewBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tchosenEntity,\r\n\t\t\t\t\t\te,\r\n\t\t\t\t\t\tnewBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\t\t\t\t// Tamsin's hero power somehow happens before the current attacker is chosen.\r\n\t\t\t\t// See http://replays.firestoneapp.com/?reviewId=bce94e6b-c807-48e4-9c72-2c5c04421213&turn=6&action=9\r\n\t\t\t\t// Even worse: if a scallywag token pops, it attacks before the first attacker is recomputed\r\n\t\t\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: true };\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -9,7 +9,7 @@ exports.GloriousGloop = {
|
|
|
9
9
|
startOfCombat: (trinket, input) => {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
12
|
-
if (heroPower.used) {
|
|
12
|
+
if (exports.GloriousGloop.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
13
13
|
if (!((_a = input.playerBoard) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glorious-gloop.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/glorious-gloop.ts"],"names":[],"mappings":";;;AAGA,mDAAqD;AAErD,0CAA8E;AAGjE,QAAA,aAAa,GAAsB;IAC/C,OAAO,EAAE,mBAAyD;IAClE,mBAAmB,EAAE,YAAY;IACjC,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,SAAS,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"glorious-gloop.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/glorious-gloop.ts"],"names":[],"mappings":";;;AAGA,mDAAqD;AAErD,0CAA8E;AAGjE,QAAA,aAAa,GAAsB;IAC/C,OAAO,EAAE,mBAAyD;IAClE,mBAAmB,EAAE,YAAY;IACjC,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,qBAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACvE,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,MAAM,CAAA,EAAE;oBAC/B,OAAO,KAAK,CAAC;iBACb;gBACD,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;;oBAC3C,OAAA,MAAA,CAAC,CAAC,YAAY,0CAAE,IAAI,CACnB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,wBAAkE,CACjF,CAAA;iBAAA,CACD,C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,EACN,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;gBAEF,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAChD,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { addImpliedMechanics, getTeammateInitialState } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const GloriousGloop: StartOfCombatCard = {\r\n\tcardIds: [CardIds.FlobbidinousFloop_GloriousGloop_BGDUO_HERO_101p],\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (GloriousGloop.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tif (!input.playerBoard?.length) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tconst target = input.playerBoard.find((m) =>\r\n\t\t\t\t\tm.enchantments?.some(\r\n\t\t\t\t\t\t(e) => e.cardId === CardIds.GloriousGloop_InTheGloopEnchantment_BGDUO_HERO_101pe2,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\tif (!target) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst teammateState = getTeammateInitialState(input.gameState.gameState, input.playerEntity);\r\n\t\t\t\tif (!teammateState?.board?.length) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tconst highestTier = Math.max(\r\n\t\t\t\t\t...teammateState.board.map((entity) => input.gameState.allCards.getCard(entity.cardId).techLevel),\r\n\t\t\t\t);\r\n\t\t\t\tconst candidates = teammateState.board.filter(\r\n\t\t\t\t\t(entity) => input.gameState.allCards.getCard(entity.cardId).techLevel === highestTier,\r\n\t\t\t\t);\r\n\t\t\t\tif (!candidates.length) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tconst highestTierMinion = pickRandom(candidates);\r\n\t\t\t\tconst clone: BoardEntity = addImpliedMechanics(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t...highestTierMinion,\r\n\t\t\t\t\t\tentityId: input.gameState.sharedState.currentEntityId++,\r\n\t\t\t\t\t\tlastAffectedByEntity: null,\r\n\t\t\t\t\t\tdefinitelyDead: false,\r\n\t\t\t\t\t\tattackImmediately: false,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tinput.gameState.cardsData,\r\n\t\t\t\t);\r\n\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t);\r\n\t\t\t\t// Replace the \"target\" minion with the \"clone\"\r\n\t\t\t\tconst index = input.playerBoard.indexOf(target);\r\n\t\t\t\tinput.playerBoard.splice(index, 1, clone);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,9 +4,10 @@ exports.LightningInvocation = void 0;
|
|
|
4
4
|
const deathrattle_effects_1 = require("../../../simulation/deathrattle-effects");
|
|
5
5
|
exports.LightningInvocation = {
|
|
6
6
|
startOfCombatTiming: 'pre-combat',
|
|
7
|
+
cardIds: ["BG22_HERO_001p_t4", "BG22_HERO_001p_t4_s"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
9
|
-
if (heroPower.used) {
|
|
10
|
+
if (exports.LightningInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
10
11
|
(0, deathrattle_effects_1.applyLightningInvocationEnchantment)(input.playerBoard, input.playerEntity, null, input.opponentBoard, input.opponentEntity, input.gameState);
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightning-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/lightning-invocation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"lightning-invocation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/lightning-invocation.ts"],"names":[],"mappings":";;;AAEA,iFAA8F;AAIjF,QAAA,mBAAmB,GAAsB;IACrD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,4CAA+D;IACxE,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,2BAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBAC7E,IAAA,yDAAmC,EAClC,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,IAAI,EACJ,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { applyLightningInvocationEnchantment } from '../../../simulation/deathrattle-effects';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const LightningInvocation: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.LightningInvocationToken, CardIds.LightningInvocation],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (LightningInvocation.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tapplyLightningInvocationEnchantment(\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,9 +4,10 @@ exports.RapidReanimation = void 0;
|
|
|
4
4
|
const utils_1 = require("../../../utils");
|
|
5
5
|
exports.RapidReanimation = {
|
|
6
6
|
startOfCombatTiming: 'pre-combat',
|
|
7
|
+
cardIds: ["BG25_HERO_103p"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
9
|
-
if (heroPower.used) {
|
|
10
|
+
if (exports.RapidReanimation.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
10
11
|
const minionThatWillDie = input.playerBoard
|
|
11
12
|
.filter((m) => m.enchantments.some((e) => e.cardId === "BG25_HERO_103pe"))
|
|
12
13
|
.sort((a, b) => b.enchantments.find((e) => e.cardId === "BG25_HERO_103pe")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rapid-reanimation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/rapid-reanimation.ts"],"names":[],"mappings":";;;AAGA,0CAA4C;AAG/B,QAAA,gBAAgB,GAAsB;IAClD,mBAAmB,EA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C,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;oBACnF,KAAK,CAAC,YAAY,CAAC,8BAA8B;wBAChD,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,6BAA6B,CAAC;oBAC9D,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,iBAAiB,CAAC,CAAC;oBAGnD,KAAK,CAAC,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC;oBACzD,iBAAiB,CAAC,cAAc,GAAG,IAAI,CAAC;oBACxC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,iBAAiB,EACjB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;oBACF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC;iBACpE;aACD;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { copyEntity } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const RapidReanimation: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.TeronGorefiend_RapidReanimation],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (RapidReanimation.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\t// Getting the right enchantment can be tricky. The RapidReanimation enchantment can sometimes be\r\n\t\t\t\t// in the Graveyard zone, so we can't filter them out. In that case, we can have multiple\r\n\t\t\t\t// enchantments\r\n\t\t\t\t// However, because of how things are handled in the logs, we should be able to always take the one *\r\n\t\t\t\t// with the biggest entityId\r\n\t\t\t\tconst minionThatWillDie = input.playerBoard\r\n\t\t\t\t\t.filter((m) =>\r\n\t\t\t\t\t\tm.enchantments.some((e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment),\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.sort(\r\n\t\t\t\t\t\t(a, b) =>\r\n\t\t\t\t\t\t\tb.enchantments.find((e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment)\r\n\t\t\t\t\t\t\t\t.originEntityId -\r\n\t\t\t\t\t\t\t\ta.enchantments.find(\r\n\t\t\t\t\t\t\t\t\t(e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment,\r\n\t\t\t\t\t\t\t\t).originEntityId || b.entityId - a.entityId,\r\n\t\t\t\t\t)[0];\r\n\t\t\t\tif (minionThatWillDie) {\r\n\t\t\t\t\t// So this is a bit tricky (as all the stuff with indices...). Because in practice it's more likely that players use Rapid Reanimation\r\n\t\t\t\t\t// on minions that they want to die quickly, most of the time they will be placed\r\n\t\t\t\t\t// to the left of the board\r\n\t\t\t\t\t// So using a left-based index (usually 0) is more likely to be correct after minions spawn on the board\r\n\t\t\t\t\t// Update: this looks like it's not the case, and looking at\r\n\t\t\t\t\t// http://replays.firestoneapp.com/?reviewId=2e6b389f-d904-43a2-a7cd-928a60d973ce&turn=11&action=1\r\n\t\t\t\t\t// the index seems to be right-based at least in some cases\r\n\t\t\t\t\t// Looks like even this is wrong:\r\n\t\t\t\t\t// http://replays.firestoneapp.com/?reviewId=9a46ab39-ccf0-478c-a010-68f2abb06c6f&turn=9&action=0\r\n\t\t\t\t\tconst rapidReanimationIndexFromLeft = input.playerBoard.indexOf(minionThatWillDie);\r\n\t\t\t\t\tinput.playerEntity.rapidReanimationIndexFromRight =\r\n\t\t\t\t\t\tinput.playerBoard.length - 1 - rapidReanimationIndexFromLeft;\r\n\t\t\t\t\tconst minionToCopy = copyEntity(minionThatWillDie);\r\n\t\t\t\t\t// We don't reapply auras when resummoning\r\n\t\t\t\t\t// removeAurasFromSelf(minionToCopy, input.playerBoard, input.playerEntity, input.gameState);\r\n\t\t\t\t\tinput.playerEntity.rapidReanimationMinion = minionToCopy;\r\n\t\t\t\t\tminionThatWillDie.definitelyDead = true;\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tminionThatWillDie,\r\n\t\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: true };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,9 +4,10 @@ exports.RebornRites = void 0;
|
|
|
4
4
|
const reborn_1 = require("../../../keywords/reborn");
|
|
5
5
|
exports.RebornRites = {
|
|
6
6
|
startOfCombatTiming: 'pre-combat',
|
|
7
|
+
cardIds: ["TB_BaconShop_HP_024"],
|
|
7
8
|
startOfCombat: (trinket, input) => {
|
|
8
9
|
for (const heroPower of input.playerEntity.heroPowers) {
|
|
9
|
-
if (heroPower.used) {
|
|
10
|
+
if (exports.RebornRites.cardIds.includes(heroPower.cardId) && heroPower.used) {
|
|
10
11
|
const targetEntityId = heroPower.info;
|
|
11
12
|
const target = input.playerBoard.find((entity) => entity.entityId === targetEntityId);
|
|
12
13
|
if (!target || target.reborn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reborn-rites.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/reborn-rites.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"reborn-rites.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/reborn-rites.ts"],"names":[],"mappings":";;;AAEA,qDAAwD;AAI3C,QAAA,WAAW,GAAsB;IAC7C,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,uBAAqB;IAC9B,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,mBAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBACrE,MAAM,cAAc,GAAG,SAAS,CAAC,IAAc,CAAC;gBAChD,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC;gBACtF,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;oBAC7B,OAAO,KAAK,CAAC;iBACb;gBAED,IAAA,qBAAY,EACX,MAAM,EACN,IAAI,EACJ,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,MAAM,EACN,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;gBACF,OAAO,IAAI,CAAC;aACZ;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { updateReborn } from '../../../keywords/reborn';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const RebornRites: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.RebornRites],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (RebornRites.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\tconst targetEntityId = heroPower.info as number;\r\n\t\t\t\tconst target = input.playerBoard.find((entity) => entity.entityId === targetEntityId);\r\n\t\t\t\tif (!target || target.reborn) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdateReborn(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|