台词试听功能(武将/皮肤/将灵)已上线,在对应页面的台词板块即可试听
目前音频功能仍有缺失或错误的情况,可点击反馈提醒我们
有兴趣参与编辑的请点击下方企鹅群加入我们哦~
欢迎收藏起来防止迷路,按"Ctrl+D"收藏本站哦~(´▽`ʃ♡ƪ)!
✬
Widget:南华
<script type="text/javascript">var text= "";var selector="";</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(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,4).clone(true); if(!IsCustom) { get.each(function(i,e){ $(this).append() }); } 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>