Exemple #1
0
$prototype_tooltip_index[] = 'If a robot has a weakness to either of a recovery ability\'s types, that robot will receive damage from that ability in battle instead.';
$prototype_tooltip_index[] = 'If a robot has an affinity to either of a damaging ability\'s types, that robot will receive recovery from that ability in battle instead.';
$prototype_tooltip_index[] = 'The Buster Shot is unique in that it requires zero Weapon Energy to use in battle.  Very useful when you\'re out of ammo and need to recharge!';
$prototype_tooltip_index[] = 'Elemental abilities are powerful but can damage the target robot\'s data.  Defeat key robots using only neutral abilities to unlock them for battle!';
//$prototype_tooltip_index[] = '';
//$prototype_tooltip_index[] = '';
//$prototype_tooltip_index[] = '';
//$prototype_tooltip_index[] = '';
//$prototype_tooltip_index[] = '';
//$prototype_tooltip_index[] = '';
if (!empty($_SESSION[rpg_game::session_token()]['DEMO'])) {
    // Define the demo-mode specific player tooltips
    $prototype_tooltip_index[] = 'Progress cannot be saved in the demo mode, but creating a new save file will let you start your adventure with any points earned thus far.';
} else {
    // Define the normal mode tooltips
    $unlock_count_players = rpg_game::players_unlocked();
    $prototype_tooltip_index[] = 'Benched robots take reduced damage based on their distance from the attacker. Use this to your advantage and put your weakest in the back!';
    $prototype_tooltip_index[] = 'Equip as many abilities as you can - there is no penalty for having multiple weapons and it\'s always better to be prepared for battle.';
    $prototype_tooltip_index[] = 'The enemy robots that appear in battle grow in level as you progress through the game, so replay old missions if you\'re having a hard time.';
    $prototype_tooltip_index[] = 'Most missions can be replayed any number of times and the robots that appear in them will grow by one level with each victory.';
    $prototype_tooltip_index[] = 'Revived robot masters can be unlocked for use in battle if defeated using only Neutral type abilities like the Buster Shot or Mega Buster.';
    if ($unlock_count_players >= 2) {
        $prototype_tooltip_index[] = 'Robots can be tranferred between players by clicking the player name in the robot editor and selecting the new owner from the dropdown.';
        $prototype_tooltip_index[] = 'Transferred robots receive twice the experience points in battle, but do not benefit from player-based stat bonuses to attack, defense, or speed.';
    }
}
// Count the number of battle tips generated
$this_tooltip_count = !empty($prototype_tooltip_index) ? count($prototype_tooltip_index) : 0;
?>
<!DOCTYPE html>
<html>
Exemple #2
0
    }
    ?>
        </div>

      </form>

  </div>

