11连模拟器:修订间差异
跳到导航
跳到搜索
稀有度 : UR概率1%,SR概率9%
抽卡次数 消耗心数
SR次数 SR概率
UR次数 UR概率
1SR次数 1SR概率
全R次数 全R概率
小无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
<html> | |||
<script src="http://lovelive.oss-cn-beijing.aliyuncs.com/Js/MouseOverEvent.js"></script> | |||
<script language="javascript"> | |||
var card | |||
var RarTab = new Array(3) | |||
var OnGoing = new Array(3) | |||
function GetIdxByID(ID){ | |||
for(var i=0;i<card.length;i++){ | |||
if(card[i].ID==ID) | |||
return i;} | |||
return -1; | |||
} | |||
function InitilizeDataBase(){ | |||
var rawFile = new XMLHttpRequest(); | |||
var allText = ""; | |||
rawFile.open("GET", 'http://lovelive.oss-cn-beijing.aliyuncs.com/Data/CardDataBase.json', false); | |||
rawFile.onreadystatechange = function (){ | |||
if(rawFile.readyState === 4){ | |||
if(rawFile.status === 200 || rawFile.status == 0){ | |||
allText = rawFile.responseText; | |||
} | |||
} | |||
} | |||
rawFile.send(null); | |||
card = JSON.parse(allText); | |||
//alert(card[0].ongoing) | |||
// Get Rarity Table | |||
for (var i=0;i<3;i++){ | |||
RarTab[i] = new Array() | |||
OnGoing[i] = new Array() | |||
} | |||
for (var i=0;i<card.length;i++){ | |||
if (card[i].avail!=2) | |||
continue; | |||
var rar = card[i].rar; | |||
if (card[i].ongoing){ | |||
OnGoing[rar][OnGoing[rar].length] = card[i].ID} | |||
else{ | |||
RarTab[rar][RarTab[rar].length] = card[i].ID} | |||
} | |||
for (var i=0;i<11;i++){ | |||
imgname = "img" + String(i+1) | |||
//document.getElementById(imgname).addEventListener("mouseover", fn_mouseover()); | |||
document.getElementById(imgname).onmouseover = function(){fn_mouseover()} | |||
document.getElementById(imgname).onmouseout = function(){fn_mouseout()} | |||
document.getElementById(imgname).hspace = "10" | |||
} | |||
} | |||
/*function CardList(Rarity){ | |||
Rarity = parseInt(Rarity) | |||
if (Rarity == 0){<!--R--> | |||
return [28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]} | |||
else if (Rarity == 1){<!--SR--> | |||
return [55,56,57,58,59,60,61,62,63, 71,72, 75, 77,78, 81, 86,87, 90, 103,104, 107, 122, 124,125, 129, 132,133, 136, 141,142,143,144, 150, 152,153,154, 313]} | |||
else{ <!--UR--> | |||
return [64,66,73,79,88,94,105,126,127,134,145,155]} | |||
}*/ | |||
function DecidRarit(Random,ur,sr){ | |||
if (Random < ur){ | |||
return 2} | |||
else if (Random < (ur+sr)){ | |||
return 1} | |||
else{ | |||
return 0} | |||
} | |||
function OneSR(list){ | |||
length = list.length | |||
for(var i=0;i<length;i++){ | |||
if (list[i]>0){ | |||
return list} | |||
} | |||
list[length-1] = 1; | |||
return list | |||
} | |||
function RandomRarity(ur,sr,backup){ | |||
var list = [0,0,0,0,0,0,0,0,0,0,3] | |||
for (var i = 0;i<11;i++){ | |||
list[i] = DecidRarit(Math.random()*100,ur,sr) <!-- Random from 0 to 100--> | |||
} | |||
if (backup==1){ | |||
list = OneSR(list)} | |||
return list | |||
} | |||
function UpdateUI(list){ | |||
var str = new Array("Total","Totalh","NumSR","NumUR","SRrate","URrate","NumBack","BackRate","NumR","RRate") | |||
var sr = 0; | |||
var ur = 0; | |||
var bac = 0; | |||
var r = 0; | |||
for (var i=0;i<list.length;i++){ | |||
if (list[i]==1){ | |||
sr++} | |||
else if (list[i]==2){ | |||
ur++} | |||
} | |||
if (ur==0){ | |||
if (sr==1){ | |||
bac = 1} | |||
else if (sr==0){ | |||
r=1} | |||
} | |||
var output = new Array(10) | |||
for (var i = 0;i<10;i++){ | |||
output[i] = parseInt(document.getElementById(str[i]).value)} | |||
output[0] += 11; | |||
output[1] += 50; | |||
output[2] += sr; | |||
output[3] += ur; | |||
output[4] = output[2]/output[0] * 100 | |||
output[4] = output[4].toFixed(2); | |||
output[5] = output[3]/output[0] * 100 | |||
output[5] = output[5].toFixed(2); | |||
output[6] += bac | |||
output[7] = output[6]/output[0] * 1100 | |||
output[7] = output[7].toFixed(2); | |||
output[8] += r | |||
output[9] = output[8]/output[0] * 1100 | |||
output[9] = output[9].toFixed(2); | |||
document.getElementById("lccon").innerHTML = String(output[1]) | |||
for (var i = 0;i<10;i++){ | |||
if (i==4 || i==5 || i==7 || i==9){ | |||
document.getElementById(str[i]).value= String(output[i])+"%"} | |||
else{ | |||
document.getElementById(str[i]).value= String(output[i])} | |||
} | |||
} | |||
function RandomCard(list){ | |||
var num = 0 | |||
var listlength = 0; | |||
for(var j = 0;j<3;j++){ | |||
var pool = RarTab[j] | |||
var pool_e = OnGoing[j] | |||
listlength = pool.length | |||
listlength_e = pool_e.length | |||
for(var i = 0;i<11;i++){ | |||
if (list[i]==j){ | |||
num++ | |||
if(pool_e.length<1||Math.random()*4>1){ | |||
var Random = Math.floor(Math.random()*listlength) | |||
list[i] = pool[Random]} | |||
else{ | |||
var Random = Math.floor(Math.random()*listlength_e) | |||
list[i] = pool_e[Random]} | |||
} | |||
} | |||
if(num>10){ | |||
break} | |||
} | |||
return list | |||
} | |||
function ChangePic(){ | |||
for (var i = 0;i<11;i++){ | |||
imgname = "img" + String(i+1) | |||
imgsrc = "" | |||
document.getElementById(imgname).src = imgsrc | |||
} | |||
var backup = document.getElementById("Back").value; | |||
var list = RandomRarity(1,9,backup) | |||
UpdateUI(list) | |||
list = RandomCard(list) | |||
var imgname = "" | |||
var imgsrc = "" | |||
for (var i = 0;i<list.length;i++){ | |||
imgname = "img" + String(i+1) | |||
imgId = list[i]; | |||
switch (imgId){ | |||
case 169: | |||
imgId = 171; | |||
break; | |||
case 170: | |||
imgId = 169; | |||
break; | |||
case 171: | |||
imgId = 170; | |||
break; | |||
default: | |||
break; | |||
} | |||
imgsrc = "http://lovelive.oss-cn-beijing.aliyuncs.com/gotcha/" + String(imgId) + ".jpg"; | |||
//imgsrc = "http://scfes.mnyk.info/ss/" + String(imgId) + ".jpg" | |||
var obj = document.getElementById(imgname) | |||
obj.src = imgsrc | |||
obj.name = String(GetIdxByID(list[i])); | |||
} | |||
//alert(document.getElementById("img4").name) | |||
} | |||
function Repeat(){ | |||
for (var i = 0;i<11;i++){ | |||
imgname = "img" + String(i+1) | |||
imgsrc = "" | |||
document.getElementById(imgname).src = imgsrc} | |||
var num = 499 | |||
var backup = document.getElementById("Back").value; | |||
var list = new Array(11) | |||
for(var i=0;i<num;i++){ | |||
list = RandomRarity(1,9,backup) | |||
UpdateUI(list) | |||
} | |||
ChangePic() | |||
} | |||
function ClearAll(){ | |||
var str = new Array("Total","Totalh","NumSR","NumUR","SRrate","URrate","NumBack","BackRate","NumR","RRate") | |||
document.getElementById("lccon").innerHTML = 0; | |||
for (var i = 0;i<10;i++){ | |||
document.getElementById(str[i]).value= "0"} | |||
} | |||
function fn_mouseover(){ | |||
event = getEvent() | |||
var td = event.srcElement||event.target | |||
cardIdx = td.name | |||
var point_s = getMousePoint(event); | |||
var point = { | |||
x:event.clientX, | |||
y:event.clientY | |||
}; | |||
tid = setTimeout( function(){ShowWindows(point,point_s,cardIdx)}, 500 ); | |||
} | |||
function ShowWindows(point,point_s,Idx){ | |||
var width = document.body.clientWidth; | |||
var x = document.getElementById("bodyContent").offsetLeft; | |||
var y = document.getElementById("bodyContent").offsetTop; | |||
//var y = 0 | |||
//var x = 0//Only for wiki | |||
//alert(point_s.y) | |||
point_s.x -= x; | |||
point_s.y -= y | |||
if (point.x > width*0.4){ | |||
point_s.x -= 450} | |||
if (Idx>=0){ | |||
if (!(card[Idx].cardimg==""||card[Idx].cardimg_id=="")){ | |||
var e = document.getElementById("Layer1"); | |||
e.style.left = String(point_s.x) + "px" | |||
e.style.top = String(point_s.y) + "px" | |||
//document.getElementById("Layer1").style.left = point_s.x; | |||
//document.getElementById("Layer1").style.top = point_s.y; | |||
document.getElementById("Layer1").innerHTML = GetImgDes(Idx); | |||
document.getElementById("Layer1").style.display = "block";} | |||
//alert(document.getElementById("Layer1").style.top) | |||
} | |||
} | |||
function bgonload(){ | |||
document.getElementById("lcreq").innerHTML = 50; | |||
document.getElementById("lccon").innerHTML = 0; | |||
} | |||
</script> | |||
<div style = "height:920px"></div> | |||
<div id="Layer1" style="position:absolute;display:none;position:absolute;z-index:2;"></div> | |||
<div style = "position:absolute;z-index:0;top:10px;left:10px;" ><img onload = "bgonload()" src = "http://i2.tietuku.com/730dfd614fd87bdf.jpg"></div> | |||
<div style = "position:absolute;z-index:1;top:510px;left:500px" onclick="ChangePic()"><img src = "http://i2.tietuku.com/7e640352fc6799b5.jpg"></div> | |||
<div style = "position:absolute;z-index:1;top:510px;left:760px" onclick="ClearAll()"><img src = "http://i2.tietuku.com/4860eb7b05f0eb17.jpg"></div> | |||
<div style = "position:absolute;z-index:0;top:522px;left:336px;font-weight: 700"><font id = "lcreq" face = "arial" size = "5px"></font></div> | |||
<div style = "position:absolute;;z-index:0;top:560px;left:336px;font-weight: 700" ><font id = "lccon" face = "arial" size = "5px"></font></div> | |||
<body onload = "InitilizeDataBase()"> | |||
<div style = "position:absolute;top:127px;left:36px;white-space:nowrap"> | |||
<img id="img1" src=""/> <img id="img2" src="" /> <img id="img3" src="" /> <img id="img4" src="" /> <img id="img5" src="" /> <img id="img6" src="" /><br> | |||
</div> | |||
<div style = "position:absolute;top:301px;left:121px;white-space:nowrap"> | |||
<img id="img7" src="" /> <img id="img8" src="" /> <img id="img9" src="" /> <img id="img10" src="" /> <img id="img11" src="" /><br> | |||
</div> <!--This is format is for wiki--> | |||
<!--SR概率设置<input id="NumSR" type="text" name="NumSR" value="0" autocomplete="off" onfocus=this.blur()> | |||
< | UR概率设置<input id="NumSR" type="text" name="NumSR" value="0" autocomplete="off" onfocus=this.blur()> <br>--> | ||
< | <div style = "position:absolute;top:710px;"> | ||
< | <input type="submit" name="EXPcal" value="查看大数" onclick="Repeat()"> <br> | ||
< | 稀有度 :<select id ="Back" name="Back" > | ||
<option value=0>无保底</option> | |||
<option value=1 SELECTED>有保底</option> | |||
</select> UR概率1%,SR概率9% <br> | |||
抽卡次数<input id="Total" type="text" name="Total" value="0" autocomplete="off" onfocus=this.blur() > 消耗心数<input id="Totalh" type="text" name="Totalh" value="0" autocomplete="off" onfocus=this.blur() > <br> | |||
SR次数<input id="NumSR" type="text" name="NumSR" value="0" autocomplete="off" onfocus=this.blur()> SR概率<input id="SRrate" type="text" name="SRrate" value="0" autocomplete="off" onfocus=this.blur()><br> | |||
UR次数<input id="NumUR" type="text" name="NumUR" value="0" autocomplete="off" onfocus=this.blur()> UR概率<input id="URrate" type="text" name="URrate" value="0" autocomplete="off" onfocus=this.blur()><br> | |||
1SR次数<input id="NumBack" type="text" name="NumBack" value="0" autocomplete="off" onfocus=this.blur()> 1SR概率 <input id="BackRate" type="text" name="BackRate" value="0" autocomplete="off" onfocus=this.blur()> <br> | |||
全R次数<input id="NumR" type="text" name="NumBack" value="0" autocomplete="off" onfocus=this.blur()> 全R概率 <input id="RRate" type="text" name="BackRate" value="0" autocomplete="off" onfocus=this.blur()> <br> | |||
</div> | </div> | ||
</body> | |||
</html> | </html> | ||
< | <noinclude>[[分类:小应用程序模板]]</noinclude> | ||
[[分类: |
2015年2月14日 (六) 12:12的版本
稀有度 : UR概率1%,SR概率9%
抽卡次数 消耗心数
SR次数 SR概率
UR次数 UR概率
1SR次数 1SR概率
全R次数 全R概率