|
@@ -17,6 +17,17 @@
|
|
|
*/
|
|
*/
|
|
|
public $monster = [];
|
|
public $monster = [];
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * IDs to other monsters of thef family
|
|
|
|
|
+ */
|
|
|
|
|
+ public $family = [
|
|
|
|
|
+ "Fire" => null,
|
|
|
|
|
+ "Water" => null,
|
|
|
|
|
+ "Wind" => null,
|
|
|
|
|
+ "Light" => null,
|
|
|
|
|
+ "Dark" => null,
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Constructor.
|
|
* Constructor.
|
|
|
*
|
|
*
|
|
@@ -32,11 +43,7 @@
|
|
|
$this->view = $path["view"] . "monster_info.php";
|
|
$this->view = $path["view"] . "monster_info.php";
|
|
|
$title = "";
|
|
$title = "";
|
|
|
$monster = new K_Monster($db, $id);
|
|
$monster = new K_Monster($db, $id);
|
|
|
- error_log("ID : " . $monster->id);
|
|
|
|
|
- error_log("FROM: " . $monster->awakens_from);
|
|
|
|
|
- error_log("TO : " . $monster->awakens_to);
|
|
|
|
|
if ($monster->can_awaken == 0){
|
|
if ($monster->can_awaken == 0){
|
|
|
- error_log("CAN_AWAKEN 0 -> SILVER");
|
|
|
|
|
// Silver star monster.
|
|
// Silver star monster.
|
|
|
$this->monster[0] = $monster;
|
|
$this->monster[0] = $monster;
|
|
|
$this->monster[1] = null;
|
|
$this->monster[1] = null;
|
|
@@ -44,7 +51,6 @@
|
|
|
$title = $this->monster[0]->element . " " . $this->monster[0]->name;
|
|
$title = $this->monster[0]->element . " " . $this->monster[0]->name;
|
|
|
}
|
|
}
|
|
|
elseif ($monster->can_awaken == 1 && $monster->awakens_to == "" && $monster->awakens_from == ""){
|
|
elseif ($monster->can_awaken == 1 && $monster->awakens_to == "" && $monster->awakens_from == ""){
|
|
|
- error_log(" -> DEGFAULT PURPLE");
|
|
|
|
|
// Default purple (Rainbowmon or King Angelmon)
|
|
// Default purple (Rainbowmon or King Angelmon)
|
|
|
$this->monster[0] = null;
|
|
$this->monster[0] = null;
|
|
|
$this->monster[1] = $monster;
|
|
$this->monster[1] = $monster;
|
|
@@ -52,29 +58,37 @@
|
|
|
$title = $this->monster[1]->name;
|
|
$title = $this->monster[1]->name;
|
|
|
}
|
|
}
|
|
|
elseif ($monster->can_awaken == 1 && $monster->awakens_to == "" && strlen($monster->awakens_from) > 0){
|
|
elseif ($monster->can_awaken == 1 && $monster->awakens_to == "" && strlen($monster->awakens_from) > 0){
|
|
|
- error_log("NORMAL MONSTER AWAKEN, no 2a. FROM: " . $monster->awakens_from);
|
|
|
|
|
// Normal monster, already awakened, no 2a.
|
|
// Normal monster, already awakened, no 2a.
|
|
|
$this->monster[0] = new K_Monster($db, $monster->awakens_from);
|
|
$this->monster[0] = new K_Monster($db, $monster->awakens_from);
|
|
|
$this->monster[1] = $monster;
|
|
$this->monster[1] = $monster;
|
|
|
$this->monster[2] = null;
|
|
$this->monster[2] = null;
|
|
|
$title = $this->monster[1]->name . " - " .$this->monster[0]->element . " " . $this->monster[0]->name;
|
|
$title = $this->monster[1]->name . " - " .$this->monster[0]->element . " " . $this->monster[0]->name;
|
|
|
|
|
+ $monster = $this->monster[0];
|
|
|
}
|
|
}
|
|
|
elseif ($monster->can_awaken == 1 && strlen($monster->awakens_to) > 0 && $monster->awakens_from == ""){
|
|
elseif ($monster->can_awaken == 1 && strlen($monster->awakens_to) > 0 && $monster->awakens_from == ""){
|
|
|
// Normal monster, not awakened, may have 2a.
|
|
// Normal monster, not awakened, may have 2a.
|
|
|
$this->monster[0] = $monster;
|
|
$this->monster[0] = $monster;
|
|
|
$this->monster[1] = new K_Monster($db, $this->monster[0]->awakens_to);
|
|
$this->monster[1] = new K_Monster($db, $this->monster[0]->awakens_to);
|
|
|
if ($this->monster[1]->awakens_to == ""){
|
|
if ($this->monster[1]->awakens_to == ""){
|
|
|
- error_log("NORMAL MONSTER, GOLD, NO 2a");
|
|
|
|
|
$this->monster[2] = null;
|
|
$this->monster[2] = null;
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- error_log("NORMAL MONSTER, GOLD, WITH 2a");
|
|
|
|
|
$this->monster[2] = new K_Monster($db, $this->monster[1]->awakens_to);
|
|
$this->monster[2] = new K_Monster($db, $this->monster[1]->awakens_to);
|
|
|
}
|
|
}
|
|
|
$title = $this->monster[1]->name . " - " .$this->monster[0]->element . " " . $this->monster[0]->name;
|
|
$title = $this->monster[1]->name . " - " .$this->monster[0]->element . " " . $this->monster[0]->name;
|
|
|
}
|
|
}
|
|
|
- else{
|
|
|
|
|
- error_log("UNKNOWN");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $s =
|
|
|
|
|
+ "SELECT " .
|
|
|
|
|
+ " id, " .
|
|
|
|
|
+ " element " .
|
|
|
|
|
+ "FROM k_monster " .
|
|
|
|
|
+ "WHERE " .
|
|
|
|
|
+ " family_id = " . $monster->family_id . " AND " .
|
|
|
|
|
+ " element <> '" . $monster->element . "';";
|
|
|
|
|
+ $q_mon = $this->db->query($s);
|
|
|
|
|
+ while ($r = $q_mon->fetchArray(SQLITE3_ASSOC)){
|
|
|
|
|
+ $this->family[$r["element"]] = $r["id"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$this->title = $title ." - SWDB";
|
|
$this->title = $title ." - SWDB";
|