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