Skip to content

Commit

Permalink
More complex crafting
Browse files Browse the repository at this point in the history
  • Loading branch information
jcreedcmu committed Feb 17, 2024
1 parent 11ed663 commit 8b7ccd4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/landing-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
}
Expand All @@ -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' };
}
}
Expand Down

0 comments on commit 8b7ccd4

Please sign in to comment.