package 剪刀石头布_小游戏;
import java.util.Scanner;
public class ComputorPlayer {
//玩家的开场
public static final int startGame = 1;
//玩家的胜利
public static final int winGame = 2;
//玩家的输
public static final int loseGame = 3;
//属性
//选择AI玩家名字
private int chioceComName;
//AI名字
private String []comName= {"Riven","Blade Master","Zed","Lee Sin","Morgana"};
//玩家game_loading时说的话
//瑞雯-1
private String []startWordsRiven = new String [] {
"发生了。",
"为了那些已经迷失的人。",
"已经流浪了如此之久。",
"一样的战斗在等待着我!",
"选择你自己的路。"
};
//剑圣-2
private String []startWordsBlade = new String [] {
"我的剑就是你的剑!",
"捍卫你自己。",
"剑刃与肉身。",
"意志与肉身",
"我们,开始吧!"
};
//劫-3
private String []startWordsZed = new String [] {
"无形之刃,最为致命。",
"悄无声息",
"忍术里没有禁忌可言",
"直面暗影,找寻真理",
"不要畏惧迷离之道"
};
//盲仔-4
private String []startWordsLee = new String [] {
"不用怕",
"小声点",
"保持警惕",
"坚决作战",
"丝毫不怠"
};
//莫甘娜-5
private String []startWordsMor = new String [] {
"我们会叫他们好受的!",
"我要报仇!",
"他们将会痛苦不堪!",
"绝不手软!",
"享用我的折磨吧!"
};
//玩家赢的时候说的话
//瑞雯-1
private String []winWordsRiven = new String [] {
"断剑重铸之日,骑士归来之时!",
"和你们这样的敌人打,就算剑是断的,整个局面我也能HOLD住",
"以暴止暴。",
"我的斗志还没有失去。",
"剑知其主。"
};
//剑圣-2
private String []winWordsBlade = new String [] {
"不要被骄傲,遮蔽了双眼",
"记忆如同迷雾当中的阴影",
"仁慈正在让混乱的思绪静止",
"没有人是无罪的",
"一个偷取了我们过去的未来将会是怎样的?"
};
//劫-3
private String []winWordsZed = new String [] {
"无知者在劫难逃",
"没有人可以逃离他们的影子",
"他们 追随了错误的导师",
"不要否定我 ",
"大开杀戒"
};
//盲仔-4
private String []winWordsLee = new String [] {
"我蒙上自己的双眼,只想记住最后看你的那一眼。我刺瞎自己的双眼,只为记住那逝去的红颜。",
"看不见山水也看不见虚伪,我要忘了我是谁,也不要再睁开眼看见任何人的美。",
"如果暴力不是为了装逼,那么要实力又有什么用。",
"双眼失明丝毫不影响我追捕敌人,因为我能 闻到他们身上的臭味",
"一库"
};
//莫甘娜-5
private String []winWordsMor = new String [] {
"你们也会被审判的!",
"有人说他们上辈子都是折翼的天使……但我上辈子是什么呢?",
"我必须去报仇了!",
"恕我直言:你是真滴菜",
"莽夫"
};
//玩家输的时候说的话
//瑞雯-1
private String []loseWordsRiven = new String [] {
"这就是我买不到剑鞘的原因。",
"必须给我的剑找些祭品!",
"浓厚的死亡气息。",
"往日的负担。",
"我已经流浪了如此之久。"
};
//剑圣-2
private String []loseWordsBlade = new String [] {
"猴子,让我看看你学了哪些本事",
"别再耍猴戏了!",
"如果你们够厉害的话,我还是会正眼相待的。",
"你们想学的辛苦一些,我懂的。",
"带剑的鞋子?谁说这些是剑?或是鞋子?"
};
//劫-3
private String []loseWordsZed = new String [] {
"我是黑暗之刃",
" 只有高手才能活下来",
"吾所成之事,不可逆也",
"均衡,脆弱无比 ",
"暗影,启发了我"
};
//盲仔-4
private String []loseWordsLee = new String [] {
"哪里需要我呢",
"他们心跳加快",
"我用双手成就你的梦想",
"我会偿还的",
"坚决作战"
};
//莫甘娜-5
private String []loseWordsMor = new String [] {
"头.......头铁",
"问题不大的,对面都是莽夫",
"没意义你懂吧",
"小老板怎么说~",
"唉,很舒服,皮,你再皮"
};
//玩家所出的拳 1 2 3 剪刀石头布
private int fist ;
//方法
//选择AI玩家名字
public void setComName() {
Scanner in = new Scanner(System.in);
System.out.println("\t【AI玩家】");
for(int i=0;i<comName.length;i++) {
System.out.println("\t"+(i+1)+"号:"+comName[i]);
}
System.out.print("\n请选择你要对战AI玩家的序号:");
//判断输入的数字是否符合要求 默认玩家对战瑞雯
int i=in.nextInt();
if(i<1 || i>5) {
i = 1;
}
chioceComName = i;
}
//选择得到AI玩家名字
public String getComName() {
return comName[getchioceComName()-1];
}
//得到玩家所出的石头-剪刀-布
public int getFist() {
return fist;
}
public void setFist() { //得到AI玩家所出的石头-剪刀-布 1-2-3 [0,1)
fist = (int)(Math.random()*3+1);
}
//得到输入选择AI玩家
public int getchioceComName() {
return chioceComName;
}
//玩家开始时所说的话
public String roleStart(){
String words = null;
switch(chioceComName) {
case 1: words = startWordsRiven[((int)(Math.random()*5))];
break;
case 2:words = startWordsBlade[((int)(Math.random()*5))];
break;
case 3:words = startWordsZed[((int)(Math.random()*5))];
break;
case 4:words = startWordsLee[((int)(Math.random()*5))];
break;
case 5:words = startWordsMor[((int)(Math.random()*5))];
break;
}
return words;
}
//玩家赢的时候所说的话
public String roleWin() {
String words = null;
switch(chioceComName) {
case 1: words = winWordsRiven[((int)(Math.random()*5))];
break;
case 2:words = winWordsBlade[((int)(Math.random()*5))];
break;
case 3:words = winWordsZed[((int)(Math.random()*5))];
break;
case 4:words = winWordsLee[((int)(Math.random()*5))];
break;
case 5:words = winWordsMor[((int)(Math.random()*5))];
break;
}
return words;
}
//玩家输的时候所说的话
public String roleLose() {
String words = null;
switch(chioceComName) {
case 1: words = loseWordsRiven[((int)(Math.random()*5))];
break;
case 2:words = loseWordsBlade[((int)(Math.random()*5))];
break;
case 3:words = loseWordsZed[((int)(Math.random()*5))];
break;
case 4:words = loseWordsLee[((int)(Math.random()*5))];
break;
case 5:words = loseWordsMor[((int)(Math.random()*5))];
break;
}
return words;
}
//玩家说话
public String computorTalk( int winorLose){
String words=null;
switch(winorLose) {
case startGame: words=roleStart();
break;
case winGame: words=roleWin();
break;
case loseGame: words=roleLose();
break;
}
return words;
}
//构造
public ComputorPlayer() {
setFist();
}
}