From 8b7ccd4bdcb2ea2edac8a4ca4d30377abd583e3e Mon Sep 17 00:00:00 2001 From: Jason Reed Date: Sat, 17 Feb 2024 16:58:50 -0500 Subject: [PATCH] More complex crafting --- src/core/landing-result.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/landing-result.ts b/src/core/landing-result.ts index 0209f1b..d6064b5 100644 --- a/src/core/landing-result.ts +++ b/src/core/landing-result.ts @@ -64,6 +64,9 @@ export function landMobileOnCell(m: MoveSource, c: CellContents): LandingResult switch (c.t) { // first branch on what exists on the target case 'mobile': { if (c.mobile.t == 'resource' && c.mobile.res == 'wood') { + if (m.t == 'resource' && m.res == 'stone') { + return { t: 'replaceResource', res: 'axe' }; + } if (m.t == 'resource' && m.res == 'axe') { return { t: 'replaceResource', res: 'planks' }; } @@ -83,7 +86,7 @@ export function landMobileOnCell(m: MoveSource, c: CellContents): LandingResult case 'word': return { t: 'collision' }; case 'time': return { t: 'collision' }; case 'dynamite': return { t: 'collision' }; - case 'water': return (m.t == 'resource' && m.res == 'wood') ? { t: 'fillWater' } : { t: 'collision' }; + case 'water': return (m.t == 'resource' && m.res == 'planks') ? { t: 'fillWater' } : { t: 'collision' }; case 'mountain': return { t: 'collision' }; } }