• 【DNF 增幅器 JAVA 模拟增幅代码】


        /**
         * main方法启动
         * @param args
         */
        public static void main(String[] args) {
            DNF(20);
            WSJ(20);
        }
    
        /**
         * DNF
         * 马哥增幅器
         * 增幅到指定级别
         * 无随机因子计算方式
         * @param level 增幅等级
         */
        public  static void DNF(int level) {
          //  1   2   3   4  5  6  7  8  9  10 11  12  13  ......12之后都是20%概率
          // 100 100 100 100 80 70 60 70 60 50 40  30  20  ......
          //                 -1 -1 -1 0  0   0 zb  zb  zb  ......5-7掉级 8、9、10清零 10+炸裂
          //增幅等级
          int a = 0;
          //摧毁装备数
          int zb= 0;
          //增幅次数
          int i = 0;
            System.out.println("--------------------------------------------------------------------");
          for(i=0;a!=level;i++){
              switch (a){
                  case 0:  a++;break;
                  case 1:  a++;break;
                  case 2:  a++;break;
                  case 3:  a++;break;
                  case 4:  if(Math.random()<=0.8){a++;}else{a--;}break;
                  case 5:  if(Math.random()<=0.7){a++;}else{a--;}break;
                  case 6:  if(Math.random()<=0.6){a++;}else{a--;}break;
                  case 7:  if(Math.random()<=0.7){a++;}else{a=0;}break;
                  case 8:  if(Math.random()<=0.6){a++;}else{a=0;}break;
                  case 9:  if(Math.random()<=0.5){a++;}else{a=0;}break;
                  case 10: if(Math.random()<=0.4){a++;}else{a=0;zb++;}break;
                  case 11: if(Math.random()<=0.3){a++;}else{a=0;zb++;}break;
                  case 12: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 13: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 14: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 15: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 16: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 17: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 18: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  case 19: if(Math.random()<=0.2){a++;}else{a=0;zb++;}break;
                  default: System.out.println(i+"---"+a+"---"+zb);
              }
          }
          System.out.println("马哥增幅+"+a+"太极天帝剑");
          System.out.println("马哥一共增幅了"+i+"次");
          System.out.println("马哥炸了"+zb+"把太极天帝剑");
          System.err.println("祝兄弟们神话毕业!");
            System.out.println("--------------------------------------------------------------------");
      }
    
        /**
         * 老吕增幅器
         * 增幅到指定级别
         * 有随即因子计算方式
         * @param level
         */
        public  static void WSJ(int level){
            Random random=new Random(1L);
            //  1   2   3   4  5  6  7  8  9  10 11  12  13  ......12之后都是20%概率
            // 100 100 100 100 80 70 60 70 60 50 40  30  20  ......
            //                 -1 -1 -1 0  0   0 zb  zb  zb  ......5-7掉级 8、9、10清零 10+炸裂
            //增幅等级
            int a = 0;
            //摧毁装备数
            int zb= 0;
            //增幅次数
            int i = 0;
            System.out.println("--------------------------------------------------------------------");
            for(i=0;a!=level;i++){
                switch (a){
                    case 0:  a++;break;
                    case 1:  a++;break;
                    case 2:  a++;break;
                    case 3:  a++;break;
                    case 4:  if(random.nextInt(100)<=80){a++;}else{a--;}break;
                    case 5:  if(random.nextInt(100)<=70){a++;}else{a--;}break;
                    case 6:  if(random.nextInt(100)<=60){a++;}else{a--;}break;
                    case 7:  if(random.nextInt(100)<=70){a++;}else{a=0;}break;
                    case 8:  if(random.nextInt(100)<=60){a++;}else{a=0;}break;
                    case 9:  if(random.nextInt(100)<=50){a++;}else{a=0;}break;
                    case 10: if(random.nextInt(100)<=40){a++;}else{a=0;zb++;}break;
                    case 11: if(random.nextInt(100)<=30){a++;}else{a=0;zb++;}break;
                    case 12: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 13: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 14: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 15: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 16: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 17: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 18: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    case 19: if(random.nextInt(100)<=20){a++;}else{a=0;zb++;}break;
                    default: System.out.println(i+"---"+a+"---"+zb);
                }
            }
            System.out.println("老吕增幅+"+a+"太极天帝剑");
            System.out.println("老吕一共增幅了"+i+"次");
            System.out.println("老吕炸了"+zb+"把太极天帝剑");
            System.err.println("祝兄弟们神话毕业!");
            System.out.println("--------------------------------------------------------------------");
        }
    

      

  • 相关阅读:
    DB2 java.lang.NoClassDefFoundError:com/ibm/db2/jcc/SQLJContext
    JavaScript字符串split方法
    使用 WebSphere Application Server Community
    为DB2数据库创建新用户帐户并为其分配特定特权
    Servlet3.0之一:Servlet3.0新特性介绍
    window下jni调用dll和linux下jni调用so库(转)
    分表分库之三:中间件介绍
    jboss5 启动时报HsqlException:length must be specified in type definition:VARBINARY错误
    J2EE Formbased Authentication
    阻塞队列之七:DelayQueue延时队列
  • 原文地址:https://www.cnblogs.com/xiaoluohao/p/13477309.html
Copyright © 2020-2023  润新知