monsters.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <?php
  2. /**
  3. * Monsters view.
  4. *
  5. * Contains the view layout and ome code to present the data.
  6. *
  7. * @category View
  8. * @var Monsters_Page $page The page model.
  9. * @var 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. <!-- Meta tags -->
  23. <link rel='canonical' href='<?=$page->canonical?>'/>
  24. <link rel='author' href='<?=$page->author?>'/>
  25. <link rel='publisher' href='<?=$page->author?>'/>
  26. <meta name='description' content='<?=$page->description?>'/>
  27. <meta property='og:title' content='<?=$page->title?>'/>
  28. <meta property='og:url' content='<?=$page->canonical?>'/>
  29. <meta property='og:description' content='<?=$page->description?>'/>
  30. <meta property='og:image' content='<?=$page->icon?>'/>
  31. <meta property='og:site_name' content='<?=$page->name?>'/>
  32. <meta property='og:type' content='website'/>
  33. <meta property='og:locale' content='en'/>
  34. <meta name='twitter:card' content='summary'/>
  35. <meta name='twitter:title' content='<?=$page->title?>'/>
  36. <meta name='twitter:description' content='<?=$page->description?>'/>
  37. <meta name='twitter:image' content='<?=$page->icon?>'/>
  38. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  39. <meta name='robots' content='index follow'/>
  40. </head>
  41. <body>
  42. <?php
  43. include __DIR__ . "/inc/header.php";
  44. ?>
  45. <aside id='filters' class='content filters'>
  46. <h2 id='filters_title'>
  47. Monsters
  48. </h2>
  49. <p>
  50. Monsters
  51. </p>
  52. <form action='/<?=$UID?>/monsters/' method='get' id='filter_monsters' class='filter'>
  53. <table>
  54. <tr>
  55. <td class='label'>
  56. Element:
  57. </td>
  58. <td class='value'>
  59. <?php
  60. $selected = Array("", "", "", "", "");
  61. $selected[$page->filters["ELEMENT"] - 1] = "selected";
  62. ?>
  63. <select name='element'>
  64. <option> </option>
  65. <option value='<?=ELEMENT_ID::FIRE?>' <?=$selected[0]?>>Fire</option>
  66. <option value='<?=ELEMENT_ID::WATER?>' <?=$selected[1]?>>Water</option>
  67. <option value='<?=ELEMENT_ID::WIND?>' <?=$selected[2]?>>Wind</option>
  68. <option value='<?=ELEMENT_ID::LIGHT?>' <?=$selected[3]?>>Light</option>
  69. <option value='<?=ELEMENT_ID::DARK?>' <?=$selected[4]?>>Dark</option>
  70. </select>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td class='label'>
  75. Stars:
  76. </td>
  77. <td class='value'>
  78. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["MIN_STARS"]?>'/>
  79. -
  80. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["MAX_STARS"]?>'/>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td class='label'>
  85. Name:
  86. </td>
  87. <td class='value'>
  88. <input type='text' name='name' id='filter_name' value='<?=$page->filters["NAME"]?>'/>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class='filter' colspan='2'>
  93. <?php
  94. $checked = "";
  95. if ($page->filters["IN_STORAGE"]){
  96. $checked = "checked";
  97. }
  98. ?>
  99. <input type='checkbox' name='in_storage' id='filter_in_storage'<?=$checked?>/>
  100. <label for='filter_in_storage'>Monsters in storage</label>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class='filter' colspan='2'>
  105. <?php
  106. $checked = "";
  107. if ($page->filters["WITHOUT_RUNES"]){
  108. $checked = "checked";
  109. }
  110. ?>
  111. <input type='checkbox' name='without_runes' id='filter_without_runes' <?=$checked?>/>
  112. <label for='filter_without_runes'>Monsters without runes</label>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td class='label'>
  117. Effects:
  118. <div class='help_tooltip'>
  119. <p>
  120. Effect the monster can induce. Choose 'All' to search for all of the selected, or 'Any' to search for any of the selected effects.
  121. </p>
  122. </div>
  123. <br/>
  124. <select name='effect_option' id='filter_effect_option'>
  125. <option value='or' <?=($page->filters["EFFECT_OPTION"] == "or") ? ("selected='selected'") : ("");?>>Any</option>
  126. <option value='and' <?=($page->filters["EFFECT_OPTION"] == "and") ? ("selected='selected'") : ("");?>>All</option>
  127. </select>
  128. </td>
  129. <td class='value'>
  130. <select multiple name='effect[]' id='filter_effect'>
  131. <?php
  132. foreach ($page->effects as $effect){
  133. if (in_array($effect->id, $page->filters["EFFECT"])){
  134. $selected = "selected='selected'";
  135. }
  136. else{
  137. $selected = "";
  138. }
  139. $name = $effect->name;
  140. $name = strtoupper($name);
  141. $name = str_replace("INCREASE", "INC.", $name);
  142. $name = str_replace("DECREASE", "DEC.", $name);
  143. $name = str_replace("CRITICAL", "CRIT.", $name);
  144. $name = str_replace("CONTINUOUS", "CONT.", $name);
  145. $name = str_replace("DAMAGE", "DMG.", $name);
  146. $name = str_replace("BENEFICIAL", "BENEF.", $name);
  147. $name = str_replace("BENEFICIAL", "BENEF.", $name);
  148. $name = str_replace("EFFECTS", "EFF.", $name);
  149. $name = str_replace("EFFECT", "EFF.", $name);
  150. ?>
  151. <option value='<?=$effect->id?>' <?=$selected?>><?=$name?></option>
  152. <?php
  153. }
  154. ?>
  155. </select>
  156. </td>
  157. </tr>
  158. </table>
  159. <input type='submit' value='Apply'/>
  160. </form>
  161. </aside> <!-- #filters -->
  162. <main>
  163. <section id='list' class='list'>
  164. <h2>
  165. Monsters
  166. </h2>
  167. <article>
  168. <?php
  169. foreach ($page->monsters as $mon){
  170. ?>
  171. <div class='monster'>
  172. <a href='/<?=$UID?>/monsters/<?=$mon->id?>'>
  173. <div class='monster_panel'>
  174. <?=HTML::unit_panel($mon)?>
  175. </div>
  176. </a>
  177. <div class='monster_tooltip'>
  178. <h4>
  179. <?=$mon->title?>
  180. </h4>
  181. <table class='stats'>
  182. <tr>
  183. <th>
  184. Stats
  185. </th>
  186. <th>
  187. Base
  188. </th>
  189. <th>
  190. Runes
  191. </th>
  192. <th>
  193. Artif.
  194. </th>
  195. <th>
  196. Bldg.
  197. </th>
  198. <th>
  199. Total
  200. </th>
  201. </tr>
  202. <tr>
  203. <th>
  204. ATK
  205. </th>
  206. <td class='base'>
  207. <?=$mon->attack?>
  208. <span class='percent'>&nbsp;</span>
  209. </td>
  210. <td class='extra'>
  211. +<?=$mon->rune_attack?>
  212. <span class='percent'>&nbsp;</span>
  213. </td>
  214. <td class='extra'>
  215. +<?=$mon->artifact_attack?>
  216. <span class='percent'>&nbsp;</span>
  217. </td>
  218. <td class='extra'>
  219. +<?=$mon->building_attack?>
  220. <span class='percent'>&nbsp;</span>
  221. </td>
  222. <td class='total'>
  223. <?=$mon->total_attack?>
  224. <span class='percent'>&nbsp;</span>
  225. </td>
  226. </tr>
  227. <tr>
  228. <th>
  229. DEF
  230. </th>
  231. <td class='base'>
  232. <?=$mon->defense?>
  233. <span class='percent'>&nbsp;</span>
  234. </td>
  235. <td class='extra'>
  236. +<?=$mon->rune_defense?>
  237. <span class='percent'>&nbsp;</span>
  238. </td>
  239. <td class='extra'>
  240. +<?=$mon->artifact_defense?>
  241. <span class='percent'>&nbsp;</span>
  242. </td>
  243. <td class='extra'>
  244. +<?=$mon->building_defense?>
  245. <span class='percent'>&nbsp;</span>
  246. </td>
  247. <td class='total'>
  248. <?=$mon->total_defense?>
  249. <span class='percent'>&nbsp;</span>
  250. </td>
  251. </tr>
  252. <tr>
  253. <th>
  254. HP
  255. </th>
  256. <td class='base'>
  257. <?=$mon->hp?>
  258. <span class='percent'>&nbsp;</span>
  259. </td>
  260. <td class='extra'>
  261. +<?=$mon->rune_hp?>
  262. <span class='percent'>&nbsp;</span>
  263. </td>
  264. <td class='extra'>
  265. +<?=$mon->artifact_hp?>
  266. <span class='percent'>&nbsp;</span>
  267. </td>
  268. <td class='extra'>
  269. +<?=$mon->building_hp?>
  270. <span class='percent'>&nbsp;</span>
  271. </td>
  272. <td class='total'>
  273. <?=$mon->total_hp?>
  274. <span class='percent'>&nbsp;</span>
  275. </td>
  276. </tr>
  277. <tr>
  278. <th>
  279. SPD
  280. </th>
  281. <td class='base'>
  282. <?=$mon->speed?>
  283. <span class='percent'>&nbsp;</span>
  284. </td>
  285. <td class='extra'>
  286. +<?=$mon->rune_speed?>
  287. <span class='percent'>&nbsp;</span>
  288. </td>
  289. <td class='extra'>
  290. +<?=$mon->artifact_speed?>
  291. <span class='percent'>&nbsp;</span>
  292. </td>
  293. <td class='extra'>
  294. +<?=$mon->building_speed?>
  295. <span class='percent'>&nbsp;</span>
  296. </td>
  297. <td class='total'>
  298. <?=$mon->total_speed?>
  299. <span class='percent'>&nbsp;</span>
  300. </td>
  301. </tr>
  302. <tr>
  303. <th>
  304. CRR
  305. </th>
  306. <td class='base'>
  307. <?=$mon->crit_rate?>
  308. <span class='percent'>%</span>
  309. </td>
  310. <td class='extra'>
  311. +<?=$mon->rune_crit_rate?>
  312. <span class='percent'>%</span>
  313. </td>
  314. <td class='extra'>
  315. +<?=$mon->artifact_crit_rate?>
  316. <span class='percent'>%</span>
  317. </td>
  318. <td class='extra'>
  319. +<?=$mon->building_crit_rate?>
  320. <span class='percent'>%</span>
  321. </td>
  322. <td class='total'>
  323. <?=$mon->total_crit_rate?>
  324. <span class='percent'>%</span>
  325. </td>
  326. </tr>
  327. <tr>
  328. <th>
  329. CRD
  330. </th>
  331. <td class='base'>
  332. <?=$mon->crit_damage?>
  333. <span class='percent'>%</span>
  334. </td>
  335. <td class='extra'>
  336. +<?=$mon->rune_crit_damage?>
  337. <span class='percent'>%</span>
  338. </td>
  339. <td class='extra'>
  340. +<?=$mon->artifact_crit_damage?>
  341. <span class='percent'>%</span>
  342. </td>
  343. <td class='extra'>
  344. +<?=$mon->building_crit_damage?>
  345. <span class='percent'>%</span>
  346. </td>
  347. <td class='total'>
  348. <?=$mon->total_crit_damage?>
  349. <span class='percent'>%</span>
  350. </td>
  351. </tr>
  352. <tr>
  353. <th>
  354. ACC
  355. </th>
  356. <td class='base'>
  357. <?=$mon->accuracy?>
  358. <span class='percent'>%</span>
  359. </td>
  360. <td class='extra'>
  361. +<?=$mon->rune_accuracy?>
  362. <span class='percent'>%</span>
  363. </td>
  364. <td class='extra'>
  365. +<?=$mon->artifact_accuracy?>
  366. <span class='percent'>%</span>
  367. </td>
  368. <td class='extra'>
  369. +<?=$mon->building_accuracy?>
  370. <span class='percent'>%</span>
  371. </td>
  372. <td class='total'>
  373. <?=$mon->total_accuracy?>
  374. <span class='percent'>%</span>
  375. </td>
  376. </tr>
  377. <tr>
  378. <th>
  379. RES
  380. </th>
  381. <td class='base'>
  382. <?=$mon->resistance?>
  383. <span class='percent'>%</span>
  384. </td>
  385. <td class='extra'>
  386. +<?=$mon->rune_resistance?>
  387. <span class='percent'>%</span>
  388. </td>
  389. <td class='extra'>
  390. +<?=$mon->artifact_resistance?>
  391. <span class='percent'>%</span>
  392. </td>
  393. <td class='extra'>
  394. +<?=$mon->building_resistance?>
  395. <span class='percent'>%</span>
  396. </td>
  397. <td class='total'>
  398. <?=$mon->total_resistance?>
  399. <span class='percent'>%</span>
  400. </td>
  401. </tr>
  402. <tr>
  403. <th colspan='5'>
  404. Effective HP
  405. </th>
  406. <td class='total'>
  407. <?=$mon->effective_hp?>
  408. <span class='percent'>&nbsp;</span>
  409. </td>
  410. </tr>
  411. <tr>
  412. <th colspan='5'>
  413. Effective DMG
  414. </th>
  415. <td class='total'>
  416. <?=$mon->effective_dmg?>
  417. <span class='percent'>&nbsp;</span>
  418. </td>
  419. </tr>
  420. </table>
  421. <div class='skills'>
  422. <?php
  423. $skill_num = 0;
  424. foreach ($mon->unit->skill as $skill){
  425. $cur_lvl = $mon->skill_levels[$skill_num];
  426. $max_lvl = $skill->max_level;
  427. if ($max_lvl == $cur_lvl){
  428. $maxed = "maxed";
  429. }
  430. else{
  431. $maxed = "";
  432. }
  433. ?>
  434. <div class='skill'>
  435. <img src='<?=$skill->get_image()?>'/>
  436. <span class='skill_level <?=$maxed?>'>
  437. <?=$cur_lvl?>/<?=$max_lvl?>
  438. </span>
  439. <span class='skill_name'>
  440. <?=$skill->name?>
  441. </span>
  442. </div>
  443. <?php
  444. $skill_num ++;
  445. }
  446. ?>
  447. </div>
  448. </div>
  449. </div>
  450. <?php
  451. }
  452. ?>
  453. </article>
  454. </section> <!-- #catalog -->
  455. </main>
  456. <?php
  457. include __DIR__ . "/inc/footer.php";
  458. ?>
  459. </body>
  460. </html>