From b08415c7f87eb56ec09cd35fe0c72a6f04c731d2 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 21 Apr 2026 18:59:17 -0600 Subject: [PATCH] feat(chess/modifiers): add 3 recipes showcasing new trigger primitives (T26) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds three recipes to the built-in template library, each built on a Wave 2 trigger that previously had no pre-composed example: - Kamikaze Knight — on-captured with target: attacker, nested add-to-attribute Hp -2. Death-rattle that damages whichever piece made the fatal capture. - Berserker Pawn — on-move nested with add-to-attribute AttackBonus +1. Stacking rage: the pawn grows stronger with every move it survives. - Promotion Feast — on-promotion nested with seed-attribute Hp 5. When a pawn finally promotes, it starts its new life with a fresh 5 HP pool regardless of damage taken on the way up the board. Each recipe passes validateCustomDescriptor and lands in the editors Templates dropdown alongside the existing five. Recipe count: 5 → 8. --- .../chess/src/modifiers/custom/recipes.ts | 123 ++++++++++++++---- 1 file changed, 98 insertions(+), 25 deletions(-) diff --git a/packages/chess/src/modifiers/custom/recipes.ts b/packages/chess/src/modifiers/custom/recipes.ts index 40c8b50..15907ed 100644 --- a/packages/chess/src/modifiers/custom/recipes.ts +++ b/packages/chess/src/modifiers/custom/recipes.ts @@ -129,29 +129,102 @@ export const CUSTOM_MODIFIER_RECIPES: readonly CustomModifierRecipe[] = [ ], ), }, - { - id: "recipe-low-hp-fortress", - title: "Low-HP Fortress (invulnerable when HP<2)", - summary: - "conditional: when Hp < 2, sets CANNOT_BE_CAPTURED. A last-stand trigger that keeps a wounded piece alive.", - descriptor: descriptorForRecipe( - "recipe-low-hp-fortress", - "Low-HP Fortress", - "Becomes untargetable when HP drops below 2.", - [ - { - kind: "conditional", - params: { - condition: { type: "attr-lt", attr: "Hp", value: 2 }, - then: [ - { - kind: "set-capture-flag", - params: { flag: 2 }, - }, - ], - }, - }, - ], - ), - }, + { + id: "recipe-low-hp-fortress", + title: "Low-HP Fortress (invulnerable when HP<2)", + summary: + "conditional: when Hp < 2, sets CANNOT_BE_CAPTURED. A last-stand trigger that keeps a wounded piece alive.", + descriptor: descriptorForRecipe( + "recipe-low-hp-fortress", + "Low-HP Fortress", + "Becomes untargetable when HP drops below 2.", + [ + { + kind: "conditional", + params: { + condition: { type: "attr-lt", attr: "Hp", value: 2 }, + then: [ + { + kind: "set-capture-flag", + params: { flag: 2 }, + }, + ], + }, + }, + ], + ), + }, + { + id: "recipe-kamikaze-knight", + title: "Kamikaze Knight (-2 HP to attacker)", + summary: + "on-captured wrapping add-to-attribute with target: 'attacker'. When captured, this piece deals 2 damage back to its slayer.", + descriptor: descriptorForRecipe( + "recipe-kamikaze-knight", + "Kamikaze Knight", + "Damages the attacker for 2 HP when captured, creating mutual wounds in exchanges.", + [ + { + kind: "on-captured", + params: { + target: "attacker", + primitives: [ + { + kind: "add-to-attribute", + params: { attr: "Hp", delta: -2 }, + }, + ], + }, + }, + ], + ), + }, + { + id: "recipe-berserker-pawn", + title: "Berserker Pawn (+1 Attack per move)", + summary: + "on-move wrapping add-to-attribute AttackBonus +1. Gains +1 attack power every move, stacking into an unstoppable force.", + descriptor: descriptorForRecipe( + "recipe-berserker-pawn", + "Berserker Pawn", + "Gains +1 AttackBonus each move, creating an escalating threat the longer it advances.", + [ + { + kind: "on-move", + params: { + primitives: [ + { + kind: "add-to-attribute", + params: { attr: "AttackBonus", delta: 1 }, + }, + ], + }, + }, + ], + ), + }, + { + id: "recipe-promotion-feast", + title: "Promotion Feast (+5 HP on promotion)", + summary: + "on-promotion wrapping seed-attribute for Hp 5. When this pawn promotes, it immediately gains 5 bonus HP as a reward.", + descriptor: descriptorForRecipe( + "recipe-promotion-feast", + "Promotion Feast", + "Seeds 5 HP when pawn promotes, rewarding safe advancement across the board.", + [ + { + kind: "on-promotion", + params: { + primitives: [ + { + kind: "seed-attribute", + params: { attr: "Hp", value: 5 }, + }, + ], + }, + }, + ], + ), + }, ];