コード例 #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;
}
コード例 #2
0
ファイル: simulator.php プロジェクト: hayalolsam/SuperNova
}
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);
        }
    }
    $show_groups = array(UNIT_TECHNOLOGIES => array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR), UNIT_MERCENARIES => array(MRC_ADMIRAL), UNIT_SHIPS => sn_get_groups('fleet'), UNIT_RESOURCES => sn_get_groups('resources_loot'), UNIT_GOVERNORS => array(MRC_FORTIFIER), UNIT_DEFENCE => sn_get_groups('defense_active'));
    foreach ($show_groups as $unit_group_id => $unit_group) {
        $template->assign_block_vars('simulator', array('GROUP' => $unit_group_id, 'NAME' => $lang['tech'][$unit_group_id]));