소스 검색

Some fixes in runs page.

Iñigo Valentin 6 년 전
부모
커밋
391571bb2f
4개의 변경된 파일193개의 추가작업 그리고 64개의 파일을 삭제
  1. 116 0
      application/Constant.php
  2. 11 2
      application/entity/Run.php
  3. 61 59
      application/entity/Unit.php
  4. 5 3
      public/css/runs.css

+ 116 - 0
application/Constant.php

@@ -518,6 +518,122 @@
         const DRAGONS_LAIR = 9001;
     };
 
+    /**
+     * Cairos Dungeons section constants.
+     *
+     * @category Data
+     */
+    final class CAIROS_DUNGEON_ID{
+
+        /**
+         * Hall of Dark.
+         */
+        const HALL_OF_DARK = 1001;
+
+        /**
+         * Hall of Fire.
+         */
+        const HALL_OF_FIRE = 2001;
+
+        /**
+         * Hall of water.
+         */
+        const HALL_OF_WATER = 3001;
+
+        /**
+         * Hall of Wind.
+         */
+        const HALL_OF_WIND = 4001;
+
+        /**
+         * Hall of Magic.
+         */
+        const HALL_OF_MAGIC = 5001;
+
+        /**
+         * Necropolis.
+         */
+        const NECROPOLIS = 6001;
+
+        /**
+         * Punisher's Crypt.
+         */
+        const PUNISHERS_CRYPT = 9502;
+
+        /**
+         * Steel Fortress
+         */
+        const STEEL_FORTRESS = 9602; // TODO: Find out
+
+        /**
+         * Hall of Light.
+         */
+        const HALL_OF_LIGHT = 7001;
+
+        /**
+         * Giants Keep.
+         */
+        const GIANTS_KEEP = 8001;
+
+        /**
+         * Dragons Lair.
+         */
+        const DRAGONS_LAIR = 9001;
+    };
+
+    /**
+     * Dimensional Dungeons section constants.
+     *
+     * @category Data
+     */
+    final class DIMENSION_DUNGEON_ID{
+
+        /**
+         * Sanctuary of Dreaming Fairies.
+         */
+        const SANCTUARY_OF_DREAMING_FAIRIES = 1101;
+
+        /**
+         * Ellunia Remains (Fairy).
+         */
+        const ELLUNIA_REMAINS_FAIRY = 1201;
+
+        /**
+         * Ellunia Remains (Pixie).
+         */
+        const ELLUNIA_REMAINS_PIXIE = 1202;
+
+        /**
+         * Forest of Roaring Beasts.
+         */
+        const FOREST_OF_ROARING_BEASTS = 2101;
+
+        /**
+         * Karzhan Remains (Warbear).
+         */
+        const KARZHAN_REMAINS_WARBEAR = 2201;
+
+        /**
+         * Karzhan Remains (Inugami).
+         */
+        const KARZHAN_REMAINS_INUGAMI = 2202;
+
+        /**
+         * Cliff of Tough Beast Men.
+         */
+        const CLIFF_OF_TOUGH_BEASTS_MEN = 3101;
+
+        /**
+         * Lumel Remains (Werewolf).
+         */
+        const LUMEL_REMAINS_WEREWOLF = 3201;
+
+        /**
+         * Lumel Remains (Martial Cat).
+         */
+        const LUMEL_REMAINS_MARTIAL_CAT = 3202;
+    };
+
     /**
      * Elemental Rift Dungeon constants.
      *

+ 11 - 2
application/entity/Run.php

@@ -195,9 +195,18 @@
             elseif (APPLICATION::valid_id("ELEMENTAL_RIFT_DUNGEON_ID", $r["area"]) && $r["stage"] < 1){
                 $type = AREA_TYPE_ID::RIFT_DUNGEON;
             }
-            elseif (APPLICATION::valid_id("DUNGEON_ID", $r["area"])){
+            elseif (APPLICATION::valid_id("CAIROS_DUNGEON_ID", $r["area"])){
                 $type = AREA_TYPE_ID::CAIROS_DUNGEON;
             }
+            elseif (APPLICATION::valid_id("DIMENSION_DUNGEON_ID", $r["area"])){
+                if ($this->id == 1486){
+                    error_log("VALID AREA ID: " . $r["area"] . ", " . AREA_TYPE_ID::DIMENSIONAL_HOLE);
+                }
+                $type = AREA_TYPE_ID::DIMENSIONAL_HOLE;
+            }
+            if ($this->id == 1486){
+                error_log("INSTANCING DH AREA: " . $r["area"] . ", " . $type);
+            }
             $this->area = new K_Area($r["area"], $type);
             $this->stage = $r["stage"];
             $this->difficulty = $r["difficulty"];
@@ -213,7 +222,7 @@
                 SELECT
                   unit,
                   k_unit,
-                  (SELECT count(id) FROM unit WHERE unit.unit = k_unit) AS owned,
+                  (SELECT count(id) FROM unit WHERE unit.id = run_party.unit) AS owned,
                   leader,
                   front
                 FROM run_party

+ 61 - 59
application/entity/Unit.php

@@ -274,66 +274,68 @@
               "  id = '$id'; ";
             $q = $db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
-            $this->uid = $r["uid"];
-            $this->id = $r["id"];
-            if ($r["building"] != null && $r["building"] > 0){
-                $this->building = new Building($r["building"]);
-            }
-            if (strlen($r["unit"]) > 0){
-                $this->unit = new K_Unit($r["unit"], $complete);
-            }
-            $this->stars = $r["stars"];
-            $this->level = $r["level"];
-            $this->hp = $r["hp"];
-            $this->attack = $r["attack"];
-            $this->defense = $r["defense"];
-            $this->speed = $r["speed"];
-            $this->crit_rate = $r["crit_rate"];
-            $this->crit_damage = $r["crit_damage"];
-            $this->resistance = $r["resistance"];
-            $this->accuracy = $r["accuracy"];
-            $this->experience = $r["experience"];
-            $this->exp_gained = $r["exp_gained"];
-            $this->exp_gain_rate = $r["exp_gain_rate"];
-            $this->costume = $r["costume"];
-            $this->source = new K_Source($r["source"]);
-            $this->create_time = date_create($r["create_time"]);
-            $this->homunculus_name = $r["homunculus_name"];
-            if ($complete){
-                $this->load_runes();
-                $this->load_artifacts();
-                $this->load_teams();
-                $this->check_storage();
-                $this->lock = $r["lock"];
-                $s =
-                  "SELECT level " .
-                  "FROM " .
-                  "  unit_skill, " .
-                  "  k_skill " .
-                  "WHERE " .
-                  "  k_skill.id = unit_skill.skill AND " .
-                  "  unit = '$this->id' " .
-                  "ORDER BY slot;";
-                $q = $db->query($s);
-                while ($r = $q->fetchArray(SQLITE3_ASSOC)){
-                    array_push($this->skill_levels, $r["level"]);
+            if ($r){
+                $this->uid = $r["uid"];
+                $this->id = $r["id"];
+                if ($r["building"] != null && $r["building"] > 0){
+                    $this->building = new Building($r["building"]);
+                }
+                if (strlen($r["unit"]) > 0){
+                    $this->unit = new K_Unit($r["unit"], $complete);
+                }
+                $this->stars = $r["stars"];
+                $this->level = $r["level"];
+                $this->hp = $r["hp"];
+                $this->attack = $r["attack"];
+                $this->defense = $r["defense"];
+                $this->speed = $r["speed"];
+                $this->crit_rate = $r["crit_rate"];
+                $this->crit_damage = $r["crit_damage"];
+                $this->resistance = $r["resistance"];
+                $this->accuracy = $r["accuracy"];
+                $this->experience = $r["experience"];
+                $this->exp_gained = $r["exp_gained"];
+                $this->exp_gain_rate = $r["exp_gain_rate"];
+                $this->costume = $r["costume"];
+                $this->source = new K_Source($r["source"]);
+                $this->create_time = date_create($r["create_time"]);
+                $this->homunculus_name = $r["homunculus_name"];
+                if ($complete){
+                    $this->load_runes();
+                    $this->load_artifacts();
+                    $this->load_teams();
+                    $this->check_storage();
+                    $this->lock = $r["lock"];
+                    $s =
+                    "SELECT level " .
+                    "FROM " .
+                    "  unit_skill, " .
+                    "  k_skill " .
+                    "WHERE " .
+                    "  k_skill.id = unit_skill.skill AND " .
+                    "  unit = '$this->id' " .
+                    "ORDER BY slot;";
+                    $q = $db->query($s);
+                    while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                        array_push($this->skill_levels, $r["level"]);
+                    }
+                    $s =
+                    "SELECT exp " .
+                    "FROM k_experience " .
+                    "WHERE " .
+                    "  stars = $this->stars AND " .
+                    "  level = $this->level;";
+                    $q = $db->query($s);
+                    $r = $q->fetchArray(SQLITE3_ASSOC);
+                    $this->experience_level = $r["exp"];
+                    $this->experience_level_up = $r["exp"] - $this->exp_gained;
+                }
+                if ($this->unit->homunculus){
+                    $this->title = $this->homunculus_name;
+                }
+                else{
+                    $this->title = $this->unit->title;
                 }
-                $s =
-                  "SELECT exp " .
-                  "FROM k_experience " .
-                  "WHERE " .
-                  "  stars = $this->stars AND " .
-                  "  level = $this->level;";
-                $q = $db->query($s);
-                $r = $q->fetchArray(SQLITE3_ASSOC);
-                $this->experience_level = $r["exp"];
-                $this->experience_level_up = $r["exp"] - $this->exp_gained;
-            }
-            if ($this->unit->homunculus){
-                $this->title = $this->homunculus_name;
-            }
-            else{
-                $this->title = $this->unit->title;
             }
         }
 

+ 5 - 3
public/css/runs.css

@@ -23,12 +23,14 @@ table#runs td.area div.area img.area{
 
 table#runs td.area div.area span.stage{
     position: relative;
-    left: -1.85em;
-    top: -0.4em;
+    right: -1.5em;
+    bottom: 1.5em;
     font-size: 80%;
-    text-align: right;
     text-shadow: 0 0 0.3em #000, 0 0 0.3em #000, 0 0 0.3em #000, 0 0 0.2em #000, 0 0 0.1em #000, 0 0 0.1em #000;
     pointer-events: none;
+    text-align: right;
+    width: 2em;
+    display: block;
 }
 
 table#runs td.area div.area span.difficulty{