if (document.getElementById('my_checkbox') == null){
var ck=document.createElement("input");
ck.id = 'my_checkbox'
ck.type="checkbox";
document.getElementById('main').appendChild(ck);
}
if (document.getElementById('my_start') == null){
var st=document.createElement("input");
st.id = 'my_start'
st.type="button";
st.value="開始";
st.onclick= function()
{
var my_sel = document.getElementById('my_boss') ;
var my_index = my_sel.selectedIndex;//選中索引
var my_text = my_sel.options[my_index].text;//選中文本
var my_value = my_sel.options[my_index].value;//選中值
if (st.value == "開始"){
st.value = "停止";
}
else{
st.value = "開始";
}
var i = 0
for (; i<1;){
if (st.value == "停止"){
if (document.getElementById("my_checkbox").checked ){ //表示正在攻擊怪物
if (document.getElementById("div_fight_show_boss_fight").innerText =="战斗胜利"){ //讀取div信息
document.getElementById("my_checkbox").checked = false;
return_map_check(); //返回地圖
}
else{
setInterval("my_s();", 1000);
}
}
else{
document.getElementById("my_checkbox").checked = true;
jinru_boss_fight_check(); //進入幻境
setInterval("my_s();", 500);
eval('my_value'); //根據選擇的BOSS進行攻擊
setInterval("my_s();", 500);
}
}
else{
break; //退出循环
}
}
}
document.getElementById('main').appendChild(st);
}
if (document.getElementById('my_boss') == null){
var sl=document.createElement("select");
sl.id = 'my_boss'
document.getElementById('main').appendChild(sl);
var varItem = new Option('半獸戰士', 'create_boss_fight_check(105,1)');
my_boss.options.add(varItem );
var varItem = new Option('半獸勇士', 'create_boss_fight_check(106,1)');
my_boss.options.add(varItem );
var varItem = new Option('屍王', 'create_boss_fight_check(133,1)');
my_boss.options.add(varItem );
}