monsters.php 14 KB

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