about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorana <ana@ana.st>2021-08-09 15:48:38 +0200
committerana <ana@ana.st>2021-08-09 15:48:38 +0200
commit911f229c23ec6aadb7ba9a36721d016547f061e1 (patch)
tree9025c1bd3e41a15a1c65fcc161a40de3556f2fd2
parent231f854a1a7fe3ac99aecb97121727997cf8f23f (diff)
downloadeureka-marks-911f229c23ec6aadb7ba9a36721d016547f061e1.tar.gz
feat: add logogram drop information
-rw-r--r--CHANGELOG.md3
-rw-r--r--public/index.css4
-rw-r--r--src/App.svelte52
-rw-r--r--src/EnemyList.svelte86
-rw-r--r--src/bestiary.js24
-rw-r--r--src/pyros.bestiary.js21
6 files changed, 143 insertions, 47 deletions
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 @@
       </h2>
 
       <h5>matches</h5>
-      <ul>
-        {#each upMatches as m (m.name + m.level)}
-          <li>
-            <span class={!m.spawning && "strikethrough"}>
-              <em>(Lv{formatLevel(m)})</em> <strong>{m.name}</strong>
-              ({#if m.mutating}mutates{/if}{#if m.augmenting}augments{/if}
-              {formatUptimeUntil(m.uptime.futureUptime)})
-            </span>
-            {#if !m.spawning}
-              &nbsp;(next spawns {m.nextSpawn
-                ? day(m.nextSpawn.date).fromNow()
-                : "in a long time"}
-            {/if}
-          </li>
-        {/each}
-      </ul>
+      <EnemyList matches={upMatches} type={0} />
 
       <h5>regular enemies</h5>
-      <ul>
-        {#each normalMatches as m (m.name + m.level)}
-          <li>
-            <span class={!m.spawning && "strikethrough"}>
-              <em>(Lv{formatLevel(m)})</em> <strong>{m.name}</strong>
-            </span>
-            {#if !m.spawning}
-              &nbsp;(next spawns {m.nextSpawn
-                ? day(m.nextSpawn.date).fromNow()
-                : "in a long time"})
-            {/if}
-          </li>
-        {/each}
-      </ul>
+      <EnemyList matches={normalMatches} type={2} />
 
       <h5>special enemies that do not mutate/augment right now</h5>
-      <ul>
-        {#each otherMatches as m (m.name + m.level)}
-          <li>
-            <span class={!m.spawning && "strikethrough"}>
-              <em>(Lv{formatLevel(m)})</em> <strong>{m.name}</strong>
-              ({#if m.mutating}mutates{/if}{#if m.augmenting}augments{/if}
-              {formatNextUptime(m.uptime.futureUptime)})
-            </span>
-            {#if !m.spawning}
-              &nbsp;(next spawns {m.nextSpawn
-                ? day(m.nextSpawn.date).fromNow()
-                : "in a long time"})
-            {/if}
-          </li>
-        {/each}
-      </ul>
+      <EnemyList matches={otherMatches} type={1} />
     </div>
     <div class="pure-u-1 pure-u-md-1-4">
       <div class="pure-menu">
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 @@
+<script>
+  export let matches;
+  export let type;
+  import { level, paWeather, pyWeather, hWeather, aWeather } from "./stores";
+  import day from "dayjs";
+  import relativeTime from "dayjs/plugin/relativeTime";
+  day.extend(relativeTime);
+
+  export const TYPES = {
+    UP: 0,
+    DOWN: 1,
+    NO_UPTIME: 2,
+  };
+
+  function formatLevel(m) {
+    if (m.level) {
+      return m.level;
+    } else if (m.levelRange) {
+      return `${m.levelRange[0]}-${m.levelRange[1]}`;
+    }
+    return "??";
+  }
+
+  export function getZoneForecast() {
+    if ($level >= 20 && $level < 35) {
+      return $paWeather;
+    } else if ($level >= 35 && $level < 50) {
+      return $pyWeather;
+    } else if ($level >= 50) {
+      return $hWeather;
+    } else {
+      return $aWeather;
+    }
+  }
+
+  function formatNextUptime(futures) {
+    let i;
+    futures.find((f, idx) => {
+      if (f) i = idx;
+      return f;
+    });
+
+    if (typeof i === "number") {
+      return `in ${day(getZoneForecast()[i + 1].date).fromNow(true)}`;
+    }
+    return "in the far future";
+  }
+
+  function formatUptimeUntil(futures) {
+    let i;
+    futures.find((f, idx) => {
+      if (!f) i = idx;
+      return !f;
+    });
+
+    if (typeof i === "number") {
+      return `for ${day(getZoneForecast()[i + 1].date).fromNow(true)}`;
+    }
+
+    return "for a long time";
+  }
+</script>
+
+<ul>
+  {#each matches as m (m.name + m.level)}
+    <li>
+      <span class={!m.spawning && "strikethrough"}>
+        <em>(Lv{formatLevel(m)})</em> <strong>{m.name}</strong>
+        {#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}
+      </span>
+      {#if !m.spawning}
+        &nbsp;(next spawns {m.nextSpawn
+          ? day(m.nextSpawn.date).fromNow()
+          : "in a long time"})
+      {/if}
+      {#if m.logogram}
+        <span class="highlight">✶ {m.logogram} logogram</span>
+      {/if}
+    </li>
+  {/each}
+</ul>
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,