$this_ability_type = !empty($this_ability['ability_type']) ? $this_ability['ability_type'] : false; $this_ability_type2 = !empty($this_ability['ability_type2']) ? $this_ability['ability_type2'] : false; if (!empty($this_ability_type) && !empty($mmrpg_database_types[$this_ability_type])){ $this_ability_type = $mmrpg_database_types[$this_ability_type]['type_name'].' Type'; } else { $this_ability_type = ''; } $this_ability_damage = !empty($this_ability['ability_damage']) ? $this_ability['ability_damage'] : 0; $this_ability_recovery = !empty($this_ability['ability_recovery']) ? $this_ability['ability_recovery'] : 0; $this_ability_accuracy = !empty($this_ability['ability_accuracy']) ? $this_ability['ability_accuracy'] : 0; $this_ability_description = !empty($this_ability['ability_description']) ? $this_ability['ability_description'] : ''; //if (!empty($this_ability_type)){ $this_ability_title_plain .= ' | '.$this_ability_type; } //if (!empty($this_ability_damage)){ $this_ability_title_plain .= ' | '.$this_ability_damage.' Damage'; } //if (!empty($this_ability_recovery)){ $this_ability_title_plain .= ' | '.$this_ability_recovery.' Recovery'; } //if (!empty($this_ability_accuracy)){ $this_ability_title_plain .= ' | '.$this_ability_accuracy.'% Accuracy'; } //if (!empty($this_ability_description)){ $this_ability_title_plain .= ' | '.$this_ability_description; } $this_ability_title_html = str_replace(' ', ' ', $this_ability_name); $this_ability_title_html = ($this_level > 1 ? 'Lv '.str_pad($this_level, 2, '0', STR_PAD_LEFT).' : ' : 'Start : ').$this_ability_title_html; $this_ability_title = rpg_ability::print_editor_title_markup($robot_info, $this_ability); $this_ability_title_plain = strip_tags(str_replace('<br />', ' ', $this_ability_title)); $this_ability_title_tooltip = htmlentities($this_ability_title, ENT_QUOTES, 'UTF-8'); $temp_string[] = '<span title="'.$this_ability_title_plain.'" data-tooltip="'.$this_ability_title_tooltip.'" class="ability_name ability_type ability_type_'.(!empty($this_ability['ability_type']) ? $this_ability['ability_type'] : 'none').(!empty($this_ability['ability_type2']) ? '_'.$this_ability['ability_type2'] : '').'">'.$this_ability_title_html.'</span>'; //.(($ability_key + 1) % 3 == 0 ? '<br />' : ''); $ability_key++; } echo implode(' ', $temp_string); } elseif (!$robot_info['robot_unlocked']){ echo '<span class="ability_name ability_type ability_type_empty">???</span>'; } else { echo '<span class="robot_ability robot_type_none">None</span>'; } ?> </div> </td> </tr>
public static function print_editor_select_markup($ability_rewards_options, $player_info, $robot_info, $ability_info, $ability_key = 0) { // Define the global variables global $mmrpg_index, $this_current_uri, $this_current_url, $db; global $allowed_edit_players, $allowed_edit_robots, $allowed_edit_abilities; global $allowed_edit_data_count, $allowed_edit_player_count, $allowed_edit_robot_count, $first_robot_token, $global_allow_editing; global $key_counter, $player_rewards, $player_ability_rewards, $player_robot_favourites, $player_robot_database, $temp_robot_totals, $player_options_markup, $item_options_markup; global $mmrpg_database_abilities; $session_token = rpg_game::session_token(); if (empty($robot_info)) { return false; } if (empty($ability_info)) { return false; } // Define the select markup variable $this_select_markup = ''; $ability_info_id = $ability_info['ability_id']; $ability_info_token = $ability_info['ability_token']; $ability_info_name = $ability_info['ability_name']; $ability_info_energy = isset($ability_info['ability_energy']) ? $ability_info['ability_energy'] : 4; $ability_info_damage = !empty($ability_info['ability_damage']) ? $ability_info['ability_damage'] : 0; $ability_info_damage2 = !empty($ability_info['ability_damage2']) ? $ability_info['ability_damage2'] : 0; $ability_info_damage_percent = !empty($ability_info['ability_damage_percent']) ? true : false; $ability_info_damage2_percent = !empty($ability_info['ability_damage2_percent']) ? true : false; if ($ability_info_damage_percent && $ability_info_damage > 100) { $ability_info_damage = 100; } if ($ability_info_damage2_percent && $ability_info_damage2 > 100) { $ability_info_damage2 = 100; } $ability_info_recovery = !empty($ability_info['ability_recovery']) ? $ability_info['ability_recovery'] : 0; $ability_info_recovery2 = !empty($ability_info['ability_recovery2']) ? $ability_info['ability_recovery2'] : 0; $ability_info_recovery_percent = !empty($ability_info['ability_recovery_percent']) ? true : false; $ability_info_recovery2_percent = !empty($ability_info['ability_recovery2_percent']) ? true : false; if ($ability_info_recovery_percent && $ability_info_recovery > 100) { $ability_info_recovery = 100; } if ($ability_info_recovery2_percent && $ability_info_recovery2 > 100) { $ability_info_recovery2 = 100; } $ability_info_accuracy = !empty($ability_info['ability_accuracy']) ? $ability_info['ability_accuracy'] : 0; $ability_info_description = !empty($ability_info['ability_description']) ? $ability_info['ability_description'] : ''; $ability_info_description = str_replace('{DAMAGE}', $ability_info_damage, $ability_info_description); $ability_info_description = str_replace('{RECOVERY}', $ability_info_recovery, $ability_info_description); $ability_info_description = str_replace('{DAMAGE2}', $ability_info_damage2, $ability_info_description); $ability_info_description = str_replace('{RECOVERY2}', $ability_info_recovery2, $ability_info_description); $ability_info_title = rpg_ability::print_editor_title_markup($robot_info, $ability_info); $ability_info_title_plain = strip_tags(str_replace('<br />', '//', $ability_info_title)); $ability_info_title_tooltip = htmlentities($ability_info_title, ENT_QUOTES, 'UTF-8'); $ability_info_title_html = str_replace(' ', ' ', $ability_info_name); $temp_select_options = str_replace('value="' . $ability_info_token . '"', 'value="' . $ability_info_token . '" selected="selected" disabled="disabled"', $ability_rewards_options); $ability_info_title_html = '<label style="background-image: url(i/a/' . $ability_info_token . '/il40.png?' . MMRPG_CONFIG_CACHE_DATE . ');">' . $ability_info_title_html . '<span class="arrow">∇</span></label>'; //if ($global_allow_editing){ $ability_info_title_html .= '<select class="ability_name" data-key="'.$ability_key.'" data-player="'.$player_info['player_token'].'" data-robot="'.$robot_info['robot_token'].'">'.$temp_select_options.'</select>'; } $this_select_markup = '<a class="ability_name ability_type ability_type_' . (!empty($ability_info['ability_type']) ? $ability_info['ability_type'] : 'none') . (!empty($ability_info['ability_type2']) ? '_' . $ability_info['ability_type2'] : '') . '" style="' . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-id="' . $ability_info_id . '" data-key="' . $ability_key . '" data-player="' . $player_info['player_token'] . '" data-robot="' . $robot_info['robot_token'] . '" data-ability="' . $ability_info_token . '" data-type="' . (!empty($ability_info['ability_type']) ? $ability_info['ability_type'] : 'none') . '" data-type2="' . (!empty($ability_info['ability_type2']) ? $ability_info['ability_type2'] : '') . '" title="' . $ability_info_title_plain . '" data-tooltip="' . $ability_info_title_tooltip . '">' . $ability_info_title_html . '</a>'; // Return the generated select markup return $this_select_markup; }
public static function print_editor_markup($player_info) { // Define the global variables global $mmrpg_index, $this_current_uri, $this_current_url, $db; global $allowed_edit_players, $allowed_edit_fields, $global_allow_editing; global $allowed_edit_data_count, $allowed_edit_player_count, $first_player_token; global $key_counter, $player_key, $player_counter, $player_rewards, $player_field_rewards, $player_item_rewards, $temp_player_totals, $player_options_markup; global $mmrpg_database_robots, $mmrpg_database_items; $session_token = rpg_game::session_token(); // If either fo empty, return error if (empty($player_info)) { return 'error:player-empty'; } // Collect the approriate database indexes if (empty($mmrpg_database_robots)) { $mmrpg_database_robots = $db->get_array_list("SELECT * FROM mmrpg_index_robots WHERE robot_flag_complete = 1;", 'robot_token'); } if (empty($mmrpg_database_items)) { $mmrpg_database_items = $db->get_array_list("SELECT * FROM mmrpg_index_abilities WHERE ability_class = 'item' AND ability_flag_complete = 1;", 'ability_token'); } // Define the quick-access variables for later use $player_token = $player_info['player_token']; if (!isset($first_player_token)) { $first_player_token = $player_token; } // Define the player's image and size if not defined $player_info['player_image'] = !empty($player_info['player_image']) ? $player_info['player_image'] : $player_info['player_token']; $player_info['player_image_size'] = !empty($player_info['player_image_size']) ? $player_info['player_image_size'] : 40; // Define the player's battle points total, battles complete, and other details $player_info['player_points'] = rpg_game::player_points($player_token); $player_info['player_battles_complete'] = rpg_prototype::battles_complete($player_token); $player_info['player_battles_complete_total'] = rpg_prototype::battles_complete($player_token, false); $player_info['player_battles_failure'] = rpg_prototype::battles_failure($player_token); $player_info['player_battles_failure_total'] = rpg_prototype::battles_failure($player_token, false); $player_info['player_robots_count'] = 0; $player_info['player_abilities_count'] = rpg_game::abilities_unlocked($player_token); $player_info['player_field_stars'] = rpg_game::stars_unlocked($player_token, 'field'); $player_info['player_fusion_stars'] = rpg_game::stars_unlocked($player_token, 'fusion'); $player_info['player_screw_counter'] = 0; $player_info['player_heart_counter'] = 0; // Define the player's experience points total $player_info['player_experience'] = 0; // Collect this player's current defined omega item list if (!empty($_SESSION[$session_token]['values']['battle_rewards'])) { //$debug_experience_sum = $player_token.' : '; foreach ($_SESSION[$session_token]['values']['battle_rewards'] as $temp_player => $temp_player_info) { if (!empty($_SESSION[$session_token]['values']['battle_rewards'][$temp_player]['player_robots'])) { $temp_player_robot_rewards = $_SESSION[$session_token]['values']['battle_rewards'][$temp_player]['player_robots']; $temp_player_robot_settings = $_SESSION[$session_token]['values']['battle_settings'][$temp_player]['player_robots']; if (empty($temp_player_robot_rewards) || empty($temp_player_robot_settings)) { unset($_SESSION[$session_token]['values']['battle_rewards'][$temp_player]['player_robots']); unset($_SESSION[$session_token]['values']['battle_settings'][$temp_player]['player_robots']); continue; } foreach ($temp_player_robot_rewards as $temp_key => $temp_robot_info) { if (empty($temp_robot_info['robot_token'])) { unset($_SESSION[$session_token]['values']['battle_rewards'][$temp_player]['player_robots'][$temp_key]); unset($_SESSION[$session_token]['values']['battle_settings'][$temp_player]['player_robots'][$temp_key]); continue; } $temp_robot_settings = $temp_player_robot_settings[$temp_robot_info['robot_token']]; $temp_robot_rewards = $temp_player_robot_settings[$temp_robot_info['robot_token']]; // If this robot is not owned by the player, skip it as it doesn't count towards their totals if (empty($temp_robot_settings['original_player']) && $temp_player != $player_token) { continue; } elseif (empty($temp_robot_settings['original_player'])) { $temp_robot_settings['original_player'] = $temp_player; } if ($temp_robot_settings['original_player'] != $player_token) { continue; } //$debug_experience_sum .= $temp_robot_info['robot_token'].', '; $player_info['player_robots_count']++; if (!empty($temp_robot_info['robot_level'])) { $player_info['player_experience'] += $temp_robot_info['robot_level'] * MMRPG_SETTINGS_BATTLEPOINTS_PERROBOT; } if (!empty($temp_robot_info['robot_experience'])) { $player_info['player_experience'] += $temp_robot_info['robot_experience']; } } } } //die($debug_experience_sum); } // Collect this player's current field selection from the omega session $temp_session_key = $player_info['player_token'] . '_target-robot-omega_prototype'; $player_info['target_robot_omega'] = !empty($_SESSION[$session_token]['values'][$temp_session_key]) ? $_SESSION[$session_token]['values'][$temp_session_key] : array(); $player_info['player_fields_current'] = array(); //die('<pre>$player_info[\'target_robot_omega\'] = '.print_r($player_info['target_robot_omega'], true).'</pre>'); if (count($player_info['target_robot_omega']) == 2) { $player_info['target_robot_omega'] = array_shift($player_info['target_robot_omega']); } foreach ($player_info['target_robot_omega'] as $key => $info) { $field = rpg_field::get_index_info($info['field']); if (empty($field)) { continue; } $player_info['player_fields_current'][] = $field; } // Define this player's stat type boost for display purposes $player_info['player_stat_type'] = ''; if (!empty($player_info['player_energy'])) { $player_info['player_stat_type'] = 'energy'; } elseif (!empty($player_info['player_attack'])) { $player_info['player_stat_type'] = 'attack'; } elseif (!empty($player_info['player_defense'])) { $player_info['player_stat_type'] = 'defense'; } elseif (!empty($player_info['player_speed'])) { $player_info['player_stat_type'] = 'speed'; } // Define whether or not field switching is enabled $temp_allow_field_switch = rpg_prototype::campaign_complete($player_info['player_token']) || rpg_prototype::campaign_complete(); // Collect a temp robot object for printing items if ($player_info['player_token'] == 'dr-light') { $robot_info = rpg_robot::parse_index_info($mmrpg_database_robots['mega-man']); } elseif ($player_info['player_token'] == 'dr-wily') { $robot_info = rpg_robot::parse_index_info($mmrpg_database_robots['bass']); } elseif ($player_info['player_token'] == 'dr-cossack') { $robot_info = rpg_robot::parse_index_info($mmrpg_database_robots['proto-man']); } // Define the markup variable $this_markup = ''; // Start the output buffer ob_start(); // DEBUG //die(print_r($player_field_rewards, true)); ?> <div class="event event_double event_<?php echo $player_key == $first_player_token ? 'visible' : 'hidden'; ?> " data-token="<?php echo $player_info['player_token'] . '_' . $player_info['player_token']; ?> "> <div class="this_sprite sprite_left" style="height: 40px;"> <?php $temp_margin = -1 * ceil(($player_info['player_image_size'] - 40) * 0.5); ?> <div style="margin-top: <?php echo $temp_margin; ?> px; margin-bottom: <?php echo $temp_margin * 3; ?> px; background-image: url(i/p/<?php echo !empty($player_info['player_image']) ? $player_info['player_image'] : $player_info['player_token']; ?> /mr<?php echo $player_info['player_image_size']; ?> .png?<?php echo MMRPG_CONFIG_CACHE_DATE; ?> ); " class="sprite sprite_player sprite_player_sprite sprite_<?php echo $player_info['player_image_size'] . 'x' . $player_info['player_image_size']; ?> sprite_<?php echo $player_info['player_image_size'] . 'x' . $player_info['player_image_size']; ?> _mug player_status_active player_position_active"><?php echo $player_info['player_name']; ?> </div> </div> <div class="header header_left player_type player_type_<?php echo !empty($player_info['player_stat_type']) ? $player_info['player_stat_type'] : 'none'; ?> " style="margin-right: 0;"><?php echo $player_info['player_name']; ?> 's Data <span class="player_type"><?php echo !empty($player_info['player_stat_type']) ? ucfirst($player_info['player_stat_type']) : 'Neutral'; ?> Type</span></div> <div class="body body_left" style="margin-right: 0; padding: 2px 3px; height: auto;"> <table class="full" style="margin-bottom: 5px;"> <colgroup> <col width="48.5%" /> <col width="1%" /> <col width="48.5%" /> </colgroup> <tbody> <tr> <td class="right"> <label style="display: block; float: left;">Name :</label> <span class="player_name player_type player_type_none"><?php echo $player_info['player_name']; ?> </span> </td> <td class="center"> </td> <td class="right"> <label style="display: block; float: left;">Bonus :</label> <?php // Display any special boosts this player has if (!empty($player_info['player_stat_type'])) { echo '<span class="player_name player_type player_type_' . $player_info['player_stat_type'] . '">Robot ' . ucfirst($player_info['player_stat_type']) . ' +' . $player_info['player_' . $player_info['player_stat_type']] . '%</span>'; } else { echo '<span class="player_name player_type player_type_none">None</span>'; } ?> </td> </tr> <tr> <td class="right"> <label style="display: block; float: left;">Exp Points :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_experience']) ? 'cutter' : 'none'; ?> "><?php echo number_format($player_info['player_experience'], 0, '.', ','); ?> EXP</span> </td> <td class="center"> </td> <td class="right"> <label style="display: block; float: left;">Unlocked Robots :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_robots_count']) ? 'cutter' : 'none'; ?> "><?php echo $player_info['player_robots_count'] . ' ' . ($player_info['player_robots_count'] == 1 ? 'Robot' : 'Robots'); ?> </span> </td> </tr> <tr> <td class="right"> <label style="display: block; float: left;">Battle Points :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_points']) ? 'cutter' : 'none'; ?> "><?php echo number_format($player_info['player_points'], 0, '.', ','); ?> BP</span> </td> <td class="center"> </td> <td class="right"> <label style="display: block; float: left;">Unlocked Abilities :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_abilities_count']) ? 'cutter' : 'none'; ?> "><?php echo $player_info['player_abilities_count'] . ' ' . ($player_info['player_abilities_count'] == 1 ? 'Ability' : 'Abilities'); ?> </span> </td> </tr> <tr> <td class="right"> <label style="display: block; float: left;">Missions Completed :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_battles_complete']) ? 'energy' : 'none'; ?> "><?php echo $player_info['player_battles_complete']; ?> Missions</span> </td> <td class="center"> </td> <td class="right"> <label style="display: block; float: left;">Total Victories :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_battles_complete_total']) ? 'energy' : 'none'; ?> "><?php echo $player_info['player_battles_complete_total']; ?> Victories</span> </td> </tr> <tr> <td class="right"> <label style="display: block; float: left;">Missions Failed :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_battles_failure']) ? 'attack' : 'none'; ?> "><?php echo $player_info['player_battles_failure']; ?> Missions</span> </td> <td class="center"> </td> <td class="right"> <label style="display: block; float: left;">Total Defeats :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_battles_failure_total']) ? 'attack' : 'none'; ?> "><?php echo $player_info['player_battles_failure_total']; ?> Defeats</span> </td> </tr> <tr> <td class="right"> <?php if (!empty($player_info['player_field_stars'])) { ?> <label style="display: block; float: left;">Field Stars :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_field_stars']) ? 'electric' : 'empty'; ?> "><?php echo $player_info['player_field_stars'] . ' ' . ($player_info['player_field_stars'] == 1 ? 'Star' : 'Stars'); ?> </span> <?php } else { ?> <label style="display: block; float: left; opacity: 0.5; filter: alpha(opacity=50); ">??? :</label> <span class="player_stat player_type player_type_empty" style=" opacity: 0.5; filter: alpha(opacity=50); ">0</span> <?php } ?> </td> <td class="center"> </td> <td class="right"> <?php if (!empty($player_info['player_fusion_stars'])) { ?> <label style="display: block; float: left;">Fusion Stars :</label> <span class="player_stat player_type player_type_<?php echo !empty($player_info['player_fusion_stars']) ? 'time' : 'empty'; ?> "><?php echo $player_info['player_fusion_stars'] . ' ' . ($player_info['player_fusion_stars'] == 1 ? 'Star' : 'Stars'); ?> </span> <?php } else { ?> <label style="display: block; float: left; opacity: 0.5; filter: alpha(opacity=50); ">??? :</label> <span class="player_stat player_type player_type_empty" style=" opacity: 0.5; filter: alpha(opacity=50); ">0</span> <?php } ?> </td> </tr> </tbody> </table> <?php if (false && !empty($player_item_rewards)) { ?> <table class="full"> <colgroup> <col width="100%" /> </colgroup> <tbody> <tr> <td class="right" style="padding-top: 4px;"> <label class="item_header">Player Items :</label> <div class="item_container" style="height: auto;"> <?php // Define the array to hold ALL the reward option markup $item_rewards_options = ''; // Collect this player's item rewards and add them to the dropdown //$player_item_rewards = !empty($player_rewards['player_items']) ? $player_rewards['player_items'] : array(); //if (!empty($player_item_rewards)){ sort($player_item_rewards); } // DEBUG //$debug_tokens = array(); //foreach ($player_item_rewards AS $info){ $debug_tokens[] = $info['ability_token']; } //echo 'before:'.implode(',', array_keys($debug_tokens)).'<br />'; // Sort the item index based on item group uasort($player_item_rewards, array('rpg_functions', 'items_sort_for_editor')); // DEBUG //echo 'after:'.implode(',', array_keys($player_item_rewards)).'<br />'; // DEBUG //$debug_tokens = array(); //foreach ($player_item_rewards AS $info){ $debug_tokens[] = $info['ability_token']; } //echo 'after:'.implode(',', $debug_tokens).'<br />'; // Dont' bother generating option dropdowns if editing is disabled if ($global_allow_editing) { $player_item_rewards_options = array(); foreach ($player_item_rewards as $temp_item_key => $temp_item_info) { if (empty($temp_item_info['ability_token'])) { continue; } $temp_token = $temp_item_info['ability_token']; $temp_item_info = rpg_ability::parse_index_info($mmrpg_database_items[$temp_token]); $temp_option_markup = rpg_ability::print_editor_option_markup($robot_info, $temp_item_info); if (!empty($temp_option_markup)) { $player_item_rewards_options[] = $temp_option_markup; } } $player_item_rewards_options = '<optgroup label="Player Items">' . implode('', $player_item_rewards_options) . '</optgroup>'; $item_rewards_options .= $player_item_rewards_options; /* // Collect this robot's item rewards and add them to the dropdown $player_item_rewards = !empty($player_rewards['player_items']) ? $player_rewards['player_items'] : array(); $player_item_settings = !empty($player_settings['player_items']) ? $player_settings['player_items'] : array(); foreach ($player_item_settings AS $token => $info){ if (empty($player_item_rewards[$token])){ $player_item_rewards[$token] = $info; } } if (!empty($player_item_rewards)){ sort($player_item_rewards); } $player_item_rewards_options = array(); foreach ($player_item_rewards AS $temp_item_info){ if (empty($temp_item_info['ability_token'])){ continue; } $temp_token = $temp_item_info['ability_token']; $temp_item_info = rpg_ability::parse_index_info($mmrpg_database_items[$temp_token]); $temp_option_markup = rpg_ability::print_editor_option_markup($robot_info, $temp_item_info); if (!empty($temp_option_markup)){ $player_item_rewards_options[] = $temp_option_markup; } } $player_item_rewards_options = '<optgroup label="Player Items">'.implode('', $player_item_rewards_options).'</optgroup>'; $item_rewards_options .= $player_item_rewards_options; */ // Add an option at the bottom to remove the ability $item_rewards_options .= '<optgroup label="Item Actions">'; $item_rewards_options .= '<option value="" title="">- Remove Item -</option>'; $item_rewards_options .= '</optgroup>'; } // Loop through the robot's current items and list them one by one $empty_item_counter = 0; $temp_string = array(); $temp_inputs = array(); $item_key = 0; if (!empty($player_info['player_items_current'])) { // DEBUG //echo 'robot-ability:'; foreach ($player_info['player_items_current'] as $key => $player_item) { if (empty($player_item['ability_token'])) { continue; } elseif ($player_item['ability_token'] == '*') { continue; } elseif ($player_item['ability_token'] == 'ability') { continue; } elseif ($item_key > 7) { continue; } $this_item = rpg_ability::parse_index_info($mmrpg_database_items[$player_item['ability_token']]); if (empty($this_item)) { continue; } $this_item_token = $this_item['ability_token']; $this_item_name = $this_item['ability_name']; $this_item_type = !empty($this_item['ability_type']) ? $this_item['ability_type'] : false; $this_item_type2 = !empty($this_item['ability_type2']) ? $this_item['ability_type2'] : false; if (!empty($this_item_type) && !empty($mmrpg_index['types'][$this_item_type])) { $this_item_type = $mmrpg_index['types'][$this_item_type]['type_name'] . ' Type'; if (!empty($this_item_type2) && !empty($mmrpg_index['types'][$this_item_type2])) { $this_item_type = str_replace(' Type', ' / ' . $mmrpg_index['types'][$this_item_type2]['type_name'] . ' Type', $this_item_type); } } else { $this_item_type = ''; } $this_item_energy = isset($this_item['ability_energy']) ? $this_item['ability_energy'] : 4; $this_item_damage = !empty($this_item['ability_damage']) ? $this_item['ability_damage'] : 0; $this_item_damage2 = !empty($this_item['ability_damage2']) ? $this_item['ability_damage2'] : 0; $this_item_damage_percent = !empty($this_item['ability_damage_percent']) ? true : false; $this_item_damage2_percent = !empty($this_item['ability_damage2_percent']) ? true : false; if ($this_item_damage_percent && $this_item_damage > 100) { $this_item_damage = 100; } if ($this_item_damage2_percent && $this_item_damage2 > 100) { $this_item_damage2 = 100; } $this_item_recovery = !empty($this_item['ability_recovery']) ? $this_item['ability_recovery'] : 0; $this_item_recovery2 = !empty($this_item['ability_recovery2']) ? $this_item['ability_recovery2'] : 0; $this_item_recovery_percent = !empty($this_item['ability_recovery_percent']) ? true : false; $this_item_recovery2_percent = !empty($this_item['ability_recovery2_percent']) ? true : false; if ($this_item_recovery_percent && $this_item_recovery > 100) { $this_item_recovery = 100; } if ($this_item_recovery2_percent && $this_item_recovery2 > 100) { $this_item_recovery2 = 100; } $this_item_accuracy = !empty($this_item['ability_accuracy']) ? $this_item['ability_accuracy'] : 0; $this_item_description = !empty($this_item['ability_description']) ? $this_item['ability_description'] : ''; $this_item_description = str_replace('{DAMAGE}', $this_item_damage, $this_item_description); $this_item_description = str_replace('{RECOVERY}', $this_item_recovery, $this_item_description); $this_item_description = str_replace('{DAMAGE2}', $this_item_damage2, $this_item_description); $this_item_description = str_replace('{RECOVERY2}', $this_item_recovery2, $this_item_description); $this_item_title = rpg_ability::print_editor_title_markup($robot_info, $this_item); $this_item_title_plain = strip_tags(str_replace('<br />', ' ', $this_item_title)); $this_item_title_tooltip = htmlentities($this_item_title, ENT_QUOTES, 'UTF-8'); $this_item_title_html = str_replace(' ', ' ', $this_item_name); $temp_select_options = str_replace('value="' . $this_item_token . '"', 'value="' . $this_item_token . '" selected="selected" disabled="disabled"', $item_rewards_options); $this_item_title_html = '<label style="background-image: url(i/a/' . $this_item_token . '/il40.png?' . MMRPG_CONFIG_CACHE_DATE . ');">' . $this_item_title_html . '</label>'; if ($global_allow_editing) { $this_item_title_html .= '<select class="ability_name" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '">' . $temp_select_options . '</select>'; } $temp_string[] = '<a class="ability_name ability_type ability_type_' . (!empty($this_item['ability_type']) ? $this_item['ability_type'] : 'none') . (!empty($this_item['ability_type2']) ? '_' . $this_item['ability_type2'] : '') . '" style="' . (($item_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '" data-item="' . $this_item_token . '" title="' . $this_item_title_plain . '" data-tooltip="' . $this_item_title_tooltip . '">' . $this_item_title_html . '</a>'; $item_key++; } if ($item_key <= 7) { for ($item_key; $item_key <= 7; $item_key++) { $empty_item_counter++; if ($empty_item_counter >= 2) { $empty_item_disable = true; } else { $empty_item_disable = false; } $temp_select_options = str_replace('value=""', 'value="" selected="selected" disabled="disabled"', $item_rewards_options); $this_item_title_html = '<label>-</label>'; if ($global_allow_editing) { $this_item_title_html .= '<select class="ability_name" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '" ' . ($empty_item_disable ? 'disabled="disabled" ' : '') . '>' . $temp_select_options . '</select>'; } $temp_string[] = '<a class="ability_name " style="' . (($item_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . ($empty_item_disable ? 'opacity:0.25; ' : '') . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '" data-item="" title="" data-tooltip="">' . $this_item_title_html . '</a>'; } } } else { for ($item_key = 0; $item_key <= 7; $item_key++) { $empty_item_counter++; if ($empty_item_counter >= 2) { $empty_item_disable = true; } else { $empty_item_disable = false; } $temp_select_options = str_replace('value=""', 'value="" selected="selected"', $item_rewards_options); $this_item_title_html = '<label>-</label>'; if ($global_allow_editing) { $this_item_title_html .= '<select class="ability_name" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '" data-robot="' . $robot_info['robot_token'] . '" ' . ($empty_item_disable ? 'disabled="disabled" ' : '') . '>' . $temp_select_options . '</select>'; } $temp_string[] = '<a class="ability_name " style="' . (($item_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . ($empty_item_disable ? 'opacity:0.25; ' : '') . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-key="' . $item_key . '" data-player="' . $player_info['player_token'] . '" data-robot="' . $robot_info['robot_token'] . '" data-ability="">' . $this_item_title_html . '</a>'; } } // DEBUG //echo 'temp-string:'; echo !empty($temp_string) ? implode(' ', $temp_string) : ''; // DEBUG //echo '<br />temp-inputs:'; echo !empty($temp_inputs) ? implode(' ', $temp_inputs) : ''; // DEBUG //echo '<br />'; ?> </div> </td> </tr> </tbody> </table> <?php } ?> <?php if (!empty($player_field_rewards) && rpg_prototype::campaign_complete($player_info['player_token'])) { ?> <table class="full"> <colgroup> <col width="100%" /> </colgroup> <tbody> <tr> <td class="right" style="padding-top: 4px;"> <label class="field_header"><?php echo $global_allow_editing ? 'Edit ' : ''; ?> Player Fields :</label> <div class="field_container" style="height: auto;"> <?php // Define the array to hold ALL the reward option markup $field_rewards_options = ''; // Collect this player's field rewards and add them to the dropdown //$player_field_rewards = !empty($player_rewards['player_fields']) ? $player_rewards['player_fields'] : array(); //if (!empty($player_field_rewards)){ sort($player_field_rewards); } // DEBUG //echo 'start:player_field_rewards:<pre style="font-size: 80%;">'.print_r($player_field_rewards, true).'</pre><br />'; // DEBUG //echo 'before:player_field_rewards(keys):'.implode(',', array_keys($player_field_rewards)).'<br />'; // DEBUG //$debug_tokens = array(); //foreach ($player_field_rewards AS $info){ $debug_tokens[] = $info['field_token']; } //echo 'before:player_field_rewards(field_tokens):'.implode(',', array_values($debug_tokens)).'<br />'; // Sort the field index based on field number uasort($player_field_rewards, array('rpg_functions', 'fields_sort_for_editor')); // DEBUG //echo 'after:player_field_rewards(keys):'.implode(',', array_keys($player_field_rewards)).'<br />'; // DEBUG //$debug_tokens = array(); //foreach ($player_field_rewards AS $info){ $debug_tokens[] = $info['field_token']; } //echo 'after:player_field_rewards(field_tokens):'.implode(',', array_values($debug_tokens)).'<br />'; // Don't bother generating the option markup if disabled editing if ($global_allow_editing) { // Define the field group index for displau $temp_group_index = array('MMRPG' => 'Mega Man RPG Fields', 'MM00' => 'Mega Man Bonus Fields', 'MM01' => 'Mega Man 1 Fields', 'MM02' => 'Mega Man 2 Fields', 'MM03' => 'Mega Man 3 Fields', 'MM04' => 'Mega Man 4 Fields', 'MM05' => 'Mega Man 5 Fields', 'MM06' => 'Mega Man 6 Fields', 'MM07' => 'Mega Man 7 Fields', 'MM08' => 'Mega Man 8 Fields', 'MM09' => 'Mega Man 9 Fields', 'MM10' => 'Mega Man 10 Fields'); // Loop through the group index and display any fields that match $player_field_rewards_backup = $player_field_rewards; foreach ($temp_group_index as $group_key => $group_name) { $player_field_rewards_options = array(); foreach ($player_field_rewards_backup as $temp_field_key => $temp_field_info) { if (empty($temp_field_info['field_game']) || $temp_field_info['field_game'] != $group_key) { continue; } $temp_option_markup = rpg_field::print_editor_option_markup($temp_field_info); if (!empty($temp_option_markup)) { $player_field_rewards_options[] = $temp_option_markup; } unset($player_field_rewards_backup[$temp_field_key]); } if (empty($player_field_rewards_options)) { continue; } $player_field_rewards_options = '<optgroup label="' . $group_name . '">' . implode('', $player_field_rewards_options) . '</optgroup>'; $field_rewards_options .= $player_field_rewards_options; } } // Add an option at the bottom to remove the field //$field_rewards_options .= '<optgroup label="Field Actions">'; //$field_rewards_options .= '<option value="" title="">- Remove Field -</option>'; //$field_rewards_options .= '</optgroup>'; // Loop through the player's current fields and list them one by one $empty_field_counter = 0; $temp_string = array(); $temp_inputs = array(); $field_key = 0; if (!empty($player_info['player_fields_current'])) { // DEBUG //echo 'player-field:'; $rpg_field_index = rpg_field::get_index(); $player_info['player_fields_current'] = $player_info['player_fields_current']; //array_reverse($player_info['player_fields_current']); foreach ($player_info['player_fields_current'] as $player_field) { if ($player_field['field_token'] == '*') { continue; } elseif (!isset($rpg_field_index[$player_field['field_token']])) { continue; } elseif ($field_key > 7) { continue; } $this_field = rpg_field::parse_index_info($rpg_field_index[$player_field['field_token']]); $this_field_token = $this_field['field_token']; $this_robot_token = $this_field['field_master']; $this_robot = rpg_robot::parse_index_info($mmrpg_database_robots[$this_robot_token]); $this_field_name = $this_field['field_name']; $this_field_type = !empty($this_field['field_type']) ? $this_field['field_type'] : false; $this_field_type2 = !empty($this_field['field_type2']) ? $this_field['field_type2'] : false; if (!empty($this_field_type) && !empty($mmrpg_index['types'][$this_field_type])) { $this_field_type = $mmrpg_index['types'][$this_field_type]['type_name'] . ' Type'; if (!empty($this_field_type2) && !empty($mmrpg_index['types'][$this_field_type2])) { $this_field_type = str_replace(' Type', ' / ' . $mmrpg_index['types'][$this_field_type2]['type_name'] . ' Type', $this_field_type); } } else { $this_field_type = ''; } $this_field_description = !empty($this_field['field_description']) ? $this_field['field_description'] : ''; $this_field_title = rpg_field::print_editor_title_markup($this_field); $this_field_title_plain = strip_tags(str_replace('<br />', ' ', $this_field_title)); $this_field_title_tooltip = htmlentities($this_field_title, ENT_QUOTES, 'UTF-8'); $this_field_title_html = str_replace(' ', ' ', $this_field_name); $temp_select_options = str_replace('value="' . $this_field_token . '"', 'value="' . $this_field_token . '" selected="selected" disabled="disabled"', $field_rewards_options); $temp_field_type_class = 'field_type_' . (!empty($this_field['field_type']) ? $this_field['field_type'] : 'none') . (!empty($this_field['field_type2']) ? '_' . $this_field['field_type2'] : ''); if ($global_allow_editing && $temp_allow_field_switch) { $this_field_title_html = '<label class="field_type ' . $temp_field_type_class . '" style="">' . $this_field_title_html . '</label><select class="field_name" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '">' . $temp_select_options . '</select>'; } elseif (!$global_allow_editing && $temp_allow_field_switch) { $this_field_title_html = '<label class="field_type ' . $temp_field_type_class . '" style="cursor: default !important;">' . $this_field_title_html . '</label>'; } else { $this_field_title_html = '<label class="field_type ' . $temp_field_type_class . '" style="cursor: default !important;">' . $this_field_title_html . '</label>'; } $temp_string[] = '<a class="field_name field_type ' . $temp_field_type_class . '" style="background-image: url(i/f/' . $this_field_token . '/bfp.png?' . MMRPG_CONFIG_CACHE_DATE . '); ' . (($field_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . (!$temp_allow_field_switch || !$global_allow_editing ? 'cursor: default !important; ' : '') . (!$temp_allow_field_switch ? 'opacity: 0.50; filter: alpha(opacity=50); ' : '') . '" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '" data-field="' . $this_field_token . '" data-tooltip="' . $this_field_title_tooltip . '">' . $this_field_title_html . '</a>'; $field_key++; } if ($field_key <= 7) { for ($field_key; $field_key <= 7; $field_key++) { $empty_field_counter++; if ($empty_field_counter >= 2) { $empty_field_disable = true; } else { $empty_field_disable = false; } $temp_select_options = str_replace('value=""', 'value="" selected="selected" disabled="disabled"', $field_rewards_options); $this_field_title_html = '<label>-</label><select class="field_name" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '" ' . ($empty_field_disable ? 'disabled="disabled" ' : '') . '>' . $temp_select_options . '</select>'; $temp_string[] = '<a class="field_name " style="' . (($field_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . ($empty_field_disable ? 'opacity:0.25; ' : '') . '" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '" data-field="" title="">' . $this_field_title_html . '</a>'; } } } else { for ($field_key = 0; $field_key <= 7; $field_key++) { $empty_field_counter++; if ($empty_field_counter >= 2) { $empty_field_disable = true; } else { $empty_field_disable = false; } $temp_select_options = str_replace('value=""', 'value="" selected="selected"', $field_rewards_options); $this_field_title_html = '<label>-</label><select class="field_name" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '" ' . ($empty_field_disable ? 'disabled="disabled" ' : '') . '>' . $temp_select_options . '</select>'; $temp_string[] = '<a class="field_name " style="' . (($field_key + 1) % 4 == 0 ? 'margin-right: 0; ' : '') . ($empty_field_disable ? 'opacity:0.25; ' : '') . '" data-key="' . $field_key . '" data-player="' . $player_info['player_token'] . '" data-player="' . $player_info['player_token'] . '" data-field="" title="">' . $this_field_title_html . '</a>'; } } // DEBUG //echo 'temp-string:'; echo !empty($temp_string) ? implode(' ', $temp_string) : ''; // DEBUG //echo '<br />temp-inputs:'; echo !empty($temp_inputs) ? implode(' ', $temp_inputs) : ''; // DEBUG //echo '<br />'; // Collect the available star counts for this player $temp_star_counts = rpg_game::stars_available($player_token); ?> <div class="field_stars"> <label class="label">stars</label> <span class="star star_field" data-star="field"><?php echo $temp_star_counts['field']; ?> field</span> <span class="star star_fusion" data-star="fusion"><?php echo $temp_star_counts['fusion']; ?> fusion</span> </div> <?php // Print the sort wrapper and options if allowed if ($global_allow_editing) { ?> <div class="field_tools"> <label class="label">tools</label> <a class="tool tool_shuffle" data-tool="shuffle" data-player="<?php echo $player_token; ?> ">shuffle</a> <a class="tool tool_randomize" data-tool="randomize" data-player="<?php echo $player_token; ?> ">randomize</a> </div> <?php } ?> </div> </td> </tr> </tbody> </table> <?php } ?> </div> </div> <?php $key_counter++; // Collect the outbut buffer contents $this_markup = trim(ob_get_clean()); // Return the generated markup return $this_markup; }
} $item_counter++; $item_info_token = $token; $item_info_price = $price; $item_info_name = $item_info['ability_name']; $item_info_quantity = !empty($_SESSION[$session_token]['values']['battle_items'][$token]) ? $_SESSION[$session_token]['values']['battle_items'][$token] : 0; $item_info_type = !empty($item_info['ability_type']) ? $item_info['ability_type'] : 'none'; if ($item_info_type != 'none' && !empty($item_info['ability_type2'])) { $item_info_type .= '_' . $item_info['ability_type2']; } elseif ($item_info_type == 'none' && !empty($item_info['ability_type2'])) { $item_info_type = $item_info['ability_type2']; } $global_item_quantities[$item_info_token] = $item_info_quantity; $global_item_prices['sell'][$item_info_token] = $item_info_price; $item_cell_float = $item_counter % 2 == 0 ? 'right' : 'left'; $temp_info_tooltip = rpg_ability::print_editor_title_markup($robot_info, $item_info, array('show_quantity' => false)); $temp_info_tooltip = htmlentities($temp_info_tooltip, ENT_QUOTES, 'UTF-8', true); ?> <td class="<?php echo $item_cell_float; ?> item_cell" data-kind="item" data-action="sell" data-token="<?php echo $item_info_token; ?> "> <span class="item_name ability_type ability_type_<?php echo $item_info_type; ?> " data-tooltip="<?php echo $temp_info_tooltip; ?>
public static function print_database_markup($robot_info, $print_options = array(), $cache_markup = false) { // Define the markup variable $this_markup = ''; // Define the global variables global $mmrpg_index, $this_current_uri, $this_current_url, $db; global $mmrpg_database_players, $mmrpg_database_items, $mmrpg_database_fields, $mmrpg_database_types; global $mmrpg_stat_base_max_value; // Collect the approriate database indexes if (empty($mmrpg_database_players)) { $mmrpg_database_players = rpg_player::get_index(true); } if (empty($mmrpg_database_items)) { $mmrpg_database_items = rpg_item::get_index(true); } if (empty($mmrpg_database_fields)) { $mmrpg_database_fields = rpg_field::get_index(true); } if (empty($mmrpg_database_types)) { $mmrpg_database_types = rpg_type::get_index(); } // Define the print style defaults if (!isset($print_options['layout_style'])) { $print_options['layout_style'] = 'website'; } if ($print_options['layout_style'] == 'website') { if (!isset($print_options['show_basics'])) { $print_options['show_basics'] = true; } if (!isset($print_options['show_mugshot'])) { $print_options['show_mugshot'] = true; } if (!isset($print_options['show_quotes'])) { $print_options['show_quotes'] = true; } if (!isset($print_options['show_description'])) { $print_options['show_description'] = true; } if (!isset($print_options['show_sprites'])) { $print_options['show_sprites'] = true; } if (!isset($print_options['show_abilities'])) { $print_options['show_abilities'] = true; } if (!isset($print_options['show_records'])) { $print_options['show_records'] = true; } if (!isset($print_options['show_footer'])) { $print_options['show_footer'] = true; } if (!isset($print_options['show_key'])) { $print_options['show_key'] = false; } if (!isset($print_options['show_stats'])) { $print_options['show_stats'] = true; } } elseif ($print_options['layout_style'] == 'website_compact') { if (!isset($print_options['show_basics'])) { $print_options['show_basics'] = true; } if (!isset($print_options['show_mugshot'])) { $print_options['show_mugshot'] = true; } if (!isset($print_options['show_quotes'])) { $print_options['show_quotes'] = false; } if (!isset($print_options['show_description'])) { $print_options['show_description'] = false; } if (!isset($print_options['show_sprites'])) { $print_options['show_sprites'] = false; } if (!isset($print_options['show_abilities'])) { $print_options['show_abilities'] = false; } if (!isset($print_options['show_records'])) { $print_options['show_records'] = false; } if (!isset($print_options['show_footer'])) { $print_options['show_footer'] = true; } if (!isset($print_options['show_key'])) { $print_options['show_key'] = false; } if (!isset($print_options['show_stats'])) { $print_options['show_stats'] = false; } } elseif ($print_options['layout_style'] == 'event') { if (!isset($print_options['show_basics'])) { $print_options['show_basics'] = true; } if (!isset($print_options['show_mugshot'])) { $print_options['show_mugshot'] = false; } if (!isset($print_options['show_quotes'])) { $print_options['show_quotes'] = false; } if (!isset($print_options['show_description'])) { $print_options['show_description'] = false; } if (!isset($print_options['show_sprites'])) { $print_options['show_sprites'] = false; } if (!isset($print_options['show_abilities'])) { $print_options['show_abilities'] = false; } if (!isset($print_options['show_records'])) { $print_options['show_records'] = false; } if (!isset($print_options['show_footer'])) { $print_options['show_footer'] = false; } if (!isset($print_options['show_key'])) { $print_options['show_key'] = false; } if (!isset($print_options['show_stats'])) { $print_options['show_stats'] = false; } } // Collect the robot sprite dimensions $robot_image_size = !empty($robot_info['robot_image_size']) ? $robot_info['robot_image_size'] : 40; $robot_image_size_text = $robot_image_size . 'x' . $robot_image_size; $robot_image_token = !empty($robot_info['robot_image']) ? $robot_info['robot_image'] : $robot_info['robot_token']; //die('<pre>$robot_info = '.print_r($robot_info, true).'</pre>'); // Collect the robot's type for background display $robot_header_types = 'type_' . (!empty($robot_info['robot_core']) ? $robot_info['robot_core'] . (!empty($robot_info['robot_core2']) ? '_' . $robot_info['robot_core2'] : '') : 'none') . ' '; // Define the sprite sheet alt and title text $robot_sprite_size = $robot_image_size * 2; $robot_sprite_size_text = $robot_sprite_size . 'x' . $robot_sprite_size; $robot_sprite_title = $robot_info['robot_name']; // Prepare the variable for extra text $robot_info['robot_name_append'] = ''; // Define the sprite frame index for robot images $robot_sprite_frames = array('base', 'taunt', 'victory', 'defeat', 'shoot', 'throw', 'summon', 'slide', 'defend', 'damage', 'base2'); // Collect the field info if applicable $field_info_array = array(); $temp_robot_fields = array(); if (!empty($robot_info['robot_field']) && $robot_info['robot_field'] != 'field') { $temp_robot_fields[] = $robot_info['robot_field']; } if (!empty($robot_info['robot_field2'])) { $temp_robot_fields = array_merge($temp_robot_fields, $robot_info['robot_field2']); } if ($temp_robot_fields) { foreach ($temp_robot_fields as $key => $token) { if (!empty($mmrpg_database_fields[$token])) { $field_info_array[] = rpg_field::parse_index_info($mmrpg_database_fields[$token]); } } } // Define the class token for this robot $robot_class_token = ''; $robot_class_token_plural = ''; if ($robot_info['robot_class'] == 'master') { $robot_class_token = 'robot'; $robot_class_token_plural = 'robots'; } elseif ($robot_info['robot_class'] == 'mecha') { $robot_class_token = 'mecha'; $robot_class_token_plural = 'mechas'; } elseif ($robot_info['robot_class'] == 'boss') { $robot_class_token = 'boss'; $robot_class_token_plural = 'bosses'; } // Define the default class tokens for "empty" images $default_robot_class_tokens = array('robot', 'mecha', 'boss'); // Automatically disable sections if content is unavailable if (empty($robot_info['robot_description2'])) { $print_options['show_description'] = false; } if (isset($robot_info['robot_image_sheets']) && $robot_info['robot_image_sheets'] === 0) { $print_options['show_sprites'] = false; } elseif (in_array($robot_image_token, $default_robot_class_tokens)) { $print_options['show_sprites'] = false; } // Define the base URLs for this robot $database_url = 'database/'; $database_category_url = $database_url; if ($robot_info['robot_class'] == 'master') { $database_category_url .= 'robots/'; } elseif ($robot_info['robot_class'] == 'mecha') { $database_category_url .= 'mechas/'; } elseif ($robot_info['robot_class'] == 'boss') { $database_category_url .= 'bosses/'; } $database_category_robot_url = $database_category_url . $robot_info['robot_token'] . '/'; // Calculate the robot base stat total $robot_info['robot_total'] = 0; $robot_info['robot_total'] += $robot_info['robot_energy']; $robot_info['robot_total'] += $robot_info['robot_attack']; $robot_info['robot_total'] += $robot_info['robot_defense']; $robot_info['robot_total'] += $robot_info['robot_speed']; // Calculate this robot's maximum base stat for reference $robot_info['robot_max_stat_name'] = 'unknown'; $robot_info['robot_max_stat_value'] = 0; $temp_types = array('energy', 'attack', 'defense', 'speed'); foreach ($temp_types as $type) { if ($robot_info['robot_' . $type] > $robot_info['robot_max_stat_value']) { $robot_info['robot_max_stat_value'] = $robot_info['robot_' . $type]; $robot_info['robot_max_stat_name'] = $type; } } // Collect the database records for this robot if ($print_options['show_records']) { global $db; $temp_robot_records = array('robot_encountered' => 0, 'robot_defeated' => 0, 'robot_unlocked' => 0, 'robot_summoned' => 0, 'robot_scanned' => 0); //$temp_robot_records['player_count'] = $db->get_value("SELECT COUNT(board_id) AS player_count FROM mmrpg_leaderboard WHERE board_robots LIKE '%[".$robot_info['robot_token'].":%' AND board_points > 0", 'player_count'); $temp_player_query = "SELECT\n mmrpg_saves.user_id,\n mmrpg_saves.save_values_robot_database,\n mmrpg_leaderboard.board_points\n FROM mmrpg_saves\n LEFT JOIN mmrpg_leaderboard ON mmrpg_leaderboard.user_id = mmrpg_saves.user_id\n WHERE mmrpg_saves.save_values_robot_database LIKE '%\"{$robot_info['robot_token']}\"%' AND mmrpg_leaderboard.board_points > 0;"; $temp_player_list = $db->get_array_list($temp_player_query); if (!empty($temp_player_list)) { foreach ($temp_player_list as $temp_data) { $temp_values = !empty($temp_data['save_values_robot_database']) ? json_decode($temp_data['save_values_robot_database'], true) : array(); $temp_entry = !empty($temp_values[$robot_info['robot_token']]) ? $temp_values[$robot_info['robot_token']] : array(); foreach ($temp_robot_records as $temp_record => $temp_count) { if (!empty($temp_entry[$temp_record])) { $temp_robot_records[$temp_record] += $temp_entry[$temp_record]; } } } } $temp_values = array(); //echo '<pre>'.print_r($temp_robot_records, true).'</pre>'; } // Define the common stat container variables $stat_container_percent = 74; $stat_base_max_value = 2000; $stat_padding_area = 76; if (!empty($mmrpg_stat_base_max_value[$robot_info['robot_class']])) { $stat_base_max_value = $mmrpg_stat_base_max_value[$robot_info['robot_class']]; } elseif ($robot_info['robot_class'] == 'master') { $stat_base_max_value = 400; } elseif ($robot_info['robot_class'] == 'mecha') { $stat_base_max_value = 400; } elseif ($robot_info['robot_class'] == 'boss') { $stat_base_max_value = 2000; } // If this is a mecha class, do not show potential stat totals... for now //if ($robot_info['robot_class'] != 'master'){ // $print_options['show_stats'] = false; //} // Define the variable to hold compact footer link markup $compact_footer_link_markup = array(); //$compact_footer_link_markup[] = '<a class="link link_permalink" href="'.$database_category_robot_url.'">+ Huh?</a>'; // Add a link to the sprites in the compact footer markup if (!in_array($robot_image_token, $default_robot_class_tokens)) { $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#sprites">#Sprites</a>'; } if (!empty($robot_info['robot_quotes']['battle_start'])) { $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#quotes">#Quotes</a>'; } if (!empty($robot_info['robot_description2'])) { $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#description">#Description</a>'; } if (!empty($robot_info['robot_abilities'])) { $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#abilities">#Abilities</a>'; } $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#stats">#Stats</a>'; $compact_footer_link_markup[] = '<a class="link" href="' . $database_category_robot_url . '#records">#Records</a>'; /* $compact_footer_link_markup[] = '<a class="link '.$robot_header_types.'" href="'.$database_category_robot_url.'">View More</a>'; */ // Start the output buffer ob_start(); /*<div class="database_container database_<?= $robot_class_token ?>_container database_<?= $print_options['layout_style'] ?>_container" data-token="<?= $robot_info['robot_token']?>" style="<?= $print_options['layout_style'] == 'website_compact' ? 'margin-bottom: 2px !important;' : '' ?>">*/ ?> <div class="database_container layout_<?php echo str_replace('website_', '', $print_options['layout_style']); ?> " data-token="<?php echo $robot_info['robot_token']; ?> "> <?php if ($print_options['layout_style'] == 'website' || $print_options['layout_style'] == 'website_compact') { ?> <a class="anchor" id="<?php echo $robot_info['robot_token']; ?> "></a> <?php } ?> <div class="subbody event event_triple event_visible" data-token="<?php echo $robot_info['robot_token']; ?> "> <?php if ($print_options['show_mugshot']) { ?> <div class="this_sprite sprite_left" style="height: 40px;"> <?php if ($print_options['show_mugshot']) { ?> <?php if ($print_options['show_key'] !== false) { ?> <div class="mugshot robot_type <?php echo $robot_header_types; ?> " style="font-size: 9px; line-height: 11px; text-align: center; margin-bottom: 2px; padding: 0 0 1px !important;"><?php echo 'No.' . $robot_info['robot_key']; ?> </div> <?php } ?> <?php if (!in_array($robot_image_token, $default_robot_class_tokens)) { ?> <div class="mugshot robot_type <?php echo $robot_header_types; ?> "><div style="background-image: url(i/r/<?php echo $robot_image_token; ?> /mr<?php echo $robot_image_size; ?> .png?<?php echo MMRPG_CONFIG_CACHE_DATE; ?> ); " class="sprite sprite_robot sprite_40x40 sprite_40x40_mug sprite_size_<?php echo $robot_image_size_text; ?> sprite_size_<?php echo $robot_image_size_text; ?> _mug robot_status_active robot_position_active"><?php echo $robot_info['robot_name']; ?> 's Mugshot</div></div> <?php } else { ?> <div class="mugshot robot_type <?php echo $robot_header_types; ?> "><div style="background-image: none; background-color: #000000; background-color: rgba(0, 0, 0, 0.6); " class="sprite sprite_robot sprite_40x40 sprite_40x40_mug sprite_size_<?php echo $robot_image_size_text; ?> sprite_size_<?php echo $robot_image_size_text; ?> _mug robot_status_active robot_position_active">No Image</div></div> <?php } ?> <?php } ?> </div> <?php } ?> <?php if ($print_options['show_basics']) { ?> <h2 class="header header_left <?php echo $robot_header_types; ?> <?php echo !$print_options['show_mugshot'] ? 'nomug' : ''; ?> " style="<?php echo !$print_options['show_mugshot'] ? 'margin-left: 0;' : ''; ?> "> <?php if ($print_options['layout_style'] == 'website_compact') { ?> <a href="<?php echo $database_category_robot_url; ?> "><?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> </a> <?php } else { ?> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Data <?php } ?> <div class="header_core robot_type"><?php echo !empty($robot_info['robot_core']) ? ucwords($robot_info['robot_core'] . (!empty($robot_info['robot_core2']) ? ' / ' . $robot_info['robot_core2'] : '')) : 'Neutral'; echo $robot_info['robot_class'] == 'mecha' ? ' Type' : ' Core'; ?> </div> </h2> <div class="body body_left <?php echo !$print_options['show_mugshot'] ? 'fullsize' : ''; ?> "> <table class="full"> <colgroup> <?php if ($print_options['layout_style'] == 'website') { ?> <col width="48%" /> <col width="1%" /> <col width="48%" /> <?php } else { ?> <col width="40%" /> <col width="1%" /> <col width="59%" /> <?php } ?> </colgroup> <tbody> <?php if ($print_options['layout_style'] != 'event') { ?> <tr> <td class="right"> <label>Name :</label> <span class="robot_type" style="width: auto;"><?php echo $robot_info['robot_name']; ?> </span> <?php if (!empty($robot_info['robot_generation'])) { ?> <span class="robot_type" style="width: auto;"><?php echo $robot_info['robot_generation']; ?> Gen</span><?php } ?> </td> <td></td> <td class="right"> <?php // Define the source game string if ($robot_info['robot_token'] == 'mega-man' || $robot_info['robot_token'] == 'roll') { $temp_source_string = 'Mega Man'; } elseif ($robot_info['robot_token'] == 'proto-man') { $temp_source_string = 'Mega Man 3'; } elseif ($robot_info['robot_token'] == 'bass') { $temp_source_string = 'Mega Man 7'; } elseif ($robot_info['robot_token'] == 'disco' || $robot_info['robot_token'] == 'rhythm') { $temp_source_string = 'Mega Man RPG Prototype'; } elseif (preg_match('/^flutter-fly/i', $robot_info['robot_token'])) { $temp_source_string = 'Mega Man RPG Prototype'; } elseif (preg_match('/^beetle-borg/i', $robot_info['robot_token'])) { $temp_source_string = '<span title="Rockman & Forte 2 : Challenger from the Future (JP)">Mega Man & Bass 2</span>'; } elseif ($robot_info['robot_token'] == 'bond-man') { $temp_source_string = 'Mega Man RPG Prototype'; } elseif ($robot_info['robot_token'] == 'enker') { $temp_source_string = 'Mega Man : Dr. Wily\'s Revenge'; } elseif ($robot_info['robot_token'] == 'punk') { $temp_source_string = 'Mega Man III'; } elseif ($robot_info['robot_token'] == 'ballade') { $temp_source_string = 'Mega Man IV'; } elseif ($robot_info['robot_token'] == 'quint') { $temp_source_string = 'Mega Man II'; } elseif ($robot_info['robot_token'] == 'oil-man' || $robot_info['robot_token'] == 'time-man') { $temp_source_string = 'Mega Man Powered Up'; } elseif ($robot_info['robot_token'] == 'solo') { $temp_source_string = 'Mega Man Star Force 3'; } elseif (preg_match('/^duo-2/i', $robot_info['robot_token'])) { $temp_source_string = 'Mega Man 8'; } elseif (preg_match('/^duo/i', $robot_info['robot_token'])) { $temp_source_string = 'Mega Man Power Battles'; } elseif (preg_match('/^trio/i', $robot_info['robot_token'])) { $temp_source_string = 'Mega Man RPG Prototype'; } elseif ($robot_info['robot_token'] == 'cosmo-man' || $robot_info['robot_token'] == 'lark-man') { $temp_source_string = 'Mega Man Battle Network 5'; } elseif ($robot_info['robot_token'] == 'laser-man') { $temp_source_string = 'Mega Man Battle Network 4'; } elseif ($robot_info['robot_token'] == 'desert-man') { $temp_source_string = 'Mega Man Battle Network 3'; } elseif ($robot_info['robot_token'] == 'planet-man' || $robot_info['robot_token'] == 'gate-man') { $temp_source_string = 'Mega Man Battle Network 2'; } elseif ($robot_info['robot_token'] == 'shark-man' || $robot_info['robot_token'] == 'number-man' || $robot_info['robot_token'] == 'color-man') { $temp_source_string = 'Mega Man Battle Network'; } elseif ($robot_info['robot_token'] == 'trill' || $robot_info['robot_token'] == 'slur') { $temp_source_string = '<span title="Rockman.EXE Stream (JP)">Mega Man NT Warrior</span>'; } elseif ($robot_info['robot_game'] == 'MM085') { $temp_source_string = '<span title="Rockman & Forte (JP)">Mega Man & Bass</span>'; } elseif ($robot_info['robot_game'] == 'MM30') { $temp_source_string = 'Mega Man V'; } elseif ($robot_info['robot_game'] == 'MM21') { $temp_source_string = 'Mega Man : The Wily Wars'; } elseif ($robot_info['robot_game'] == 'MM19') { $temp_source_string = 'Mega Man RPG Prototype'; } elseif ($robot_info['robot_game'] == 'MMEXE') { $temp_source_string = 'Mega Man EXE'; } elseif ($robot_info['robot_game'] == 'MM00' || $robot_info['robot_game'] == 'MM01') { $temp_source_string = 'Mega Man'; } elseif (preg_match('/^MM([0-9]{2})$/', $robot_info['robot_game'])) { $temp_source_string = 'Mega Man ' . ltrim(str_replace('MM', '', $robot_info['robot_game']), '0'); } elseif (!empty($robot_info['robot_game'])) { $temp_source_string = $robot_info['robot_game']; } else { $temp_source_string = '???'; } ?> <label>Source :</label> <span class="robot_type"><?php echo $temp_source_string; ?> </span> </td> </tr> <?php } ?> <tr> <td class="right"> <label>Model :</label> <span class="robot_type"><?php echo $robot_info['robot_number']; ?> </span> </td> <td></td> <td class="right"> <label>Class :</label> <span class="robot_type"><?php echo !empty($robot_info['robot_description']) ? $robot_info['robot_description'] : '…'; ?> </span> </td> </tr> <tr> <td class="right"> <label>Type :</label> <?php if ($print_options['layout_style'] != 'event') { ?> <?php if (!empty($robot_info['robot_core2'])) { ?> <span class="robot_type type_<?php echo $robot_info['robot_core'] . '_' . $robot_info['robot_core2']; ?> "> <a href="<?php echo $database_category_url; echo $robot_info['robot_core']; ?> /"><?php echo ucfirst($robot_info['robot_core']); ?> </a> / <a href="<?php echo $database_category_url; echo $robot_info['robot_core2']; ?> /"><?php echo ucfirst($robot_info['robot_core2']); echo $robot_info['robot_class'] == 'master' ? ' Core' : ' Type'; ?> </a> </span> <?php } else { ?> <a href="<?php echo $database_category_url; echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none'; ?> /" class="robot_type type_<?php echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none'; ?> "><?php echo !empty($robot_info['robot_core']) ? ucfirst($robot_info['robot_core']) : 'Neutral'; echo $robot_info['robot_class'] == 'master' ? ' Core' : ' Type'; ?> </a> <?php } ?> <?php } else { ?> <span class="robot_type type_<?php echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] . (!empty($robot_info['robot_core2']) ? '_' . $robot_info['robot_core2'] : '') : 'none'; ?> "><?php echo !empty($robot_info['robot_core']) ? ucwords($robot_info['robot_core'] . (!empty($robot_info['robot_core2']) ? ' / ' . $robot_info['robot_core2'] : '')) : 'Neutral'; echo $robot_info['robot_class'] == 'master' ? ' Core' : ' Type'; ?> </span> <?php } ?> </td> <td></td> <td class="right"> <label><?php echo empty($field_info_array) || count($field_info_array) == 1 ? 'Field' : 'Fields'; ?> :</label> <?php // Loop through the robots fields if available if (!empty($field_info_array)) { foreach ($field_info_array as $key => $field_info) { ?> <?php if ($print_options['layout_style'] != 'event') { ?> <a href="<?php echo $database_url; ?> fields/<?php echo $field_info['field_token']; ?> /" class="field_type field_type_<?php echo (!empty($field_info['field_type']) ? $field_info['field_type'] : 'none') . (!empty($field_info['field_type2']) ? '_' . $field_info['field_type2'] : ''); ?> " <?php echo $key > 0 ? 'title="' . $field_info['field_name'] . '"' : ''; ?> ><?php echo $key == 0 ? $field_info['field_name'] : preg_replace('/^([a-z0-9]+)\\s([a-z0-9]+)$/i', '$1…', $field_info['field_name']); ?> </a> <?php } else { ?> <span class="field_type field_type_<?php echo (!empty($field_info['field_type']) ? $field_info['field_type'] : 'none') . (!empty($field_info['field_type2']) ? '_' . $field_info['field_type2'] : ''); ?> " <?php echo $key > 0 ? 'title="' . $field_info['field_name'] . '"' : ''; ?> ><?php echo $key == 0 ? $field_info['field_name'] : preg_replace('/^([a-z0-9]+)\\s([a-z0-9]+)$/i', '$1…', $field_info['field_name']); ?> </span> <?php } ?> <?php } } else { ?> <span class="field_type">…</span> <?php } ?> </td> </tr> <tr> <td class="right"> <label>Energy :</label> <span class="stat" style="width: <?php echo $stat_container_percent; ?> %;"> <?php if (false && $print_options['layout_style'] == 'website_compact') { ?> <span class="robot_stat type_energy" style="padding-left: <?php echo round($robot_info['robot_energy'] / $robot_info['robot_total'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_energy']; ?> </span></span> <?php } else { ?> <span class="robot_stat type_energy" style="padding-left: <?php echo round($robot_info['robot_energy'] / $robot_info['robot_max_stat_value'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_energy']; ?> </span></span> <?php } ?> </span> </td> <td></td> <td class="right"> <label>Weaknesses :</label> <?php if (!empty($robot_info['robot_weaknesses'])) { $temp_string = array(); foreach ($robot_info['robot_weaknesses'] as $robot_weakness) { if ($print_options['layout_style'] != 'event') { $temp_string[] = '<a href="' . $database_url . 'abilities/' . $robot_weakness . '/" class="robot_weakness robot_type type_' . $robot_weakness . '">' . $mmrpg_database_types[$robot_weakness]['type_name'] . '</a>'; } else { $temp_string[] = '<span class="robot_weakness robot_type type_' . $robot_weakness . '">' . $mmrpg_database_types[$robot_weakness]['type_name'] . '</span>'; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_weakness robot_type type_none">None</span>'; } ?> </td> </tr> <tr> <td class="right"> <label>Attack :</label> <span class="stat" style="width: <?php echo $stat_container_percent; ?> %;"> <?php if (false && $print_options['layout_style'] == 'website_compact') { ?> <span class="robot_stat type_attack" style="padding-left: <?php echo round($robot_info['robot_attack'] / $robot_info['robot_total'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_attack']; ?> </span></span> <?php } else { ?> <span class="robot_stat type_attack" style="padding-left: <?php echo round($robot_info['robot_attack'] / $robot_info['robot_max_stat_value'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_attack']; ?> </span></span> <?php } ?> </span> </td> <td></td> <td class="right"> <label>Resistances :</label> <?php if (!empty($robot_info['robot_resistances'])) { $temp_string = array(); foreach ($robot_info['robot_resistances'] as $robot_resistance) { if ($print_options['layout_style'] != 'event') { $temp_string[] = '<a href="' . $database_url . 'abilities/' . $robot_resistance . '/" class="robot_resistance robot_type type_' . $robot_resistance . '">' . $mmrpg_database_types[$robot_resistance]['type_name'] . '</a>'; } else { $temp_string[] = '<span class="robot_resistance robot_type type_' . $robot_resistance . '">' . $mmrpg_database_types[$robot_resistance]['type_name'] . '</span>'; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_resistance robot_type type_none">None</span>'; } ?> </td> </tr> <tr> <td class="right"> <label>Defense :</label> <span class="stat" style="width: <?php echo $stat_container_percent; ?> %;"> <?php if (false && $print_options['layout_style'] == 'website_compact') { ?> <span class="robot_stat type_defense" style="padding-left: <?php echo round($robot_info['robot_defense'] / $robot_info['robot_total'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_defense']; ?> </span></span> <?php } else { ?> <span class="robot_stat type_defense" style="padding-left: <?php echo round($robot_info['robot_defense'] / $robot_info['robot_max_stat_value'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_defense']; ?> </span></span> <?php } ?> </span> </td> <td></td> <td class="right"> <label>Affinities :</label> <?php if (!empty($robot_info['robot_affinities'])) { $temp_string = array(); foreach ($robot_info['robot_affinities'] as $robot_affinity) { if ($print_options['layout_style'] != 'event') { $temp_string[] = '<a href="' . $database_url . 'abilities/' . $robot_affinity . '/" class="robot_affinity robot_type type_' . $robot_affinity . '">' . $mmrpg_database_types[$robot_affinity]['type_name'] . '</a>'; } else { $temp_string[] = '<span class="robot_affinity robot_type type_' . $robot_affinity . '">' . $mmrpg_database_types[$robot_affinity]['type_name'] . '</span>'; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_affinity robot_type type_none">None</span>'; } ?> </td> </tr> <tr> <td class="right"> <label>Speed :</label> <span class="stat" style="width: <?php echo $stat_container_percent; ?> %;"> <?php if (false && $print_options['layout_style'] == 'website_compact') { ?> <span class="robot_stat type_speed" style="padding-left: <?php echo round($robot_info['robot_speed'] / $robot_info['robot_total'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_speed']; ?> </span></span> <?php } else { ?> <span class="robot_stat type_speed" style="padding-left: <?php echo round($robot_info['robot_speed'] / $robot_info['robot_max_stat_value'] * $stat_padding_area, 4); ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_speed']; ?> </span></span> <?php } ?> </span> </td> <td></td> <td class="right"> <label>Immunities :</label> <?php if (!empty($robot_info['robot_immunities'])) { $temp_string = array(); foreach ($robot_info['robot_immunities'] as $robot_immunity) { if ($print_options['layout_style'] != 'event') { $temp_string[] = '<a href="' . $database_url . 'abilities/' . $robot_immunity . '/" class="robot_immunity robot_type type_' . $robot_immunity . '">' . $mmrpg_database_types[$robot_immunity]['type_name'] . '</a>'; } else { $temp_string[] = '<span class="robot_immunity robot_type type_' . $robot_immunity . '">' . $mmrpg_database_types[$robot_immunity]['type_name'] . '</span>'; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_immunity robot_type type_none">None</span>'; } ?> </td> </tr> <?php if (false && ($print_options['layout_style'] == 'website' || $print_options['layout_style'] == 'website_compact')) { ?> <tr> <td class="right"> <label>Total :</label> <span class="stat" style="width: <?php echo $stat_container_percent; ?> %;"> <?php if ($print_options['layout_style'] == 'website_compact' && $robot_info['robot_total'] < $stat_base_max_value) { ?> <span class="robot_stat type_empty"> <span class="robot_stat type_none" style="padding-left: <?php echo round($robot_info['robot_total'] / $stat_base_max_value * $stat_padding_area, 4); ?> %;"><span><?php echo $robot_info['robot_total']; ?> </span></span> </span> <?php } else { ?> <span class="robot_stat type_none" style="padding-left: <?php echo $stat_padding_area; ?> %;"><span style="display: inline-block; width: 35px;"><?php echo $robot_info['robot_total']; ?> </span></span> <?php } ?> </span> </td> <td></td> <td class="right"><?/* <label>Immunities :</label> <?php if (!empty($robot_info['robot_immunities'])) { $temp_string = array(); foreach ($robot_info['robot_immunities'] as $robot_immunity) { if ($print_options['layout_style'] != 'event') { $temp_string[] = '<a href="' . $database_url . 'abilities/' . $robot_immunity . '/" class="robot_immunity robot_type type_' . $robot_immunity . '">' . $mmrpg_database_types[$robot_immunity]['type_name'] . '</a>'; } else { $temp_string[] = '<span class="robot_immunity robot_type type_' . $robot_immunity . '">' . $mmrpg_database_types[$robot_immunity]['type_name'] . '</span>'; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_immunity robot_type type_none">None</span>'; } ?> */?> </td> </tr> <?php } ?> <?php if ($print_options['layout_style'] == 'event') { ?> <?php // Define the search and replace arrays for the robot quotes $temp_find = array('{this_player}', '{this_robot}', '{target_player}', '{target_robot}'); $temp_replace = array('Doctor', $robot_info['robot_name'], 'Doctor', 'Robot'); ?> <tr> <td colspan="3" class="center" style="font-size: 13px; padding: 5px 0; "> <span class="robot_quote">"<?php echo !empty($robot_info['robot_quotes']['battle_taunt']) ? str_replace($temp_find, $temp_replace, $robot_info['robot_quotes']['battle_taunt']) : '…'; ?> "</span> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> <?php if ($print_options['layout_style'] == 'website') { ?> <?php // Define the various tabs we are able to scroll to $section_tabs = array(); if ($print_options['show_sprites']) { $section_tabs[] = array('sprites', 'Sprites', false); } if ($print_options['show_quotes']) { $section_tabs[] = array('quotes', 'Quotes', false); } if ($print_options['show_description']) { $section_tabs[] = array('description', 'Description', false); } if ($print_options['show_abilities']) { $section_tabs[] = array('abilities', 'Abilities', false); } if ($print_options['show_stats']) { $section_tabs[] = array('stats', 'Stats', false); } if ($print_options['show_records']) { $section_tabs[] = array('records', 'Records', false); } // Automatically mark the first element as true or active $section_tabs[0][2] = true; // Define the current URL for this robot or mecha page $temp_url = 'database/'; if ($robot_info['robot_class'] == 'mecha') { $temp_url .= 'mechas/'; } elseif ($robot_info['robot_class'] == 'master') { $temp_url .= 'robots/'; } elseif ($robot_info['robot_class'] == 'boss') { $temp_url .= 'bosses/'; } $temp_url .= $robot_info['robot_token'] . '/'; ?> <div class="section_tabs"> <?php foreach ($section_tabs as $tab) { echo '<a class="link_inline link_' . $tab[0] . ' ' . ($tab[2] ? 'active' : '') . '" href="' . $temp_url . '#' . $tab[0] . '" data-anchor="#' . $tab[0] . '"><span class="wrap">' . $tab[1] . '</span></a>'; } ?> </div> <?php } ?> <?php if ($print_options['show_sprites']) { ?> <?php // Start the output buffer and prepare to collect sprites ob_start(); // Define the alts we'll be looping through for this robot $temp_alts_array = array(); $temp_alts_array[] = array('token' => '', 'name' => $robot_info['robot_name'], 'summons' => 0); // Append predefined alts automatically, based on the robot image alt array if (!empty($robot_info['robot_image_alts'])) { $temp_alts_array = array_merge($temp_alts_array, $robot_info['robot_image_alts']); } elseif ($robot_info['robot_core'] == 'copy' && preg_match('/^(mega-man|proto-man|bass|doc-robot)$/i', $robot_info['robot_token'])) { foreach ($mmrpg_database_types as $type_token => $type_info) { if (empty($type_token) || $type_token == 'none' || $type_token == 'copy') { continue; } $temp_alts_array[] = array('token' => $type_token, 'name' => $robot_info['robot_name'] . ' (' . ucfirst($type_token) . ' Core)', 'summons' => 0); } } elseif (!empty($robot_info['robot_image_sheets'])) { for ($i = 2; $i <= $robot_info['robot_image_sheets']; $i++) { $temp_alts_array[] = array('sheet' => $i, 'name' => $robot_info['robot_name'] . ' (Sheet #' . $i . ')', 'summons' => 0); } } // Loop through the alts and display images for them (yay!) foreach ($temp_alts_array as $alt_key => $alt_info) { // Define the current image token with alt in mind $temp_robot_image_token = $robot_image_token; $temp_robot_image_token .= !empty($alt_info['token']) ? '_' . $alt_info['token'] : ''; $temp_robot_image_token .= !empty($alt_info['sheet']) ? '-' . $alt_info['sheet'] : ''; $temp_robot_image_name = $alt_info['name']; // Update the alt array with this info $temp_alts_array[$alt_key]['image'] = $temp_robot_image_token; // Collect the number of sheets $temp_sheet_number = !empty($robot_info['robot_image_sheets']) ? $robot_info['robot_image_sheets'] : 1; // Loop through the different frames and print out the sprite sheets foreach (array('right', 'left') as $temp_direction) { $temp_direction2 = substr($temp_direction, 0, 1); $temp_embed = '[robot:' . $temp_direction . ']{' . $temp_robot_image_token . '}'; $temp_title = $temp_robot_image_name . ' | Mugshot Sprite ' . ucfirst($temp_direction); $temp_title .= '<div style="margin-top: 4px; letting-spacing: 1px; font-size: 90%; font-family: Courier New; color: rgb(159, 150, 172);">' . $temp_embed . '</div>'; $temp_title = htmlentities($temp_title, ENT_QUOTES, 'UTF-8', true); $temp_label = 'Mugshot ' . ucfirst(substr($temp_direction, 0, 1)); echo '<div class="frame_container" data-clickcopy="' . $temp_embed . '" data-direction="' . $temp_direction . '" data-image="' . $temp_robot_image_token . '" data-frame="mugshot" style="padding-top: 20px; float: left; position: relative; margin: 0; box-shadow: inset 1px 1px 5px rgba(0, 0, 0, 0.75); width: ' . $robot_sprite_size . 'px; height: ' . $robot_sprite_size . 'px; overflow: hidden;">'; echo '<img style="margin-left: 0;" data-tooltip="' . $temp_title . '" src="i/r/' . $temp_robot_image_token . '/m' . $temp_direction2 . $robot_sprite_size . '.png?' . MMRPG_CONFIG_CACHE_DATE . '" />'; echo '<label style="position: absolute; left: 5px; top: 0; color: #EFEFEF; font-size: 10px; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);">' . $temp_label . '</label>'; echo '</div>'; } // Loop through the different frames and print out the sprite sheets foreach ($robot_sprite_frames as $this_key => $this_frame) { $margin_left = ceil((0 - $this_key) * $robot_sprite_size); $frame_relative = $this_frame; //if ($temp_sheet > 1){ $frame_relative = 'frame_'.str_pad((($temp_sheet - 1) * count($robot_sprite_frames) + $this_key + 1), 2, '0', STR_PAD_LEFT); } $frame_relative_text = ucfirst(str_replace('_', ' ', $frame_relative)); foreach (array('right', 'left') as $temp_direction) { $temp_direction2 = substr($temp_direction, 0, 1); $temp_embed = '[robot:' . $temp_direction . ':' . $frame_relative . ']{' . $temp_robot_image_token . '}'; $temp_title = $temp_robot_image_name . ' | ' . $frame_relative_text . ' Sprite ' . ucfirst($temp_direction); $temp_title .= '<div style="margin-top: 4px; letting-spacing: 1px; font-size: 90%; font-family: Courier New; color: rgb(159, 150, 172);">' . $temp_embed . '</div>'; $temp_title = htmlentities($temp_title, ENT_QUOTES, 'UTF-8', true); $temp_label = $frame_relative_text . ' ' . ucfirst(substr($temp_direction, 0, 1)); //$image_token = !empty($robot_info['robot_image']) ? $robot_info['robot_image'] : $robot_info['robot_token']; //if ($temp_sheet > 1){ $temp_robot_image_token .= '-'.$temp_sheet; } echo '<div class="frame_container" data-clickcopy="' . $temp_embed . '" data-direction="' . $temp_direction . '" data-image="' . $temp_robot_image_token . '" data-frame="' . $frame_relative . '" style="padding-top: 20px; float: left; position: relative; margin: 0; box-shadow: inset 1px 1px 5px rgba(0, 0, 0, 0.75); width: ' . $robot_sprite_size . 'px; height: ' . $robot_sprite_size . 'px; overflow: hidden;">'; echo '<img style="margin-left: ' . $margin_left . 'px;" title="' . $temp_title . '" alt="' . $temp_title . '" src="i/r/' . $temp_robot_image_token . '/s' . $temp_direction2 . $robot_sprite_size . '.png?' . MMRPG_CONFIG_CACHE_DATE . '" />'; echo '<label style="position: absolute; left: 5px; top: 0; color: #EFEFEF; font-size: 10px; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);">' . $temp_label . '</label>'; echo '</div>'; } } } // Collect the sprite markup from the output buffer for later $this_sprite_markup = ob_get_clean(); ?> <h2 id="sprites" class="header header_full <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left; overflow: hidden; height: auto;"> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Sprites <span class="header_links image_link_container"> <span class="images" style="<?php echo count($temp_alts_array) == 1 ? 'visibility: hidden;' : ''; ?> "><?php // Loop though and print links for the alts $alt_type_base = 'robot_type type_' . (!empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none') . ' '; foreach ($temp_alts_array as $alt_key => $alt_info) { $alt_type = ''; $alt_style = ''; $alt_title = $alt_info['name']; $alt_type2 = $alt_type_base; if (preg_match('/^(?:[-_a-z0-9\\s]+)\\s\\(([a-z0-9]+)\\sCore\\)$/i', $alt_info['name'])) { $alt_type = strtolower(preg_replace('/^(?:[-_a-z0-9\\s]+)\\s\\(([a-z0-9]+)\\sCore\\)$/i', '$1', $alt_info['name'])); $alt_name = '•'; //ucfirst($alt_type); //substr(ucfirst($alt_type), 0, 2); $alt_type = 'robot_type type_' . $alt_type . ' core_type '; $alt_type2 = 'robot_type type_' . $alt_type . ' '; $alt_style = 'border-color: rgba(0, 0, 0, 0.2) !important; '; } else { $alt_name = $alt_key == 0 ? $robot_info['robot_name'] : 'Alt' . ($alt_key > 1 ? ' ' . $alt_key : ''); //$alt_key == 0 ? $robot_info['robot_name'] : $robot_info['robot_name'].' Alt'.($alt_key > 1 ? ' '.$alt_key : ''); $alt_type = 'robot_type type_empty '; $alt_style = 'border-color: rgba(0, 0, 0, 0.2) !important; background-color: rgba(0, 0, 0, 0.2) !important; '; //if ($robot_info['robot_core'] == 'copy' && $alt_key == 0){ $alt_type = 'robot_type type_empty '; } } echo '<a href="#" data-tooltip="' . $alt_title . '" data-tooltip-type="' . $alt_type2 . '" class="link link_image ' . ($alt_key == 0 ? 'link_active ' : '') . '" data-image="' . $alt_info['image'] . '">'; echo '<span class="' . $alt_type . '" style="' . $alt_style . '">' . $alt_name . '</span>'; echo '</a>'; } ?> </span> <span class="pipe" style="<?php echo count($temp_alts_array) == 1 ? 'visibility: hidden;' : ''; ?> ">|</span> <span class="directions"><?php // Loop though and print links for the alts foreach (array('right', 'left') as $temp_key => $temp_direction) { echo '<a href="#" data-tooltip="' . ucfirst($temp_direction) . ' Facing Sprites" data-tooltip-type="' . $alt_type_base . '" class="link link_direction ' . ($temp_key == 0 ? 'link_active' : '') . '" data-direction="' . $temp_direction . '">'; echo '<span class="ability_type ability_type_empty" style="border-color: rgba(0, 0, 0, 0.2) !important; background-color: rgba(0, 0, 0, 0.2) !important; ">' . ucfirst($temp_direction) . '</span>'; echo '</a>'; } ?> </span> </span> </h2> <div id="sprites_body" class="body body_full" style="margin: 0; padding: 10px; min-height: 10px;"> <div style="border: 1px solid rgba(0, 0, 0, 0.20); border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; background: #4d4d4d url(images/assets/sprite-grid.gif) scroll repeat -10px -30px; overflow: hidden; padding: 10px 30px;"> <?php echo $this_sprite_markup; ?> </div> <? // Collect the sprite contributor index for display $user_fields = rpg_user::get_fields(true, 'user'); $user_role_fields = rpg_user_role::get_fields(true, 'role'); $contributor_index = $db->get_array_list("SELECT {$user_fields}, {$user_role_fields}, (CASE WHEN user.user_name_public <> '' THEN user.user_name_public ELSE user.user_name END) AS user_name_current FROM mmrpg_users AS user LEFT JOIN mmrpg_roles AS role ON role.role_id = user.role_id WHERE role.role_token IN ('developer', 'administrator', 'contributor', 'moderator') ORDER BY user_name_current ASC; ", 'user_id'); // Define the editor title based on ID $temp_editor_title = 'Undefined'; $temp_final_divider = '<span style="color: #565656;"> | </span>'; $temp_editor_ids = array(); // Check if an image editor ID has been defined if (!empty($robot_info['robot_image_editor']) && isset($contributor_index[$robot_info['robot_image_editor']])){ $temp_editor_ids[] = $robot_info['robot_image_editor']; } // Check if a second image editor ID has been defined if (!empty($robot_info['robot_image_editor2']) && isset($contributor_index[$robot_info['robot_image_editor2']])){ $temp_editor_ids[] = $robot_info['robot_image_editor2']; } // If not empty, loop through and add image editors to the string if (!empty($temp_editor_ids)){ $temp_editor_title = array(); foreach ($temp_editor_ids AS $editor_id){ $temp_editor = $contributor_index[$editor_id]; $temp_name_public = !empty($temp_editor['user_name_public']) ? $temp_editor['user_name_public'] : $temp_editor['user_name']; $temp_name_real = !empty($temp_editor['user_name']) ? $temp_editor['user_name'] : $temp_editor['user_name_clean']; $temp_name_public_clean = preg_replace('/[^a-z0-9]+/i', '', strtolower($temp_name_public)); $temp_name_real_clean = preg_replace('/[^a-z0-9]+/i', '', strtolower($temp_name_real)); if ($temp_name_public_clean != $temp_name_real_clean){ $temp_editor_title[] = '<strong>'.$temp_name_public.' / '.$temp_name_real.'</strong>'; } else { $temp_editor_title[] = '<strong>'.$temp_name_public.'</strong>'; } } if (count($temp_editor_title) > 1){ $temp_final_divider = '<br />'; } $temp_editor_title = implode(' and ', $temp_editor_title); } // Define the robots created by specific creators outside of the Capcom characters $temp_adrian_robots = array('disco', 'rhythm', 'flutter-fly', 'flutter-fly-2', 'flutter-fly-3'); // Print out the final credits footer based on if special case or Capcom original if (in_array($robot_info['robot_token'], $temp_adrian_robots)){ echo '<p class="text text_editor" style="text-align: center; color: #868686; font-size: 10px; line-height: 13px; margin-top: 6px;">Sprite Editing by '.$temp_editor_title.' '.$temp_final_divider.' Original Character by <strong>Adrian Marceau</strong></p>'."\n"; } elseif ($robot_info['robot_game'] == 'MMRPG'){ echo '<p class="text text_editor" style="text-align: center; color: #868686; font-size: 10px; line-height: 13px; margin-top: 6px;">Sprite Editing by '.$temp_editor_title.' '.$temp_final_divider.' Original Artwork by <strong>Mega Man RPG Prototype</strong></p>'."\n"; } elseif ($robot_info['robot_game'] == 'MMRPG2'){ echo '<p class="text text_editor" style="text-align: center; color: #868686; font-size: 10px; line-height: 13px; margin-top: 6px;">Sprite Editing by '.$temp_editor_title.' '.$temp_final_divider.' Original Artwork by <strong>Mega Man RPG World</strong></p>'."\n"; }else { echo '<p class="text text_editor" style="text-align: center; color: #868686; font-size: 10px; line-height: 13px; margin-top: 6px;">Sprite Editing by '.$temp_editor_title.' '.$temp_final_divider.' Original Artwork by <strong>Capcom</strong></p>'."\n"; } ?> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #sprites" rel="permalink">#Sprites</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_quotes']) { ?> <h2 id="quotes" class="header header_left <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left;"> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Quotes </h2> <div class="body body_left" style="margin-right: 0; margin-left: 0; margin-bottom: 5px; padding: 2px 0; min-height: 10px;"> <?php // Define the search and replace arrays for the robot quotes $temp_find = array('{this_player}', '{this_robot}', '{target_player}', '{target_robot}'); $temp_replace = array('Doctor', $robot_info['robot_name'], 'Doctor', 'Robot'); ?> <table class="full" style="margin: 5px auto 10px;"> <colgroup> <col width="100%" /> </colgroup> <tbody> <tr> <td class="right"> <label>Start Quote : </label> <span class="robot_quote">"<?php echo !empty($robot_info['robot_quotes']['battle_start']) ? str_replace($temp_find, $temp_replace, $robot_info['robot_quotes']['battle_start']) : '…'; ?> "</span> </td> </tr> <tr> <td class="right"> <label>Taunt Quote : </label> <span class="robot_quote">"<?php echo !empty($robot_info['robot_quotes']['battle_taunt']) ? str_replace($temp_find, $temp_replace, $robot_info['robot_quotes']['battle_taunt']) : '…'; ?> "</span> </td> </tr> <tr> <td class="right"> <label>Victory Quote : </label> <span class="robot_quote">"<?php echo !empty($robot_info['robot_quotes']['battle_victory']) ? str_replace($temp_find, $temp_replace, $robot_info['robot_quotes']['battle_victory']) : '…'; ?> "</span> </td> </tr> <tr> <td class="right"> <label>Defeat Quote : </label> <span class="robot_quote">"<?php echo !empty($robot_info['robot_quotes']['battle_defeat']) ? str_replace($temp_find, $temp_replace, $robot_info['robot_quotes']['battle_defeat']) : '…'; ?> "</span> </td> </tr> </tbody> </table> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #quotes" rel="permalink">#Quotes</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_description'] && !empty($robot_info['robot_description2'])) { ?> <h2 id="description" class="header header_left <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left; "> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Description </h2> <div class="body body_left" style="margin-right: 0; margin-left: 0; margin-bottom: 5px; padding: 2px 0; min-height: 10px;"> <table class="full" style="margin: 5px auto 10px;"> <colgroup> <col width="100%" /> </colgroup> <tbody> <tr> <td class="right"> <div class="robot_description" style="text-align: left; padding: 0 4px;"><?php echo $robot_info['robot_description2']; ?> </div> </td> </tr> </tbody> </table> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #description" rel="permalink">#Description</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_abilities']) { ?> <h2 id="abilities" class="header header_full <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left;"> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Abilities </h2> <div class="body body_full" style="margin: 0; padding: 2px 3px; min-height: 10px;"> <table class="full" style="margin: 5px auto 10px;"> <colgroup> <col width="100%" /> </colgroup> <tbody> <tr> <td class="right"> <div class="ability_container"> <?php // Define the robot ability class and collect the cores for testing $robot_ability_class = !empty($robot_info['robot_class']) ? $robot_info['robot_class'] : 'master'; $robot_ability_core = !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : false; $robot_ability_core2 = !empty($robot_info['robot_core2']) ? $robot_info['robot_core2'] : false; $robot_ability_list = !empty($robot_info['robot_abilities']) ? $robot_info['robot_abilities'] : array(); $robot_ability_rewards = !empty($robot_info['robot_rewards']['abilities']) ? $robot_info['robot_rewards']['abilities'] : array(); // Collect a FULL list of abilities for display $temp_required = array(); foreach ($robot_ability_rewards as $info) { $temp_required[] = $info['token']; } $temp_abilities_index = rpg_ability::get_index(false, false, '', $temp_required); // Clone abilities into new array for filtering $new_ability_rewards = array(); foreach ($robot_ability_rewards as $this_info) { $new_ability_rewards[$this_info['token']] = $this_info; } $robot_copy_program = $robot_ability_core == 'copy' || $robot_ability_core2 == 'copy' ? true : false; //if ($robot_copy_program){ $robot_ability_list = $temp_all_ability_tokens; } $robot_ability_core_list = array(); if ((!empty($robot_ability_core) || !empty($robot_ability_core2)) && $robot_ability_class != 'mecha') { // only robot masters can core match abilities foreach ($temp_abilities_index as $token => $info) { if (!empty($info['ability_type']) && ($robot_copy_program || $info['ability_type'] == $robot_ability_core || $info['ability_type'] == $robot_ability_core2) || !empty($info['ability_type2']) && ($info['ability_type2'] == $robot_ability_core || $info['ability_type2'] == $robot_ability_core2)) { $robot_ability_list[] = $info['ability_token']; $robot_ability_core_list[] = $info['ability_token']; } } } foreach ($robot_ability_list as $this_token) { if ($this_token == '*') { continue; } if (!isset($new_ability_rewards[$this_token])) { if (in_array($this_token, $robot_ability_core_list)) { $new_ability_rewards[$this_token] = array('level' => 'Player', 'token' => $this_token); } else { $new_ability_rewards[$this_token] = array('level' => 'Player', 'token' => $this_token); } } } $robot_ability_rewards = $new_ability_rewards; //die('<pre>'.print_r($robot_ability_rewards, true).'</pre>'); if (!empty($robot_ability_rewards)) { $temp_string = array(); $ability_key = 0; $ability_method_key = 0; $ability_method = ''; foreach ($robot_ability_rewards as $this_info) { if (!isset($temp_abilities_index[$this_info['token']])) { continue; } $this_level = $this_info['level']; $this_ability = $temp_abilities_index[$this_info['token']]; $this_ability_token = $this_ability['ability_token']; $this_ability_name = $this_ability['ability_name']; $this_ability_class = !empty($this_ability['ability_class']) ? $this_ability['ability_class'] : 'master'; $this_ability_image = !empty($this_ability['ability_image']) ? $this_ability['ability_image'] : $this_ability['ability_token']; $this_ability_type = !empty($this_ability['ability_type']) ? $this_ability['ability_type'] : false; $this_ability_type2 = !empty($this_ability['ability_type2']) ? $this_ability['ability_type2'] : false; if (!empty($this_ability_type) && !empty($mmrpg_database_types[$this_ability_type])) { $this_ability_type = $mmrpg_database_types[$this_ability_type]['type_name'] . ' Type'; } else { $this_ability_type = ''; } if (!empty($this_ability_type2) && !empty($mmrpg_database_types[$this_ability_type2])) { $this_ability_type = str_replace('Type', '/ ' . $mmrpg_database_types[$this_ability_type2]['type_name'], $this_ability_type); } $this_ability_damage = !empty($this_ability['ability_damage']) ? $this_ability['ability_damage'] : 0; $this_ability_damage2 = !empty($this_ability['ability_damage2']) ? $this_ability['ability_damage2'] : 0; $this_ability_damage_percent = !empty($this_ability['ability_damage_percent']) ? true : false; $this_ability_damage2_percent = !empty($this_ability['ability_damage2_percent']) ? true : false; if ($this_ability_damage_percent && $this_ability_damage > 100) { $this_ability_damage = 100; } if ($this_ability_damage2_percent && $this_ability_damage2 > 100) { $this_ability_damage2 = 100; } $this_ability_recovery = !empty($this_ability['ability_recovery']) ? $this_ability['ability_recovery'] : 0; $this_ability_recovery2 = !empty($this_ability['ability_recovery2']) ? $this_ability['ability_recovery2'] : 0; $this_ability_recovery_percent = !empty($this_ability['ability_recovery_percent']) ? true : false; $this_ability_recovery2_percent = !empty($this_ability['ability_recovery2_percent']) ? true : false; if ($this_ability_recovery_percent && $this_ability_recovery > 100) { $this_ability_recovery = 100; } if ($this_ability_recovery2_percent && $this_ability_recovery2 > 100) { $this_ability_recovery2 = 100; } $this_ability_accuracy = !empty($this_ability['ability_accuracy']) ? $this_ability['ability_accuracy'] : 0; $this_ability_description = !empty($this_ability['ability_description']) ? $this_ability['ability_description'] : ''; $this_ability_description = str_replace('{DAMAGE}', $this_ability_damage, $this_ability_description); $this_ability_description = str_replace('{RECOVERY}', $this_ability_recovery, $this_ability_description); $this_ability_description = str_replace('{DAMAGE2}', $this_ability_damage2, $this_ability_description); $this_ability_description = str_replace('{RECOVERY2}', $this_ability_recovery2, $this_ability_description); //$this_ability_title_plain = $this_ability_name; //if (!empty($this_ability_type)){ $this_ability_title_plain .= ' | '.$this_ability_type; } //if (!empty($this_ability_damage)){ $this_ability_title_plain .= ' | '.$this_ability_damage.' Damage'; } //if (!empty($this_ability_recovery)){ $this_ability_title_plain .= ' | '.$this_ability_recovery.' Recovery'; } //if (!empty($this_ability_accuracy)){ $this_ability_title_plain .= ' | '.$this_ability_accuracy.'% Accuracy'; } //if (!empty($this_ability_description)){ $this_ability_title_plain .= ' | '.$this_ability_description; } $this_ability_title_plain = rpg_ability::print_editor_title_markup($robot_info, $this_ability); $this_ability_method = 'level'; $this_ability_method_text = 'Level Up'; $this_ability_title_html = '<strong class="name">' . $this_ability_name . '</strong>'; if (is_numeric($this_level)) { if ($this_level > 1) { $this_ability_title_html .= '<span class="level">Lv ' . str_pad($this_level, 2, '0', STR_PAD_LEFT) . '</span>'; } else { $this_ability_title_html .= '<span class="level">Start</span>'; } } else { $this_ability_method = 'player'; $this_ability_method_text = 'Player Only'; if (!in_array($this_ability_token, $robot_info['robot_abilities'])) { $this_ability_method = 'core'; $this_ability_method_text = 'Core Match'; } $this_ability_title_html .= '<span class="level"> </span>'; } // If this is a boss, don't bother showing player or core match abilities if ($this_ability_method != 'level' && $robot_info['robot_class'] == 'boss') { continue; } if (!empty($this_ability_type)) { $this_ability_title_html .= '<span class="type">' . $this_ability_type . '</span>'; } if (!empty($this_ability_damage)) { $this_ability_title_html .= '<span class="damage">' . $this_ability_damage . (!empty($this_ability_damage_percent) ? '%' : '') . ' ' . ($this_ability_damage && $this_ability_recovery ? 'D' : 'Damage') . '</span>'; } if (!empty($this_ability_recovery)) { $this_ability_title_html .= '<span class="recovery">' . $this_ability_recovery . (!empty($this_ability_recovery_percent) ? '%' : '') . ' ' . ($this_ability_damage && $this_ability_recovery ? 'R' : 'Recovery') . '</span>'; } if (!empty($this_ability_accuracy)) { $this_ability_title_html .= '<span class="accuracy">' . $this_ability_accuracy . '% Accuracy</span>'; } $this_ability_sprite_path = 'images/sprites/abilities/' . $this_ability_image . '/icon_left_40x40.png'; if (!file_exists(MMRPG_CONFIG_ROOTDIR . $this_ability_sprite_path)) { $this_ability_image = 'ability'; $this_ability_sprite_path = 'i/a/ability/il40.png'; } else { $this_ability_sprite_path = 'i/a/' . $this_ability_image . '/il40.png'; } $this_ability_sprite_html = '<span class="icon"><img src="' . $this_ability_sprite_path . '?' . MMRPG_CONFIG_CACHE_DATE . '" alt="' . $this_ability_name . ' Icon" /></span>'; $this_ability_title_html = '<span class="label">' . $this_ability_title_html . '</span>'; //$this_ability_title_html = (is_numeric($this_level) && $this_level > 1 ? 'Lv '.str_pad($this_level, 2, '0', STR_PAD_LEFT).' : ' : $this_level.' : ').$this_ability_title_html; // Show the ability method separator if necessary if ($ability_method != $this_ability_method && $robot_info['robot_class'] == 'master') { $temp_separator = '<div class="ability_separator">' . $this_ability_method_text . '</div>'; $temp_string[] = $temp_separator; $ability_method = $this_ability_method; $ability_method_key++; // Print out the disclaimer if a copy-core robot if ($this_ability_method != 'level' && $robot_copy_program) { $temp_string[] = '<div class="" style="margin: 10px auto; text-align: center; color: #767676; font-size: 11px;">Copy Core robots can equip <em>any</em> ' . ($this_ability_method == 'player' ? 'player' : 'type') . ' ability!</div>'; } } // If this is a copy core robot, don't bother showing EVERY core-match ability if ($this_ability_method != 'level' && $robot_copy_program) { continue; } elseif ($this_level >= 0 || !$robot_copy_program) { $temp_element = $this_ability_class == 'master' ? 'a' : 'span'; $temp_markup = '<' . $temp_element . ' ' . ($this_ability_class == 'master' ? 'href="' . MMRPG_CONFIG_ROOTURL . 'database/abilities/' . $this_ability['ability_token'] . '/"' : '') . ' class="ability_name ability_class_' . $this_ability_class . ' ability_type ability_type_' . (!empty($this_ability['ability_type']) ? $this_ability['ability_type'] : 'none') . (!empty($this_ability['ability_type2']) ? '_' . $this_ability['ability_type2'] : '') . '" title="' . $this_ability_title_plain . '" style="' . ($this_ability_image == 'ability' ? 'opacity: 0.3; ' : '') . '">'; $temp_markup .= '<span class="chrome">' . $this_ability_sprite_html . $this_ability_title_html . '</span>'; $temp_markup .= '</' . $temp_element . '>'; $temp_string[] = $temp_markup; $ability_key++; continue; } } echo implode(' ', $temp_string); } else { echo '<span class="robot_ability type_none"><span class="chrome">None</span></span>'; } ?> </div> </td> </tr> </tbody> </table> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #abilities" rel="permalink">#Abilities</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_stats']) { ?> <h2 id="stats" class="header header_full <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left;"> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Stats </h2> <div class="body body_full" style="margin: 0 auto 5px; padding: 2px 0; min-height: 10px;"> <?php // Define the various levels we'll display in this chart $display_levels = array(1, 5, 10, 50, 100); //range(1, 100, 1); ?> <table class="full stat_container" style=""> <colgroup> <col width="20%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> </colgroup> <thead> <tr> <th class="top left level">Level</th> <th class="top center energy" colspan="1">Energy</th> <th class="top center weapons" colspan="1">Weapons</th> <th class="top center attack" colspan="2">Attack</th> <th class="top center defense" colspan="2">Defense</th> <th class="top center speed" colspan="2">Speed</th> </tr> <tr> <th class="sub left level" > </th> <th class="sub center energy max">-</th> <th class="sub center weapons max">-</th> <th class="sub center attack min">Min</th> <th class="sub center attack max">Max</th> <th class="sub center defense min">Min</th> <th class="sub center defense max">Max</th> <th class="sub center speed min">Min</th> <th class="sub center speed max">Max</th> </tr> </thead> <tbody> <?php // Define or collect the base stats for this robot, ready to be modified $base_stats = array(); $base_stats['energy'] = $robot_info['robot_energy']; $base_stats['weapons'] = $robot_info['robot_weapons']; $base_stats['attack'] = $robot_info['robot_attack']; $base_stats['defense'] = $robot_info['robot_defense']; $base_stats['speed'] = $robot_info['robot_speed']; // Loop through the display levels and calculate stat adjustments foreach ($display_levels as $level) { // Calculate the minimum stat values for this robot with only level-based stat boosts $min_stats = array(); $min_stats['energy'] = MMRPG_SETTINGS_STATS_GET_ROBOTMIN($base_stats['energy'], $level); $min_stats['attack'] = MMRPG_SETTINGS_STATS_GET_ROBOTMIN($base_stats['attack'], $level); $min_stats['defense'] = MMRPG_SETTINGS_STATS_GET_ROBOTMIN($base_stats['defense'], $level); $min_stats['speed'] = MMRPG_SETTINGS_STATS_GET_ROBOTMIN($base_stats['speed'], $level); // Calculate the maximum stat values for this robot considering both level and overkill-based stat boosts $max_stats = array(); //$max_stats['energy'] = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($base_stats['energy'], $level); $max_stats['attack'] = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($base_stats['attack'], $level); $max_stats['defense'] = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($base_stats['defense'], $level); $max_stats['speed'] = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($base_stats['speed'], $level); ?> <tr> <td class="left level">Lv <?php echo $level; ?> </td> <td class="center energy max"><?php echo number_format($min_stats['energy'], 0, '.', ','); ?> </td> <td class="center weapons max"><?php echo number_format($base_stats['weapons'], 0, '.', ','); ?> </td> <td class="center attack min"><?php echo number_format($min_stats['attack'], 0, '.', ','); ?> </td> <td class="center attack max"><?php echo number_format($max_stats['attack'], 0, '.', ','); ?> </td> <td class="center defense min"><?php echo number_format($min_stats['defense'], 0, '.', ','); ?> </td> <td class="center defense max"><?php echo number_format($max_stats['defense'], 0, '.', ','); ?> </td> <td class="center speed min"><?php echo number_format($min_stats['speed'], 0, '.', ','); ?> </td> <td class="center speed max"><?php echo number_format($max_stats['speed'], 0, '.', ','); ?> </td> </tr> <?php } ?> <tr> <td class="left help" colspan="9"> <?php if ($robot_info['robot_class'] == 'master') { ?> * Min stats represent a robot's base values without any knockout bonuses applied.<br /> ** Max stats represent a robot's potential values with maximum knockout bonuses applied. <?php } elseif ($robot_info['robot_class'] == 'mecha') { ?> * Min stats represent a mecha's base values without any difficulty mods applied.<br /> ** Max stats represent a mecha's potential values with maximum difficulty mods applied. <?php } elseif ($robot_info['robot_class'] == 'boss') { ?> * Min stats represent a boss's base values without any difficulty mods applied.<br /> ** Max stats represent a boss's potential values with maximum difficulty mods applied. <?php } ?> </td> </tr> </tbody> </table> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #stats" rel="permalink">#Stats</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_records']) { ?> <h2 id="records" class="header header_full <?php echo $robot_header_types; ?> " style="margin: 10px 0 0; text-align: left;"> <?php echo $robot_info['robot_name'] . $robot_info['robot_name_append']; ?> 's Records </h2> <div class="body body_full" style="margin: 0 auto 5px; padding: 2px 0; min-height: 10px;"> <table class="full" style="margin: 5px auto 10px;"> <colgroup> <col width="100%" /> </colgroup> <tbody> <?php if ($robot_info['robot_class'] == 'master') { ?> <tr> <td class="right"> <label>Unlocked By : </label> <span class="robot_quote"><?php echo $temp_robot_records['robot_unlocked'] == 1 ? '1 Player' : number_format($temp_robot_records['robot_unlocked'], 0, '.', ',') . ' Players'; ?> </span> </td> </tr> <?php } ?> <tr> <td class="right"> <label>Encountered : </label> <span class="robot_quote"><?php echo $temp_robot_records['robot_encountered'] == 1 ? '1 Time' : number_format($temp_robot_records['robot_encountered'], 0, '.', ',') . ' Times'; ?> </span> </td> </tr> <tr> <td class="right"> <label>Summoned : </label> <span class="robot_quote"><?php echo $temp_robot_records['robot_summoned'] == 1 ? '1 Time' : number_format($temp_robot_records['robot_summoned'], 0, '.', ',') . ' Times'; ?> </span> </td> </tr> <tr> <td class="right"> <label>Defeated : </label> <span class="robot_quote"><?php echo $temp_robot_records['robot_defeated'] == 1 ? '1 Time' : number_format($temp_robot_records['robot_defeated'], 0, '.', ',') . ' Times'; ?> </span> </td> </tr> <tr> <td class="right"> <label>Scanned : </label> <span class="robot_quote"><?php echo $temp_robot_records['robot_scanned'] == 1 ? '1 Time' : number_format($temp_robot_records['robot_scanned'], 0, '.', ',') . ' Times'; ?> </span> </td> </tr> </tbody> </table> </div> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> #records" rel="permalink">#Records</a> </div> <?php } ?> <?php } ?> <?php if ($print_options['show_footer'] && $print_options['layout_style'] == 'website_compact') { ?> <div class="link_wrapper"> <a class="link link_top" data-href="#top" rel="nofollow">^ Top</a> <a class="link link_permalink" href="<?php echo $database_category_robot_url; ?> " rel="permalink">+ View More</a> </div> <span class="link_container"> <?php echo !empty($compact_footer_link_markup) ? implode("\n", $compact_footer_link_markup) : ''; ?> </span> <?php } ?> </div> </div> <?php // Collect the outbut buffer contents $this_markup = trim(ob_get_clean()); // Return the generated markup return $this_markup; }