<?php 
} elseif ($this_action == 'game') {
    ?>

  <?php 
    // Define the temp game flags
    $this_playerinfo = $this_userinfo;
    $temp_show_players = rpg_game::players_unlocked() > 1 ? true : false;
    $temp_show_starforce = rpg_prototype::campaign_complete() ? true : false;
    $temp_colour_token = !empty($this_playerinfo['user_colour_token']) ? $this_playerinfo['user_colour_token'] : 'none';
    ?>

  <h2 class="subheader field_type_<?php 
    echo MMRPG_SETTINGS_CURRENT_FIELDTYPE;
    ?>
">My Account &raquo; <?php 
    echo $html_header_title;
    ?>
</h2>

  <div class="subbody" style="padding-left: 15px; margin-bottom: 2px; ">
    <?php 
    echo !strstr($html_header_text, '</p>') ? '<p class="text">' . $html_header_text . '</p>' : $html_header_text;
 public static function load_session($user_id = 0)
 {
     // Reference global variables
     global $db;
     //$GAME_SESSION = &$_SESSION[self::session_token()];
     $session_token = self::session_token();
     // Do NOT load, save, or otherwise alter the game file while viewing remote
     if (defined('MMRPG_REMOTE_GAME')) {
         return true;
     }
     // Collect or update the user ID in the session
     if (empty($user_id) && isset($_SESSION[$session_token]['USER']['userid'])) {
         $user_id = $_SESSION[$session_token]['USER']['userid'];
     } else {
         $_SESSION[$session_token]['USER']['userid'] = $user_id;
     }
     // Clear the community thread tracker
     $_SESSION['COMMUNITY']['threads_viewed'] = array();
     // If this is NOT demo mode, load from database
     if (!empty($user_id) && $user_id != MMRPG_SETTINGS_GUEST_ID) {
         // LOAD DATABASE USER & SAVE INFO
         // Collect the user and save info from the database
         $db_save = $db->get_array("SELECT * FROM mmrpg_saves WHERE user_id = {$user_id} LIMIT 1");
         $db_user = $db->get_array("SELECT * FROM mmrpg_users WHERE user_id = '{$user_id}' LIMIT 1");
         // Update the game session with database extracted variables
         $new_game_data = array();
         $new_game_data['CACHE_DATE'] = $db_save['save_cache_date'];
         $new_game_data['USER']['userid'] = $db_user['user_id'];
         $new_game_data['USER']['roleid'] = $db_user['role_id'];
         $new_game_data['USER']['username'] = $db_user['user_name'];
         $new_game_data['USER']['username_clean'] = $db_user['user_name_clean'];
         $new_game_data['USER']['password'] = $db_user['user_password'];
         $new_game_data['USER']['password_encoded'] = $db_user['user_password_encoded'];
         $new_game_data['USER']['profiletext'] = $db_user['user_profile_text'];
         $new_game_data['USER']['creditstext'] = $db_user['user_credit_text'];
         $new_game_data['USER']['creditsline'] = $db_user['user_credit_line'];
         $new_game_data['USER']['imagepath'] = $db_user['user_image_path'];
         $new_game_data['USER']['backgroundpath'] = $db_user['user_background_path'];
         $new_game_data['USER']['colourtoken'] = $db_user['user_colour_token'];
         $new_game_data['USER']['gender'] = $db_user['user_gender'];
         $new_game_data['USER']['displayname'] = $db_user['user_name_public'];
         $new_game_data['USER']['emailaddress'] = $db_user['user_email_address'];
         $new_game_data['USER']['websiteaddress'] = $db_user['user_website_address'];
         $new_game_data['USER']['dateofbirth'] = $db_user['user_date_birth'];
         $new_game_data['USER']['approved'] = $db_user['user_flag_approved'];
         $new_game_data['counters'] = !empty($db_save['save_counters']) ? json_decode($db_save['save_counters'], true) : array();
         $new_game_data['values'] = !empty($db_save['save_values']) ? json_decode($db_save['save_values'], true) : array();
         if (!empty($db_save['save_values_battle_index'])) {
             //$new_game_data['values']['battle_index'] = json_decode($db_save['save_values_battle_index'], true);
             //foreach ($new_game_data['values']['battle_index'] AS $token => $array){ $new_game_data['values']['battle_index'][$token] = json_encode($array); }
             //$new_game_data['values']['battle_index_hash'] = md5($db_save['save_values_battle_index']);
             $new_game_data['values']['battle_index'] = array();
         }
         if (!empty($db_save['save_values_battle_complete'])) {
             $new_game_data['values']['battle_complete'] = json_decode($db_save['save_values_battle_complete'], true);
             $new_game_data['values']['battle_complete_hash'] = md5($db_save['save_values_battle_complete']);
         }
         if (!empty($db_save['save_values_battle_failure'])) {
             $new_game_data['values']['battle_failure'] = json_decode($db_save['save_values_battle_failure'], true);
             $new_game_data['values']['battle_failure_hash'] = md5($db_save['save_values_battle_failure']);
         }
         if (!empty($db_save['save_values_battle_rewards'])) {
             $new_game_data['values']['battle_rewards'] = json_decode($db_save['save_values_battle_rewards'], true);
             $new_game_data['values']['battle_rewards_hash'] = md5($db_save['save_values_battle_rewards']);
         }
         if (!empty($db_save['save_values_battle_settings'])) {
             $new_game_data['values']['battle_settings'] = json_decode($db_save['save_values_battle_settings'], true);
             $new_game_data['values']['battle_settings_hash'] = md5($db_save['save_values_battle_settings']);
         }
         if (!empty($db_save['save_values_battle_items'])) {
             $new_game_data['values']['battle_items'] = json_decode($db_save['save_values_battle_items'], true);
             $new_game_data['values']['battle_items_hash'] = md5($db_save['save_values_battle_items']);
         }
         if (!empty($db_save['save_values_battle_stars'])) {
             $new_game_data['values']['battle_stars'] = json_decode($db_save['save_values_battle_stars'], true);
             $new_game_data['values']['battle_stars_hash'] = md5($db_save['save_values_battle_stars']);
         }
         if (!empty($db_save['save_values_robot_database'])) {
             $new_game_data['values']['robot_database'] = json_decode($db_save['save_values_robot_database'], true);
             $new_game_data['values']['robot_database_hash'] = md5($db_save['save_values_robot_database']);
         }
         $new_game_data['flags'] = !empty($db_save['save_flags']) ? json_decode($db_save['save_flags'], true) : array();
         $new_game_data['battle_settings'] = !empty($db_save['save_settings']) ? json_decode($db_save['save_settings'], true) : array();
         // Update the session with the new save info
         $_SESSION[$session_token] = array_merge($_SESSION[$session_token], $new_game_data);
         unset($new_game_data);
         // Unset the player selection to restart at the player select screen
         if (rpg_game::players_unlocked() > 1) {
             $_SESSION[$session_token]['battle_settings']['this_player_token'] = false;
         }
     } else {
         // LOAD DEMO USER AND SAVE INFO
         // return false for now...
         return false;
     }
     // Update the last saved value
     $_SESSION[$session_token]['values']['last_load'] = time();
     // Update the user table in the database if not done already
     if (empty($_SESSION[$session_token]['DEMO'])) {
         $db->update('mmrpg_users', array('user_last_login' => time(), 'user_backup_login' => $db_user['user_last_login']), "user_id = {$db_user['user_id']}");
     }
     //exit();
     // Return true on success
     return true;
 }