本WIKI除首页和部分特殊页面外编辑权限开放。
为了方便未来的使用,务必收藏哦~
感谢 一直在作死的千岛酱对主页的设计支持,期待更多家主大人加入妖怪屋WIKI~
编辑帮助萌新问答区

全站通知:

Widget:Gacha

来自阴阳师妖怪屋WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

<html> <head> <style type="text/css"> h1{ color:black; } td{ width:120px; height:50px; background:white; text-align:center; } hr{ width:50%; } th{ color:black; } table{ border:2px gray solid; } button{ width:120px; height:50px; color:darkblue; }

#result{ color:black; }


</style> <script type="text/javascript"> var num1=0; var num2=0; var num3=0; var num4=0; var numRolls=0; var price = 0; var targetCharacter = "食灵"; // Set the target character here


function pull(times) {

 // Create arrays for the different rarities
 var nCharacters = ["一张N卡", "一张N卡"];
 var rCharacters = ["一张R卡", "一张R卡"];
 var srCharacters = ["一张SR卡", "一张SR卡"];
 var ssrCharacters = ["食灵", "铃彦姬", "玉藻前", "小鹿男", "妖刀姬", "御馔津", "一目连", "八岐大蛇", "雪童子", "彼岸花", "鬼切", "大天狗", "大岳丸", "泷夜叉姬", "花鸟卷", "鬼童丸", "阎魔", "缘结神", "两面佛", "茨木童子", "灶门炭治郎", "荒川之主", "不知火", "荒", "面灵气", "阿修罗", "灶门祢豆子", "白藏主", "青行灯", "酒吞童子", "帝释天", "山风", "辉夜姬"];
 var spCharacters = ["少羽大天狗", "炼狱茨木童子", "赤影妖刀姬", "苍风一目连", "麓铭大岳丸", "因幡辉夜姬", "鬼王酒吞童子"];
 switch(times)
 {
   case 1:
     // Perform a single pull and update the results
     var rarity = pullOnce();
     updateResults(rarity);
     calcPrice();
     displayResult();
     break;
   case 2:
     // Perform 10 pulls and update the results
     for (var i = 0; i < 10; i++)
     {
       var rarity = pullOnce();
       updateResults(rarity);
     }
     calcPrice();
     displayResult();
     break;

default:

 // Clear the counters and perform pulls until the target character is obtained
 clear();
 while (targetCharacter != "")
 {
   var rarity = pullOnce();
   updateResults(rarity);
 }
 calcPrice();
 displayResult();
 }

if (targetCharacter == "") {

 targetCharacter = "食灵"; // Set the target character here

}


// Function to perform a single pull and return the rarity of the character obtained

 function pullOnce()
 {
   var rng = Math.random();
   if (rng <= 0.325)
   {
     // 3-star character
     num1++;
     numRolls++;
     return "N";
   }
   else if (rng > 0.325 && rng < 0.725)
   {
     // 4-star character
     num2++;
     numRolls++;
     return "R";
   }
   else if (rng > 0.725 && rng < 0.975)
   {
     // 5-star character
     num3++;
     numRolls++;
     return "SR";
   }
   else
   {
     // 6-star character
     num4++;
     numRolls++;
     return "SSR/SP";
   }
 }


// Function to update the results with the character name and rarity

 function updateResults(rarity)
 {
   switch (rarity)
   {
     case "N":
       // Select a random character from the N array
       var index = Math.floor(Math.random() * nCharacters.length);
       var character = nCharacters[index];
       // Check if the target character has been obtained
       if (character == targetCharacter)
       {
         targetCharacter = "";
       }
       // Update the results with the character name and rarity
       document.getElementById("result").innerHTML += character + " (" + rarity + ")
";

break;

     case "R":
       // Select a random character from the R array
       var index = Math.floor(Math.random() * rCharacters.length);
       var character = rCharacters[index];
       // Check if the target character has been obtained
       if (character == targetCharacter)
       {
         targetCharacter = "";
       }
       // Update the results with the character name and rarity
       document.getElementById("result").innerHTML += character + " (" + rarity + ")
"; break; case "SR": // Select a random character from the SR array var index = Math.floor(Math.random() * srCharacters.length); var character = srCharacters[index];
       // Check if the target character has been obtained
       if (character == targetCharacter)
       {
         targetCharacter = "";
       }
       // Update the results with the character name and rarity
       document.getElementById("result").innerHTML += character + " (" + rarity + ")
"; break; case "SSR/SP": // Select a random character from the SSR/SP array 稀有度分类记得改 var index = Math.floor(Math.random() * spCharacters.length); var character = ssrCharacters[index];
     // Check if the character is an SSR or SP character
     var characterRarity;
     if (character == "少羽大天狗", "炼狱茨木童子", "赤影妖刀姬", "苍风一目连", "麓铭大岳丸", "因幡辉夜姬", "鬼王酒吞童子") {
       characterRarity = "SP";
     } else {
       characterRarity = "SSR";
     }
     // Check if the target character has been obtained
     if (character == targetCharacter) {
       targetCharacter = "";
     }
     // Update the results with the character name and rarity
     document.getElementById("result").innerHTML += character + " (" + characterRarity + ")
"; break; }

}

}

       // Calculate the price of the pulls
       function calcPrice()
       {
         price = numRolls * 70;
       }

       // Display the results of the pulls
       function displayResult()
       {
         document.getElementById("res1").innerHTML = num1;
         document.getElementById("res2").innerHTML = num2;
         document.getElementById("res3").innerHTML = num3;
         document.getElementById("res4").innerHTML = num4;
         document.getElementById("numPulls").innerHTML = numRolls;
         document.getElementById("priceTotal").innerHTML="一共抽取 "+numRolls+" 次, 共计"+price+"勾玉";
       }

       // Clear the results of the pulls
       function clear()
       {
         num1 = 0;
         num2 = 0;
         num3 = 0;
         num4 = 0;
         numRolls = 0;
         price = 0;
         document.getElementById("result").innerHTML = "";
       }
     function clearResults()
     {
       clear();
       displayResult();
     }
    
     </script>

</head>

<body bgcolor="pink" id="bg">

稀有度
概率
SP/SSR2.5%
SR25%
R40%
N32.5%


<button type="button" onclick="pull(1)">单剪</button> <button type="button" onclick="pull(2)">十剪</button> <button type="button" onclick="pull(3)">UP式神</button>


抽卡结果
SP/SSR0
SR0
R0
N0
抽数0


<button onclick="clearResults()">清空</button>


所消耗剪刀已折算成勾玉.

一共抽取 0 次, 花了 0 勾玉!


获得角色:



</body> </html>