reflect attack automatically
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
export let player1Data: PokemonData | undefined;
|
||||
export let player2Data: PokemonData | undefined;
|
||||
export let attackId: number | undefined;
|
||||
let attackData;
|
||||
$: {
|
||||
if (myValue > 0 && myValue !== currentValue) {
|
||||
@@ -15,6 +16,14 @@
|
||||
console.log(attackData);
|
||||
});
|
||||
}
|
||||
if (!!attackId) {
|
||||
invoke("search_move", { index: attackId }).then((r) => {
|
||||
currentValue = myValue = attackId;
|
||||
attackData = r;
|
||||
console.log(attackData);
|
||||
attackId = undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
let attack_direction = "p1p2";
|
||||
let total_max_damage = 0;
|
||||
|
||||
Reference in New Issue
Block a user