Ejemplo n.º 1
0
function sn_battle_report_view($template = null)
{
    global $template_result, $lang;
    require_once 'includes/includes/ube_report.php';
    $combat_data = sn_ube_report_load(sys_get_param_str('cypher'));
    if ($combat_data != UBE_REPORT_NOT_FOUND) {
        sn_ube_report_generate($combat_data, $template_result);
        $template = gettemplate('ube_combat_report', $template);
    } else {
        message($lang['sys_msg_ube_report_err_not_found'], $lang['sys_error']);
    }
    return $template;
}
Ejemplo n.º 2
0
    $sym_attacker = $unpacked['A'];
} else {
    $sym_defender = array(0 => $sym_defender);
    $sym_attacker = array(1 => $sym_attacker);
}
if ($_POST['submit'] || $execute) {
    $replay = sn_ube_simulator_encode_replay($sym_defender, 'D');
    $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A');
    $combat_data = sn_ube_simulator_fleet_converter($sym_attacker, $sym_defender);
    $combat_data[UBE_OPTIONS][UBE_METHOD] = $config->game_ube_method ? $config->game_ube_method : 0;
    sn_ube_combat($combat_data);
    if (!sys_get_param_int('simulator') || sys_get_param_str('reload')) {
        sn_ube_report_save($combat_data);
    }
    if (sys_get_param_str('reload')) {
        $combat_data = sn_ube_report_load($combat_data[UBE_REPORT_CYPHER]);
    }
    //debug($combat_data);
    // Рендерим их в темплейт
    sn_ube_report_generate($combat_data, $template_result);
    $template_result['MICROTIME'] = $combat_data[UBE_TIME_SPENT];
    $template = gettemplate('ube_combat_report', true);
    $template->assign_recursive($template_result);
    display($template, '', false, '', false, false, true);
} else {
    $template = gettemplate('simulator', true);
    $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
    foreach ($techs_and_officers as $tech_id) {
        if (!$sym_attacker[1][$tech_id]) {
            $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id);
        }