Daggers, rocks, blades, and wands can be set down too
The rulebook's movable-object list is wider than the stones: "magic stones, treasure chests, the dagger, the large rock, and the wizardblade" — and the expansion expects wands to change hands, since "its remaining charges go with it." A new isMovableObject helper in the engine names that full set, doDropObject honors it, and the hint bar's "Drop it here" button follows suit. Charges are keyed by card instance, so a dropped wand carries them to whoever picks it up — covered by new tests, along with the refusal to drop spell cards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c04ed1e0ee
commit
789d927122
@@ -4578,12 +4578,28 @@ function doPickUpObject(prev: GameState, instanceId: string): CommandResult {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Physical, droppable objects beyond the object-type stones. Rulebook:
|
||||
* "Movable objects include magic stones, treasure chests, the dagger, the
|
||||
* large rock, and the wizardblade" — plus the expansion wands, which the
|
||||
* rules expect to change hands ("its remaining charges go with it";
|
||||
* charges are keyed by instance, so they travel automatically).
|
||||
*/
|
||||
const MOVABLE_OBJECT_CARD_IDS = new Set([
|
||||
"dagger", "large-rock", "wizardblade",
|
||||
"blaster-wand", "shift-wand", "sticky-wand", "warp-wand",
|
||||
]);
|
||||
|
||||
export function isMovableObject(cardId: string): boolean {
|
||||
return cardDef(cardId).cardType === "object" || MOVABLE_OBJECT_CARD_IDS.has(cardId);
|
||||
}
|
||||
|
||||
function doDropObject(prev: GameState, instanceId: string): CommandResult {
|
||||
const state = clone(prev);
|
||||
const p = activePlayer(state);
|
||||
const card = p.hand.find((c) => c.instanceId === instanceId);
|
||||
if (!card) return err("card not in hand");
|
||||
if (cardDef(card.cardId).cardType !== "object") return err("only objects can be dropped");
|
||||
if (!isMovableObject(card.cardId)) return err("only objects can be dropped");
|
||||
takeFromHand(p, instanceId);
|
||||
const key = cellKey(p.position);
|
||||
state.groundObjects[key] = [...(state.groundObjects[key] ?? []), card];
|
||||
|
||||
Reference in New Issue
Block a user