monsters.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <?php
  2. global $ELEMENT;
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang='en'>
  6. <head>
  7. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  8. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  9. <title><?=$page->title?></title>
  10. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  11. <!-- CSS files -->
  12. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  13. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>monsters.css'/>
  14. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>filters.css'/>
  15. <!-- Meta tags -->
  16. <link rel='canonical' href='<?=$page->canonical?>'/>
  17. <link rel='author' href='<?=$page->author?>'/>
  18. <link rel='publisher' href='<?=$page->author?>'/>
  19. <meta name='description' content='<?=$page->description?>'/>
  20. <meta property='og:title' content='<?=$page->title?>'/>
  21. <meta property='og:url' content='<?=$page->canonical?>'/>
  22. <meta property='og:description' content='<?=$page->description?>'/>
  23. <meta property='og:image' content='<?=$page->icon?>'/>
  24. <meta property='og:site_name' content='<?=$page->name?>'/>
  25. <meta property='og:type' content='website'/>
  26. <meta property='og:locale' content='en'/>
  27. <meta name='twitter:card' content='summary'/>
  28. <meta name='twitter:title' content='<?=$page->title?>'/>
  29. <meta name='twitter:description' content='<?=$page->description?>'/>
  30. <meta name='twitter:image' content='<?=$page->icon?>'/>
  31. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  32. <meta name='robots' content='index follow'/>
  33. <script>
  34. /**
  35. * Shows or hiddes the filters panel.
  36. */
  37. function toggleFilters(){
  38. var content = document.getElementById('filters_content');
  39. var slid = document.getElementById('filters_slid');
  40. if (content.style.maxHeight != '30em'){
  41. content.style.maxHeight = '30em';
  42. slid.style.transform = 'rotate(90deg)';
  43. }
  44. else{
  45. content.style.maxHeight = '0px';
  46. slid.style.transform = 'rotate(0deg)';
  47. }
  48. };
  49. </script>
  50. </head>
  51. <body>
  52. <?php
  53. include __DIR__ . "/inc/header.php";
  54. ?>
  55. <section class='filters'>
  56. <h2 id='filters_title' onClick='toggleFilters();'>
  57. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=$path["img"]["icon"]?>slid.png'/>
  58. Monster filters
  59. </h2>
  60. <article id='filters_content'>
  61. <?php
  62. $filters = $page->filters;
  63. $custom_filters = $page->custom_filters;
  64. include __DIR__ . "/inc/filter_monsters.php";
  65. ?>
  66. </article>
  67. </section> <!-- #filters -->
  68. <section class='list'>
  69. <h2>
  70. Monsters
  71. </h2>
  72. <article>
  73. <?php
  74. foreach ($page->monsters as $mon){
  75. ?>
  76. <div class='monster'>
  77. <a href='/<?=$UID?>/monsters/<?=$mon->id?>'>
  78. <div class='monster_panel'>
  79. <?=html_unit_panel($mon)?>
  80. </div>
  81. </a>
  82. <div class='monster_tooltip'>
  83. <h4>
  84. <?=$mon->title?>
  85. </h4>
  86. <?php
  87. $building_attack = floor(($mon->attack * $page->building_stats["atk"] / 100) + ($mon->attack * $page->building_stats["elm"][$mon->unit->element] / 100));
  88. $building_defense = floor($page->building_stats["def"] * $mon->defense / 100);
  89. $building_hp = floor($page->building_stats["hp"] * $mon->hp / 100);
  90. $building_speed = $page->building_stats["spd"];
  91. $building_crit_rate = 0;
  92. $building_crit_damage = $page->building_stats["crd"];
  93. $building_accuracy = 0;
  94. $building_resistance = 0;
  95. ?>
  96. <table class='stats'>
  97. <tr>
  98. <th>
  99. Stats
  100. </th>
  101. <th>
  102. Base
  103. </th>
  104. <th>
  105. Runes
  106. </th>
  107. <th>
  108. Buildings
  109. </th>
  110. <th>
  111. Total
  112. </th>
  113. </tr>
  114. <tr>
  115. <th>
  116. ATK
  117. </th>
  118. <td class='base'>
  119. <?=$mon->attack?>
  120. </td>
  121. <td class='extra'>
  122. +<?=$mon->rune_attack?>
  123. </td>
  124. <td class='extra'>
  125. +<?=$building_attack?>
  126. </td>
  127. <td class='total'>
  128. <?=$mon->attack + $mon->rune_attack + $building_attack?>
  129. </td>
  130. </tr>
  131. <tr>
  132. <th>
  133. DEF
  134. </th>
  135. <td class='base'>
  136. <?=$mon->defense?>
  137. </td>
  138. <td class='extra'>
  139. +<?=$mon->rune_defense?>
  140. </td>
  141. <td class='extra'>
  142. +<?=$building_defense?>
  143. </td>
  144. <td class='total'>
  145. <?=$mon->defense + $mon->rune_defense + $building_defense?>
  146. </td>
  147. </tr>
  148. <tr>
  149. <th>
  150. HP
  151. </th>
  152. <td class='base'>
  153. <?=$mon->hp?>
  154. </td>
  155. <td class='extra'>
  156. +<?=$mon->rune_hp?>
  157. </td>
  158. <td class='extra'>
  159. +<?=$building_hp?>
  160. </td>
  161. <td class='total'>
  162. <?=$mon->hp + $mon->rune_hp + $building_hp?>
  163. </td>
  164. </tr>
  165. <tr>
  166. <th>
  167. SPD
  168. </th>
  169. <td class='base'>
  170. <?=$mon->speed?>
  171. </td>
  172. <td class='extra'>
  173. +<?=$mon->rune_speed?>
  174. </td>
  175. <td class='extra'>
  176. +<?=$building_speed?>
  177. </td>
  178. <td class='total'>
  179. <?=$mon->speed + $mon->rune_speed + $building_speed?>
  180. </td>
  181. </tr>
  182. <tr>
  183. <th>
  184. CRR
  185. </th>
  186. <td class='base'>
  187. <?=$mon->crit_rate?>%
  188. </td>
  189. <td class='extra'>
  190. +<?=$mon->rune_crit_rate?>%
  191. </td>
  192. <td class='extra'>
  193. +<?=$building_crit_rate?>%
  194. </td>
  195. <td class='total'>
  196. <?=$mon->crit_rate + $mon->rune_crit_rate + $building_crit_rate?>%
  197. </td>
  198. </tr>
  199. <tr>
  200. <th>
  201. CRD
  202. </th>
  203. <td class='base'>
  204. <?=$mon->crit_damage?>%
  205. </td>
  206. <td class='extra'>
  207. +<?=$mon->rune_crit_damage?>%
  208. </td>
  209. <td class='extra'>
  210. +<?=$building_crit_damage?>%
  211. </td>
  212. <td class='total'>
  213. <?=$mon->crit_damage + $mon->rune_crit_damage + $building_crit_damage?>%
  214. </td>
  215. </tr>
  216. <tr>
  217. <th>
  218. ACC
  219. </th>
  220. <td class='base'>
  221. <?=$mon->accuracy?>%
  222. </td>
  223. <td class='extra'>
  224. +<?=$mon->rune_accuracy?>%
  225. </td>
  226. <td class='extra'>
  227. +<?=$building_accuracy?>%
  228. </td>
  229. <td class='total'>
  230. <?=$mon->accuracy + $mon->rune_accuracy + $building_accuracy?>%
  231. </td>
  232. </tr>
  233. <tr>
  234. <th>
  235. RES
  236. </th>
  237. <td class='base'>
  238. <?=$mon->resistance?>%
  239. </td>
  240. <td class='extra'>
  241. +<?=$mon->rune_resistance?>%
  242. </td>
  243. <td class='extra'>
  244. +<?=$building_resistance?>%
  245. </td>
  246. <td class='total'>
  247. <?=$mon->resistance + $mon->rune_resistance + $building_resistance?>%
  248. </td>
  249. </tr>
  250. </table>
  251. <div class='skills'>
  252. <?php
  253. $skill_num = 0;
  254. foreach ($mon->unit->skill as $skill){
  255. $cur_lvl = $mon->skill_levels[$skill_num];
  256. $max_lvl = $skill->max_level;
  257. if ($max_lvl == $cur_lvl){
  258. $maxed = "maxed";
  259. }
  260. else{
  261. $maxed = "";
  262. }
  263. ?>
  264. <div class='skill'>
  265. <img src='<?=$skill->get_image()?>'/>
  266. <span class='skill_level <?=$maxed?>'>
  267. <?=$cur_lvl?>/<?=$max_lvl?>
  268. </span>
  269. <span class='skill_name'>
  270. <?=$skill->name?>
  271. </span>
  272. </div>
  273. <?php
  274. $skill_num ++;
  275. }
  276. ?>
  277. </div>
  278. </div>
  279. </div>
  280. <?php
  281. }
  282. ?>
  283. </article>
  284. </section> <!-- #catalog -->
  285. <?php
  286. include __DIR__ . "/inc/footer.php";
  287. ?>
  288. </body>
  289. </html>