From 911f229c23ec6aadb7ba9a36721d016547f061e1 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 9 Aug 2021 15:48:38 +0200 Subject: feat: add logogram drop information --- CHANGELOG.md | 3 ++ public/index.css | 4 +++ src/App.svelte | 52 +++---------------------------- src/EnemyList.svelte | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/bestiary.js | 24 ++++++++++++++ src/pyros.bestiary.js | 21 +++++++++++++ 6 files changed, 143 insertions(+), 47 deletions(-) create mode 100644 src/EnemyList.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index d82e44e..bcde04f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ The site always runs on the latest released version. - Sprites now know about their spawn time, and will tell you if they're not spawning due to a missing weather condition. +- Sprites now also show the logogram they drop, give they drop any. This + currently only works with Pyros sprites, I don't have enough data about + Hydatos sprites at the moment. ## [1.0.1] - 2021-08-09 diff --git a/public/index.css b/public/index.css index b884f1e..c47a532 100644 --- a/public/index.css +++ b/public/index.css @@ -38,3 +38,7 @@ header ul li { text-decoration: line-through; color: gray; } + +.highlight { + color: green; +} diff --git a/src/App.svelte b/src/App.svelte index cd6102b..3a0db7d 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,6 +3,7 @@ import ew from "./ew"; import { formatUtc } from "./times"; import { getMatches } from "./bestiary"; + import EnemyList from "./EnemyList.svelte"; import day from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; import { onMount } from "svelte"; @@ -52,7 +53,7 @@ otherMatches = matches.filter((m) => m.special && !m.uptime.isUp); } - function getZoneForecast() { + export function getZoneForecast() { if ($level >= 20 && $level < 35) { return pagosForecast; } else if ($level >= 35 && $level < 50) { @@ -133,56 +134,13 @@
matches
- +
regular enemies
- +
special enemies that do not mutate/augment right now
-
    - {#each otherMatches as m (m.name + m.level)} -
  • - - (Lv{formatLevel(m)}) {m.name} - ({#if m.mutating}mutates{/if}{#if m.augmenting}augments{/if} - {formatNextUptime(m.uptime.futureUptime)}) - - {#if !m.spawning} -  (next spawns {m.nextSpawn - ? day(m.nextSpawn.date).fromNow() - : "in a long time"}) - {/if} -
  • - {/each} -
+
diff --git a/src/EnemyList.svelte b/src/EnemyList.svelte new file mode 100644 index 0000000..e6c096e --- /dev/null +++ b/src/EnemyList.svelte @@ -0,0 +1,86 @@ + + +
    + {#each matches as m (m.name + m.level)} +
  • + + (Lv{formatLevel(m)}) {m.name} + {#if type !== 2}({#if m.mutating}mutates{/if}{#if m.augmenting}augments{/if} + {#if type === TYPES.UP} + {formatUptimeUntil(m.uptime.futureUptime)}) + {:else if type === TYPES.DOWN} + {formatNextUptime(m.uptime.futureUptime)}) + {/if}{/if} + + {#if !m.spawning} +  (next spawns {m.nextSpawn + ? day(m.nextSpawn.date).fromNow() + : "in a long time"}) + {/if} + {#if m.logogram} + ✶ {m.logogram} logogram + {/if} +
  • + {/each} +
diff --git a/src/bestiary.js b/src/bestiary.js index 9a2728c..08b16e1 100644 --- a/src/bestiary.js +++ b/src/bestiary.js @@ -25,6 +25,29 @@ export const logograms = { OBSCURE: 8, }; +export function getLogogramName(logogram) { + switch (logogram) { + case 0: + return "Conceptual"; + case 1: + return "Fundamental"; + case 2: + return "Offensive"; + case 3: + return "Protective"; + case 4: + return "Curative"; + case 5: + return "Tactical"; + case 6: + return "Inmical"; + case 7: + return "Mitigative"; + case 8: + return "Obscure"; + } +} + export function getMatches(forecast, level) { let res = []; bestiaries[forecast[0].zone].forEach((b) => { @@ -40,6 +63,7 @@ export function getMatches(forecast, level) { special: b.type > 0, mutating: b.type === 1, augmenting: b.type === 2, + logogram: typeof b.logogram === "number" && getLogogramName(b.logogram), spawning: !b.spawnConditions || b.spawnConditions.includes(forecast[0].currWeather), diff --git a/src/pyros.bestiary.js b/src/pyros.bestiary.js index 2a4ec5e..d9a270a 100644 --- a/src/pyros.bestiary.js +++ b/src/pyros.bestiary.js @@ -419,6 +419,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 36, @@ -427,6 +428,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [5], + logogram: 0, }, { level: 37, @@ -435,6 +437,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [5], + logogram: 0, }, { level: 38, @@ -443,6 +446,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [4], + logogram: 0, }, { level: 39, @@ -451,6 +455,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [4], + logogram: 0, }, { level: 40, @@ -459,6 +464,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 41, @@ -467,6 +473,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [5], + logogram: 1, }, { level: 42, @@ -475,6 +482,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 43, @@ -483,6 +491,7 @@ export default [ elem: null, conditions: { day: [4], night: [4] }, spawnConditions: [4], + logogram: 7, }, { level: 44, @@ -491,6 +500,7 @@ export default [ elem: null, conditions: { day: [4], night: [4] }, spawnConditions: [4], + logogram: 7, }, { level: 45, @@ -499,6 +509,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 46, @@ -507,6 +518,7 @@ export default [ elem: null, conditions: { day: [5], night: [5] }, spawnConditions: [5], + logogram: 7, }, { level: 47, @@ -515,6 +527,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [3, 7], + logogram: 0, }, { level: 48, @@ -523,6 +536,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 49, @@ -531,6 +545,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [9], + logogram: 0, }, { level: 50, @@ -539,6 +554,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [3, 7], + logogram: 0, }, { level: 51, @@ -547,6 +563,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [3, 7], + logogram: 0, }, { level: 52, @@ -555,6 +572,7 @@ export default [ elem: null, conditions: { day: [7, 3], night: [7, 3] }, spawnConditions: [3, 7], + logogram: 6, }, { level: 53, @@ -563,6 +581,7 @@ export default [ elem: null, conditions: { day: [], night: [] }, spawnConditions: [4], + logogram: 0, }, { level: 54, @@ -571,6 +590,7 @@ export default [ elem: null, conditions: { day: [5], night: [5] }, spawnConditions: [5], + logogram: 6, }, { level: 55, @@ -579,6 +599,7 @@ export default [ elem: null, conditions: { day: [9], night: [9] }, spawnConditions: [9], + logogram: 6, }, { level: 55, -- cgit 1.4.1-2-gfad0