some other twists
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "pokemon-data-displayer",
|
||||
"version": "0.0.6"
|
||||
"version": "0.0.7"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
@@ -9,19 +9,16 @@
|
||||
export let attackId: number | undefined;
|
||||
let attackData;
|
||||
$: {
|
||||
if (myValue > 0 && myValue !== currentValue) {
|
||||
invoke("search_move", { index: myValue }).then((r) => {
|
||||
currentValue = myValue;
|
||||
if (moveValue > 0) {
|
||||
invoke("search_move", { index: moveValue }).then((r) => {
|
||||
attackData = r;
|
||||
console.log(attackData);
|
||||
moveValue = undefined;
|
||||
});
|
||||
}
|
||||
if (!!attackId) {
|
||||
console.log(attackId);
|
||||
invoke("search_move", { index: attackId }).then((r) => {
|
||||
currentValue = myValue = attackId;
|
||||
attackData = r;
|
||||
console.log(attackData);
|
||||
attackId = undefined;
|
||||
});
|
||||
}
|
||||
@@ -44,6 +41,10 @@
|
||||
(!!attackData && ![1, 2].includes(attackData.category))
|
||||
) {
|
||||
// display some message somewhere
|
||||
total_max_damage = 0;
|
||||
total_min_damage = 0;
|
||||
total_max_damage_percentage = 0;
|
||||
total_min_damage_percentage = 0;
|
||||
console.log("skip");
|
||||
return;
|
||||
}
|
||||
@@ -353,8 +354,7 @@
|
||||
return [];
|
||||
}
|
||||
}
|
||||
let myValue;
|
||||
let currentValue = 0;
|
||||
let moveValue;
|
||||
</script>
|
||||
|
||||
<div class="calculator">
|
||||
@@ -392,7 +392,7 @@
|
||||
localFiltering={false}
|
||||
labelFieldName="name"
|
||||
valueFieldName="id"
|
||||
bind:value={myValue}
|
||||
bind:value={moveValue}
|
||||
/>
|
||||
</td>
|
||||
<td>{ attackData ? attackData.name : "" }</td>
|
||||
|
||||
@@ -142,31 +142,31 @@
|
||||
pokemonData.hp_v,
|
||||
pokemonData.hp_d
|
||||
);
|
||||
atk_final = other_stats(
|
||||
attack_final = other_stats(
|
||||
pokemonData.attack,
|
||||
pokemonData.attack_v,
|
||||
pokemonData.attack_d,
|
||||
atk_p
|
||||
);
|
||||
def_final = other_stats(
|
||||
defense_final = other_stats(
|
||||
pokemonData.defense,
|
||||
pokemonData.defense_v,
|
||||
pokemonData.defense_d,
|
||||
def_p
|
||||
);
|
||||
spatk_final = other_stats(
|
||||
special_attack_final = other_stats(
|
||||
pokemonData.special_attack,
|
||||
pokemonData.special_attack_v,
|
||||
pokemonData.special_attack_d,
|
||||
spatk_p
|
||||
);
|
||||
spdef_final = other_stats(
|
||||
special_defense_final = other_stats(
|
||||
pokemonData.special_defense,
|
||||
pokemonData.special_defense_v,
|
||||
pokemonData.special_defense_d,
|
||||
spdef_p
|
||||
);
|
||||
spd_final = other_stats(
|
||||
speed_final = other_stats(
|
||||
pokemonData.speed,
|
||||
pokemonData.speed_v,
|
||||
pokemonData.speed_d,
|
||||
@@ -308,11 +308,11 @@
|
||||
}
|
||||
|
||||
export let hp_final = 0;
|
||||
export let atk_final = 0;
|
||||
export let def_final = 0;
|
||||
export let spatk_final = 0;
|
||||
export let spdef_final = 0;
|
||||
export let spd_final = 0;
|
||||
export let attack_final = 0;
|
||||
export let defense_final = 0;
|
||||
export let special_attack_final = 0;
|
||||
export let special_defense_final = 0;
|
||||
export let speed_final = 0;
|
||||
let level = 50;
|
||||
let selected_terastype = 0;
|
||||
let selected_item = 0;
|
||||
@@ -465,7 +465,7 @@
|
||||
/></b
|
||||
></td
|
||||
>
|
||||
<td class="atai-column"><b>{atk_final}</b></td>
|
||||
<td class="atai-column"><b>{attack_final}</b></td>
|
||||
<td class="atai-column"
|
||||
><b
|
||||
><input
|
||||
@@ -485,14 +485,50 @@
|
||||
<td> </td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i - 6) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer minus {pokemonData.attack_buff < i+1 ? "red" : ""}" on:click={() => { pokemonData.attack_buff = i; }}>▼</td>
|
||||
<td
|
||||
class="cursor-pointer minus {pokemonData.attack_buff < i + 1
|
||||
? 'red'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.attack_buff = i;
|
||||
}}
|
||||
>
|
||||
▼
|
||||
</td>
|
||||
{/each}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer" on:click={() => { pokemonData.attack_buff = 0; }}>・</td>
|
||||
<td
|
||||
class="cursor-pointer"
|
||||
on:click={() => {
|
||||
pokemonData.attack_buff = 0;
|
||||
}}
|
||||
>
|
||||
・
|
||||
</td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer plus {pokemonData.attack_buff > i ? "green" : ""}" on:click={() => { pokemonData.attack_buff = i+1; }}>▲</td>
|
||||
<td
|
||||
class="cursor-pointer plus {pokemonData.attack_buff > i
|
||||
? 'green'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.attack_buff = i + 1;
|
||||
}}
|
||||
>
|
||||
▲
|
||||
</td>
|
||||
{/each}
|
||||
<td> </td>
|
||||
<td>
|
||||
({Math.floor(
|
||||
attack_final *
|
||||
(pokemonData.attack_buff > 0
|
||||
? (2 + pokemonData.attack_buff) / 2
|
||||
: pokemonData.attack_buff < 0
|
||||
? 2 / (2 - pokemonData.attack_buff)
|
||||
: 1)
|
||||
)})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="value-column"><b>DEF</b></td>
|
||||
@@ -519,7 +555,7 @@
|
||||
/></b
|
||||
></td
|
||||
>
|
||||
<td class="atai-column"><b>{def_final}</b></td>
|
||||
<td class="atai-column"><b>{defense_final}</b></td>
|
||||
<td class="atai-column"
|
||||
><b
|
||||
><input
|
||||
@@ -539,14 +575,50 @@
|
||||
<td> </td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i - 6) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer minus {pokemonData.defense_buff < i+1 ? "red" : ""}" on:click={() => { pokemonData.defense_buff = i; }}>▼</td>
|
||||
<td
|
||||
class="cursor-pointer minus {pokemonData.defense_buff < i + 1
|
||||
? 'red'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.defense_buff = i;
|
||||
}}
|
||||
>
|
||||
▼
|
||||
</td>
|
||||
{/each}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer" on:click={() => { pokemonData.defense_buff = 0; }}>・</td>
|
||||
<td
|
||||
class="cursor-pointer"
|
||||
on:click={() => {
|
||||
pokemonData.defense_buff = 0;
|
||||
}}
|
||||
>
|
||||
・
|
||||
</td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer plus {pokemonData.defense_buff > i ? "green" : ""}" on:click={() => { pokemonData.defense_buff = i+1; }}>▲</td>
|
||||
<td
|
||||
class="cursor-pointer plus {pokemonData.defense_buff > i
|
||||
? 'green'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.defense_buff = i + 1;
|
||||
}}
|
||||
>
|
||||
▲
|
||||
</td>
|
||||
{/each}
|
||||
<td> </td>
|
||||
<td>
|
||||
({Math.floor(
|
||||
defense_final *
|
||||
(pokemonData.defense_buff > 0
|
||||
? (2 + pokemonData.defense_buff) / 2
|
||||
: pokemonData.defense_buff < 0
|
||||
? 2 / (2 - pokemonData.defense_buff)
|
||||
: 1)
|
||||
)})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="value-column"><b>S.ATK</b></td>
|
||||
@@ -573,7 +645,7 @@
|
||||
/>
|
||||
</b>
|
||||
</td>
|
||||
<td class="atai-column"><b>{spatk_final}</b></td>
|
||||
<td class="atai-column"><b>{special_attack_final}</b></td>
|
||||
<td class="atai-column">
|
||||
<b>
|
||||
<input
|
||||
@@ -593,14 +665,52 @@
|
||||
<td> </td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i - 6) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer minus {pokemonData.special_attack_buff < i+1 ? "red" : ""}" on:click={() => { pokemonData.special_attack_buff = i; }}>▼</td>
|
||||
<td
|
||||
class="cursor-pointer minus {pokemonData.special_attack_buff <
|
||||
i + 1
|
||||
? 'red'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.special_attack_buff = i;
|
||||
}}
|
||||
>
|
||||
▼
|
||||
</td>
|
||||
{/each}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer" on:click={() => { pokemonData.special_attack_buff = 0; }}>・</td>
|
||||
<td
|
||||
class="cursor-pointer"
|
||||
on:click={() => {
|
||||
pokemonData.special_attack_buff = 0;
|
||||
}}
|
||||
>
|
||||
・
|
||||
</td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer plus {pokemonData.special_attack_buff > i ? "green" : ""}" on:click={() => { pokemonData.special_attack_buff = i+1; }}>▲</td>
|
||||
<td
|
||||
class="cursor-pointer plus {pokemonData.special_attack_buff >
|
||||
i
|
||||
? 'green'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.special_attack_buff = i + 1;
|
||||
}}
|
||||
>
|
||||
▲
|
||||
</td>
|
||||
{/each}
|
||||
<td> </td>
|
||||
<td>
|
||||
({Math.floor(
|
||||
special_attack_final *
|
||||
(pokemonData.special_attack_buff > 0
|
||||
? (2 + pokemonData.special_attack_buff) / 2
|
||||
: pokemonData.special_attack_buff < 0
|
||||
? 2 / (2 - pokemonData.special_attack_buff)
|
||||
: 1)
|
||||
)})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="value-column"><b>S.DEF</b></td>
|
||||
@@ -627,7 +737,7 @@
|
||||
/>
|
||||
</b>
|
||||
</td>
|
||||
<td class="atai-column"><b>{spdef_final}</b></td>
|
||||
<td class="atai-column"><b>{special_defense_final}</b></td>
|
||||
<td class="atai-column">
|
||||
<b>
|
||||
<input
|
||||
@@ -647,14 +757,52 @@
|
||||
<td> </td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i - 6) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer minus {pokemonData.special_defense_buff < i+1 ? "red" : ""}" on:click={() => { pokemonData.special_defense_buff = i; }}>▼</td>
|
||||
<td
|
||||
class="cursor-pointer minus {pokemonData.special_defense_buff <
|
||||
i + 1
|
||||
? 'red'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.special_defense_buff = i;
|
||||
}}
|
||||
>
|
||||
▼
|
||||
</td>
|
||||
{/each}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer" on:click={() => { pokemonData.special_defense_buff = 0; }}>・</td>
|
||||
<td
|
||||
class="cursor-pointer"
|
||||
on:click={() => {
|
||||
pokemonData.special_defense_buff = 0;
|
||||
}}
|
||||
>
|
||||
・
|
||||
</td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer plus {pokemonData.special_defense_buff > i ? "green" : ""}" on:click={() => { pokemonData.special_defense_buff = i+1; }}>▲</td>
|
||||
<td
|
||||
class="cursor-pointer plus {pokemonData.special_defense_buff >
|
||||
i
|
||||
? 'green'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.special_defense_buff = i + 1;
|
||||
}}
|
||||
>
|
||||
▲
|
||||
</td>
|
||||
{/each}
|
||||
<td> </td>
|
||||
<td>
|
||||
({Math.floor(
|
||||
special_defense_final *
|
||||
(pokemonData.special_defense_buff > 0
|
||||
? (2 + pokemonData.special_defense_buff) / 2
|
||||
: pokemonData.special_defense_buff < 0
|
||||
? 2 / (2 - pokemonData.special_defense_buff)
|
||||
: 1)
|
||||
)})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="value-column"><b>SPD</b></td>
|
||||
@@ -681,7 +829,7 @@
|
||||
/>
|
||||
</b>
|
||||
</td>
|
||||
<td class="atai-column"><b>{spd_final}</b></td>
|
||||
<td class="atai-column"><b>{speed_final}</b></td>
|
||||
<td class="atai-column">
|
||||
<b>
|
||||
<input
|
||||
@@ -701,27 +849,63 @@
|
||||
<td> </td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i - 6) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer minus {pokemonData.speed_buff < i+1 ? "red" : ""}" on:click={() => { pokemonData.speed_buff = i; }}>▼</td>
|
||||
<td
|
||||
class="cursor-pointer minus {pokemonData.speed_buff < i + 1
|
||||
? 'red'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.speed_buff = i;
|
||||
}}
|
||||
>
|
||||
▼
|
||||
</td>
|
||||
{/each}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer" on:click={() => { pokemonData.speed_buff = 0; }}>・</td>
|
||||
<td
|
||||
class="cursor-pointer"
|
||||
on:click={() => {
|
||||
pokemonData.speed_buff = 0;
|
||||
}}
|
||||
>
|
||||
・
|
||||
</td>
|
||||
{#each Array.from({ length: 6 }, (_, i) => i) as i}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<td class="cursor-pointer plus {pokemonData.speed_buff > i ? "green" : ""}" on:click={() => { pokemonData.speed_buff = i+1; }}>▲</td>
|
||||
<td
|
||||
class="cursor-pointer plus {pokemonData.speed_buff > i
|
||||
? 'green'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
pokemonData.speed_buff = i + 1;
|
||||
}}
|
||||
>
|
||||
▲
|
||||
</td>
|
||||
{/each}
|
||||
<td> </td>
|
||||
<td>
|
||||
({Math.floor(
|
||||
speed_final *
|
||||
(pokemonData.speed_buff > 0
|
||||
? (2 + pokemonData.speed_buff) / 2
|
||||
: pokemonData.speed_buff < 0
|
||||
? 2 / (2 - pokemonData.speed_buff)
|
||||
: 1)
|
||||
)})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="value-column"><b>TOTAL</b></td>
|
||||
<td class="atai-column"
|
||||
><b
|
||||
>{pokemonData.hp +
|
||||
<td class="atai-column">
|
||||
<b>
|
||||
{pokemonData.hp +
|
||||
pokemonData.attack +
|
||||
pokemonData.defense +
|
||||
pokemonData.special_attack +
|
||||
pokemonData.special_defense +
|
||||
pokemonData.speed}</b
|
||||
></td
|
||||
>
|
||||
pokemonData.speed}
|
||||
</b>
|
||||
</td>
|
||||
<td class="atai-column" />
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -747,7 +931,9 @@
|
||||
console.log("passing" + learnset.name);
|
||||
attackId = learnset.learnset_id;
|
||||
await invoke("increase_attack_usage", { index: learnset.id });
|
||||
pokemonData.learnset = await invoke("search_learnset", { index: pokemonData.id });
|
||||
pokemonData.learnset = await invoke("search_learnset", {
|
||||
index: pokemonData.id,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<td
|
||||
@@ -850,12 +1036,12 @@
|
||||
}
|
||||
.minus:hover {
|
||||
color: pink;
|
||||
transition: font-size .5s ease;
|
||||
transition: font-size 0.5s ease;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.plus:hover {
|
||||
color: lightgreen;
|
||||
transition: font-size .5s ease;
|
||||
transition: font-size 0.5s ease;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.red {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import DisplayData from "./DisplayData.svelte";
|
||||
import type { PokemonStatus } from "../model/PokemonStatus";
|
||||
import type { PokemonDBData, PokemonData } from "src/model/PokemonData";
|
||||
import type { ItemData, ItemEffect } from "../model/ItemData";
|
||||
import type { ItemData } from "../model/ItemData";
|
||||
$: {
|
||||
if (myValue > 0) {
|
||||
invoke("search", { index: myValue }).then((r: PokemonDBData) => {
|
||||
@@ -59,11 +59,11 @@
|
||||
types: pokemonData ? pokemonData.types : [],
|
||||
terastype: pokemonData ? pokemonData.terastype : [0],
|
||||
hp: hp_final,
|
||||
attack: atk_final,
|
||||
defense: def_final,
|
||||
special_attack: spatk_final,
|
||||
special_defense: spdef_final,
|
||||
speed: spd_final,
|
||||
attack: attack_final,
|
||||
defense: defense_final,
|
||||
special_attack: special_attack_final,
|
||||
special_defense: special_defense_final,
|
||||
speed: speed_final,
|
||||
attack_buff: pokemonData ? pokemonData.attack_buff : 0,
|
||||
defense_buff: pokemonData ? pokemonData.defense_buff : 0,
|
||||
special_attack_buff: pokemonData ? pokemonData.special_attack_buff : 0,
|
||||
@@ -79,11 +79,11 @@
|
||||
let pokemonData: PokemonData | undefined;
|
||||
let pokemonDataArray: PokemonData[] = [];
|
||||
let hp_final = 0;
|
||||
let atk_final = 0;
|
||||
let def_final = 0;
|
||||
let spatk_final = 0;
|
||||
let spdef_final = 0;
|
||||
let spd_final = 0;
|
||||
let attack_final = 0;
|
||||
let defense_final = 0;
|
||||
let special_attack_final = 0;
|
||||
let special_defense_final = 0;
|
||||
let speed_final = 0;
|
||||
export let pokemonStatus: PokemonStatus = {
|
||||
types: [],
|
||||
terastype: [0],
|
||||
@@ -174,11 +174,11 @@
|
||||
<DisplayData
|
||||
{pokemonData}
|
||||
bind:hp_final
|
||||
bind:atk_final
|
||||
bind:def_final
|
||||
bind:spatk_final
|
||||
bind:spdef_final
|
||||
bind:spd_final
|
||||
bind:attack_final
|
||||
bind:defense_final
|
||||
bind:special_attack_final
|
||||
bind:special_defense_final
|
||||
bind:speed_final
|
||||
bind:attackId
|
||||
{items}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user