3、Monster.java
package com.home.jiangfan;
//怪物类
public class Monster {
 //怪物属性
 public int id,lv,hp,mp,attack,armor;
 public String name,skill;
 
 //怪物普通攻击方法
    public void generalAttack(Player a){
     System.out.println(this.name+",对你发起了攻击!造成了:"+this.attack+" 点伤害!");
     a.hp-=this.attack;
    }
    //怪物法术攻击方法
    public void magicAttack(Player a){
     System.out.println(this.name+",对你使用了"+this.skill);
     a.hp-=this.attack*2;
    }
    //怪物逃跑事件
    public void escape(){
     System.out.println(this.name+",由于害怕而灰溜溜的逃跑了!");
    }
    //构造方法
    public Monster(){}
 public Monster(int id, int lv, String skill, String name) {
  super();
    
  this.id = id;
  this.lv = lv;
  this.hp = lv*100;
  this.mp = lv*30;
  this.attack = (lv*lv+10)*lv;
  this.armor = lv*lv;
  this.skill = skill;
  this.name = name;
 } 
}


4、Operations.java
package com.home.jiangfan;

import java.util.Scanner;

public class Operations {
 //战斗操作界面
 public void fight(Monster monster,Player player){
  while(monster.hp>0 & player.hp>0){
   System.out.println("1,普通攻击 2,法术攻击 3,自身状态 4,怪物状态");
   Scanner inInner=new Scanner(System.in);
   int chooseInner = inInner.nextInt();
   //选择普通攻击
   if(chooseInner==1){
    JudgementPK pkkaikai=new JudgementPK();
    pkkaikai.judgementGA(player, monster);
   }
   //选择法术攻击
   if(chooseInner==2){
    JudgementPK pkkaikai=new JudgementPK();
    pkkaikai.judgementMA(player, monster);
   }
   //自身状态
   if(chooseInner==3){
    UserFace showPlayer=new UserFace();
    showPlayer.printPlayer(player);
   }
   //怪物状态
   if(chooseInner==4){
    
   }
  }
 }
 
 //二级操作界面--刷怪练级
 public void lianji(Player player){
  System.out.println("欢迎进入练级区域:请输入您想挑战的怪物:");
  System.out.println("1,凯凯 2,力力 3,黑客 4,研究生");
  Scanner in=new Scanner(System.in);
  int choose=in.nextInt();
  if(choose==1){
   System.out.println("您选择拿凯凯练级!");
   Monster kaikai=new Monster(11,1,"凯凯发傻","凯凯");
   fight(kaikai,player);
  }
  if(choose==2){
   System.out.println("您选择拿力力练级!");
   Monster lili=new Monster(12,5,"力力发呆","力力");
   fight(lili,player);
  }
  if(choose==3){
   System.out.println("您选择拿黑客练级!");
   Monster hacker=new Monster(13,15,"黑客病毒","黑客");
   fight(hacker,player);
  }
  if(choose==4){
   System.out.println("您选择拿研究生练级!");
   Monster graduate=new Monster(14,45,"知识就是力量","研究生");
   fight(graduate,player);
  }

 }
 //二级操作界面--治疗
 public void heal(Player player){
  System.out.println("欢迎您来到治疗中心!目前版本为免费治疗~~");
  System.out.println("请选择:1、治疗自己 2、查看当前状态");
  Scanner in=new Scanner(System.in);
  int choose=in.nextInt();
  if(choose==1){
   player.hp=player.lv*100;
   System.out.println("恭喜您~治疗完毕!您的当前hp为:"+player.hp);
   UserFace back=new UserFace();
   back.printOperations(player);
  }
  if(choose==2){
   UserFace back=new UserFace();
   back.printOperations(player);
  }
  
 }

}