monsters.php 24 KB

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