@firestone-hs/simulate-bgs-battle 1.1.374 → 1.1.376
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.
|
@@ -113,7 +113,7 @@ const handleSpawnEffect = (board, boardHero, otherHero, spawned, allCards, spect
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
const handleAddedMinionAuraEffect = (board, boardHero, spawned, allCards, spectator, sharedState) => {
|
|
116
|
-
var _a, _b, _c, _d
|
|
116
|
+
var _a, _b, _c, _d;
|
|
117
117
|
switch (boardHero.heroPowerId) {
|
|
118
118
|
case "TB_BaconShop_HP_107":
|
|
119
119
|
spawned.taunt = true;
|
|
@@ -134,13 +134,13 @@ const handleAddedMinionAuraEffect = (board, boardHero, spawned, allCards, specta
|
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
if ((_a = boardHero.questRewards) === null || _a === void 0 ? void 0 : _a.includes("BG28_Reward_505")) {
|
|
137
|
-
const tumblingDisasterBonus = (
|
|
137
|
+
const tumblingDisasterBonus = ((_c = (_b = boardHero.questRewardEntities) === null || _b === void 0 ? void 0 : _b.find((e) => e.cardId === "BG28_Reward_505")) === null || _c === void 0 ? void 0 : _c.scriptDataNum1) || 1;
|
|
138
138
|
(0, utils_1.modifyAttack)(spawned, tumblingDisasterBonus, board, allCards);
|
|
139
139
|
(0, utils_1.modifyHealth)(spawned, tumblingDisasterBonus, board, allCards);
|
|
140
140
|
(0, utils_1.afterStatsUpdate)(spawned, board, allCards);
|
|
141
141
|
}
|
|
142
142
|
(0, exports.applyAurasToSelf)(spawned, board, boardHero, allCards, sharedState, spectator);
|
|
143
|
-
const cardIds = [spawned.cardId, ...((
|
|
143
|
+
const cardIds = [spawned.cardId, ...((_d = spawned.additionalCards) !== null && _d !== void 0 ? _d : [])];
|
|
144
144
|
for (const spawnedCardId of cardIds) {
|
|
145
145
|
handleMinionAddedAuraEffect(spawnedCardId, spawned, board, boardHero, allCards, spectator, sharedState);
|
|
146
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-minion-to-board.js","sourceRoot":"","sources":["../../src/simulation/add-minion-to-board.ts"],"names":[],"mappings":";;;AAAA,iEAA8E;AAG9E,oDAAqD;AACrD,oCASkB;AAIX,MAAM,iBAAiB,GAAG,CAChC,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,KAAa,EACb,YAAoC,EACpC,QAAyB,EACzB,SAAoB,EACpB,WAAwB,EACjB,EAAE;IACT,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACxC,KAAK,MAAM,WAAW,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,IAAA,wBAAgB,EAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;KAC3G;IACD,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC3F,CAAC,CAAC;AAfW,QAAA,iBAAiB,qBAe5B;AAEK,MAAM,gBAAgB,GAAG,CAC/B,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,KAAa,EACb,WAAwB,EACxB,QAAyB,EACzB,SAAoB,EACpB,WAAwB,EACxB,wBAAwB,GAAG,IAAI,EACxB,EAAE;IACT,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IAEpC,IAAA,mCAA2B,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7F,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CA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AAK,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ,EAAE;oBAC3F,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,iBAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC/E,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;oBACnD,IAAA,wBAAgB,EAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC1C;gBACD,MAAM;YACP,kBAAwC;YACxC;gBACC,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;oBACnC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,mBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACpF,IAAA,uBAAe,EAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;iBACrE;gBACD,MAAM;YAGP;gBACC,IAAI,IAAA,uBAAe,EAAC,OAAO,EAAE,qBAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ,EAAE;oBAC5F,IAAA,oBAAY,EAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;oBAC1C,IAAA,wBAAgB,EAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;oBAC1C,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;iBACjE;gBACD,MAAM;SACP;KACD;AACF,CAAC,CAAC","sourcesContent":["import { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { WHELP_CARD_IDS } from '../cards/cards-data';\r\nimport {\r\n\taddStatsToBoard,\r\n\tafterStatsUpdate,\r\n\thasCorrectTribe,\r\n\tisCorrectTribe,\r\n\tmodifyAttack,\r\n\tmodifyHealth,\r\n\tsetEntityStats,\r\n\tupdateDivineShield,\r\n} from '../utils';\r\nimport { SharedState } from './shared-state';\r\nimport { Spectator } from './spectator/spectator';\r\n\r\nexport const addMinionsToBoard = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tindex: number,\r\n\tminionsToAdd: readonly BoardEntity[],\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tboard.splice(index, 0, ...minionsToAdd);\r\n\tfor (const minionToAdd of [...minionsToAdd].reverse()) {\r\n\t\taddMinionToBoard(board, boardHero, otherHero, index, minionToAdd, allCards, spectator, sharedState, false);\r\n\t}\r\n\thandleAfterSpawnEffects(board, boardHero, minionsToAdd, allCards, sharedState, spectator);\r\n};\r\n\r\nexport const addMinionToBoard = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tindex: number,\r\n\tminionToAdd: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n\tperformAfterSpawnEffects = true,\r\n): void => {\r\n\tboard.splice(index, 0, minionToAdd);\r\n\t// Minion has already been removed from the board in the previous step\r\n\thandleAddedMinionAuraEffect(board, boardHero, minionToAdd, allCards, spectator, sharedState);\r\n\thandleSpawnEffect(board, boardHero, otherHero, minionToAdd, allCards, spectator, sharedState);\r\n\tif (performAfterSpawnEffects) {\r\n\t\thandleAfterSpawnEffects(board, boardHero, [minionToAdd], allCards, sharedState, spectator);\r\n\t}\r\n};\r\n\r\nconst handleSpawnEffect = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tconst cardIds = [spawned.cardId, ...(spawned.additionalCards ?? [])];\r\n\r\n\t// https://twitter.com/LoewenMitchell/status/1491879869457879040\r\n\tif (cardIds.some((cardId) => WHELP_CARD_IDS.includes(cardId as CardIds))) {\r\n\t\tconst manyWhelps = board.filter((entity) => entity.cardId === CardIds.ManyWhelps_BG22_HERO_305_Buddy);\r\n\t\tconst goldenManyWhelps = board.filter((entity) => entity.cardId === CardIds.ManyWhelps_BG22_HERO_305_Buddy_G);\r\n\t\tmanyWhelps.forEach((entity) => {\r\n\t\t\tmodifyAttack(entity, 2, board, allCards);\r\n\t\t\tmodifyHealth(entity, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t});\r\n\t\tgoldenManyWhelps.forEach((entity) => {\r\n\t\t\tmodifyAttack(entity, 4, board, allCards);\r\n\t\t\tmodifyHealth(entity, 4, board, allCards);\r\n\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t});\r\n\t}\r\n\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy:\r\n\t\t\tcase CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy_G:\r\n\t\t\t\tif (allCards.getCard(spawned.cardId).techLevel === boardHero.tavernTier) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy_G ? 8 : 4;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// This has to happen after greybough's hero power kicks in\r\n\t\t\tcase CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy:\r\n\t\t\tcase CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy_G:\r\n\t\t\t\tif (spawned.taunt) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy_G ? 4 : 2;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CobaltGuardian:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\t\tif (!entity.divineShield) {\r\n\t\t\t\t\t\tupdateDivineShield(entity, board, true, allCards);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmodifyAttack(entity, 2, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.DeflectOBot_BGS_071:\r\n\t\t\tcase CardIds.DeflectOBot_TB_BaconUps_123:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.DeflectOBot_TB_BaconUps_123 ? 4 : 2;\r\n\t\t\t\t\tif (!entity.divineShield) {\r\n\t\t\t\t\t\tupdateDivineShield(entity, board, true, allCards);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmodifyAttack(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Bigfernal_BGS_204:\r\n\t\t\tcase CardIds.Bigfernal_TB_BaconUps_304:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.DEMON, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.Bigfernal_TB_BaconUps_304 ? 2 : 1;\r\n\t\t\t\t\tmodifyAttack(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MamaBear_BGS_021:\r\n\t\t\tcase CardIds.MamaBear_TB_BaconUps_090:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.MamaBear_TB_BaconUps_090 ? 6 : 3;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.PackLeader_BGS_017:\r\n\t\t\tcase CardIds.PackLeader_TB_BaconUps_086:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.PackLeader_TB_BaconUps_086 ? 4 : 2;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\nexport const handleAddedMinionAuraEffect = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tswitch (boardHero.heroPowerId) {\r\n\t\tcase CardIds.SproutItOut:\r\n\t\t\tspawned.taunt = true;\r\n\t\t\tmodifyAttack(spawned, 1, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.KurtrusAshfallen_CloseThePortal:\r\n\t\t\tmodifyAttack(spawned, 2, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.Tinker_TB_BaconShop_HP_015:\r\n\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\tmodifyAttack(spawned, 2, board, allCards);\r\n\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif (boardHero.questRewards?.includes(CardIds.TumblingDisaster_BG28_Reward_505)) {\r\n\t\tconst tumblingDisasterBonus =\r\n\t\t\tboardHero.questRewardEntities?.find((e) => e.cardId === CardIds.TumblingDisaster_BG28_Reward_505)\r\n\t\t\t\t?.scriptDataNum1 ?? 1;\r\n\t\tmodifyAttack(spawned, tumblingDisasterBonus, board, allCards);\r\n\t\tmodifyHealth(spawned, tumblingDisasterBonus, board, allCards);\r\n\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t}\r\n\r\n\t// The board here already contains the new minion\r\n\t// TODO: what if the additional part is a potential target for the aura effect?\r\n\tapplyAurasToSelf(spawned, board, boardHero, allCards, sharedState, spectator);\r\n\r\n\t// Apply auras to board\r\n\tconst cardIds = [spawned.cardId, ...(spawned.additionalCards ?? [])];\r\n\tfor (const spawnedCardId of cardIds) {\r\n\t\thandleMinionAddedAuraEffect(spawnedCardId, spawned, board, boardHero, allCards, spectator, sharedState);\r\n\t}\r\n};\r\n\r\nexport const applyAurasToSelf = (\r\n\tspawned: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tif (!!boardHero.questRewards?.length) {\r\n\t\tfor (const quest of boardHero.questRewards) {\r\n\t\t\tswitch (quest) {\r\n\t\t\t\tcase CardIds.VolatileVenom:\r\n\t\t\t\t\tspawned.attack += 7;\r\n\t\t\t\t\tspawned.health += 7;\r\n\t\t\t\t\tspawned.enchantments.push({\r\n\t\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\t\ttiming: sharedState.currentEntityId++,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CardIds.TheSmokingGun:\r\n\t\t\t\t\tspawned.attack += 4;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards)) {\r\n\t\tif (boardHero.globalInfo.UndeadAttackBonus > 0) {\r\n\t\t\tmodifyAttack(spawned, boardHero.globalInfo.UndeadAttackBonus, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t}\r\n\t}\r\n\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\tif (boardHero.globalInfo.GoldrinnBuffAtk > 0) {\r\n\t\t\tmodifyAttack(spawned, boardHero.globalInfo.GoldrinnBuffAtk, board, allCards);\r\n\t\t\tmodifyHealth(spawned, boardHero.globalInfo.GoldrinnBuffHealth, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tspectator.registerPowerTarget(boardHero, spawned, board, null, null);\r\n\t\t}\r\n\t}\r\n\r\n\t// In case Putricide spawns a stictched minion whose stitched part creates an aura effect\r\n\t// const potentialAuraSources: { cardId: string; entityId: number }[] = [\r\n\t// \t{ cardId: spawned.cardId, entityId: spawned.entityId },\r\n\t// \t...(spawned.additionalCards ?? []).map((cardId) => ({ cardId, entityId: spawned.entityId })),\r\n\t// ];\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MURLOC, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.PIRATE, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t\tspawned.health += entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\t\tspawned.attack += entity.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.DEMON, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.Kathranatir_BG21_039_G ? 2 : 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\t\tif (spawned.divineShield) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += (entity.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (spawned.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst multiplierKnight = spawned.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tconst statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tmodifyAttack(spawned, statsBonusKnight, board, allCards);\r\n\t\t\tmodifyHealth(spawned, statsBonusKnight, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555:\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555_G:\r\n\t\t\tconst multiplierFungus = spawned.cardId === CardIds.EnsorcelledFungus_BG28_555_G ? 2 : 1;\r\n\t\t\tconst statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;\r\n\t\t\tmodifyAttack(spawned, statsBonusFungus, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2 * statsBonusFungus, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537:\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537_G:\r\n\t\t\tconst multiplierFrostling = spawned.cardId === CardIds.FlourishingFrostling_BG26_537_G ? 2 : 1;\r\n\t\t\tconst statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;\r\n\t\t\tmodifyAttack(spawned, statsBonusFrostling, board, allCards);\r\n\t\t\tmodifyHealth(spawned, statsBonusFrostling, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.RotHideGnoll_BG25_013:\r\n\t\tcase CardIds.RotHideGnoll_BG25_013_G:\r\n\t\t\tconst multiplierGnoll = spawned.cardId === CardIds.RotHideGnoll_BG25_013_G ? 2 : 1;\r\n\t\t\tconst statsBonusGnoll =\r\n\t\t\t\tmultiplierGnoll * sharedState.deaths.filter((e) => e.friendly === spawned.friendly).length;\r\n\t\t\tmodifyAttack(spawned, statsBonusGnoll, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\n// Introduced for Rapid Reanimation: since we will \"addMinionToBoard\" the minion afterwards, the auras will\r\n// be re-applied then, so we need to remove them first\r\nexport const removeAurasFromSelf = (\r\n\tentity: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tif (!!boardHero.questRewards?.length) {\r\n\t\tfor (const quest of boardHero.questRewards) {\r\n\t\t\tswitch (quest) {\r\n\t\t\t\tcase CardIds.VolatileVenom:\r\n\t\t\t\t\tentity.attack = Math.max(0, entity.attack - 7);\r\n\t\t\t\t\tentity.health = Math.max(1, entity.health - 7);\r\n\t\t\t\t\tentity.enchantments = entity.enchantments.filter(\r\n\t\t\t\t\t\t(e) => e.cardId !== CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CardIds.TheSmokingGun:\r\n\t\t\t\t\tentity.attack = Math.max(0, entity.attack - 7);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (hasCorrectTribe(entity, Race.UNDEAD, allCards)) {\r\n\t\tif (boardHero.globalInfo.UndeadAttackBonus > 0) {\r\n\t\t\tentity.attack = Math.max(0, entity.attack - boardHero.globalInfo.UndeadAttackBonus);\r\n\t\t}\r\n\t}\r\n\tif (hasCorrectTribe(entity, Race.BEAST, allCards)) {\r\n\t\tif (boardHero.globalInfo.GoldrinnBuffAtk > 0) {\r\n\t\t\tentity.attack = Math.max(0, entity.attack - boardHero.globalInfo.GoldrinnBuffAtk);\r\n\t\t\tentity.health = Math.max(1, entity.health - boardHero.globalInfo.GoldrinnBuffHealth);\r\n\t\t}\r\n\t}\r\n\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.MURLOC, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.BEAST, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.PIRATE, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t\tentity.health = Math.max(\r\n\t\t\t\t\t\t1,\r\n\t\t\t\t\t\tentity.health - (entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tentity.attack - (entity.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3),\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.DEMON, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.Kathranatir_BG21_039_G ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\t\tif (entity.divineShield) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.UNDEAD, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (entity.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst multiplierKnight = entity.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tconst statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusKnight);\r\n\t\t\tentity.health = Math.max(1, entity.health - statsBonusKnight);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555:\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555_G:\r\n\t\t\tconst multiplierFungus = entity.cardId === CardIds.EnsorcelledFungus_BG28_555_G ? 2 : 1;\r\n\t\t\tconst statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusFungus);\r\n\t\t\tentity.health = Math.max(1, entity.health - 2 * statsBonusFungus);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537:\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537_G:\r\n\t\t\tconst multiplierFrostling = entity.cardId === CardIds.FlourishingFrostling_BG26_537_G ? 2 : 1;\r\n\t\t\tconst statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusFrostling);\r\n\t\t\tentity.health = Math.max(1, entity.health - statsBonusFrostling);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.RotHideGnoll_BG25_013:\r\n\t\tcase CardIds.RotHideGnoll_BG25_013_G:\r\n\t\t\tconst multiplierGnoll = entity.cardId === CardIds.RotHideGnoll_BG25_013_G ? 2 : 1;\r\n\t\t\tconst statsBonusGnoll =\r\n\t\t\t\tmultiplierGnoll * sharedState.deaths.filter((e) => e.friendly === entity.friendly).length;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusGnoll);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\nconst handleMinionAddedAuraEffect = (\r\n\tspawnedCardId: string,\r\n\tspawned: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tswitch (spawnedCardId) {\r\n\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards))\r\n\t\t\t\t// Other\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t\te.health += spawned.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\tboard.forEach((e) => {\r\n\t\t\t\te.attack += spawned.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.Kathranatir_BG21_039_G ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => e.divineShield)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += (spawned.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\nconst handleAfterSpawnEffects = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tallSpawned: readonly BoardEntity[],\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tfor (const spawned of allSpawned) {\r\n\t\thandleAfterSpawnEffect(board, hero, spawned, allCards, sharedState, spectator);\r\n\t}\r\n};\r\n\r\nconst handleAfterSpawnEffect = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\t// console.debug('after spawn', stringifySimpleCard(spawned, allCards), stringifySimple(board, allCards));\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\t// case CardIds.MurlocTidecallerLegacy:\r\n\t\t\t// case CardIds.MurlocTidecallerCore:\r\n\t\t\t// \tconst multiplier = entity.cardId === CardIds.MurlocTidecallerBattlegrounds ? 2 : 1;\r\n\t\t\t// \tconst buffAmount =\r\n\t\t\t// \t\tmultiplier * (isCorrectTribe(allCards.getCard(spawned.cardId).races, Race.MURLOC) ? 1 : 0);\r\n\t\t\t// \tif (buffAmount > 0) {\r\n\t\t\t// \t\tmodifyAttack(entity, buffAmount, board, allCards);\r\n\t\t\t// \t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t// \t\tspectator.registerPowerTarget(entity, entity, board);\r\n\t\t\t// \t}\r\n\t\t\t// \tbreak;\r\n\t\t\tcase CardIds.Swampstriker_BG22_401:\r\n\t\t\tcase CardIds.Swampstriker_BG22_401_G:\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst multiplier2 = entity.cardId === CardIds.Swampstriker_BG22_401_G ? 2 : 1;\r\n\t\t\t\t\tconst buffAmount2 =\r\n\t\t\t\t\t\tmultiplier2 * (isCorrectTribe(allCards.getCard(spawned.cardId).races, Race.MURLOC) ? 1 : 0);\r\n\t\t\t\t\tif (buffAmount2 > 0) {\r\n\t\t\t\t\t\tmodifyAttack(entity, buffAmount2, board, allCards);\r\n\t\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Felstomper_BG25_042:\r\n\t\t\tcase CardIds.Felstomper_BG25_042_G:\r\n\t\t\tcase CardIds.Deadstomper_BG28_634:\r\n\t\t\tcase CardIds.Deadstomper_BG28_634_G:\r\n\t\t\t\t// console.debug('felstomper');\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst felstomperBuff = entity.cardId === CardIds.Felstomper_BG25_042_G ? 6 : 3;\r\n\t\t\t\t\tboard.forEach((e) => {\r\n\t\t\t\t\t\tmodifyAttack(e, felstomperBuff, board, allCards);\r\n\t\t\t\t\t\tafterStatsUpdate(e, board, allCards);\r\n\t\t\t\t\t\tspectator.registerPowerTarget(entity, e, board, null, null);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.XyloBones_BG26_172:\r\n\t\t\tcase CardIds.XyloBones_BG26_172_G:\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst xylobonesBuff = entity.cardId === CardIds.XyloBones_BG26_172_G ? 6 : 3;\r\n\t\t\t\t\tmodifyHealth(entity, xylobonesBuff, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.OctosariWrapGod_BG26_804:\r\n\t\t\tcase CardIds.OctosariWrapGod_BG26_804_G:\r\n\t\t\t\tconst octoStats = entity.cardId === CardIds.OctosariWrapGod_BG26_804_G ? 4 : 2;\r\n\t\t\t\tentity.scriptDataNum1 += octoStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.BananaSlamma_BG26_802:\r\n\t\t\tcase CardIds.BananaSlamma_BG26_802_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst bananaStatBuff = entity.cardId === CardIds.BananaSlamma_BG26_802_G ? 3 : 2;\r\n\t\t\t\t\tsetEntityStats(\r\n\t\t\t\t\t\tspawned,\r\n\t\t\t\t\t\tspawned.attack * bananaStatBuff,\r\n\t\t\t\t\t\tspawned.health * bananaStatBuff,\r\n\t\t\t\t\t\tboard,\r\n\t\t\t\t\t\thero,\r\n\t\t\t\t\t\tallCards,\r\n\t\t\t\t\t\tsharedState,\r\n\t\t\t\t\t\tspectator,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, spawned, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HungrySnapjaw_BG26_370:\r\n\t\t\tcase CardIds.HungrySnapjaw_BG26_370_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst snapjawBuff = entity.cardId === CardIds.HungrySnapjaw_BG26_370_G ? 2 : 1;\r\n\t\t\t\t\tmodifyHealth(entity, snapjawBuff, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ObserverOfMyths_BG_TTN_078:\r\n\t\t\tcase CardIds.ObserverOfMyths_BG_TTN_078_G:\r\n\t\t\t\tif (spawned.attack > entity.attack) {\r\n\t\t\t\t\tconst observerBuff = entity.cardId === CardIds.ObserverOfMyths_BG_TTN_078_G ? 2 : 1;\r\n\t\t\t\t\taddStatsToBoard(entity, board, observerBuff, 0, allCards, spectator);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Putricide-only\r\n\t\t\tcase CardIds.ArmsDealer_BG26_RLK_824:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tmodifyAttack(spawned, 1, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"add-minion-to-board.js","sourceRoot":"","sources":["../../src/simulation/add-minion-to-board.ts"],"names":[],"mappings":";;;AAAA,iEAA8E;AAG9E,oDAAqD;AACrD,oCASkB;AAIX,MAAM,iBAAiB,GAAG,CAChC,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,KAAa,EACb,YAAoC,EACpC,QAAyB,EACzB,SAAoB,EACpB,WAAwB,EACjB,EAAE;IACT,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACxC,KAAK,MAAM,WAAW,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,IAAA,wBAAgB,EAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;KAC3G;IACD,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC3F,CAAC,CAAC;AAfW,QAAA,iBAAiB,qBAe5B;AAEK,MAAM,gBAAgB,GAAG,CAC/B,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,KAAa,EACb,WAAwB,EACxB,QAAyB,EACzB,SAAoB,EACpB,WAAwB,EACxB,wBAAwB,GAAG,IAAI,EACxB,EAAE;IACT,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IAEpC,IAAA,mCAA2B,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7F,iBAAiB,CAAC,KAAK,EAAE,SAA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reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { WHELP_CARD_IDS } from '../cards/cards-data';\r\nimport {\r\n\taddStatsToBoard,\r\n\tafterStatsUpdate,\r\n\thasCorrectTribe,\r\n\tisCorrectTribe,\r\n\tmodifyAttack,\r\n\tmodifyHealth,\r\n\tsetEntityStats,\r\n\tupdateDivineShield,\r\n} from '../utils';\r\nimport { SharedState } from './shared-state';\r\nimport { Spectator } from './spectator/spectator';\r\n\r\nexport const addMinionsToBoard = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tindex: number,\r\n\tminionsToAdd: readonly BoardEntity[],\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tboard.splice(index, 0, ...minionsToAdd);\r\n\tfor (const minionToAdd of [...minionsToAdd].reverse()) {\r\n\t\taddMinionToBoard(board, boardHero, otherHero, index, minionToAdd, allCards, spectator, sharedState, false);\r\n\t}\r\n\thandleAfterSpawnEffects(board, boardHero, minionsToAdd, allCards, sharedState, spectator);\r\n};\r\n\r\nexport const addMinionToBoard = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tindex: number,\r\n\tminionToAdd: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n\tperformAfterSpawnEffects = true,\r\n): void => {\r\n\tboard.splice(index, 0, minionToAdd);\r\n\t// Minion has already been removed from the board in the previous step\r\n\thandleAddedMinionAuraEffect(board, boardHero, minionToAdd, allCards, spectator, sharedState);\r\n\thandleSpawnEffect(board, boardHero, otherHero, minionToAdd, allCards, spectator, sharedState);\r\n\tif (performAfterSpawnEffects) {\r\n\t\thandleAfterSpawnEffects(board, boardHero, [minionToAdd], allCards, sharedState, spectator);\r\n\t}\r\n};\r\n\r\nconst handleSpawnEffect = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tconst cardIds = [spawned.cardId, ...(spawned.additionalCards ?? [])];\r\n\r\n\t// https://twitter.com/LoewenMitchell/status/1491879869457879040\r\n\tif (cardIds.some((cardId) => WHELP_CARD_IDS.includes(cardId as CardIds))) {\r\n\t\tconst manyWhelps = board.filter((entity) => entity.cardId === CardIds.ManyWhelps_BG22_HERO_305_Buddy);\r\n\t\tconst goldenManyWhelps = board.filter((entity) => entity.cardId === CardIds.ManyWhelps_BG22_HERO_305_Buddy_G);\r\n\t\tmanyWhelps.forEach((entity) => {\r\n\t\t\tmodifyAttack(entity, 2, board, allCards);\r\n\t\t\tmodifyHealth(entity, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t});\r\n\t\tgoldenManyWhelps.forEach((entity) => {\r\n\t\t\tmodifyAttack(entity, 4, board, allCards);\r\n\t\t\tmodifyHealth(entity, 4, board, allCards);\r\n\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t});\r\n\t}\r\n\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy:\r\n\t\t\tcase CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy_G:\r\n\t\t\t\tif (allCards.getCard(spawned.cardId).techLevel === boardHero.tavernTier) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.BabyYshaarj_TB_BaconShop_HERO_92_Buddy_G ? 8 : 4;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// This has to happen after greybough's hero power kicks in\r\n\t\t\tcase CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy:\r\n\t\t\tcase CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy_G:\r\n\t\t\t\tif (spawned.taunt) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.WanderingTreant_TB_BaconShop_HERO_95_Buddy_G ? 4 : 2;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CobaltGuardian:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\t\tif (!entity.divineShield) {\r\n\t\t\t\t\t\tupdateDivineShield(entity, board, true, allCards);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmodifyAttack(entity, 2, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.DeflectOBot_BGS_071:\r\n\t\t\tcase CardIds.DeflectOBot_TB_BaconUps_123:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.DeflectOBot_TB_BaconUps_123 ? 4 : 2;\r\n\t\t\t\t\tif (!entity.divineShield) {\r\n\t\t\t\t\t\tupdateDivineShield(entity, board, true, allCards);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmodifyAttack(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Bigfernal_BGS_204:\r\n\t\t\tcase CardIds.Bigfernal_TB_BaconUps_304:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.DEMON, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.Bigfernal_TB_BaconUps_304 ? 2 : 1;\r\n\t\t\t\t\tmodifyAttack(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(entity, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MamaBear_BGS_021:\r\n\t\t\tcase CardIds.MamaBear_TB_BaconUps_090:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.MamaBear_TB_BaconUps_090 ? 6 : 3;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tmodifyHealth(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.PackLeader_BGS_017:\r\n\t\t\tcase CardIds.PackLeader_TB_BaconUps_086:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\t\t\t\tconst statsBonus = entity.cardId === CardIds.PackLeader_TB_BaconUps_086 ? 4 : 2;\r\n\t\t\t\t\tmodifyAttack(spawned, statsBonus, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, boardHero, otherHero);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\nexport const handleAddedMinionAuraEffect = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tswitch (boardHero.heroPowerId) {\r\n\t\tcase CardIds.SproutItOut:\r\n\t\t\tspawned.taunt = true;\r\n\t\t\tmodifyAttack(spawned, 1, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.KurtrusAshfallen_CloseThePortal:\r\n\t\t\tmodifyAttack(spawned, 2, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.Tinker_TB_BaconShop_HP_015:\r\n\t\t\tif (hasCorrectTribe(spawned, Race.MECH, allCards)) {\r\n\t\t\t\tmodifyAttack(spawned, 2, board, allCards);\r\n\t\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif (boardHero.questRewards?.includes(CardIds.TumblingDisaster_BG28_Reward_505)) {\r\n\t\tconst tumblingDisasterBonus =\r\n\t\t\tboardHero.questRewardEntities?.find((e) => e.cardId === CardIds.TumblingDisaster_BG28_Reward_505)\r\n\t\t\t\t?.scriptDataNum1 || 1;\r\n\t\tmodifyAttack(spawned, tumblingDisasterBonus, board, allCards);\r\n\t\tmodifyHealth(spawned, tumblingDisasterBonus, board, allCards);\r\n\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t}\r\n\r\n\t// The board here already contains the new minion\r\n\t// TODO: what if the additional part is a potential target for the aura effect?\r\n\tapplyAurasToSelf(spawned, board, boardHero, allCards, sharedState, spectator);\r\n\r\n\t// Apply auras to board\r\n\tconst cardIds = [spawned.cardId, ...(spawned.additionalCards ?? [])];\r\n\tfor (const spawnedCardId of cardIds) {\r\n\t\thandleMinionAddedAuraEffect(spawnedCardId, spawned, board, boardHero, allCards, spectator, sharedState);\r\n\t}\r\n};\r\n\r\nexport const applyAurasToSelf = (\r\n\tspawned: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tif (!!boardHero.questRewards?.length) {\r\n\t\tfor (const quest of boardHero.questRewards) {\r\n\t\t\tswitch (quest) {\r\n\t\t\t\tcase CardIds.VolatileVenom:\r\n\t\t\t\t\tspawned.attack += 7;\r\n\t\t\t\t\tspawned.health += 7;\r\n\t\t\t\t\tspawned.enchantments.push({\r\n\t\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\t\ttiming: sharedState.currentEntityId++,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CardIds.TheSmokingGun:\r\n\t\t\t\t\tspawned.attack += 4;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards)) {\r\n\t\tif (boardHero.globalInfo.UndeadAttackBonus > 0) {\r\n\t\t\tmodifyAttack(spawned, boardHero.globalInfo.UndeadAttackBonus, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t}\r\n\t}\r\n\tif (hasCorrectTribe(spawned, Race.BEAST, allCards)) {\r\n\t\tif (boardHero.globalInfo.GoldrinnBuffAtk > 0) {\r\n\t\t\tmodifyAttack(spawned, boardHero.globalInfo.GoldrinnBuffAtk, board, allCards);\r\n\t\t\tmodifyHealth(spawned, boardHero.globalInfo.GoldrinnBuffHealth, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tspectator.registerPowerTarget(boardHero, spawned, board, null, null);\r\n\t\t}\r\n\t}\r\n\r\n\t// In case Putricide spawns a stictched minion whose stitched part creates an aura effect\r\n\t// const potentialAuraSources: { cardId: string; entityId: number }[] = [\r\n\t// \t{ cardId: spawned.cardId, entityId: spawned.entityId },\r\n\t// \t...(spawned.additionalCards ?? []).map((cardId) => ({ cardId, entityId: spawned.entityId })),\r\n\t// ];\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.MURLOC, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.PIRATE, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t\tspawned.health += entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\t\tspawned.attack += entity.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.DEMON, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.Kathranatir_BG21_039_G ? 2 : 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\t\tif (spawned.divineShield) {\r\n\t\t\t\t\tspawned.attack += entity.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tspawned.attack += (entity.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (spawned.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst multiplierKnight = spawned.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tconst statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tmodifyAttack(spawned, statsBonusKnight, board, allCards);\r\n\t\t\tmodifyHealth(spawned, statsBonusKnight, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555:\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555_G:\r\n\t\t\tconst multiplierFungus = spawned.cardId === CardIds.EnsorcelledFungus_BG28_555_G ? 2 : 1;\r\n\t\t\tconst statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;\r\n\t\t\tmodifyAttack(spawned, statsBonusFungus, board, allCards);\r\n\t\t\tmodifyHealth(spawned, 2 * statsBonusFungus, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537:\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537_G:\r\n\t\t\tconst multiplierFrostling = spawned.cardId === CardIds.FlourishingFrostling_BG26_537_G ? 2 : 1;\r\n\t\t\tconst statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;\r\n\t\t\tmodifyAttack(spawned, statsBonusFrostling, board, allCards);\r\n\t\t\tmodifyHealth(spawned, statsBonusFrostling, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.RotHideGnoll_BG25_013:\r\n\t\tcase CardIds.RotHideGnoll_BG25_013_G:\r\n\t\t\tconst multiplierGnoll = spawned.cardId === CardIds.RotHideGnoll_BG25_013_G ? 2 : 1;\r\n\t\t\tconst statsBonusGnoll =\r\n\t\t\t\tmultiplierGnoll * sharedState.deaths.filter((e) => e.friendly === spawned.friendly).length;\r\n\t\t\tmodifyAttack(spawned, statsBonusGnoll, board, allCards);\r\n\t\t\tafterStatsUpdate(spawned, board, allCards);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\n// Introduced for Rapid Reanimation: since we will \"addMinionToBoard\" the minion afterwards, the auras will\r\n// be re-applied then, so we need to remove them first\r\nexport const removeAurasFromSelf = (\r\n\tentity: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tif (!!boardHero.questRewards?.length) {\r\n\t\tfor (const quest of boardHero.questRewards) {\r\n\t\t\tswitch (quest) {\r\n\t\t\t\tcase CardIds.VolatileVenom:\r\n\t\t\t\t\tentity.attack = Math.max(0, entity.attack - 7);\r\n\t\t\t\t\tentity.health = Math.max(1, entity.health - 7);\r\n\t\t\t\t\tentity.enchantments = entity.enchantments.filter(\r\n\t\t\t\t\t\t(e) => e.cardId !== CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CardIds.TheSmokingGun:\r\n\t\t\t\t\tentity.attack = Math.max(0, entity.attack - 7);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (hasCorrectTribe(entity, Race.UNDEAD, allCards)) {\r\n\t\tif (boardHero.globalInfo.UndeadAttackBonus > 0) {\r\n\t\t\tentity.attack = Math.max(0, entity.attack - boardHero.globalInfo.UndeadAttackBonus);\r\n\t\t}\r\n\t}\r\n\tif (hasCorrectTribe(entity, Race.BEAST, allCards)) {\r\n\t\tif (boardHero.globalInfo.GoldrinnBuffAtk > 0) {\r\n\t\t\tentity.attack = Math.max(0, entity.attack - boardHero.globalInfo.GoldrinnBuffAtk);\r\n\t\t\tentity.health = Math.max(1, entity.health - boardHero.globalInfo.GoldrinnBuffHealth);\r\n\t\t}\r\n\t}\r\n\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.MURLOC, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.BEAST, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.PIRATE, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t\tentity.health = Math.max(\r\n\t\t\t\t\t\t1,\r\n\t\t\t\t\t\tentity.health - (entity.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tentity.attack - (entity.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3),\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.DEMON, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.Kathranatir_BG21_039_G ? 2 : 1),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\t\tif (entity.divineShield) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\t\tif (hasCorrectTribe(entity, Race.UNDEAD, allCards) && entity.entityId !== entity.entityId) {\r\n\t\t\t\t\tentity.attack = Math.max(\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tentity.attack - (entity.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tswitch (entity.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst multiplierKnight = entity.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tconst statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusKnight);\r\n\t\t\tentity.health = Math.max(1, entity.health - statsBonusKnight);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555:\r\n\t\tcase CardIds.EnsorcelledFungus_BG28_555_G:\r\n\t\t\tconst multiplierFungus = entity.cardId === CardIds.EnsorcelledFungus_BG28_555_G ? 2 : 1;\r\n\t\t\tconst statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusFungus);\r\n\t\t\tentity.health = Math.max(1, entity.health - 2 * statsBonusFungus);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537:\r\n\t\tcase CardIds.FlourishingFrostling_BG26_537_G:\r\n\t\t\tconst multiplierFrostling = entity.cardId === CardIds.FlourishingFrostling_BG26_537_G ? 2 : 1;\r\n\t\t\tconst statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusFrostling);\r\n\t\t\tentity.health = Math.max(1, entity.health - statsBonusFrostling);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.RotHideGnoll_BG25_013:\r\n\t\tcase CardIds.RotHideGnoll_BG25_013_G:\r\n\t\t\tconst multiplierGnoll = entity.cardId === CardIds.RotHideGnoll_BG25_013_G ? 2 : 1;\r\n\t\t\tconst statsBonusGnoll =\r\n\t\t\t\tmultiplierGnoll * sharedState.deaths.filter((e) => e.friendly === entity.friendly).length;\r\n\t\t\tentity.attack = Math.max(0, entity.attack - statsBonusGnoll);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\nconst handleMinionAddedAuraEffect = (\r\n\tspawnedCardId: string,\r\n\tspawned: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tspectator: Spectator,\r\n\tsharedState: SharedState,\r\n): void => {\r\n\tswitch (spawnedCardId) {\r\n\t\tcase CardIds.SouthseaCaptainLegacy_BG_NEW1_027:\r\n\t\tcase CardIds.SouthseaCaptainLegacy_TB_BaconUps_136:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards))\r\n\t\t\t\t// Other\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t\te.health += spawned.cardId === CardIds.SouthseaCaptainLegacy_TB_BaconUps_136 ? 2 : 1;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.MurlocWarleaderLegacy_BG_EX1_507:\r\n\t\tcase CardIds.MurlocWarleaderLegacy_TB_BaconUps_008:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.MurlocWarleaderLegacy_TB_BaconUps_008 ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.HummingBird_BG26_805:\r\n\t\tcase CardIds.HummingBird_BG26_805_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.HummingBird_BG26_805_G ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy:\r\n\t\tcase CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G:\r\n\t\t\tboard.forEach((e) => {\r\n\t\t\t\te.attack += spawned.cardId === CardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G ? 6 : 3;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.Kathranatir_BG21_039:\r\n\t\tcase CardIds.Kathranatir_BG21_039_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.Kathranatir_BG21_039_G ? 4 : 2;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t\tcase CardIds.CyborgDrake_BG25_043:\r\n\t\tcase CardIds.CyborgDrake_BG25_043_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => e.divineShield)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += spawned.cardId === CardIds.CyborgDrake_BG25_043_G ? 12 : 6;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\tcase CardIds.SoreLoser_BG27_030:\r\n\t\tcase CardIds.SoreLoser_BG27_030_G:\r\n\t\t\tboard\r\n\t\t\t\t.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards))\r\n\t\t\t\t.filter((e) => e.entityId !== spawned.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += (spawned.cardId === CardIds.SoreLoser_BG27_030_G ? 2 : 1) * boardHero.tavernTier;\r\n\t\t\t\t});\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n\r\nconst handleAfterSpawnEffects = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tallSpawned: readonly BoardEntity[],\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\tfor (const spawned of allSpawned) {\r\n\t\thandleAfterSpawnEffect(board, hero, spawned, allCards, sharedState, spectator);\r\n\t}\r\n};\r\n\r\nconst handleAfterSpawnEffect = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tspawned: BoardEntity,\r\n\tallCards: AllCardsService,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n): void => {\r\n\t// console.debug('after spawn', stringifySimpleCard(spawned, allCards), stringifySimple(board, allCards));\r\n\tfor (const entity of board) {\r\n\t\tswitch (entity.cardId) {\r\n\t\t\t// case CardIds.MurlocTidecallerLegacy:\r\n\t\t\t// case CardIds.MurlocTidecallerCore:\r\n\t\t\t// \tconst multiplier = entity.cardId === CardIds.MurlocTidecallerBattlegrounds ? 2 : 1;\r\n\t\t\t// \tconst buffAmount =\r\n\t\t\t// \t\tmultiplier * (isCorrectTribe(allCards.getCard(spawned.cardId).races, Race.MURLOC) ? 1 : 0);\r\n\t\t\t// \tif (buffAmount > 0) {\r\n\t\t\t// \t\tmodifyAttack(entity, buffAmount, board, allCards);\r\n\t\t\t// \t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t// \t\tspectator.registerPowerTarget(entity, entity, board);\r\n\t\t\t// \t}\r\n\t\t\t// \tbreak;\r\n\t\t\tcase CardIds.Swampstriker_BG22_401:\r\n\t\t\tcase CardIds.Swampstriker_BG22_401_G:\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst multiplier2 = entity.cardId === CardIds.Swampstriker_BG22_401_G ? 2 : 1;\r\n\t\t\t\t\tconst buffAmount2 =\r\n\t\t\t\t\t\tmultiplier2 * (isCorrectTribe(allCards.getCard(spawned.cardId).races, Race.MURLOC) ? 1 : 0);\r\n\t\t\t\t\tif (buffAmount2 > 0) {\r\n\t\t\t\t\t\tmodifyAttack(entity, buffAmount2, board, allCards);\r\n\t\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Felstomper_BG25_042:\r\n\t\t\tcase CardIds.Felstomper_BG25_042_G:\r\n\t\t\tcase CardIds.Deadstomper_BG28_634:\r\n\t\t\tcase CardIds.Deadstomper_BG28_634_G:\r\n\t\t\t\t// console.debug('felstomper');\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst felstomperBuff = entity.cardId === CardIds.Felstomper_BG25_042_G ? 6 : 3;\r\n\t\t\t\t\tboard.forEach((e) => {\r\n\t\t\t\t\t\tmodifyAttack(e, felstomperBuff, board, allCards);\r\n\t\t\t\t\t\tafterStatsUpdate(e, board, allCards);\r\n\t\t\t\t\t\tspectator.registerPowerTarget(entity, e, board, null, null);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.XyloBones_BG26_172:\r\n\t\t\tcase CardIds.XyloBones_BG26_172_G:\r\n\t\t\t\tif (entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst xylobonesBuff = entity.cardId === CardIds.XyloBones_BG26_172_G ? 6 : 3;\r\n\t\t\t\t\tmodifyHealth(entity, xylobonesBuff, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.OctosariWrapGod_BG26_804:\r\n\t\t\tcase CardIds.OctosariWrapGod_BG26_804_G:\r\n\t\t\t\tconst octoStats = entity.cardId === CardIds.OctosariWrapGod_BG26_804_G ? 4 : 2;\r\n\t\t\t\tentity.scriptDataNum1 += octoStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.BananaSlamma_BG26_802:\r\n\t\t\tcase CardIds.BananaSlamma_BG26_802_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst bananaStatBuff = entity.cardId === CardIds.BananaSlamma_BG26_802_G ? 3 : 2;\r\n\t\t\t\t\tsetEntityStats(\r\n\t\t\t\t\t\tspawned,\r\n\t\t\t\t\t\tspawned.attack * bananaStatBuff,\r\n\t\t\t\t\t\tspawned.health * bananaStatBuff,\r\n\t\t\t\t\t\tboard,\r\n\t\t\t\t\t\thero,\r\n\t\t\t\t\t\tallCards,\r\n\t\t\t\t\t\tsharedState,\r\n\t\t\t\t\t\tspectator,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, spawned, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.HungrySnapjaw_BG26_370:\r\n\t\t\tcase CardIds.HungrySnapjaw_BG26_370_G:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.BEAST, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tconst snapjawBuff = entity.cardId === CardIds.HungrySnapjaw_BG26_370_G ? 2 : 1;\r\n\t\t\t\t\tmodifyHealth(entity, snapjawBuff, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ObserverOfMyths_BG_TTN_078:\r\n\t\t\tcase CardIds.ObserverOfMyths_BG_TTN_078_G:\r\n\t\t\t\tif (spawned.attack > entity.attack) {\r\n\t\t\t\t\tconst observerBuff = entity.cardId === CardIds.ObserverOfMyths_BG_TTN_078_G ? 2 : 1;\r\n\t\t\t\t\taddStatsToBoard(entity, board, observerBuff, 0, allCards, spectator);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Putricide-only\r\n\t\t\tcase CardIds.ArmsDealer_BG26_RLK_824:\r\n\t\t\t\tif (hasCorrectTribe(spawned, Race.UNDEAD, allCards) && entity.entityId !== spawned.entityId) {\r\n\t\t\t\t\tmodifyAttack(spawned, 1, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, entity, board, null, null);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n"]}
|
package/dist/simulation/auras.js
CHANGED
|
@@ -70,12 +70,17 @@ const setImplicitDataHero = (hero, cardsData, isPlayer) => {
|
|
|
70
70
|
hero.questRewards = [hero.questRewards];
|
|
71
71
|
}
|
|
72
72
|
hero.questRewards = [...((_b = hero.questRewards) !== null && _b !== void 0 ? _b : []), hero.heroPowerId].filter((e) => !!e);
|
|
73
|
-
hero.questRewardEntities = hero.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
hero.questRewardEntities = hero.questRewardEntities
|
|
74
|
+
? hero.questRewardEntities.map((reward) => ({
|
|
75
|
+
...reward,
|
|
76
|
+
avengeDefault: cardsData.avengeValue(reward.cardId),
|
|
77
|
+
}))
|
|
78
|
+
: hero.questRewards.map((reward) => ({
|
|
79
|
+
cardId: reward,
|
|
80
|
+
avengeCurrent: 0,
|
|
81
|
+
avengeDefault: cardsData.avengeValue(reward),
|
|
82
|
+
scriptDataNum1: 0,
|
|
83
|
+
}));
|
|
79
84
|
hero.entityId = (_c = hero.entityId) !== null && _c !== void 0 ? _c : (isPlayer ? 999999998 : 999999999);
|
|
80
85
|
hero.hand = (_d = hero.hand) !== null && _d !== void 0 ? _d : [];
|
|
81
86
|
if (!hero.globalInfo) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auras.js","sourceRoot":"","sources":["../../src/simulation/auras.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAI9E,oCAA2C;AAEpC,MAAM,eAAe,GAAG,CAC9B,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,QAAyB,EAClB,EAAE;IACT,qBAAqB,CAAC,KAAK,EAAE,SAAS,E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,oBAAoB,wBAY/B","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\r\nimport { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from 'src/bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { hasCorrectTribe } from '../utils';\r\n\r\nexport const setMissingAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingMinionsAura(board, boardHero, allCards);\r\n\tsetMissingHeroPowerAura(board, boardHero, otherHero);\r\n};\r\n\r\nexport const setMissingHeroPowerAura = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n): void => {\r\n\tif (boardHero.heroPowerId === CardIds.TheSmokingGun) {\r\n\t\tboard\r\n\t\t\t.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\t!e.enchantments.find(\r\n\t\t\t\t\t\t(ench) => ench.cardId === CardIds.TheSmokingGun_ArmedAndStillSmokingEnchantment,\r\n\t\t\t\t\t),\r\n\t\t\t)\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += 4;\r\n\t\t\t});\r\n\t}\r\n\tif (boardHero.heroPowerId === CardIds.VolatileVenom) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === CardIds.VolatileVenom_VolatileEnchantment))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += 7;\r\n\t\t\t\te.health += 7;\r\n\t\t\t\te.enchantments.push({\r\n\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\ttiming: 0,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nconst setMissingMinionsAura = (board: BoardEntity[], boardHero: BgsPlayerEntity, allCards: AllCardsService): void => {\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_BG_NEW1_027,\r\n\t\tCardIds.SouthseaCaptain_YarrrVanillaEnchantment,\r\n\t\t1,\r\n\t\t1,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_TB_BaconUps_136,\r\n\t\tCardIds.SouthseaCaptain_YarrrEnchantment,\r\n\t\t2,\r\n\t\t2,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglLegacyEnchantment,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglEnchantment,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards)),\r\n\t\tCardIds.HummingBird_BG26_805,\r\n\t\tCardIds.HummingBird_EntrancedEnchantment_BG26_805e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards)),\r\n\t\tCardIds.HummingBird_BG26_805_G,\r\n\t\tCardIds.HummingBird_EntrancedEnchantment_BG26_805_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039_G,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard,\r\n\t\tCardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy,\r\n\t\tCardIds.DraconicBlessingEnchantment_TB_BaconShop_HERO_52_Buddy_e,\r\n\t\t3,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard,\r\n\t\tCardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G,\r\n\t\tCardIds.DraconicBlessingEnchantment_TB_BaconShop_HERO_52_Buddy_G_e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043_G,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043_Ge,\r\n\t\t12,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\tboardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030_G,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\t2 * boardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n};\r\n\r\nconst setMissingAura = (\r\n\tboard: BoardEntity[],\r\n\tminionCardId: string,\r\n\tenchantmentCardId: string,\r\n\tattack: number,\r\n\thealth: number,\r\n\tignoreSelf = true,\r\n\tallCards: AllCardsService = null,\r\n): void => {\r\n\tconst buffers = board.filter((e) => e.cardId === minionCardId);\r\n\tfor (const buffer of buffers) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === enchantmentCardId))\r\n\t\t\t.filter((e) => (ignoreSelf ? e.entityId !== buffer.entityId : true))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += attack;\r\n\t\t\t\te.health += health;\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport const setImplicitDataHero = (hero: BgsPlayerEntity, cardsData: CardsData, isPlayer: boolean): void => {\r\n\tconst avengeValue = cardsData.avengeValue(hero.heroPowerId);\r\n\tif (avengeValue > 0) {\r\n\t\thero.avengeCurrent = avengeValue;\r\n\t\thero.avengeDefault = avengeValue;\r\n\t}\r\n\t// Backward compatibility\r\n\tif (!!hero.questRewards?.length && !Array.isArray(hero.questRewards)) {\r\n\t\thero.questRewards = [hero.questRewards as any];\r\n\t}\r\n\r\n\t// Because Denathrius can send a quest reward as its hero power (I think)\r\n\thero.questRewards = [...(hero.questRewards ?? []), hero.heroPowerId].filter((e) => !!e);\r\n\thero.questRewardEntities = hero.questRewards.map((reward) => ({\r\n\t\tcardId: reward,\r\n\t\tavengeCurrent: 0,\r\n\t\tavengeDefault: cardsData.avengeValue(reward),\r\n\t\tscriptDataNum1: 0,\r\n\t}));\r\n\thero.entityId = hero.entityId ?? (isPlayer ? 999_999_998 : 999_999_999);\r\n\thero.hand = hero.hand ?? [];\r\n\tif (!hero.globalInfo) {\r\n\t\thero.globalInfo = {};\r\n\t}\r\n\r\n\thero.globalInfo.EternalKnightsDeadThisGame = hero.globalInfo.EternalKnightsDeadThisGame ?? 0;\r\n\thero.globalInfo.TavernSpellsCastThisGame = hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\thero.globalInfo.UndeadAttackBonus = hero.globalInfo.UndeadAttackBonus ?? 0;\r\n\thero.globalInfo.FrostlingBonus = hero.globalInfo.FrostlingBonus ?? 0;\r\n\thero.globalInfo.BloodGemAttackBonus = hero.globalInfo.BloodGemAttackBonus ?? 0;\r\n\thero.globalInfo.BloodGemHealthBonus = hero.globalInfo.BloodGemHealthBonus ?? 0;\r\n\thero.globalInfo.GoldrinnBuffAtk = hero.globalInfo.GoldrinnBuffAtk ?? 0;\r\n\thero.globalInfo.GoldrinnBuffHealth = hero.globalInfo.GoldrinnBuffHealth ?? 0;\r\n};\r\n\r\nexport const clearStealthIfNeeded = (board: BoardEntity[], otherBoard: BoardEntity[]): void => {\r\n\t// https://twitter.com/DCalkosz/status/1562194944688660481?s=20&t=100I8IVZmBKgYQWkdK8nIA\r\n\tif (board.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\tboard.forEach((e) => (e.stealth = false));\r\n\t}\r\n\tif (otherBoard.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\totherBoard.forEach((e) => (e.stealth = false));\r\n\t}\r\n\tif (board.every((e) => e.stealth) && otherBoard.every((e) => e.stealth)) {\r\n\t\tboard.forEach((e) => (e.stealth = false));\r\n\t\totherBoard.forEach((e) => (e.stealth = false));\r\n\t}\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"auras.js","sourceRoot":"","sources":["../../src/simulation/auras.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAI9E,oCAA2C;AAEpC,MAAM,eAAe,GAAG,CAC9B,KAAoB,EACpB,SAA0B,EAC1B,SAA0B,EAC1B,QAAyB,EAClB,EAAE;IACT,q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xE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;QAC1C,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;KAC/C;AACF,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\r\nimport { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from 'src/bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { hasCorrectTribe } from '../utils';\r\n\r\nexport const setMissingAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingMinionsAura(board, boardHero, allCards);\r\n\tsetMissingHeroPowerAura(board, boardHero, otherHero);\r\n};\r\n\r\nexport const setMissingHeroPowerAura = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n): void => {\r\n\tif (boardHero.heroPowerId === CardIds.TheSmokingGun) {\r\n\t\tboard\r\n\t\t\t.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\t!e.enchantments.find(\r\n\t\t\t\t\t\t(ench) => ench.cardId === CardIds.TheSmokingGun_ArmedAndStillSmokingEnchantment,\r\n\t\t\t\t\t),\r\n\t\t\t)\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += 4;\r\n\t\t\t});\r\n\t}\r\n\tif (boardHero.heroPowerId === CardIds.VolatileVenom) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === CardIds.VolatileVenom_VolatileEnchantment))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += 7;\r\n\t\t\t\te.health += 7;\r\n\t\t\t\te.enchantments.push({\r\n\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\ttiming: 0,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nconst setMissingMinionsAura = (board: BoardEntity[], boardHero: BgsPlayerEntity, allCards: AllCardsService): void => {\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_BG_NEW1_027,\r\n\t\tCardIds.SouthseaCaptain_YarrrVanillaEnchantment,\r\n\t\t1,\r\n\t\t1,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.PIRATE, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_TB_BaconUps_136,\r\n\t\tCardIds.SouthseaCaptain_YarrrEnchantment,\r\n\t\t2,\r\n\t\t2,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglLegacyEnchantment,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglEnchantment,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards)),\r\n\t\tCardIds.HummingBird_BG26_805,\r\n\t\tCardIds.HummingBird_EntrancedEnchantment_BG26_805e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.BEAST, allCards)),\r\n\t\tCardIds.HummingBird_BG26_805_G,\r\n\t\tCardIds.HummingBird_EntrancedEnchantment_BG26_805_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.DEMON, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039_G,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard,\r\n\t\tCardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy,\r\n\t\tCardIds.DraconicBlessingEnchantment_TB_BaconShop_HERO_52_Buddy_e,\r\n\t\t3,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard,\r\n\t\tCardIds.LadySinestra_TB_BaconShop_HERO_52_Buddy_G,\r\n\t\tCardIds.DraconicBlessingEnchantment_TB_BaconShop_HERO_52_Buddy_G_e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043_G,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043_Ge,\r\n\t\t12,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\tboardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, Race.UNDEAD, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030_G,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\t2 * boardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n};\r\n\r\nconst setMissingAura = (\r\n\tboard: BoardEntity[],\r\n\tminionCardId: string,\r\n\tenchantmentCardId: string,\r\n\tattack: number,\r\n\thealth: number,\r\n\tignoreSelf = true,\r\n\tallCards: AllCardsService = null,\r\n): void => {\r\n\tconst buffers = board.filter((e) => e.cardId === minionCardId);\r\n\tfor (const buffer of buffers) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === enchantmentCardId))\r\n\t\t\t.filter((e) => (ignoreSelf ? e.entityId !== buffer.entityId : true))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += attack;\r\n\t\t\t\te.health += health;\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport const setImplicitDataHero = (hero: BgsPlayerEntity, cardsData: CardsData, isPlayer: boolean): void => {\r\n\tconst avengeValue = cardsData.avengeValue(hero.heroPowerId);\r\n\tif (avengeValue > 0) {\r\n\t\thero.avengeCurrent = avengeValue;\r\n\t\thero.avengeDefault = avengeValue;\r\n\t}\r\n\t// Backward compatibility\r\n\tif (!!hero.questRewards?.length && !Array.isArray(hero.questRewards)) {\r\n\t\thero.questRewards = [hero.questRewards as any];\r\n\t}\r\n\r\n\t// Because Denathrius can send a quest reward as its hero power (I think)\r\n\thero.questRewards = [...(hero.questRewards ?? []), hero.heroPowerId].filter((e) => !!e);\r\n\thero.questRewardEntities = hero.questRewardEntities\r\n\t\t? hero.questRewardEntities.map((reward) => ({\r\n\t\t\t\t...reward,\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward.cardId),\r\n\t\t }))\r\n\t\t: hero.questRewards.map((reward) => ({\r\n\t\t\t\tcardId: reward,\r\n\t\t\t\tavengeCurrent: 0,\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward),\r\n\t\t\t\tscriptDataNum1: 0,\r\n\t\t }));\r\n\thero.entityId = hero.entityId ?? (isPlayer ? 999_999_998 : 999_999_999);\r\n\thero.hand = hero.hand ?? [];\r\n\tif (!hero.globalInfo) {\r\n\t\thero.globalInfo = {};\r\n\t}\r\n\r\n\thero.globalInfo.EternalKnightsDeadThisGame = hero.globalInfo.EternalKnightsDeadThisGame ?? 0;\r\n\thero.globalInfo.TavernSpellsCastThisGame = hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\thero.globalInfo.UndeadAttackBonus = hero.globalInfo.UndeadAttackBonus ?? 0;\r\n\thero.globalInfo.FrostlingBonus = hero.globalInfo.FrostlingBonus ?? 0;\r\n\thero.globalInfo.BloodGemAttackBonus = hero.globalInfo.BloodGemAttackBonus ?? 0;\r\n\thero.globalInfo.BloodGemHealthBonus = hero.globalInfo.BloodGemHealthBonus ?? 0;\r\n\thero.globalInfo.GoldrinnBuffAtk = hero.globalInfo.GoldrinnBuffAtk ?? 0;\r\n\thero.globalInfo.GoldrinnBuffHealth = hero.globalInfo.GoldrinnBuffHealth ?? 0;\r\n};\r\n\r\nexport const clearStealthIfNeeded = (board: BoardEntity[], otherBoard: BoardEntity[]): void => {\r\n\t// https://twitter.com/DCalkosz/status/1562194944688660481?s=20&t=100I8IVZmBKgYQWkdK8nIA\r\n\tif (board.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\tboard.forEach((e) => (e.stealth = false));\r\n\t}\r\n\tif (otherBoard.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\totherBoard.forEach((e) => (e.stealth = false));\r\n\t}\r\n\tif (board.every((e) => e.stealth) && otherBoard.every((e) => e.stealth)) {\r\n\t\tboard.forEach((e) => (e.stealth = false));\r\n\t\totherBoard.forEach((e) => (e.stealth = false));\r\n\t}\r\n};\r\n"]}
|