Check.java
上传用户:hainatieta
上传日期:2019-07-13
资源大小:1076k
文件大小:5k
- package cn.seejava.lei2;
- public class Check {
- //确定
- SColor c1 = new SColor(167,188,127);
-
- //准备
- SColor c3 = new SColor(139,166,181);
- SColor c4 = new SColor(52,128,172);
-
- //快速加入按钮
- SColor c5 = new SColor(233,214,150);
- SColor c6 = new SColor(233,214,147);
-
- //确定按钮
- SColor c7 = new SColor(163,202,51);
- SColor c8 = new SColor(68,100,22);
-
- //加入游戏按钮
- SColor c9 = new SColor(126,202,237);
- SColor c10 = new SColor(136,166,182);
-
- //恭喜提升军衔按钮
- SColor c11 = new SColor(202,157,51);
- SColor c12 = new SColor(108,61,22);
-
- //开始游戏
- SColor c13 = new SColor(144,195,219);
- SColor c14 = new SColor(142,192,216);
-
- //取消准备
- SColor c16 = new SColor(166,193,206);
- SColor c17 = new SColor(60,144,190);
-
- //高手一
- SColor c22 = new SColor(158,253,253);
-
- //房间一个成员
- SColor c20 = new SColor(66,86,105);
-
- //在房间里面
- SColor c21 = new SColor(80,35,1);
-
-
- //死亡的成员色
- SColor c23 = new SColor(125,125,124);
- //CT成员色
- SColor c24 = new SColor(40,157,212);
- //TT成员色
- SColor c25 = new SColor(178,150,73);
-
-
- //白色
- SColor white = new SColor(255,255,255);
-
-
- int SColorValue = 237;
- int grayValue = 150;
-
-
- public boolean isResult(SRobot robot3){
- return robot3.getPixelColor(736, 560).sequals(c1);
- }
- public boolean isFQueDing(SRobot robot3){
- return robot3.getPixelColor(422, 394).sequals(c7)&&robot3.getPixelColor(486, 394).sequals(c8);
- }
- public boolean joinGame(SRobot robot3){
- return robot3.getPixelColor(725, 440).sequals(c9)&&robot3.getPixelColor(781, 433).sequals(c10);
- }
- public boolean isNotice(SRobot robot3){
- return robot3.getPixelColor(367, 394).sequals(c7)&&robot3.getPixelColor(431, 394).sequals(c8);
- }
- public boolean isLevelUp(SRobot robot3){
- return robot3.getPixelColor(373, 450).sequals(c11)&&robot3.getPixelColor(437, 450).sequals(c12);
- }
- public boolean isStartGame(SRobot robot3){
- return robot3.getPixelColor(736, 437).sequals(c13)&&robot3.getPixelColor(748, 437).sequals(c14);
- }
- public boolean isFastJoin(SRobot robot3){
- return robot3.getPixelColor(281, 116).sequals(c5)&&robot3.getPixelColor(406, 116).sequals(c6)&&robot3.getPixelColor(84, 81).sequals(c22);
- }
- public boolean isReadyButton(SRobot robot3){
- return robot3.getPixelColor(734, 431).sequals(c3)&&robot3.getPixelColor(734,444).sequals(c4);
- }
- public boolean isInvite(SRobot robot3){
- return robot3.getPixelColor(327, 470).sequals(c7)&&robot3.getPixelColor(391, 470).sequals(c8);
- }
- public boolean isCancelReady(SRobot robot3){
- return robot3.getPixelColor(752, 432).sequals(c16)&&robot3.getPixelColor(752, 445).sequals(c17);
- }
- public boolean isInRoom(SRobot robot3){
- return robot3.getPixelColor(517, 128).sequals(c21);
- }
- public boolean checkEmptySpace(SRobot robot3){
- int k = 196;
- for(int i=0;i<8;i++){
- if(!(robot3.getPixelColor(299, k+i*30).sequals(c20))){
- return true;
- }
- }
- return false;
- }
- public int getPep(SRobot robot){
- int j = 0 ;
- int k = 196;
- for(int i=0;i<8;i++){
- if(robot.getPixelColor(299, k+i*30).sequals(c20)){
- j++;
- }
- }
- for(int l=0;l<8;l++){
- if(robot.getPixelColor(558, k+l*30).sequals(c20)){
- j++;
- }
- }
- return j;
- }
- public int getPepNum(SRobot robot){
- int j = 0 ;
- int k = 304;
- int l = 8;
- if(robot.getPixelColor(112, 571).sequals(white)&&robot.getPixelColor(116, 571).sequals(white)){
- for(int i=0;i<8;i++){
- SColor sc = robot.getPixelColor(k+i*l, 32);
- if(sc.sequals(c23)||sc.sequals(c24)||sc.sequals(c25)){
- j++;
- }
- }
- int m = 439;
- for(int i=0;i<8;i++){
- SColor sc = robot.getPixelColor(m+i*l, 32);
- if(sc.sequals(c23)||sc.sequals(c24)||sc.sequals(c25)){
- j++;
- }
- }
- return j;
- }
- return 16;
-
-
- }
- public boolean isLive(SRobot robot){
- return robot.getPixelColor(112, 571).sequals(white)&&robot.getPixelColor(116, 571).sequals(white);
- }
- public boolean isHaveBomb(SRobot robot3){
- return robot3.getPixelColor(720, 564).sequals(white)&&robot3.getPixelColor(747, 564).sequals(white);
- }
-
- public boolean timeToDead(SRobot robot){
- if(
- //CT 0
- likeWhite(robot.getPixelColor(351, 9))&&likeWhite(robot.getPixelColor(357, 9))&&likeWhite(robot.getPixelColor(351, 16))&&likeWhite(robot.getPixelColor(357, 16))&&likeGray(robot.getPixelColor(350, 8))&&likeGray(robot.getPixelColor(354, 12))){
- return true;
- }else if(
- //CT 12
- likeWhite(robot.getPixelColor(347, 8))&&likeWhite(robot.getPixelColor(356, 8))&&likeWhite(robot.getPixelColor(364, 17))&&likeGray(robot.getPixelColor(364, 8))){
- return true;
- }else{
- return false;
- }
- }
- private boolean likeWhite(SColor c1){
- //全部大于就返回
- return c1.getRed()>SColorValue&&c1.getGreen()>SColorValue&&c1.getBlue()>SColorValue;
- }
- private boolean likeGray(SColor c){
-
- if(c.getRed()<grayValue){
- return true;
- }else if(c.getGreen()<grayValue){
- return true;
- }else if(c.getBlue()<grayValue){
- return true;
- }else{
- return false;
- }
- }
- }