Initial commit
This commit is contained in:
commit
8c709fb52f
771 files changed
+222983
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import type { Card } from './cards';
|
||||
import {
|
||||
battleCardEffects,
|
||||
isDefenseCard,
|
||||
weaponTypes,
|
||||
defenseTypes,
|
||||
} from './battle-cards';
|
||||
import type { StrongholdId } from './stronghold-cards';
|
||||
|
||||
/** Carthag adds a Snooper property, not a second physical card or Chemistry. */
|
||||
export function strongholdSnooper(
|
||||
effect: StrongholdId | null | undefined,
|
||||
weapon?: Card,
|
||||
defense?: Card,
|
||||
) {
|
||||
return (
|
||||
effect === 'carthag' &&
|
||||
!!defense &&
|
||||
defense.kind !== 'worthless' &&
|
||||
isDefenseCard(defense) &&
|
||||
!defenseTypes(defense).includes('snooper') &&
|
||||
!weaponTypes(weapon).includes('poison')
|
||||
);
|
||||
}
|
||||
export function strongholdBattleEffects(
|
||||
aw?: Card,
|
||||
ad?: Card,
|
||||
dw?: Card,
|
||||
dd?: Card,
|
||||
toothA = true,
|
||||
toothD = true,
|
||||
aEffect?: StrongholdId | null,
|
||||
dEffect?: StrongholdId | null,
|
||||
) {
|
||||
return battleCardEffects(aw, ad, dw, dd, toothA, toothD, {
|
||||
attacker: strongholdSnooper(aEffect, aw, ad),
|
||||
defender: strongholdSnooper(dEffect, dw, dd),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user