java写dnf_【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("--------------------------------------------------------------------");

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值