这是我自己编写的源代码,本人属于菜鸟,代码编写不好,请多包涵,也欢迎来讨论!
卡池描述:
活动时间:02月05日 16:00 - 02月19日 03:59
活动说明:活动期间【限定寻访·春节】系列寻访【月隐晦明】寻访开启,该寻访中以下干员出现率上升
★★★★★★:夕[限定] \ 嵯峨(占6★出率的70%)
★★★★★:乌有(占5★出率的50%)
★★★★★★:年[限定] (在6★剩余出率【30%】中以5倍权值出率提升)
寻访数据契约交换所开启时间:02月05日 16:00 - 02月19日 03:59
注意:
◆【月隐晦明】为【限定寻访·春节】系列寻访
◆【限定寻访·春节】寻访为【限定寻访】
◆新增干员【嵯峨】、【乌有】除加入【限定寻访·春节】外,将在02月18日04:00后加入并常驻【标准寻访】卡池
◆新增干员【夕】为【限定寻访·春节】限定干员,不会加入任何【标准寻访】
◆限定干员【夕】在本次寻访结束后,将不会在2022年01月01日前加入任何【限定寻访】
【限定寻访·春节】说明
◆【限定寻访·春节】寻访为【限定寻访】
◆【限定寻访·春节】系列所属干员:【年】、【夕】
◆【限定寻访·春节】的限定干员在今后的【限定寻访·春节】中会再次登场
◆【限定寻访·春节】的限定干员在今后的【限定寻访·春节】以外的【限定寻访】中存在再次登场的特殊情况
◆【限定寻访·春节】限定干员在今后的【限定寻访】中会存在再次出率提高的特殊情况
【限定寻访】说明
◆在所有【限定寻访】中,如果连续50次没有获得6星干员,则下一次获得6星干员的概率将从原本的2%提升至4%,如果该次还没有寻访到6星干员,则下一次寻访获得6星的概率由4%提升到6%。依此类推,每次提高2%获得6星干员的概率,直至达到100%时必定获得6星干员
◆在任意两个不同的【限定寻访】中,没有获得6星干员的累计次数不会累计,该次数会因为【限定寻访】的结束而清零。因为累计次数而增加的获得概率,不会应用于接下来任意一次【限定寻访】
◆在所有【限定寻访】中,每进行一次寻访,可获取一张【寻访数据契约】,寻访十次则可获取十张【寻访数据契约】,【寻访数据契约】可用于当期【寻访数据契约交换所】兑换指定干员
注意:
◆任何时候在【限定寻访】中获得一位6星干员,则下一次在【限定寻访】中获得6星干员的概率将恢复到2%
◆在当期【限定寻访】中所获得的【寻访数据契约】存在使用期限。在当期【寻访数据契约交换所】关闭后,剩余未兑换的【寻访数据契约】将会被自动兑换成【寻访参数模型】,每张【寻访数据契约】自动兑换成六张【寻访参数模型】。【寻访参数模型】不存在使用期限,可用于【寻访参数模型交换所】兑换指定物品。
◆5倍权值指在6星干员概率分布中【年[限定]】的获得概率提高,而除【夕[限定]】、【嵯峨】外的其他单个6星干员的获得概率相应降低,使得【年[限定]】达到其他单个6星干员(除【夕[限定]】、【嵯峨】外)获得概率的5倍。
作者:明日方舟
https://www.bilibili.com/read/cv9502272
出处: bilibili
以下为代码:
抽卡类:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
//"","","","","","","","","","",
public class Chouka {
public static String[] sixstar = {
"能天使","黑","早露","空弦","伊芙利特",
"艾雅法拉","莫斯提马","刻俄柏","推进之王","风笛",
"陈","银灰","斯卡蒂","赫拉格","煌"
"棘刺","史尔特尔","山","塞雷亚","星熊",
"森蚺","瑕光","泥岩","夜莺","闪灵",
"安洁莉娜","麦哲伦","铃兰","阿","傀影",
"温蒂","年","年","年","年",
"年"
};
public static String[] fivestar = {
"蓝毒","普罗旺斯","白金","守林人","陨星","送葬人","灰喉","慑砂","安哲拉",
"四月","奥斯塔","夜魔","天火","惊蛰","莱恩哈特","蜜蜡","爱丽丝","德克萨斯","凛冬",
"芦草","极境","贾维","芙兰卡","拉普兰德","幽灵鲨","诗怀雅", "星极","布洛卡","断崖",
"燧石","雷蛇","临光","可颂","吽","石棉","赫默","白面鸮","华法琳","絮雨",
"真理","初雪","梅尔","空","格劳克斯","巫恋","月禾","稀音","狮蝎","红",
"食铁兽","崖心","槐虎","卡夫卡"
};
public static String[] fourstar = {
"梅","白雪","流星","杰西卡","红云","安比尔","酸糖","松果","夜烟","远山",
"格雷伊","卡达","红豆","清道夫","桃金娘","豆苗","缠丸","杜宾","猎蜂","慕斯",
"霜叶","宴","刻刀","芳汀","杰克","蛇屠箱","古米","角峰","泡泡","末药",
"调香师","苏苏洛","深海色","地灵","波登可","阿消","砾","暗锁","孑"
};
public static String[] threestar = {
"空爆","克洛丝","史都华德","炎熔","香草","翎羽","芬","玫兰莎","月见夜","泡普卡",
"卡缇","米格鲁","斑点","安塞尔","芙蓉","梓兰"
};
public static void test(){
for (int i = 0; i < sixstar.length; i++) {
System.out.println(sixstar[i]);
}
}
private static int sum = 0;//记录没出六星的抽卡次数
private static int up = 0;//up = sum-50
public static void chouka(int n){
Random rand = new Random();
int count_xi,count_cuoe,count_nian,count_other,count_six,count_five,count_four,count_three,count_wuyou;
count_xi = count_cuoe = count_nian = count_other = count_six = count_five = count_four = count_three = count_wuyou = 0;
int x,y,z;
int six,five,four,three;
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
x = rand.nextInt(100);
if (x < (2 + 2*up)){
y = rand.nextInt(100);
if (y < 70){
z = rand.nextInt(100);
if (z < 50){
list.add("夕");
count_xi ++;
}
else{
list.add("嵯峨");
count_cuoe ++;
}
}else{
six = rand.nextInt(sixstar.length);
list.add(sixstar[six]);
if ("年" == sixstar[six])
count_nian ++;
else
count_other ++;
}
count_six ++;
sum = 0;//如果出六星则up重置为0
up = 0;
}else {
if (x >= (2 + 2 * up) && x < (10 + 2 * up)) {
y = rand.nextInt(100);
if (y < 50) {
five = rand.nextInt(fivestar.length);
list.add(fivestar[five]);
}else{
list.add("乌有");
count_wuyou ++;
}
count_five ++;
} else if (x >= (10 + 2 * up) && x < (60 + 2 * up)) {
four = rand.nextInt(fourstar.length);
list.add(fourstar[four]);
count_four ++;
} else {
three = rand.nextInt(threestar.length);
list.add(threestar[three]);
count_three ++;
}
sum++;
if (sum > 50)
up = sum - 50;
}
}
for (int i = 0; i < list.size(); i++) {
if ("夕" == list.get(i) || "嵯峨" == list.get(i) || Arrays.asList(sixstar).contains(list.get(i)))
System.out.print("\033[31;1m" + list.get(i) + " " + "\033[0m");//红色打印
if ("乌有" == list.get(i) || Arrays.asList(fivestar).contains(list.get(i)))
System.out.print("\033[33;1m" + list.get(i) + " " + "\033[0m");//橙色打印
if (Arrays.asList(fourstar).contains(list.get(i)))
System.out.print("\033[34;1m" + list.get(i) + " " + "\033[0m");//蓝色打印
if (Arrays.asList(threestar).contains(list.get(i)))
System.out.print(list.get(i) + " ");//普通打印
if ((i+1)%10 == 0)//每十列一行
System.out.println();
}
System.out.println("夕:" + count_xi);
System.out.println("嵯峨:" + count_cuoe);
System.out.println("年:" + count_nian);
System.out.println("乌有:" + count_wuyou);
System.out.println("其他六星" + count_other);
System.out.println("六星计数:" + count_six);
System.out.println("五星计数:" + count_five);
System.out.println("四星计数:" + count_four);
System.out.println("三星计数:" + count_three);
}
}
主类:
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入抽卡次数:");
Chouka.chouka(input.nextInt());//平均每抽出六星概率约为0.0285
}
}
运行结果:
