From bf23443f3aac2043fe741a432223dd99863edd05 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 15 Jan 2023 14:40:32 -0500 Subject: [PATCH] chapter 4 groundwork --- src/lib/components/Battle.svelte | 25 ++++++-- .../components/Battle/Chapter4.story.svelte | 59 +++++++++++++++++++ src/lib/store/api.js | 9 +++ src/lib/store/genNextBattle.js | 1 + 4 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 src/lib/components/Battle/Chapter4.story.svelte diff --git a/src/lib/components/Battle.svelte b/src/lib/components/Battle.svelte index 2aa87dd..c1e6cbb 100644 --- a/src/lib/components/Battle.svelte +++ b/src/lib/components/Battle.svelte @@ -21,16 +21,29 @@ -- {status}
- {#if status === 'ongoing'} + {#if status === 'ongoing' && chapter !== 4}
wave
{wave === 2 ? 'second' : 'first'}
{/if}
city
-
{city}
+
+ {#if typeof city === 'string'} + {city} + {:else} + + {/if} +
scenario
{scenario}
-
character
-
{character}
+ + {#if character} +
character
+
{character}
+ {/if} {#if additionalCharacters} {#each additionalCharacters as c, i (c.selection)} @@ -161,6 +174,10 @@ ({ target: { value } }) => { event?.setCharacter(params.battleId, index, value); }; + + const changeCity = ({ target: { value } }) => { + event?.setCity(params.battleId, value); + };