Example #1
0
    function CharStatShow()
    {
        $char =& $this->char[$_GET["char"]];
        if (!$char) {
            print "Not exists";
            return false;
        }
        // 戦闘用変数の設定。
        $char->SetBattleVariable();
        // 職データ
        $JobData = LoadJobData($char->job);
        // 転職可能な職
        if ($JobData["change"]) {
            include_once DATA_CLASSCHANGE;
            foreach ($JobData["change"] as $job) {
                if (CanClassChange($char, $job)) {
                    $CanChange[] = $job;
                }
                //転職できる候補。
            }
        }
        ////// ステータス表示 //////////////////////////////
        ?>
<form action="?char=<?php 
        print $_GET["char"];
        ?>
" method="post" style="padding:5px 0 0 15px">
<?php 
        // その他キャラ
        print '<div style="padding-top:5px">';
        foreach ($this->char as $key => $val) {
            //if($key == $_GET["char"]) continue;//表示中キャラスキップ
            echo "<a href=\"?char={$key}\">{$val->name}</a>  ";
        }
        print "</div>";
        ?>
<h4>人物状态 <a href="?manual#charstat" target="_blank" class="a0">?</a></h4>
<?php 
        $char->ShowCharDetail();
        // 改名
        if ($this->item["7500"]) {
            print '<input type="submit" class="btn" name="rename" value="ChangeName">' . "\n";
        }
        // ステータスリセット系
        if ($this->item["7510"] || $this->item["7511"] || $this->item["7512"] || $this->item["7513"] || $this->item["7520"]) {
            print '<input type="submit" class="btn" name="showreset" value="重置">' . "\n";
        }
        ?>
<input type="submit" class="btn" name="byebye" value="剔除">
</form>
<?php 
        // ステータス上昇 ////////////////////////////
        if (0 < $char->statuspoint) {
            print <<<HTML
\t<form action="?char={$_GET['char']}" method="post" style="padding:0 15px">
\t<h4>Status <a href="?manual#statup" target="_blank" class="a0">?</a></h4>
HTML;
            $Stat = array("Str", "Int", "Dex", "Spd", "Luk");
            print "Point : {$char->statuspoint}<br />\n";
            foreach ($Stat as $val) {
                print "{$val}:\n";
                print "<select name=\"up{$val}\" class=\"vcent\">\n";
                for ($i = 0; $i < $char->statuspoint + 1; $i++) {
                    print "<option value=\"{$i}\">+{$i}</option>\n";
                }
                print "</select>";
            }
            print "<br />";
            print '<input type="submit" class="btn" name="stup" value="升值">';
            print "\n";
            print "</form>\n";
        }
        ?>
	<form action="?char=<?php 
        print $_GET["char"];
        ?>
" method="post" style="padding:0 15px">
	<h4>行动模式 <a href="?manual#jdg" target="_blank" class="a0">?</a></h4>
<?php 
        // Action Pattern 行動判定 /////////////////////////
        $list = JudgeList();
        // 行動判定条件一覧
        print "<table cellspacing=\"5\"><tbody>\n";
        for ($i = 0; $i < $char->MaxPatterns(); $i++) {
            print "<tr><td>";
            //----- No
            print $i + 1 . "</td><td>";
            //----- JudgeSelect(判定の種類)
            print "<select name=\"judge" . $i . "\">\n";
            foreach ($list as $val) {
                //判断のoption
                $exp = LoadJudgeData($val);
                print "<option value=\"{$val}\"" . ($char->judge[$i] == $val ? " selected" : NULL) . ($exp["css"] ? ' class="select0"' : NULL) . ">" . ($exp["css"] ? ' ' : '   ') . "{$exp[exp]}</option>\n";
            }
            print "</select>\n";
            print "</td><td>\n";
            //----- 数値(量)
            print "<input type=\"text\" name=\"quantity" . $i . "\" maxlength=\"4\" value=\"" . $char->quantity[$i] . "\" style=\"width:56px\" class=\"text\">";
            print "</td><td>\n";
            //----- //SkillSelect(技の種類)
            print "<select name=\"skill" . $i . "\">\n";
            foreach ($char->skill as $val) {
                //技のoption
                $skill = LoadSkillData($val);
                print "<option value=\"{$val}\"" . ($char->action[$i] == $val ? " selected" : NULL) . ">";
                print $skill["name"] . (isset($skill["sp"]) ? " - (SP:{$skill[sp]})" : NULL);
                print "</option>\n";
            }
            print "</select>\n";
            print "</td><td>\n";
            print '<input type="radio" name="PatternNumber" value="' . $i . '">';
            print "</td></tr>\n";
        }
        print "</tbody></table>\n";
        ?>
<input type="submit" class="btn" value="确定模式" name="ChangePattern">
<input type="submit" class="btn" value="设置 & 测试" name="TestBattle">
 <a href="?simulate">Simulate</a><br />
<input type="submit" class="btn" value="切换模式" name="PatternMemo">
<input type="submit" class="btn" value="添加" name="AddNewPattern">
<input type="submit" class="btn" value="删除" name="DeletePattern">
</form>
<form action="?char=<?php 
        print $_GET["char"];
        ?>
" method="post" style="padding:0 15px">
<h4>位置 & 保护<a href="?manual#posi" target="_blank" class="a0">?</a></h4>
<table><tbody>
<tr><td>位置(Position) :</td><td><input type="radio" class="vcent" name="position" value="front"
<?php 
        $char->position == "front" ? print " checked" : NULL;
        ?>
>前卫(Front)</td></tr>
<tr><td></td><td><input type="radio" class="vcent" name="position" value="back"
<?php 
        $char->position == "back" ? print " checked" : NULL;
        ?>
>后卫(Backs)</td></tr>
<tr><td>护卫(Guarding) :</td><td>
<select name="guard">
<?php 
        // 前衛の時の後衛守り //////////////////////////////
        $option = array("always" => "必定保护", "never" => "不保护", "life25" => "体力25%以上时保护", "life50" => "体力50%以上时保护", "life75" => "体力75%以上时保护", "prob25" => "25%的概率保护", "prpb50" => "50%的概率保护", "prob75" => "75%的概率保护");
        foreach ($option as $key => $val) {
            print "<option value=\"{$key}\"" . ($char->guard == $key ? " selected" : NULL) . ">{$val}</option>";
        }
        ?>
	</select>
	</td></tr>
	</tbody></table>
	<input type="submit" class="btn" value="设置">
	</form>
<?php 
        // 装備中の物表示 ////////////////////////////////
        $weapon = LoadItemData($char->weapon);
        $shield = LoadItemData($char->shield);
        $armor = LoadItemData($char->armor);
        $item = LoadItemData($char->item);
        $handle = 0;
        $handle = $weapon["handle"] + $shield["handle"] + $armor["handle"] + $item["handle"];
        ?>
	<div style="margin:0 15px">
	<h4>装备<a href="?manual#equip" target="_blank" class="a0">?</a></h4>
	<div class="bold u">Current Equip's</div>
	<table>
	<tr><td class="dmg" style="text-align:right">Atk :</td><td class="dmg"><?php 
        print $char->atk[0];
        ?>
</td></tr>
	<tr><td class="spdmg" style="text-align:right">Matk :</td><td class="spdmg"><?php 
        print $char->atk[1];
        ?>
</td></tr>
	<tr><td class="recover" style="text-align:right">Def :</td><td class="recover"><?php 
        print $char->def[0] . " + " . $char->def[1];
        ?>
</td></tr>
	<tr><td class="support" style="text-align:right">Mdef :</td><td class="support"><?php 
        print $char->def[2] . " + " . $char->def[3];
        ?>
</td></tr>
	<tr><td class="charge" style="text-align:right">handle :</td><td class="charge"><?php 
        print $handle;
        ?>
 / <?php 
        print $char->GetHandle();
        ?>
</td></tr>
	</table>
	<form action="?char=<?php 
        print $_GET["char"];
        ?>
" method="post">
	<table>
	<tr><td class="align-right">
	武器:</td><td><input type="radio" class="vcent" name="spot" value="weapon">
<?php 
        ShowItemDetail(LoadItemData($char->weapon));
        ?>
	</td></tr><tr><td class="align-right">
	盾:</td><td><input type="radio" class="vcent" name="spot" value="shield">
<?php 
        ShowItemDetail(LoadItemData($char->shield));
        ?>
	</td></tr><tr><td class="align-right">
	甲:</td><td><input type="radio" class="vcent" name="spot" value="armor">
<?php 
        ShowItemDetail(LoadItemData($char->armor));
        ?>
	</td></tr><tr><td class="align-right">
	道具:</td><td><input type="radio" class="vcent" name="spot" value="item">
<?php 
        ShowItemDetail(LoadItemData($char->item));
        ?>
	</td></tr></tbody>
	</table>
	<input type="submit" class="btn" name="remove" value="卸下">
	<input type="submit" class="btn" name="remove_all" value="全卸">
	</form>
	</div>
<?php 
        // 装備可能な物表示 ////////////////////////////////
        if ($JobData["equip"]) {
            $EquipAllow = array_flip($JobData["equip"]);
        } else {
            $EquipAllow = array();
        }
        //装備可能な物リスト(反転)
        $Equips = array("Weapon" => "2999", "Shield" => "4999", "Armor" => "5999", "Item" => "9999");
        print "<div style=\"padding:15px 15px 0 15px\">\n";
        print "\t<div class=\"bold u\">拥有的 & 容许装备的</div>\n";
        if ($this->item) {
            include CLASS_JS_ITEMLIST;
            $EquipList = new JS_ItemList();
            $EquipList->SetID("equip");
            $EquipList->SetName("type_equip");
            // JSを使用しない。
            if ($this->no_JS_itemlist) {
                $EquipList->NoJS();
            }
            reset($this->item);
            //これが無いと装備変更時に表示されない
            foreach ($this->item as $key => $val) {
                $item = LoadItemData($key);
                // 装備できないので次
                if (!isset($EquipAllow[$item["type"]])) {
                    continue;
                }
                $head = '<input type="radio" name="item_no" value="' . $key . '" class="vcent">';
                $head .= ShowItemDetail($item, $val, true) . "<br />";
                $EquipList->AddItem($item, $head);
            }
            print $EquipList->GetJavaScript("list0");
            print $EquipList->ShowSelect();
            print '<form action="?char=' . $_GET["char"] . '" method="post">' . "\n";
            print '<div id="list0">' . $EquipList->ShowDefault() . '</div>' . "\n";
            print '<input type="submit" class="btn" name="equip_item" value="装备">' . "\n";
            print "</form>\n";
        } else {
            print "暂无道具.<br />\n";
        }
        print "</div>\n";
        /*
        print("\t<table><tbody><tr><td colspan=\"2\">\n");
        print("\t<span class=\"bold u\">Stock & Allowed to Equip</span></td></tr>\n");
        if($this->item):
        	reset($this->item);//これが無いと装備変更時に表示されない
        	foreach($Equips as $key => $val) {
        		print("\t<tr><td class=\"align-right\" valign=\"top\">\n");
        		print("\t{$key} :</td><td>\n");
        		while( substr(key($this->item),0,4) <= $val && substr(current($this->item),0,4) !== false ) {
        			$item	= LoadItemData(key($this->item));
        			if(!isset( $EquipAllow[ $item["type"] ] )) {
        				next($this->item);
        				continue;
        			}
        			print("\t");
        			print('<input type="radio" class="vcent" name="item_no" value="'.key($this->item).'">');
        			print("\n\t");
        			print(current($this->item)."x");
        			ShowItemDetail($item);
        			print("<br>\n");
        			next($this->item);
        		}
        		print("\t</td></tr>\n");
        	}
        else:
        	print("<tr><td>No items.</td></tr>");
        endif;
        print("\t</tbody></table>\n");
        */
        ?>
	<form action="?char=<?php 
        print $_GET["char"];
        ?>
" method="post" style="padding:0 15px">
	<h4>技能<a href="?manual#skill" target="_blank" class="a0">?</a></h4>
<?php 
        // スキル表示 //////////////////////////////////////
        //include(DATA_SKILL);//ActionPatternに移動
        include_once DATA_SKILL_TREE;
        if ($char->skill) {
            print '<div class="u bold">已掌握的</div>';
            print "<table><tbody>";
            foreach ($char->skill as $val) {
                print "<tr><td>";
                $skill = LoadSkillData($val);
                ShowSkillDetail($skill);
                print "</td></tr>";
            }
            print "</tbody></table>";
            print '<div class="u bold">新技能</div>';
            print "技能点 : {$char->skillpoint}";
            print "<table><tbody>";
            $tree = LoadSkillTree($char);
            foreach (array_diff($tree, $char->skill) as $val) {
                print "<tr><td>";
                $skill = LoadSkillData($val);
                ShowSkillDetail($skill, 1);
                print "</td></tr>";
            }
            print "</tbody></table>";
            //dump($char->skill);
            //dump($tree);
            print '<input type="submit" class="btn" name="learnskill" value="习得">' . "\n";
            print '<input type="hidden" name="learnskill" value="1">' . "\n";
        }
        // 転職 ////////////////////////////////////////////
        if ($CanChange) {
            ?>

	</form>
	<form action="?char=<?php 
            print $_GET["char"];
            ?>
" method="post" style="padding:0 15px">
	<h4>转职</h4>
	<table><tbody><tr>
<?php 
            foreach ($CanChange as $job) {
                print "<td valign=\"bottom\" style=\"padding:5px 30px;text-align:center\">";
                $JOB = LoadJobData($job);
                print '<img src="' . IMG_CHAR . $JOB["img_" . ($char->gender ? "female" : "male")] . '">' . "<br />\n";
                //画像
                print '<input type="radio" value="' . $job . '" name="job">' . "<br />\n";
                print $JOB["name_" . ($char->gender ? "female" : "male")];
                print "</td>";
            }
            ?>

	</tr></tbody></table>
	<input type="submit" class="btn" name="classchange" value="转职">
	<input type="hidden" name="classchange" value="1">
<?php 
        }
        ?>

	</form>
<?php 
        //その他キャラ
        print '<div  style="padding:15px">';
        foreach ($this->char as $key => $val) {
            //if($key == $_GET["char"]) continue;//表示中キャラスキップ
            echo "<a href=\"?char={$key}\">{$val->name}</a>  ";
        }
        print '</div>';
    }
Example #2
0
	function ChangePattern($judge,$action) {
		$this->judge	= array();
		$this->action	= array();
		$max	= $this->MaxPatterns();//最低判断数
		$judge_list	= array_flip(JudgeList());
		$skill_list	= array_flip($this->skill);
		for($i=0; $i<$max; $i++) {//判断順に記憶
			if(!$judge["$i"])	$this->judge[$i]	= 1000;
			if(!$action["$i"])	$this->action[$i]	= 1000;

			if( isset($judge_list[$judge[$i]]) && isset($skill_list[$action[$i]]) ) {
				$this->judge[$i]	= $judge[$i];
				$this->action[$i]	= $action[$i];
			}
		}
		if($max < count($this->judge))
			return false;
		return true;
	}