From 9ec67e96e6e1e846eee291b1a4958486dd339128 Mon Sep 17 00:00:00 2001 From: Hansoo Date: Sun, 15 Jan 2023 20:17:36 +0900 Subject: [PATCH] added type weakness to display added matrices for attack/defense type compatibility --- src-tauri/tauri.conf.json | 2 +- src/App.svelte | 2 +- src/const/attack_types.json | 20 +++++++++ src/const/defense_types.json | 20 +++++++++ src/lib/DisplayData.svelte | 85 +++++++++++++++++++++++++++++++++--- 5 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 src/const/attack_types.json create mode 100644 src/const/defense_types.json diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 23878dd..92dbfa7 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -60,7 +60,7 @@ "windows": [ { "fullscreen": false, - "height": 800, + "height": 900, "resizable": true, "title": "pokemon-data-displayer", "width": 1000, diff --git a/src/App.svelte b/src/App.svelte index 8f4f803..c6c3cf3 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -40,6 +40,6 @@ .main-row { display: flex; flex-direction: row; - height: 700px; + height: 800px; } \ No newline at end of file diff --git a/src/const/attack_types.json b/src/const/attack_types.json new file mode 100644 index 0000000..450d9eb --- /dev/null +++ b/src/const/attack_types.json @@ -0,0 +1,20 @@ +[ + [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.0, 1.0, 1.0, 0.5, 1.0], + [1.0, 0.5, 0.5, 1.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 0.5, 1.0, 0.5, 1.0, 2.0, 1.0], + [1.0, 2.0, 0.5, 1.0, 0.5, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 2.0, 1.0, 0.5, 1.0, 1.0, 1.0], + [1.0, 1.0, 2.0, 0.5, 0.5, 1.0, 1.0, 1.0, 0.0, 2.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 1.0, 1.0], + [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, 1.0, 0.5, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 0.5, 1.0, 0.5], + [1.0, 0.5, 0.5, 0.5, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 0.5, 2.0], + [1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 2.0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 0.5, 1.0] +] \ No newline at end of file diff --git a/src/const/defense_types.json b/src/const/defense_types.json new file mode 100644 index 0000000..18fbb21 --- /dev/null +++ b/src/const/defense_types.json @@ -0,0 +1,20 @@ +[ + [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0], + [1.0, 0.5, 2.0, 1.0, 0.5, 0.5, 1.0, 1.0, 2.0, 1.0, 1.0, 0.5, 2.0, 1.0, 1.0, 1.0, 0.5, 0.5], + [1.0, 0.5, 0.5, 2.0, 2.0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0], + [1.0, 1.0, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 2.0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0], + [1.0, 2.0, 0.5, 0.5, 0.5, 2.0, 1.0, 2.0, 0.5, 2.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + [1.0, 2.0, 1.0, 1.0, 1.0, 0.5, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 2.0, 1.0], + [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 0.5, 0.5, 1.0, 1.0, 0.5, 1.0, 2.0], + [1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 0.5, 0.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/DisplayData.svelte +++ b/src/lib/DisplayData.svelte @@ -1,4 +1,5 @@