function creatureGrid($creature_results = false) { global $site_root; // From global.php // If result is empty do a query if ($creature_results == false) { $creature_results = get_creatures(); } echo '<style type="text/css">'; foreach ($creature_results as $r) { if ($r['id'] == 0) { continue; } // Ignore Dark Priest echo '.vignette.type' . $r['realm'] . $r['level'] . '{background-image: url("' . $site_root . 'units/avatars/' . $r["name"] . '.jpg");}'; } echo '</style><div id="creaturegrid">'; foreach ($creature_results as $r) { if ($r['id'] == 0 || $r['id'] == 50) { // Ignore Dark Priest and Shadow Leech continue; } $underscore = str_replace(' ', '_', $r['name']); echo '<a href="#' . $underscore . '" class="vignette realm' . $r['realm'] . ' type' . $r['realm'] . $r['level'] . '" creature="' . $r['realm'] . $r['level'] . '"><div class="tooltip"><div class="content">' . $r['name'] . '</div></div><div class="overlay"></div><div class="border"></div></a>'; } echo '</div>'; }
function cards($r = "", $id = -1, $modifiers = false) { global $site_url; // From global.php global $stats; if ($id != -1 && !is_array($r)) { $ab_id = $id; $ab_creatures = get_creatures(); $r = reset($ab_creatures); } // Preparing shout $spaceless = str_replace(' ', '%20', $r['name']); $underscore = str_replace(' ', '_', $r['name']); $CallCreature = 'CallCreature(\'' . $spaceless . '_shout\');'; // Side A ?> <div class="center" style="display:inline-block; vertical-align: top;"> <div class="card sideA" style="background-image: url('<?php echo $site_url; ?> images/cards/margin.png'), url('<?php echo $site_url; ?> units/artwork/<?php echo $r['name']; ?> .jpg');"> <!-- On hover mini tutorial --> <div class="card_info stats_desc"><br> <div><span class="icon health"></span> Health: The raw amount of damage points a creature can take before it dies.</div> <div><span class="icon regrowth"></span> Regrowth: Amount of health that gets restored at the beginning of every turn.</div> <div><span class="icon endurance"></span> Endurance : Protects unit from fatigue, which disables regrowth and meditation.</div><br> <div><span class="icon energy"></span> Energy : Each unit ability requires a certain amount of energy to be used.</div> <div><span class="icon meditation"></span> Meditation : Energy restored each turn.</div> <div><span class="icon initiative"></span> Initiative : Units with higher amount of initiative points get to act their turn faster.</div><br> <div><span class="icon offense"></span> Offense : Influences the damage output done by all the creature's attack abilities.</div> <div><span class="icon defense"></span> Defense : Protects the creature by reducing some of the incoming damage.</div> <div><span class="icon movement"></span> Movement : Any creature can move a certain number of hexagons every turn.</div> </div> <div class="card_info masteries_desc"> <span>There are 9 common types of damage and a rare one called Pure damage that bypasses the formula bellow, doing a fixed non-variable amount of harm no matter what.</span><br><br> <span><u>Damage Formula</u><br>attack damage +<br>attack damage / 100 *<br>(offense of attacking unit -<br>defense of unit attacked /<br>number of hexagons hit +<br>source stat of attacker -<br>source stat of defender)</span><br><br> <span>Minimum damage is usually 1<br>unless the hit is being avoided.</span> </div> <!-- Card Anchor --> <a href="#<?php echo $underscore; ?> "><div style="height:100%;"></div></a> <?php // Display unit info echo '<div class="section info sin' . $r['realm'] . '"> <span class="type" creature_type="' . $r['realm'] . $r['lvl'] . '" style="float:left; margin-left:22px;">' . $r['realm'] . $r['lvl'] . '</span> <span><audio src="../units/shouts/' . $spaceless . '.ogg" id="' . $spaceless . '_shout" style="display:none;" preload="auto"></audio> <a class="name" onClick="' . $CallCreature . '" onmouseover="' . $CallCreature . '" creature_name="' . $r['name'] . '" >' . $r['name'] . '</a></span> <span class="hexs" creature_size="' . $r['size'] . 'H" style="float:right; margin-right:22px;">' . $r['size'] . 'H</span> </div> </div></div>'; // Side B echo ' <div class="card sideB" style="background-image: url(' . $site_url . 'images/cards/margin.png), url(' . $site_url . 'images/cards/' . $r['realm'] . '.jpg);"> <div class="section numbers stats">'; // Display Stats $i = 1; foreach ($r["stats"] as $key => $value) { if ($i > 0 && $i < 10) { displayStat($key, $value, $modifiers); } $i++; } echo ' </div> <div class="section abilities">'; // Display Abilities for ($i = 0; $i < 4; $i++) { echo ' <div class="ability"> <div class="icon" style="background-image: url(\'' . $site_url . 'units/icons/' . $r["name"] . ' ' . $i . '.svg\');"> <div class="contour"></div> </div> <div class="wrapper"> <div class="info"> <h3>' . $r["ability_info"][$i]["title"] . '</h3> <span class="desc" id="desc">' . $r["ability_info"][$i]["desc"] . '</span><br> <span class="desc" id="info">' . $r["ability_info"][$i]["info"] . '</span> </div> </div> </div>'; } echo ' </div> <div class="section numbers masteries">'; // Display Masteries $i = 1; foreach ($r["stats"] as $key => $value) { if ($i > 9 && $i < 19) { displayStat($key, $value, $modifiers); } $i++; } echo ' </div> </div>'; }
* GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * https://www.AncientBeast.com * https://github.com/FreezingMoon/AncientBeast * DreadKnight@FreezingMoon.org */ $page_title = 'Units'; $stylesheet = '../game/css/grid.css'; require_once '../header.php'; require_once 'grid.php'; require_once 'cards.php'; require_once 'functions.php'; $creature_results = get_creatures(); // TODO: Navigation bar //echo '<nav>Modes: Single | Multiple | List</nav>'; ?> <!-- License --> <div class="div" id="license">All the characters are under the <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank"><b>CC-BY-SA 3.0</b></a> license. You can use them however you like, even for commercial projects, as long as you credit / link the project and mention the original artist(s), similar to the next example: <i>from Ancient Beast game project http://AncientBeast.com - character (or artwork) created by Awesome_Dude</i></div> <!-- Grid view --> <style type="text/css"> #creaturegrid .vignette, .vignette div.border, .vignette div.overlay {height: 128px; width: 128px;} #creaturegrid {width: 896px; height: 896px;} .progress-widget {background: url('../images/progress.png') no-repeat 0 -75px; width: 825px; height: 75px; margin-top: 10px;}