chapter 4 ui
This commit is contained in:
parent
bf23443f3a
commit
3e9ceddb48
@ -15,7 +15,6 @@
|
||||
const api = genApi();
|
||||
|
||||
setContext('api', api);
|
||||
console.log('api set, sucka');
|
||||
|
||||
const routes = {
|
||||
// Exact path
|
||||
|
@ -33,7 +33,9 @@
|
||||
<AdditionalCharacter
|
||||
on:change={changeCity}
|
||||
selection={city.selection}
|
||||
choices={city.choices}
|
||||
choices={status !== 'ongoing'
|
||||
? []
|
||||
: city.choices.filter((c) => c !== city.selection)}
|
||||
/>
|
||||
{/if}
|
||||
</dd>
|
||||
|
@ -4,7 +4,7 @@
|
||||
???
|
||||
{:else}
|
||||
<a href={`#/campaign/${campaignId}/battle/${id}`}>
|
||||
Battle of {city}</a
|
||||
Battle of {typeof city === 'string' ? city : city.selection}</a
|
||||
><span>, {status}</span>
|
||||
{/if}
|
||||
</p>
|
||||
|
@ -9,7 +9,7 @@ const seedCampaign = {
|
||||
|
||||
export function updateBattle(campaign, battleId, status) {
|
||||
const battle = campaign.battles[battleId - 1];
|
||||
if (status === 'lost' && battle.wave == 1) {
|
||||
if (status === 'lost' && (battle.wave == 1 || battle.id < 7)) {
|
||||
return u.updateIn(campaign, `battles.${battleId - 1}`, {
|
||||
wave: 2,
|
||||
});
|
||||
|
@ -112,7 +112,7 @@ export function genChapter4Battle(battles) {
|
||||
.slice(0, 6)
|
||||
.filter(({ status }) => status !== 'lost')
|
||||
.map(R.prop('city')),
|
||||
battles.slice(6).map((b) => b.city.selection),
|
||||
battles.slice(6).map((b) => b.city?.selection),
|
||||
);
|
||||
|
||||
const characters = battles.slice(0, 6).map(R.prop('character'));
|
||||
|
Loading…
Reference in New Issue
Block a user