function selectOpponentTactic($Tact)
{
    //$Tact is $Op->Player['tactics']
    $Op_Tact = '';
    if ($Tact) {
        $Op_Tact_Cache = explode("\n", $Tact);
        $Op_Tact_Avail = array('0');
        foreach ($Op_Tact_Cache as $v) {
            if (isset($v) && $v != '0' && $v != '') {
                $Op_Tact_Avail[] = $v;
            }
        }
        $Op_Tact_Use = mt_rand(0, count($Op_Tact_Avail) - 1);
        $Op_Tact = trim($Op_Tact_Avail[$Op_Tact_Use]);
        return GetTactics($Op_Tact);
    } else {
        return GetTactics('0');
    }
}
}
if ($ControlSEED && ereg('(SeedMode)+', $Pl_Game['spec']) && ereg('(co|ext|nat)+', $Pl_Gen['typech'])) {
    echo "進入SEED Mode<input type=checkbox name=SEEDStat";
    if ($Pl_Gen['hypermode'] == 1 || $Pl_Gen['hypermode'] == 5) {
        echo " checked";
    }
    echo ">";
}
echo "以<select name=\"Pl_GTctcs\">";
echo "<option value='0'>通常攻擊";
if ($Pl_Game['tactics']) {
    $Pl_TactList = explode("\n", $Pl_Game['tactics']);
    sort($Pl_TactList);
    foreach ($Pl_TactList as $Tactics) {
        $Tactics = trim($Tactics);
        $TactInf = GetTactics("{$Tactics}");
        if (($Pl_Gen['hypermode'] == 1 || $Pl_Gen['hypermode'] == 5) && $ControlSEED) {
            $TactInf['spc'] = ceil($TactInf['spc'] * 1.25) + 5;
        }
        //SEED Mode SP額外消耗
        if ($Pl_Gen['hypermode'] >= 4 && $Pl_Gen['hypermode'] <= 6) {
            $TactInf['spc'] = ceil($TactInf['spc'] * 1.2) + 3;
        }
        //EXAM System SP額外消耗
        if (!$Tactics) {
            unset($Tactics);
        } else {
            if ($Pl_Game['sp'] - $TactInf['spc'] < 0) {
                unset($Tactics);
            } elseif ($Pl_Game['en'] < $Pl_SyWepA['enc'] + $Pl_SyWepD['enc'] + $Pl_SyWepE['enc'] + $TactInf['enc']) {
                unset($Tactics);
    echo "預感 <input type=checkbox name=NTPresage";
    if ($bctlHasPrsg) {
        echo " checked";
    }
    echo ">";
}
echo "以<select {$BStyleB} style=\"{$BStyleA}\" name=\"Pl_GTctcs\" onchange='changeEnc();changeSpc();'>";
echo "<option value='0'>通常攻擊";
$Cont_TactSpc_Format = '<input type=hidden name=Tact_%s value=%u>';
$Cont_TactSpc = sprintf($Cont_TactSpc_Format, '0', 0);
if ($Pl->Player['tactics']) {
    $Pl_TactList = explode("\n", $Pl->Player['tactics']);
    sort($Pl_TactList);
    foreach ($Pl_TactList as $Tactics) {
        $Tactics = trim($Tactics);
        $TactInf = GetTactics($Tactics, '`spc`, `name`');
        if (!$Tactics) {
            unset($Tactics);
        } else {
            echo "<option value='{$Tactics}'";
            if ($Tactics == $Pl->Player['last_tact']) {
                echo " selected";
                $baseSpCost += $TactInf['spc'];
            }
            echo ">{$TactInf['name']} (SP消耗: {$TactInf['spc']})";
            $Cont_TactSpc .= sprintf($Cont_TactSpc_Format, $Tactics, $TactInf['spc']);
        }
    }
}
echo "</select>";
echo $Cont_TactSpc;
예제 #4
0
header('Content-Type: text/html; charset=utf-8');
$mode = isset($_GET['action']) ? $_GET['action'] : $_POST['action'];
include 'cfu.php';
postHead('');
AuthUser();
if ($CFU_Time >= $_SESSION['timeauth'] + $TIME_OUT_TIME || $_SESSION['timeauth'] <= $CFU_Time - $TIME_OUT_TIME) {
    echo "驗證機制!<br>請重新登入!";
    exit;
}
GetUsrDetails("{$_SESSION['username']}", 'Gen', 'Game');
//Tactics Learning center GUI
if ($mode == 'main') {
    unset($CancelFlag, $TactMessage);
    echo "<br>戰術學院<hr>";
    if ($actionb == 'proclearn') {
        $Tactics = GetTactics($learndesired);
        if ($Tactics['price'] > $Gen['cash']) {
            $TactMessage = '金錢不足!';
            $CancelFlag = '1';
        }
        if ($Tactics['needlv'] > $Game['level']) {
            $TactMessage .= '等級不足!';
            $CancelFlag = '1';
        }
        if (ereg("({$Tactics['id']})+", $Game['tactics'])) {
            $TactMessage .= "你早就學會了 {$Tactics['name']} 。";
            $CancelFlag = '1';
        }
        if (!$CancelFlag) {
            $TactMessage = "成功以 {$Tactics['price']} 元學習了 {$Tactics['name']} 。";
        }
예제 #5
0
 $Pl_Tactics = GetTactics($Pl_GTctcs);
 $Pl_Game['tactics'] = explode("\n", $Pl_Game['tactics']);
 sort($Pl_Game['tactics']);
 $Pl_Game['tactics'] = implode("\n", $Pl_Game['tactics']);
 $Pl_Game['tactics'] = trim($Pl_Game['tactics']);
 $Op_Tact_Cache = explode("\n", $Op_Game['tactics']);
 sort($Op_Tact_Cache);
 $Op_Game['tactics'] = implode("\n", $Op_Tact_Cache);
 trim($Op_Tact_Cache);
 $Op_Tact_Cache = explode("\n", $Op_Game['tactics']);
 $Op_Tact_Use = mt_rand(0, count($Op_Tact_Cache));
 $Op_Tact = trim($Op_Tact_Cache[$Op_Tact_Use]);
 if ($Op_Tact) {
     $Op_Tactics = GetTactics("{$Op_Tact}");
 } else {
     $Op_Tactics = GetTactics('0');
 }
 $Pl_SyWepA['enc'] += $Pl_Tactics['enc'];
 $SP_Cost = $Pl_Tactics['spc'];
 if (($Pl_Gen['hypermode'] == 1 || $Pl_Gen['hypermode'] == 5) && $ControlSEED) {
     $SP_Cost = ceil($SP_Cost * 1.25) + 5;
 }
 //SEED Mode SP額外消耗
 if ($Pl_Gen['hypermode'] >= 4 && $Pl_Gen['hypermode'] <= 6) {
     $SP_Cost = ceil($SP_Cost * 1.2) + 3;
 }
 //EXAM System SP額外消耗
 $SP_CostOP = 0;
 $Op_Type = GetChType($Op_Gen['typech']);
 $Pl_Type = GetChType($Pl_Gen['typech']);
 if ($Pl_Game['level'] >= 70) {
예제 #6
0
         $Op->MyStanceState = 4;
         // Passive Attacker
     } else {
         $isEnemyFlag = 1;
         $Pl->MyStanceState = 1;
         // Active Attacker
         $Op->MyStanceState = 4;
         // Passive Attacker
     }
 }
 // Hypermode Stats
 $SEEDStat = isset($SEEDStat) ? $SEEDStat : false;
 $EXAMStat = isset($EXAMStat) ? $EXAMStat : false;
 $NTPresage = isset($NTPresage) ? $NTPresage : false;
 // Analyze Use of Tactics
 $Pl->Tactics = GetTactics($Pl_GTctcs);
 $Pl->checkTactics($Pl_GTctcs);
 $Op->Tactics = selectOpponentTactic($Op->Player['tactics']);
 $Pl->initSpCost();
 $Op->initSpCost();
 $Pl->iniFixes();
 $Op->iniFixes();
 // Analyze Hypermode State
 $Pl->analyzeHypermodeState();
 // Grant DefX to Enhanced Hypermode
 $Pl->analyzeEnhHM();
 // Process MS
 $Pl->ProcessMS();
 if ($AtkFortFlag != 1) {
     $Op->ProcessMS();
 } else {
예제 #7
0
     }
 }
 if ($Op_Game['status']) {
     echo '<form action=gmscrn_main.php?action=proc method=post name=frmreturn target=Alpha>';
     echo "<p align=center><input type=submit value=\"返回\" onClick=\"parent.Beta.location.replace('gen_info.php')\"></p>";
     echo "<input type=hidden name=\"TIMEAUTH\" value=\"{$CFU_Time}\">";
     echo '</form>';
 } else {
     echo '<form action=battle.php?action=attack_target method=post name=battle_sel_form>';
     echo "<p align=center><input type=submit name=battle_submit value='再戰' id=\"battle_submit\" onClick=\"{$OnConfirm}\" disabled=disabled></p>";
     echo "<input type=hidden value='process' name=actionb>";
     echo "<input type=hidden name=\"TIMEAUTH\" value=\"{$CFU_Time}\">";
     echo "<input type=hidden name=Op_Name value=\"{$Op_Name}\">";
     $LastTctcs = $Pl_GTctcs;
     if ($LastTctcs != '0') {
         $TactInf = GetTactics("{$LastTctcs}");
         if ($Pl_Gen['hypermode'] == 1 && $ControlSEED) {
             $TactInf['spc'] = ceil($TactInf['spc'] * 1.25) + 5;
         }
         //SEED Mode SP額外消耗
         if ($Pl_Gen['hypermode'] >= 4 && $Pl_Gen['hypermode'] <= 6) {
             $TactInf['spc'] = ceil($TactInf['spc'] * 1.2) + 3;
         }
         //EXAM System SP額外消耗
         if ($Pl_Game['sp'] - $TactInf['spc'] < 0) {
             $LastTctcs = 0;
         } elseif ($Pl_Game['en'] < $Pl_SyWepA['enc'] + $Pl_SyWepD['enc'] + $Pl_SyWepE['enc'] + $TactInf['enc']) {
             $LastTctcs = 0;
         }
     }
     echo "<input type=hidden name=Pl_GTctcs value=\"{$LastTctcs}\">";