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

📄 creatonsquest.java

📁 Creaton s Quest是一个有趣的Java角色扮演游戏!很有趣
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
			a=Math.round(a);
			if(a>=5){
				ran=(Math.random()*(lvl+4))*(Math.random()*(str+4))+125;
				dmg=(int)ran;
				if(dmg>80000){
					dmg=80000;
				}
			}
		}
		if((M==6)&&(!(lvl<=35))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=9){
				ran=(Math.random()*(lvl+5))*(Math.random()*(str+5))+175;
				dmg=(int)ran;
				if(dmg>110000){
					dmg=110000;
				}
			}
		}
		if((M==7)&&(!(lvl<=50))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=14){
				ran=(Math.random()*(lvl+6))*(Math.random()*(str+6))+250;
				dmg=(int)ran;
				if(dmg>160000){
				dmg=160000;
				}
			}
		}
		if((M==8)&&(!(lvl<=65))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=18){
				ran=(Math.random()*(lvl+7))*(Math.random()*(str+7))+500;
				dmg=(int)ran;
				if(dmg>200000){
					dmg=200000;
				}
			}
		}
		if((M==9)&&(!(lvl<=80))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=23){
				ran=(Math.random()*(lvl+8))*(Math.random()*(str+8))+750;
				dmg=(int)ran;
				if(dmg>300000){
					dmg=300000;
				}
			}
		}
		if((M==10)&&(!(lvl<=100))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=28){
				ran=(Math.random()*(lvl+8))*(Math.random()*(str+8))+1000;
				dmg=(int)ran;
				if(dmg>600000){
					dmg=600000;
				}
			}
		}
		if(S==1){
			a=Math.random()*lvl+1;
			lvlgap=0;
			if(a>=1.1){
				heal=(Math.random()*(lvl))*(Math.random()*(mag))+lvl+mag+25;
			}
			Heal=(int)heal;
			if(Heal>10000){
				Heal=10000;
			}
		}
		if((S==2)&&(!(lvl<5))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=2){
				ran=(Math.random()*(lvl+1))*(Math.random()*(mag+1))+lvl+mag+50;
				dmg=(int)ran;
				if(dmg>9000){
					dmg=9000;
				}
			}
		}
		if((S==3)&&(!(lvl<=10))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=3){
				ran=(Math.random()*(lvl+2))*(Math.random()*(mag+2))+lvl+mag+75;
				dmg=(int)ran;
				if(dmg>28000){
					dmg=28000;
				}
			}
		}
		if((S==4)&&(!(lvl<=15))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=4){
				ran=(Math.random()*(lvl+3))*(Math.random()*(mag+3))+lvl+mag+100;
				dmg=(int)ran;
				if(dmg>48000){
					dmg=48000;
				}
			}
		}
		if((S==5)&&(!(lvl<=25))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			lvlgap=0;
			dmg=0;
			if(a>=5){
				heal=(Math.random()*(lvl+4))*(Math.random()*(mag+4))+lvl+mag+125;
				Heal=(int)heal;
			}
			if(Heal>100000){
				Heal=100000;
			}
			
		}
		if((S==6)&&(!(lvl<=35))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=7){
				ran=(Math.random()*(lvl+5))*(Math.random()*(mag+5))+lvl+mag+175;
				dmg=(int)ran;
				if(dmg>108000){
					dmg=108000;
				}
			}
		}
		if((S==7)&&(!(lvl<=50))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=10){
				ran=(Math.random()*(lvl+6))*(Math.random()*(mag+6))+lvl+mag+250;
				dmg=(int)ran;
			}
		}
		if((S==8)&&(!(lvl<=65))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			lvlgap=0;
			if(a>=13){
				heal=(Math.random()*(lvl+7))*(Math.random()*(mag+7))+lvl+mag+500;
				Heal=(int)heal;
				dmg=1000;
				if(heal>200000){
					heal=200000;
				}
			}
		}
		if((S==9)&&(!(lvl<=80))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=16){
				ran=(Math.random()*(lvl+8))*(Math.random()*(mag+8))+lvl+mag+750;
				dmg=(int)ran;
				if(dmg>295000){
					dmg=295000;
				}				
			}
		}
		if((S==10)&&(!(lvl<=100))){
			a=Math.random()*lvl+1;
			a=Math.round(a);
			if(a>=20){
				ran=(Math.random()*(lvl+8))*(Math.random()*(mag+8))+lvl+mag+1000;
				dmg=(int)ran;
				if(dmg>598000){
					dmg=598000;
				}
			}
		}
		if(M==0){
			lvlgap=0;
		}
		if(lvlgap<=3){
			dmg=dmg;
	
		}
		if((lvlgap>=4)&&(lvlgap<=8)){
			dmg=dmg+(lvl*2)+str;  
		}
		if((lvlgap>=9)&&(lvlgap<=15)){
			dmg=dmg+(lvl*3)+str;  
		}
		if(lvlgap>16){
			dmg=dmg+(lvl*4)+str;  
		}
		
		ran=(Math.random()*(monster_lvl))*(Math.random()*(monster_str))+monster_lvl+(2*monster_str);
		monster_dmg=(int)ran;
		lvlgap=monster_lvl-lvl;
		if(lvlgap<=3){
			monster_dmg=monster_dmg;
	
		}
		if((lvlgap>=4)&&(lvlgap<=8)){
			monster_dmg=monster_dmg+(lvl*2)+monster_str;  
		}
		if((lvlgap>=9)&&(lvlgap<=15)){
			monster_dmg=monster_dmg+(lvl*3)+monster_str;  
		}
		if(lvlgap>16){
			monster_dmg=monster_dmg+(lvl*4)+monster_str;
		}	
		monster_def=monster_def-dmg;
		def=def-monster_dmg;
		def=def+Heal;
		System.out.println("");
		System.out.println("");
		System.out.println("---------------------------------------------------------------------");
		System.out.println("You have healed yourself for "+Heal+" points of life");
		System.out.println("You have dealt "+dmg+" points of damage to "+(monster_name));
		System.out.println(monster_name+" has "+(monster_def)+" Hitpoints remaining");
		System.out.println(monster_name+" has dealt "+monster_dmg+" points of damage to you");
		System.out.println("You have "+(def)+" Hitpoints remaining");
		System.out.println("---------------------------------------------------------------------");
	}
	if((def<1)&&(!(((monster_def<1)&&(def<1))))){
		System.out.println("---------------------------------------------------");
		System.out.println("You have been killed by "+monster_name);
		System.out.println("You have lost "+(monster_exp*2)+" experience points");
		System.out.println("---------------------------------------------------");
		exp=exp-(monster_exp*2);
		FileOutputStream file=new FileOutputStream(name);
		PrintWriter file1=new PrintWriter(file);
		file1.println(lvl);
		file1.println(str);
		file1.println(realdef);
		file1.println(mag);
		file1.println(exp);
		file1.println(skill);
		file1.close();
	}
	x=0;
	if((monster_def<1)&&(!(((monster_def<1)&&(def<1))))){
		System.out.println("---------------------------------------------------");
		System.out.println("You have killed "+monster_name);
		System.out.println("You have gained "+(monster_exp)+" experience points");
		System.out.println("You have gained "+(monster_skill)+" skill points");
		System.out.println("---------------------------------------------------");
		exp=(monster_exp)+exp;
		skill=skill+monster_skill;
		FileOutputStream file=new FileOutputStream(name);
		PrintWriter file1=new PrintWriter(file);
		file1.println(lvl);
		file1.println(str);
		file1.println(realdef);
		file1.println(mag);
		file1.println(exp);
		file1.println(skill);
		file1.close();
		x=1;
	}
	if((monster_def<1)&&(def<1)){
		System.out.println("-------------------------------------");
		System.out.println("Your bloody battle has ended in a tie");
		System.out.println("You have lost "+(monster_exp/2)+" experience");
		System.out.println("-------------------------------------");
		exp=(monster_exp/2)+exp;
	}
				
		System.out.println("Press Enter to continue");
		txt=key.readString(txt);
			if(x==1){
				hint=Math.random()*150;
				hint=Math.round(hint);
				System.out.println("------------------------------------------------------------------------------");
				if(hint==1){
					System.out.println("You have found a magical sword. It's presence gives you the ability to have 10 more strength and 10 more magically skill. Use it wisely!");
					mag=mag+10;
					str=str+10;
					hint=0;
				}
				if((hint>=5)&&(hint<=10)){
					System.out.println("Creaton has poisoned the village food which you eat to gain strength. You have lost 5 strength");
					str=str-5;
					hint=0;
				}
				if((hint>=11)&&(hint<=20)){
					System.out.println("The village brewer has supplied you with some alcohol. You gain 10 strength but lose 5 magic skill");
					str=str+10;
					mag=mag-5;
					hint=0;
				}
				if((hint>=21)&&(hint<=25)){
					System.out.println("You have spent the night with a village maiden she has given you the confidence to do anything! You gain 25 defence!");
					realdef=realdef+25;
					hint=0;
				}
				if((hint>=26)&&(hint<=30)){
					System.out.println("You have found a mithril steel chestplate it being with you increases your defence by 50!");
					realdef=realdef+50;
					hint=0;
				}
				if((hint>=31)&&(hint<=40)){
					System.out.println("Hint: Killing an easy monster may be fast but to kill creaton you must develope your skills by fighting difficult enemies!");
					hint=0;
				}
				if((hint>=41)&&(hint<=70)){
					System.out.println("Hint: You can only deal damage with attacks you have the ability to execute. Go to view abilities to see what skills you are able to execute!");
					hint=0;
				}
				if((hint>=71)&&(hint<=90)){
					System.out.println("Hint: Rumour has it Creaton is more than level 100 practice hard so one day you may defeat him with confidence!");
					hint=0;
				}
				if((hint>=91)&&(hint<=96)){
					System.out.println("You were charmed by the village enchantress you gain 25 magical skill");
					mag=mag+25;
					hint=0;
				}
				if((hint>=97)&&(hint<=99)){
					System.out.println("You have looted the breastplate of Vignt! You gain 20 strength 20 magic and 20 defence");
					mag=mag+20;
					str=str+20;
					realdef=realdef+20;
					hint=0;
				}
				if(hint==100){
					System.out.println("You have looted The Breastplate of the Righteous. You gain 100 Strength 100 Defence and 100 Magic");
					mag=mag+100;
					str=str+100;
					realdef=realdef+100;
					hint=0;
				}
				if((hint>100)&&(hint<=110)){
					System.out.println("Hint: The greater your level the easier it will be for you to execute harder attacks. Work hard to gain levels to make your attacks more reliable");
				}
				if((hint>=111)&&(hint<=120)){
					System.out.println("Hint: The greater your strength the harder you hit! Kill monsters to increase your skill strength to hit harder.");
				}
				if((hint>=121)&&(hint<=130)){
					System.out.println("After the battle you do your happy dance. Unfortunatly you trip and lose 50 hitpoints");
					realdef=realdef-50;
				}
				if((hint>=131)&&(hint<=140)){
					System.out.println("Hint: The greater your magic the greater you can heal and do damage with magical attacks.");
				}
				if((hint>=141)&&(hint<=148)){
					System.out.println("You have looted the breastplate of "+monster_name+" you gain 100 defence!");
					realdef=realdef+100;
				}
				if((hint>148)&&(hint<=151)){
					System.out.println("You have looted the Great Breastplate. You gain 100 strength 100 defence and 100 magic!");
					realdef=realdef+100;
					str=str+100;
					mag=mag+100;
				}
				System.out.println("--------------------------------------------------------------------------------");
				FileOutputStream file=new FileOutputStream(name);
				PrintWriter file2=new PrintWriter(file);
				file2.println(lvl);
				file2.println(str);
				file2.println(realdef);
				file2.println(mag);
				file2.println(exp);
				file2.println(skill);
				file2.close();
			}
	b=1;
	return b;	
	}//end of combat method
		
}//end of main class
		

⌨️ 快捷键说明

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