report_skillup.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  6. <title><?=$page->title?></title>
  7. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  8. <!-- CSS files -->
  9. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  10. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>report.css'/>
  11. <!-- Script files -->
  12. <script src="<?=$path["js"]?>ui.js"></script>
  13. <!-- Meta tags -->
  14. <link rel='canonical' href='<?=$page->canonical?>'/>
  15. <link rel='author' href='<?=$page->author?>'/>
  16. <link rel='publisher' href='<?=$page->author?>'/>
  17. <meta name='description' content='<?=$page->description?>'/>
  18. <meta property='og:title' content='<?=$page->title?>'/>
  19. <meta property='og:url' content='<?=$page->canonical?>'/>
  20. <meta property='og:description' content='<?=$page->description?>'/>
  21. <meta property='og:image' content='<?=$page->icon?>'/>
  22. <meta property='og:site_name' content='<?=$page->name?>'/>
  23. <meta property='og:type' content='website'/>
  24. <meta property='og:locale' content='en'/>
  25. <meta name='twitter:card' content='summary'/>
  26. <meta name='twitter:title' content='<?=$page->title?>'/>
  27. <meta name='twitter:description' content='<?=$page->description?>'/>
  28. <meta name='twitter:image' content='<?=$page->icon?>'/>
  29. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  30. <meta name='robots' content='index follow'/>
  31. </head>
  32. <body id='body_report_skillup'>
  33. <?php
  34. include __DIR__ . "/inc/header.php";
  35. ?>
  36. <section class='filters'>
  37. <h2>
  38. <span>
  39. Monster filters
  40. </span>
  41. </h2>
  42. <form action='/report/skillup/' method='get'>
  43. <table>
  44. <tr>
  45. <td class='filter' id='filter_stars'>
  46. <span>Stars:</span>
  47. <input type='number' name='min_stars' min='1' max='6' value='<?=$page->filters["min_stars"]?>'/>
  48. -
  49. <input type='number' name='max_stars' min='1' max='6' value='<?=$page->filters["max_stars"]?>'/>
  50. </td>
  51. <td class='filter' id='filter_stars'>
  52. <span>Natural stars:</span>
  53. <input type='number' name='min_natural_stars' min='1' max='6' value='<?=$page->filters["min_natural_stars"]?>'/>
  54. -
  55. <input type='number' name='max_natural_stars' min='1' max='6' value='<?=$page->filters["max_natural_stars"]?>'/>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td class='filter' colspan='2'>
  60. <?php
  61. $checked = "";
  62. if ($page->filters["family"]){
  63. $checked = "checked";
  64. }
  65. ?>
  66. <input type='checkbox' name='family' <?=$checked?>/>
  67. Show monsters with family with lower grade.
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class='filter' colspan='2'>
  72. <?php
  73. $checked = "";
  74. if ($page->filters["2a"]){
  75. $checked = "checked";
  76. }
  77. ?>
  78. <input type='checkbox' name='2a' <?=$checked?>/>
  79. Include second-awakened monsters.
  80. </td>
  81. </tr>
  82. <tr>
  83. <td class='filter' colspan='2'>
  84. <?php
  85. $checked = "";
  86. if ($page->filters["homunculus"]){
  87. $checked = "checked";
  88. }
  89. ?>
  90. <input type='checkbox' name='homunculus' <?=$checked?>/>
  91. Include Homunculus.
  92. </td>
  93. </tr>
  94. <tr>
  95. <td class='filter' colspan='2'>
  96. <?php
  97. $checked = "";
  98. if ($page->filters["in_storage"]){
  99. $checked = "checked";
  100. }
  101. ?>
  102. <input type='checkbox' name='in_storage' <?=$checked?>/>
  103. Show monsters in storage
  104. </td>
  105. </tr>
  106. <tr>
  107. <td class='filter' colspan='2'>
  108. <?php
  109. $checked = "";
  110. if ($page->filters["without_runes"]){
  111. $checked = "checked";
  112. }
  113. ?>
  114. <input type='checkbox' name='without_runes' <?=$checked?>/>
  115. Show monsters without runes
  116. </td>
  117. </tr>
  118. <tr>
  119. <td class='filter' colspan='2'>
  120. <?php
  121. $checked = "";
  122. if ($page->filters["maxed"]){
  123. $checked = "checked";
  124. }
  125. ?>
  126. <input type='checkbox' name='maxed' <?=$checked?>/>
  127. Show fully skilled-up monster
  128. </td>
  129. </tr>
  130. </table>
  131. <div id='filter_apply'>
  132. <input type='submit' value='Apply'/>
  133. </div>
  134. </form>
  135. </section> <!-- #filters -->
  136. <?php
  137. $index = 1;
  138. foreach ($page->units as $unit){
  139. if ($unit->unit->awakens_from == "" && $unit->unit->awakens_to == ""){
  140. // No to, no from, silver monster.
  141. $star_class ="star_silver";
  142. $unit_title = $unit->unit->element . " " . $unit->unit->name;
  143. }
  144. elseif ($unit->unit->awakens_from =! "" && $unit->unit->awakens_to == ""){
  145. // Already awakened
  146. if ($unit->unit->base_stars - $unit->unit->natural_stars == 1){
  147. // Normal awaken.
  148. $star_class = "star_purple";
  149. }
  150. else{
  151. // Second awaken.
  152. $star_class = "star_red";
  153. }
  154. $unit_title = $unit->unit->name;
  155. }
  156. elseif ($unit->unit->awakens_to =! ""){
  157. // Awakeable.
  158. $star_class = "star_gold";
  159. $unit_title = $unit->unit->element . " " . $unit->unit->name;
  160. }
  161. switch ($index % 10){
  162. case 1:
  163. $index_title = $index . "<span class='superindex'>st</span> - " . $unit_title;
  164. break;
  165. case 2:
  166. $index_title = $index . "<span class='superindex'>nd</span> - " . $unit_title;
  167. break;
  168. case 3:
  169. $index_title = $index . "<span class='superindex'>rd</span> - " . $unit_title;
  170. break;
  171. default:
  172. $index_title = $index . "<span class='superindex'>th</span> - " . $unit_title;
  173. break;
  174. }
  175. switch ($index % 100){
  176. case 11:
  177. case 12:
  178. case 13:
  179. $index_title = $index . "<span class='superindex'>th</span> - " . $unit_title;
  180. break;
  181. }
  182. ?>
  183. <section class='content'>
  184. <h2>
  185. <span>
  186. <?=$index_title?>
  187. </span>
  188. </h2>
  189. <article>
  190. <div class='monster'>
  191. <div class='profile'>
  192. <div class='monster_panel'>
  193. <span class='stars'>
  194. <?php
  195. for ($i = 0; $i < $unit->stars; $i ++){
  196. ?>
  197. <img class='star <?=$star_class?>' src='<?=$path["img"]["layout"] . "icon/star.png"?>'/>
  198. <?php
  199. }
  200. ?>
  201. </span>
  202. <img title='<?=$unit_title?>' class='monster border_<?=$unit->unit->element_name?>' src='<?=$unit->unit->get_image()?>'/>
  203. <span class='level'>
  204. <?=$unit->level?>
  205. </span>
  206. </div>
  207. </div> <!-- .profile -->
  208. <div class='skills'>
  209. <?php
  210. $skill_num = 0;
  211. $absolute_level = 0;
  212. $absolute_max_level = 0;
  213. $ponderated_level = 0;
  214. $ponderated_max_level = 0;
  215. foreach ($unit->unit->skill as $skill){
  216. if ($skill->max_level > 1){
  217. $absolute_max_level += $skill->max_level - 1;
  218. }
  219. $cur_lvl = $unit->skill_levels[$skill_num];
  220. if ($skill->max_level > 1){
  221. $absolute_level += $cur_lvl - 1;
  222. $ponderated_level += ($cur_lvl - 1) * (1 + ($skill_num / 2));
  223. $ponderated_max_level += ($skill->max_level - 1) * (1 + ($skill_num / 2));
  224. }
  225. $max_lvl = $skill->max_level;
  226. if ($max_lvl == $cur_lvl){
  227. $maxed = "maxed";
  228. }
  229. else{
  230. $maxed = "";
  231. }
  232. ?>
  233. <div class='skill'>
  234. <img title='<?=$skill->description?>' src='<?=$skill->get_image()?>'/>
  235. <span class='skill_level <?=$maxed?>'>
  236. <?=$cur_lvl?>/<?=$max_lvl?>
  237. </span>
  238. <span class='skill_name'>
  239. <?=$skill->name?>
  240. </span>
  241. </div>
  242. <?php
  243. $skill_num ++;
  244. }
  245. ?>
  246. </div> <!-- #skills -->
  247. <table id='skill_averages'>
  248. <tr>
  249. <td class='title'>
  250. Absolute skill-ups:
  251. </td>
  252. <td class='value'>
  253. <?=number_format($absolute_level * 100 / $absolute_max_level, 2)?>%
  254. </td>
  255. </tr>
  256. <tr>
  257. <td class='title'>
  258. Ponderated skill-ups:
  259. </td>
  260. <td class='value'>
  261. <?=number_format($ponderated_level * 100 / $ponderated_max_level, 2)?>%
  262. </td>
  263. </tr>
  264. <tr>
  265. <td class='title'>
  266. Remaining skill-ups:
  267. </td>
  268. <td class='value'>
  269. <?=$absolute_max_level - $absolute_level?>
  270. </td>
  271. </tr>
  272. </table>
  273. </div>
  274. </article>
  275. </section>
  276. <?php
  277. $index ++;
  278. }
  279. ?>
  280. <?php
  281. include __DIR__ . "/inc/footer.php";
  282. ?>
  283. </body>
  284. </html>