|
@@ -274,66 +274,68 @@
|
|
|
" id = '$id'; ";
|
|
" id = '$id'; ";
|
|
|
$q = $db->query($s);
|
|
$q = $db->query($s);
|
|
|
$r = $q->fetchArray(SQLITE3_ASSOC);
|
|
$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;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|