⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monster.java

📁 简单的文字游戏 包括行走
💻 JAVA
字号:
import java.io.IOException;


public class Monster {
	
	/**
	 * 怪物属性
	 */
	boolean bossCombat = false;
	static int Level =0;
	static int HP;
	static int attack;
	static int defence;
	static String Mname="";
	static int Money = 0;
	static int Exp =0;
	
	/*
	 * 怪物显示
	 */
	  void MonsterG(){ 
		System.out.println("怪物名字:"+Mname);
		System.out.println("  等级:"+Level);
		System.out.println("  血量:"+HP);
	}
	/**
	 * 怪物构造
	 * @param a
	 */
	void monster(int a){
		switch(a){
		case 0:
			this.Level = 3;
			this.Mname	= "骷髅兵";
			this.HP = 300;
			this.attack =40;
			this.defence = 20;
			this.Money=250;
			this.Exp=600;
			break;
		case 1:
			this.Level =5;
			this.Mname ="骷髅弓箭手";
			this.HP = 800;
			this.attack = 70;
			this.defence = 30;
			this.Money=450;;
			this.Exp=800;
			break;
		case 2:
			this.Level =10;
			this.Mname ="骷髅战士";
			this.HP = 1500;
			this.attack = 110;
			this.defence = 50;
			this.Money=670;;
			this.Exp=1000;
			break;
		case 3:
			this.Level =15;
			this.Mname ="骷髅勇士";
			this.HP = 3000;
			this.attack = 150;
			this.defence = 60;
			this.Money=700;;
			this.Exp=1200;
			break;
		}
	}
	void BOSS(int x,int y){     //boss 数据
		if(x==36&&y==390){
			if(Player.LV>=20){
				this.bossCombat = true;
			this.Level =25;
			this.Mname ="骷髅皮哥";
			this.HP = 10000;
			this.attack = 400;
			this.defence = 120;
			System.out.println("BOSS 台词待定.....");
			System.out.println(" ————————————————————————————————————————————|按下Enter键继续...");
			try{
				System.in.read(); 
			}catch(IOException ex){
				ex.printStackTrace();
			}
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -