monsters.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. </aside> <!-- #filters -->
  169. <main>
  170. <section id='list' class='list'>
  171. <h2>
  172. Monsters
  173. </h2>
  174. <article>
  175. <?php
  176. foreach ($page->monsters as $mon){
  177. ?>
  178. <div class='monster'>
  179. <a href='/<?=$UID?>/monsters/<?=$mon->id?>'>
  180. <div class='monster_panel'>
  181. <?=HTML::unit_panel($mon)?>
  182. </div>
  183. </a>
  184. <div class='monster_tooltip'>
  185. <h4>
  186. <?=$mon->title?>
  187. </h4>
  188. <table class='stats'>
  189. <tr>
  190. <th>
  191. Stats
  192. </th>
  193. <th>
  194. Base
  195. </th>
  196. <th>
  197. Runes
  198. </th>
  199. <th>
  200. Artif.
  201. </th>
  202. <th>
  203. Bldg.
  204. </th>
  205. <th>
  206. Total
  207. </th>
  208. </tr>
  209. <tr>
  210. <th>
  211. ATK
  212. </th>
  213. <td class='base'>
  214. <?=$mon->attack?>
  215. <span class='percent'>&nbsp;</span>
  216. </td>
  217. <td class='extra'>
  218. +<?=$mon->rune_attack?>
  219. <span class='percent'>&nbsp;</span>
  220. </td>
  221. <td class='extra'>
  222. +<?=$mon->artifact_attack?>
  223. <span class='percent'>&nbsp;</span>
  224. </td>
  225. <td class='extra'>
  226. +<?=$mon->building_attack?>
  227. <span class='percent'>&nbsp;</span>
  228. </td>
  229. <td class='total'>
  230. <?=$mon->total_attack?>
  231. <span class='percent'>&nbsp;</span>
  232. </td>
  233. </tr>
  234. <tr>
  235. <th>
  236. DEF
  237. </th>
  238. <td class='base'>
  239. <?=$mon->defense?>
  240. <span class='percent'>&nbsp;</span>
  241. </td>
  242. <td class='extra'>
  243. +<?=$mon->rune_defense?>
  244. <span class='percent'>&nbsp;</span>
  245. </td>
  246. <td class='extra'>
  247. +<?=$mon->artifact_defense?>
  248. <span class='percent'>&nbsp;</span>
  249. </td>
  250. <td class='extra'>
  251. +<?=$mon->building_defense?>
  252. <span class='percent'>&nbsp;</span>
  253. </td>
  254. <td class='total'>
  255. <?=$mon->total_defense?>
  256. <span class='percent'>&nbsp;</span>
  257. </td>
  258. </tr>
  259. <tr>
  260. <th>
  261. HP
  262. </th>
  263. <td class='base'>
  264. <?=$mon->hp?>
  265. <span class='percent'>&nbsp;</span>
  266. </td>
  267. <td class='extra'>
  268. +<?=$mon->rune_hp?>
  269. <span class='percent'>&nbsp;</span>
  270. </td>
  271. <td class='extra'>
  272. +<?=$mon->artifact_hp?>
  273. <span class='percent'>&nbsp;</span>
  274. </td>
  275. <td class='extra'>
  276. +<?=$mon->building_hp?>
  277. <span class='percent'>&nbsp;</span>
  278. </td>
  279. <td class='total'>
  280. <?=$mon->total_hp?>
  281. <span class='percent'>&nbsp;</span>
  282. </td>
  283. </tr>
  284. <tr>
  285. <th>
  286. SPD
  287. </th>
  288. <td class='base'>
  289. <?=$mon->speed?>
  290. <span class='percent'>&nbsp;</span>
  291. </td>
  292. <td class='extra'>
  293. +<?=$mon->rune_speed?>
  294. <span class='percent'>&nbsp;</span>
  295. </td>
  296. <td class='extra'>
  297. +<?=$mon->artifact_speed?>
  298. <span class='percent'>&nbsp;</span>
  299. </td>
  300. <td class='extra'>
  301. +<?=$mon->building_speed?>
  302. <span class='percent'>&nbsp;</span>
  303. </td>
  304. <td class='total'>
  305. <?=$mon->total_speed?>
  306. <span class='percent'>&nbsp;</span>
  307. </td>
  308. </tr>
  309. <tr>
  310. <th>
  311. CRR
  312. </th>
  313. <td class='base'>
  314. <?=$mon->crit_rate?>
  315. <span class='percent'>%</span>
  316. </td>
  317. <td class='extra'>
  318. +<?=$mon->rune_crit_rate?>
  319. <span class='percent'>%</span>
  320. </td>
  321. <td class='extra'>
  322. +<?=$mon->artifact_crit_rate?>
  323. <span class='percent'>%</span>
  324. </td>
  325. <td class='extra'>
  326. +<?=$mon->building_crit_rate?>
  327. <span class='percent'>%</span>
  328. </td>
  329. <td class='total'>
  330. <?=$mon->total_crit_rate?>
  331. <span class='percent'>%</span>
  332. </td>
  333. </tr>
  334. <tr>
  335. <th>
  336. CRD
  337. </th>
  338. <td class='base'>
  339. <?=$mon->crit_damage?>
  340. <span class='percent'>%</span>
  341. </td>
  342. <td class='extra'>
  343. +<?=$mon->rune_crit_damage?>
  344. <span class='percent'>%</span>
  345. </td>
  346. <td class='extra'>
  347. +<?=$mon->artifact_crit_damage?>
  348. <span class='percent'>%</span>
  349. </td>
  350. <td class='extra'>
  351. +<?=$mon->building_crit_damage?>
  352. <span class='percent'>%</span>
  353. </td>
  354. <td class='total'>
  355. <?=$mon->total_crit_damage?>
  356. <span class='percent'>%</span>
  357. </td>
  358. </tr>
  359. <tr>
  360. <th>
  361. ACC
  362. </th>
  363. <td class='base'>
  364. <?=$mon->accuracy?>
  365. <span class='percent'>%</span>
  366. </td>
  367. <td class='extra'>
  368. +<?=$mon->rune_accuracy?>
  369. <span class='percent'>%</span>
  370. </td>
  371. <td class='extra'>
  372. +<?=$mon->artifact_accuracy?>
  373. <span class='percent'>%</span>
  374. </td>
  375. <td class='extra'>
  376. +<?=$mon->building_accuracy?>
  377. <span class='percent'>%</span>
  378. </td>
  379. <td class='total'>
  380. <?=$mon->total_accuracy?>
  381. <span class='percent'>%</span>
  382. </td>
  383. </tr>
  384. <tr>
  385. <th>
  386. RES
  387. </th>
  388. <td class='base'>
  389. <?=$mon->resistance?>
  390. <span class='percent'>%</span>
  391. </td>
  392. <td class='extra'>
  393. +<?=$mon->rune_resistance?>
  394. <span class='percent'>%</span>
  395. </td>
  396. <td class='extra'>
  397. +<?=$mon->artifact_resistance?>
  398. <span class='percent'>%</span>
  399. </td>
  400. <td class='extra'>
  401. +<?=$mon->building_resistance?>
  402. <span class='percent'>%</span>
  403. </td>
  404. <td class='total'>
  405. <?=$mon->total_resistance?>
  406. <span class='percent'>%</span>
  407. </td>
  408. </tr>
  409. <tr>
  410. <th colspan='5'>
  411. Effective HP
  412. </th>
  413. <td class='total'>
  414. <?=$mon->effective_hp?>
  415. <span class='percent'>&nbsp;</span>
  416. </td>
  417. </tr>
  418. <tr>
  419. <th colspan='5'>
  420. Effective DMG
  421. </th>
  422. <td class='total'>
  423. <?=$mon->effective_dmg?>
  424. <span class='percent'>&nbsp;</span>
  425. </td>
  426. </tr>
  427. </table>
  428. <div class='skills'>
  429. <?php
  430. $skill_num = 0;
  431. foreach ($mon->unit->skill as $skill){
  432. $cur_lvl = $mon->skill_levels[$skill_num];
  433. $max_lvl = $skill->max_level;
  434. if ($max_lvl == $cur_lvl){
  435. $maxed = "maxed";
  436. }
  437. else{
  438. $maxed = "";
  439. }
  440. ?>
  441. <div class='skill'>
  442. <img src='<?=$skill->get_image()?>'/>
  443. <span class='skill_level <?=$maxed?>'>
  444. <?=$cur_lvl?>/<?=$max_lvl?>
  445. </span>
  446. <span class='skill_name'>
  447. <?=$skill->name?>
  448. </span>
  449. </div>
  450. <?php
  451. $skill_num ++;
  452. }
  453. ?>
  454. </div>
  455. </div>
  456. </div>
  457. <?php
  458. }
  459. ?>
  460. </article>
  461. </section> <!-- #catalog -->
  462. </main>
  463. <?php
  464. include __DIR__ . "/inc/footer.php";
  465. ?>
  466. </body>
  467. </html>