Пример #1
0
    function printTarget($hako, $data)
    {
        global $init;
        // idから島番号を取得
        $id = $data['ISLANDID'];
        $number = $hako->idToNumber[$id];
        // なぜかその島がない場合
        if ($number < 0 || $number > $hako->islandNumber) {
            HakoError::problem();
            return;
        }
        $island = $hako->islands[$number];
        echo <<<END
<script>
function ps(x, y) {
\twindow.opener.document.InputPlan.POINTX.options[x].selected = true;
\twindow.opener.document.InputPlan.POINTY.options[y].selected = true;
\treturn true;
}
</script>

<div class="text-center">
{$init->tagBig_}{$init->tagName_}{$island['name']}{$init->nameSuffix}{$init->_tagName}{$init->_tagBig}<br>
</div>
END;
        //島の地図
        $this->islandMap($hako, $island, 2);
    }
Пример #2
0
 function readIsland($fp, $num)
 {
     global $init;
     $name = chop(fgets($fp, READ_LINE));
     list($name, $owner, $monster, $port, $ship0, $ship1, $ship2, $ship3, $ship4, $ship5, $ship6, $ship7, $ship8, $ship9, $ship10, $ship11, $ship12, $ship13, $ship14) = array_pad(explode(",", $name), 20, 0);
     $id = chop(fgets($fp, READ_LINE));
     list($id, $starturn, $isBF, $keep) = array_pad(explode(",", $id), 4, 0);
     if ($isBF) {
         $isBF = 1;
     }
     if ($keep) {
         $keep = 1;
     }
     $prize = chop(fgets($fp, READ_LINE));
     $absent = chop(fgets($fp, READ_LINE));
     $comment = chop(fgets($fp, READ_LINE));
     list($comment, $comment_turn) = array_pad(explode(",", $comment), 2, 0);
     $password = chop(fgets($fp, READ_LINE));
     $point = chop(fgets($fp, READ_LINE));
     list($point, $pots) = array_pad(explode(",", $point), 2, NULL);
     $eisei = chop(fgets($fp, READ_LINE));
     list($eisei0, $eisei1, $eisei2, $eisei3, $eisei4, $eisei5) = array_pad(explode(",", $eisei), 6, 0);
     $zin = chop(fgets($fp, READ_LINE));
     list($zin0, $zin1, $zin2, $zin3, $zin4, $zin5, $zin6) = array_pad(explode(",", $zin), 7, 0);
     $item = chop(fgets($fp, READ_LINE));
     list($item0, $item1, $item2, $item3, $item4, $item5, $item6, $item7, $item8, $item9, $item10, $item11, $item12, $item13, $item14, $item15, $item16, $item17, $item18, $item19, $item20) = array_pad(explode(",", $item), 21, NULL);
     $money = chop(fgets($fp, READ_LINE));
     list($money, $lot, $gold) = array_pad(explode(",", $money), 3, 0);
     $food = chop(fgets($fp, READ_LINE));
     list($food, $rice) = array_pad(explode(",", $food), 2, 0);
     $pop = chop(fgets($fp, READ_LINE));
     list($pop, $peop) = array_pad(explode(",", $pop), 2, 0);
     $area = chop(fgets($fp, READ_LINE));
     $job = chop(fgets($fp, READ_LINE));
     list($farm, $factory, $commerce, $mountain, $hatuden) = array_pad(explode(",", $job), 5, 0);
     $power = chop(fgets($fp, READ_LINE));
     list($taiji, $rena, $fire) = array_pad(explode(",", $power), 3, 0);
     $tenki = chop(fgets($fp, READ_LINE));
     $soccer = chop(fgets($fp, READ_LINE));
     list($soccer, $team, $shiai, $kachi, $make, $hikiwake, $kougeki, $bougyo, $tokuten, $shitten) = array_pad(explode(",", $soccer), 10, 0);
     $this->idToName[$id] = $name;
     if ($num == -1 || $num == $id) {
         $fp_i;
         // データファイルの存在チェック
         if (file_exists("{$init->dirName}/island.{$id}")) {
             $fp_i = fopen("{$init->dirName}/island.{$id}", "r");
         } else {
             $fp_i = false;
         }
         if ($fp_i === false) {
             HTML::header();
             HakoError::problem();
         }
         // 地形
         $offset = 7;
         // 一対のデータが何文字か
         for ($y = 0; $y < $init->islandSize; $y++) {
             $line = chop(fgets($fp_i, READ_LINE));
             for ($x = 0; $x < $init->islandSize; $x++) {
                 $l = substr($line, $x * $offset, 2);
                 $v = substr($line, $x * $offset + 2, 5);
                 $land[$x][$y] = hexdec($l);
                 $landValue[$x][$y] = hexdec($v);
             }
         }
         // コマンド
         for ($i = 0; $i < $init->commandMax; $i++) {
             $line = chop(fgets($fp_i, READ_LINE));
             list($kind, $target, $x, $y, $arg) = explode(",", $line);
             $command[$i] = array('kind' => $kind, 'target' => $target, 'x' => $x, 'y' => $y, 'arg' => $arg);
         }
         fclose($fp_i);
     }
     return array('name' => $name, 'owner' => $owner, 'id' => $id, 'starturn' => $starturn, 'isBF' => $isBF, 'keep' => $keep, 'prize' => $prize, 'absent' => $absent, 'comment' => $comment, 'comment_turn' => $comment_turn, 'password' => $password, 'point' => $point, 'pots' => $pots, 'money' => $money, 'lot' => $lot, 'gold' => $gold, 'food' => $food, 'rice' => $rice, 'pop' => $pop, 'peop' => $peop, 'area' => $area, 'farm' => $farm, 'factory' => $factory, 'commerce' => $commerce, 'mountain' => $mountain, 'hatuden' => $hatuden, 'monster' => $monster, 'taiji' => $taiji, 'rena' => $rena, 'fire' => $fire, 'tenki' => $tenki, 'soccer' => $soccer, 'team' => $team, 'shiai' => $shiai, 'kachi' => $kachi, 'make' => $make, 'hikiwake' => $hikiwake, 'kougeki' => $kougeki, 'bougyo' => $bougyo, 'tokuten' => $tokuten, 'shitten' => $shitten, 'land' => isset($land) ? $land : "", 'landValue' => isset($landValue) ? $landValue : "", 'command' => isset($command) ? $command : "", 'lbbs' => isset($lbbs) ? $lbbs : "", 'port' => $port, 'ship' => array(0 => $ship0, 1 => $ship1, 2 => $ship2, 3 => $ship3, 4 => $ship4, 5 => $ship5, 6 => $ship6, 7 => $ship7, 8 => $ship8, 9 => $ship9, 10 => $ship10, 11 => $ship11, 12 => $ship12, 13 => $ship13, 14 => $ship14), 'eisei' => array(0 => $eisei0, 1 => $eisei1, 2 => $eisei2, 3 => $eisei3, 4 => $eisei4, 5 => $eisei5), 'zin' => array(0 => $zin0, 1 => $zin1, 2 => $zin2, 3 => $zin3, 4 => $zin4, 5 => $zin5, 6 => $zin6), 'item' => array(0 => $item0, 1 => $item1, 2 => $item2, 3 => $item3, 4 => $item4, 5 => $item5, 6 => $item6, 7 => $item7, 8 => $item8, 9 => $item9, 10 => $item10, 11 => $item11, 12 => $item12, 13 => $item13, 14 => $item14, 15 => $item15, 16 => $item16, 17 => $item17, 18 => $item18, 19 => $item19, 20 => $item20));
 }