台词试听功能(武将/皮肤/将灵)已上线,在对应页面的台词板块即可试听;目前音频功能仍有缺失或错误的情况,可点击反馈提醒我们;有兴趣参与编辑的请点击下方企鹅群加入我们哦~。欢迎收藏起来防止迷路~(´▽`ʃ♡ƪ)!

如果你看到本段文字,说明该页面未正常加载全局JS,包括但不仅限于语音、评论区等部分功能将无法使用,请点击 重新加载页面,如果刷新无效,请找BWIKI客服进行反馈。
全站通知:

Widget:许劭

来自三国杀WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

<script type="text/javascript">var text= "";var selector="";var num="" ? "" : 3;</script> <script> var CustomSkill,TurnSkill,EndSkill,HurtSkill,Custom,Turn,End,Hurt,Xuan,SkillW,SkillH; var IsCustom = text!="" && selector!= "" ;

(function () { var t = function () { if(window.jQuery && window.mw && $("#bili-tt-cache-block").length != 0)PoolInit();else{window.setTimeout(t, 100);console.log("许劭:"+"jquery未加载!");} }; t(); })();

function PoolInit() {

var th = $(".wikitable").find("th"); var tr = $(".wikitable").find("tr");

if(IsCustom) { Custom = $("th").filter( function(index){ return $(this).text().replace(/[\r\n]/g, ) == text; }); console.log(Custom); CustomSkill = tr.find(selector).children("span"); SkillW = CustomSkill.eq(0).outerWidth(); SkillH = CustomSkill.eq(0).outerHeight(); }else { Turn=th.filter( function(index){ return $(this).text().replace(/[\r\n]/g, ) == "出牌阶段" ; }); End=th.filter( function(index){ return $(this).text().replace(/[\r\n]/g, ) == "结束阶段" ; }); Hurt=th.filter( function(index){ return $(this).text().replace(/[\r\n]/g, ) == "受到伤害" ; }); TurnSkill = tr.find("td:nth-child(2)").children("span"); SkillW = TurnSkill.eq(0).outerWidth(); SkillH = TurnSkill.eq(0).outerHeight(); EndSkill = tr.find("td:nth-child(3)").children("span"); HurtSkill = tr.find("td:nth-child(4)").children("span"); if($(".modal-dialog").length != 0) {

$(".modal-dialog").prepend('

');

console.log(); Xuan = $(".modal-dialog").children(".选"); SkillBind(TurnSkill); SkillBind(EndSkill); SkillBind(HurtSkill); } }

if(IsCustom) { Custom.append('<button type="button" onclick="getSkill(\'Custom\')">抽取!</button>');

Custom.append('

');

Custom = Custom.find(".skill"); console.log(Custom); } else { Turn.append('<button type="button" onclick="getSkill(\'出牌阶段\')">抽取!</button>');

Turn.append('

');

Turn = Turn.find(".skill"); End.append('<button type="button" onclick="getSkill(\'结束阶段\')">抽取!</button>');

End.append('

');

End = End.find(".skill"); Hurt.append('<button type="button" onclick="getSkill(\'受到伤害\')">抽取!</button>');

Hurt.append('

');

Hurt = Hurt.find(".skill"); console.log(TurnSkill); console.log(EndSkill); console.log(HurtSkill); }

} function getSkill(Time) { var Pool = Time == "出牌阶段" ? TurnSkill : Time == "结束阶段" ? EndSkill : Time == "受到伤害" ? HurtSkill : CustomSkill; var Show = Time == "出牌阶段" ? Turn : Time == "结束阶段" ? End : Time == "受到伤害" ? Hurt : Custom;;

if(Pool.length != 0) { shuffle(Pool); var get = Pool.slice(0,num).clone(true); if(!IsCustom) { get.each(function(i,e){ $(this).append('<button type="button" onclick="selectSkill(\+Time+'\','+ i +',this)">选</button>') }); } Show.html(get).css("min-height","75px"); }else { Show.html('技能已空,刷新网页重开!'); } }

function selectSkill(Time,index,This) { console.log(Time);

var Pool = Time == "出牌阶段" ? TurnSkill : Time == "结束阶段" ? EndSkill : Time == "受到伤害" ? HurtSkill : CustomSkill; var Show = Time == "出牌阶段" ? Turn : Time == "结束阶段" ? End : Time == "受到伤害" ? Hurt : Custom;;

Pool.filter( function(i){ if(i == index) return true; return false; }).html("").css("width",SkillW + "px").css("height",SkillH + "px").css("vertical-align","bottom"); Pool.splice(index,1);

$(This).parent().parent().children().not($(This).parent()).remove(); $(This).parent().parent().append('已从技能池删除!'); $(This).remove(); console.log(Pool); }

function SkillBind(Button) { console.log("sss"); console.log(Button.children("a")); Button.children("a").on('click', function() { var buttonOri = $(this).parent().children("button"); if(buttonOri.length != 0) { var button = buttonOri.clone(); var click = button.attr("onclick").replace("selectSkill(","").replace(")","").replace(/[']/g,"").split(","); button.attr("onclick",""); button.on('click',function(){selectSkill(click[0],click[1],buttonOri.get(0));});

console.log(click);

Xuan.html(button); }else Xuan.html(""); });

}

function shuffle(arr) {

       for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);
       return arr;
   }


</script>