package 抽卡; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class ChouTMD { final static String[] sanxin = new String[]{"弹弓", "飞天御剑", "神射手之誓", "鸦羽弓", "黑缨枪", "黎明神剑", "以理服人", "冷刃"}; final static String[] sixin = new String[]{"香菱", "安柏", "凯亚", "丽莎", "班尼特", "芭芭拉", "早柚", "砂糖", "迪奥娜", "重云", "菲谢尔", "凝光", "行秋", "诺艾尔", "北斗", "雷泽", "船坞长剑", "西福斯的月光", "暗巷闪光", "笛剑","琳妮特","烟绯","绝弦","西风剑","西风枪","西风秘典","西风大剑","祭礼剑","祭礼秘典","祭礼大剑","五郎","九条沙罗","托马","科莱","多莉","瑶瑶","夏洛蒂"}; final static String[] wuxinup = new String[]{"万叶", "达达利亚","甘雨","温迪","可莉","优拉","钟离","魈","胡桃","八重神子","雷电将军","珊瑚宫心海","神里绫华","神里绫人","荒陇一斗","艾尔海森","纳西妲","赛诺","白术","妮露","林尼","纳维莱特","芙苧娜"}; final static String[] wuxinnup = new String[]{"七七", "琴","迪卢克","刻晴","迪西雅","提纳里","莫娜"}; static int n = 0, dbd = 0, i = 0, j = 0, k = 0; static ArrayList <String> wp3=new ArrayList<String>(); static ArrayList <String> wp4=new ArrayList<String>(); static ArrayList <String> wp5=new ArrayList<String>(); static int sixinnum = 0, sanxinnum = 0, wainum = 0, upnum = 0,wuxinnum=0; public static void chouka(int cishu) { Random rand = new Random(); System.out.println("恭喜您获得:"); for (int z = 0; z < cishu; z++,n++) { k = rand.nextInt(100); if ((k < 93) && (i < 9)&&(j<88)) { sanXin(); i++; j++; continue; } if ((93 <= k) && (k < 98) || (i == 9)&&(k!=88)) { siXin(); i = 0; j++; continue; } if ((k >= 98)||(j>=88)) { if ((k % 2 == 0)||(dbd==1)) { wuXinup(); j = 0; i++; upnum++; continue; } else { wuXinnup(); j = 0; i++; wainum++; continue; } } } } static void sanXin() { Random rand = new Random(); k = rand.nextInt(sanxin.length); System.out.print(sanxin[k]+"\t"); wp3.add(sanxin[k]); sanxinnum++; } static void siXin() { Random rand = new Random(); k = rand.nextInt(sixin.length); System.out.print(sixin[k]+"\t"); wp4.add(sixin[k] + (i+1)); sixinnum++; } static void wuXinup() { Random rand = new Random(); k = rand.nextInt(wuxinup.length); System.out.print(wuxinup[k]+"\t"); dbd=0; wp5.add(wuxinup[k]+ (j+1) ); wuxinnum++; } static void wuXinnup() { Random rand = new Random(); k = rand.nextInt(wuxinnup.length); System.out.print(wuxinnup[k]+"\t"); dbd=1; wp5.add(wuxinnup[k] + (j+1)); wuxinnum++; } public static void main(String[] args) { int keep = 1; Scanner sc = new Scanner(System.in); while (keep != 0) { System.out.print("\n\n--------------------------------------------------------------------------------------------\n\n"); System.out.println("请选择你要进行的操作:\n1、单抽\n2、十连\n3、查询已获得物品\n4、清空记录\n5、退出"); int choise1 = sc.nextInt(); switch (choise1) { case 1: chouka(1); break; case 2: chouka(10); break; case 3: System.out.println("1、查询已获得三星物品\n2、查询已获得四星物品\n3、查询已获得五星物品"); int choise2 = sc.nextInt(); System.out.print("您总计进行了"+n+"抽,其中"); switch (choise2) { case 1: if(sanxinnum!=0) { System.out.println("获得的三星物品有:"); for (String wp : wp3) { System.out.print(wp + "\t"); } break; } else { System.out.println("您尚未获得三星物品"); break; } case 2: if(sixinnum!=0) { System.out.println("获得的四星物品有:"); for (String wp : wp4) { System.out.print(wp + "\t"); } break; } else {System.out.println("您尚未获得四星物品"); break;} case 3: if(wuxinnum!=0) { System.out.println("获得的五星物品有:"); for (String wp : wp5) { System.out.print(wp + "\t"); } break; } else { System.out.println("您尚未获得五星物品"); break; } } break; case 4: wp3.clear();sanxinnum=0; wp4.clear();sixinnum=0; wp5.clear();wuxinnum=0; n=0;i=0;j=0; System.out.println("已成功清空所有记录"); break; case 5: keep = 0; break; } } } }
原神抽卡新人傻瓜代码
最新推荐文章于 2024-05-14 19:19:45 发布