关于java:王者荣耀中皮肤和英雄技能java实现

52次阅读

共计 2083 个字符,预计需要花费 6 分钟才能阅读完成。

int flag=menulogin.Menulogin(); // 游戏开始标记符;

    Boolean red = false;
    Boolean blue = false; // 默认英雄初始是没有 buff 的
    while (flag==3) {Menuable menuable = new Menuable();
        Menuyeguai menuyeguai = new Menuyeguai();
        Menuzhuangbei menuzhuangbei = new Menuzhuangbei();
        int res = menuable.Menuable(); // 技能菜单
        int[] arr = new int[4];
        switch (res) {   // 技能失效操作
            case 1:
                System.out.println("以后应用一技能誓约之盾!");
                arr = Firstable(red);
                break;
            case 2:
                System.out.println("以后应用二技能盘旋打击!");
                arr = Secondable(red, blue);
                break;
            case 3:
                System.out.println("以后应用二技能圣剑裁决!");
                arr = Thirdable(red, blue);
                break;
            case 10:
                int res1 = menuyeguai.Menuyeguai();
                switch (res1){  // 刷野失效操作
                    case 80:
                    case 100:
                    case 150:
                    case 200:
                    case 250:yase.setMoney(yase.getMoney()+res1);break;
                    case 1: red = true;break;
                    case 0: blue = true;break;
                    case 10:;
                    case 11:;
                    default:
                        System.out.println("零碎谬误");
                }
                break;
            case 11:
                int res2 = menuzhuangbei.Menuzhuangbei();
                switch (res2){[PerfectMoney 下载](https://www.gendan5.com/wallet/PerfectMoney.html)// 进入配备购买页面
                    case 1:
                        Shoe shoe = new Shoe();
                        if(yase.getMoney()>=200){System.out.println(yase.name+"购买了"+shoe.name);
                        yase.phyfangyu+=shoe.getPhyattack();
                        yase.move+=shoe.getMove();
                        yase.money=yase.money-200;
                    }else{System.out.println("金币有余,无奈购买"+shoe.name);
                        };break;
                    case 2:
                        Fajia fajia = new Fajia();
                        if(yase.getMoney()>=1200){System.out.println(yase.name+"购买了"+fajia.name);
                        yase.phyattack+=fajia.getPhyattack(); // 攻击力 +
                        yase.phyfangyu+=fajia.getPhyfanyu();  // 防御力 +
                        yase.money=yase.money-1200;
                    }else {System.out.println("金币有余,无奈购买"+fajia.name);
                        };break;
                    case 3:
                        Anyinzhanfu anyinzhanfu = new Anyinzhanfu();
                        if(yase.getMoney()>=2000){System.out.println(yase.name+"购买了"+anyinzhanfu.name);
                        yase.phyattack+=anyinzhanfu.getPhyattack(); // 攻击力 +
                        yase.blood+=anyinzhanfu.getBlood();  // 生命力 +
                        yase.money=yase.money-2000;
                    }else {System.out.println("金币有余,无奈购买"+anyinzhanfu.name);
                        }
                        break;
                    case 10:
                    case 11:
                    default:
                        System.out.println("零碎谬误");
                }
                break;
            case 4:
                return;
            default:
                System.out.println("主动平 A 中。。。。");
                break;
        }
        yase.setPhyattack(yase.getPhyattack()+arr[0]);
        yase.setBlood(yase.getBlood()+arr[1]);
        yase.setMove(yase.getMove()+arr[2]);
        System.out.println(yase.getName()+"以后属性为"+"金币"+yase.getMoney()+"物理攻击"+yase.getPhyattack()+"血量"+yase.getBlood()+"移速"+yase.getMove()
        +"以后技能冷却工夫"+arr[3]+"ms");
    }

正文完
 0