Fa triggers malament

This commit is contained in:
2026-10-29 20:30:29 +01:00
parent bc05b63083
commit 9ec486274f
16 changed files with 2287 additions and 128 deletions

View File

@@ -84,6 +84,46 @@ Deck
assert.match(result.errors.join(' '), /exactly 100/)
})
test('a commander identity mana source only offers colors in the identity', () => {
const game = new Game({
seed: 1,
startingHandSize: 0,
commander: true,
players: [
{ id: 'p1', deck: [basicLand('Forest')], commander: commanderDefinition('Test Commander', { colors: ['U', 'R'], colorIdentity: ['U', 'R'] }) },
{ id: 'p2', deck: [basicLand('Forest')], commander: commanderDefinition('Other Commander') },
],
})
game.start()
const tower = game.addCard('p1', {
oracleId: 'command-tower',
name: 'Command Tower',
typeLine: 'Land',
abilities: [{
kind: 'activated',
costs: [{ kind: 'tap' }],
effects: [{
op: 'add_mana',
player: 'you',
mana: {
kind: 'any_color',
amount: { kind: 'number', value: 1 },
oneColor: false,
restriction: "commander's color identity",
},
}],
optional: false,
text: "{T}: Add one mana of any color in your commander's color identity.",
}],
}, 'battlefield')
assert.deepEqual(game.manaColorChoices(tower, 0), ['U', 'R'])
assert.throws(() => game.activateAbility('p1', tower.id, 0, { manaColor: 'G' }), /cannot produce/)
assert.equal(tower.tapped, false)
game.activateAbility('p1', tower.id, 0, { manaColor: 'R' })
assert.equal(game.getPlayer('p1').manaPool.R, 1)
})
test('a commander starts in the command zone, pays tax, and returns there from the graveyard', () => {
const commander = commanderDefinition('Test Commander')
const game = new Game({
@@ -91,8 +131,8 @@ test('a commander starts in the command zone, pays tax, and returns there from t
startingHandSize: 0,
commander: true,
players: [
{ id: 'p1', deck: [], commander },
{ id: 'p2', deck: [], commander: commanderDefinition('Other Commander') },
{ id: 'p1', deck: [basicLand('Forest')], commander },
{ id: 'p2', deck: [basicLand('Forest')], commander: commanderDefinition('Other Commander') },
],
})
game.start()
@@ -138,8 +178,8 @@ test('twenty-one commander damage loses the game', () => {
startingHandSize: 0,
commander: true,
players: [
{ id: 'p1', deck: [], commander },
{ id: 'p2', deck: [], commander: commanderDefinition('Other Commander') },
{ id: 'p1', deck: [basicLand('Forest')], commander },
{ id: 'p2', deck: [basicLand('Forest')], commander: commanderDefinition('Other Commander') },
],
})
game.start()