/// <summary> /// 三角攻击:攻击前统计节点数量: 红提供威力 ,黄提供攻击次数, 蓝删除敌人攻击边, 白提供随机魔力恢复 /// </summary> /// <param name="m"></param> void TiangleAttackB(ref Magic m) { int pS = m.magicRoute[0]; int pE = m.magicRoute[1]; for (int i = pS; i <= pE; ++i) { PointColor pc = magicCore.getPoint(magicCore.getRoute()[i].pEnd).color; switch (pc) { case PointColor.white: magicCore.recoverRandomPointMagic(1); break; case PointColor.red: m.skill.addpower += 1.5f; break; case PointColor.yellow: m.skill.addcount += 1; break; case PointColor.blue: magicCore.delectMonsterATK(); break; } } }
//获取颜色信息 public Color toPointColor(PointColor pointC) { Color color = new Color(); switch (pointC) { case PointColor.black: color = new Color(0.1f, 0.11f, 0.12f); break; case PointColor.blue: color = new Color(0.4f, 0.6f, 0.9f); break; case PointColor.red: color = new Color(0.9f, 0.4f, 0.4f); break; case PointColor.white: color = new Color(0.83f, 0.85f, 0.87f); break; case PointColor.yellow: color = new Color(0.9f, 0.9f, 0.5f); break; } return(color); }
/// <summary> /// Get point coord and check its color if it fits /// </summary> private bool isGamePointRecognized(GamePoint gamePoint, string resolution, int horizontalOffset = 0, int verticalOffset = 0, PointColor color = PointColor.Default) { PointColor pointColor = gamePoint.getPointColor(); // Do we pass the color with the call and not during data definition? if (pointColor == PointColor.WillProvidLater) { // Make sure we have provided a real color Dbg.assert(color != PointColor.WillProvidLater && color != PointColor.Default && color != PointColor.Error); pointColor = color; } List <Point> alternatePoints = gamePoint.getAlternatePoint(resolution); // If 1 of any alternate points is recognized, then point of gfx object is recognized foreach (Point point in alternatePoints) { var pixelColor = ScreenCapture.getScreenShot().GetPixel(point.X + horizontalOffset, point.Y + verticalOffset); if (isPixelColorFitsGameColor(pixelColor, pointColor)) { return(true); } } return(false); }
public Color toPointColor(PointColor pointC) { Color color = new Color(); switch (pointC) { case PointColor.black: color = Color.black; break; case PointColor.blue: color = Color.blue; break; case PointColor.red: color = Color.red; break; case PointColor.white: color = Color.white; break; case PointColor.yellow: color = Color.yellow; break; } return(color); }
public void PointChange(PointColor pc) { Debug.Log(magic.isPointTransable(id)); if (magic.isPointTransable(id)) { magic.pointTrans(id, pc); } }
public bool recognize(PointColor color) { Dbg.assert(color != PointColor.WillProvidLater && color != PointColor.Error, "Wrong color provided"); var gameResolution = ScreenCapture.getScreenshotResolutionAsString(); return(recognize(gameResolution, 0, 0, false, color)); }
protected override IEnumerator ProcessPayload(VisualPayload payload) { payload.VisualData.Bound.name = "Line Graph Bound"; var lineGraph = VisualizerFactory.InstantiateLineGraph(); lineGraph.Initialize(this, payload); AssignStates(lineGraph); var entries = EntryField.GetLastKeyValue(payload.Data) as IEnumerable <MutableObject>; if (entries == null) { throw new Exception("Illegal mutable field here! " + EntryField.AbsoluteKey + " is not an enumerable of mutables!"); } if (!entries.Any()) { yield return(null); yield break; } foreach (var entry in entries) { Vector3 entryPosition = new Vector3( XAxis.GetLastKeyValue(entry), YAxis.GetLastKeyValue(entry), ZAxis.GetLastKeyValue(entry) ); Color pointColor = PointColor.GetLastKeyValue(entry); lineGraph.AddPoint(entryPosition, pointColor); yield return(null); } yield return(null); lineGraph.SetLineData(MainColor.GetLastKeyValue(payload.Data), LineWidth.GetLastKeyValue(payload.Data), ZDepthOffset.GetLastKeyValue(payload.Data), EdgeColor.GetLastKeyValue(payload.Data), EdgeWidth.GetLastKeyValue(payload.Data), PointWidth.GetLastKeyValue(payload.Data), PulseLine.GetLastKeyValue(payload.Data), PulseWidth.GetLastKeyValue(payload.Data), Wipe.GetLastKeyValue(payload.Data), StartTime.GetLastKeyValue(payload.Data), WipeDuration.GetLastKeyValue(payload.Data) ); lineGraph.ApplyPoints(); }
public void DrawBallPoint() { int LocX = (Point.X - 1) * Constants.BALLS_GAP + Constants.EDGE; int LocY = (Point.Y - 1) * Constants.BALLS_GAP + Constants.EDGE; Location = new Point(LocY, LocX); string colorName = PointColor.ToString().ToLower(); SetBackgroundImage(Constants.BallImageFileName(colorName)); }
/// <summary> /// Check if color fits the provided PointColor /// </summary> private static bool isPixelColorFitsGameColor(Color color, PointColor pointColor) { switch (pointColor) { case PointColor.BrighterThanDark: return(ScreenParser.isPixelBrighterThanDark(color)); case PointColor.BrightnessMax15: return(ScreenParser.isPixelMaxBrightless15(color)); case PointColor.Black: return(ScreenParser.isPixelBlack(color)); case PointColor.PitchBlack: return(ScreenParser.isPixelPitchBlack(color)); case PointColor.DarkBlue: return(ScreenParser.isPixelVeryDarkBlue(color)); case PointColor.DarkGrey: return(ScreenParser.isPixelDarkGrey(color)); case PointColor.VeryDarkGrey: return(ScreenParser.isPixelVeryDarkGrey(color)); case PointColor.DarkOrVeryDarkGrey: return(ScreenParser.isPixelDarkOrVeryDarkGrey(color)); case PointColor.Red: return(ScreenParser.isPixelRed(color)); case PointColor.DarkAndNotRed: return(ScreenParser.isPixelDarkAndNotRed(color)); case PointColor.DbdLogoColor: return(ScreenParser.isPixelOfDbdLogoColor(color)); case PointColor.White: return(ScreenParser.isPixelWhite(color)); case PointColor.NotWhite: return(!ScreenParser.isPixelWhite(color)); case PointColor.FontColor: return(ScreenParser.isPixelOfFontColor(color)); case PointColor.NotFontColor: return(!ScreenParser.isPixelOfFontColor(color)); case PointColor.Error: default: throw new Exception("Wrong color"); } }
//创建新的路径转变特效 public void newLineTransfer(bool isLight, bool isPara = true, PointColor skillColor = PointColor.white, int time = 12, int delay = 0) { if (isLight) { List <Move> route = magic.getRoute(); int ps = route[route.Count - 1].pStart; int pe = route[route.Count - 1].pEnd; int l = route[route.Count - 1].moveLine; GameObject light = Instantiate(lineLightPerb, lines.transform); //生成新特效 EFController.Instance.RoadTransfer(lineGameObjectlist[l], light, pointGameObjectlist[ps], pointGameObjectlist[pe], delay, time, isPara); lineGameObjectlist[l] = light; } else { //消去mRoute中的第一条路 List <Move> route = magic.getRoute(); int ps = route[0].pStart; int pe = route[0].pEnd; int l = route[0].moveLine; GameObject normal = new GameObject(); //修改粒子系统参数 GameObject newParSys = new GameObject(); switch (skillColor) { case PointColor.black: normal = Instantiate(blackSkilLine, lines.transform); break; case PointColor.white: normal = Instantiate(whiteSkillLine, lines.transform); break; case PointColor.yellow: normal = Instantiate(yellowSkillLine, lines.transform); break; case PointColor.blue: normal = Instantiate(blueSKillLine, lines.transform); break; case PointColor.red: normal = Instantiate(redSkillLine, lines.transform); break; } EFController.Instance.RoadTransfer(lineGameObjectlist[l], normal, pointGameObjectlist[ps], pointGameObjectlist[pe], delay, time, isPara); lineGameObjectlist[l] = normal; } }
public GamePoint(string pointDescription, PointColor pointColor, Dictionary <string, string> points) { this.point = new Dictionary <string, List <Point> >(); // Convert from string to Point() foreach (var kvp in points) { this.point.Add(kvp.Key.Trim(), getPointFromString(kvp.Value)); } this.pointDescription = pointDescription.Trim(); Debug.Assert(pointColor != PointColor.Error); this.pointColor = pointColor; }
public MMAmerica2(botWindow botwindow) { #region общие this.botwindow = botwindow; this.xx = botwindow.getX(); this.yy = botwindow.getY(); #endregion pointIsMMSell1 = new PointColor(549 - 5 + xx, 606 - 5 + yy, 4370000, 4); pointIsMMSell2 = new PointColor(549 - 5 + xx, 607 - 5 + yy, 4370000, 4); pointIsMMBuy1 = new PointColor(572 - 5 + xx, 604 - 5 + yy, 7850000, 4); pointIsMMBuy2 = new PointColor(572 - 5 + xx, 605 - 5 + yy, 7850000, 4); pointGotoBuySell = new Point(670 - 5 + xx, 181 - 5 + yy); pointInitializeButton = new Point(670 - 5 + xx, 207 - 5 + yy); pointSearchButton = new Point(670 - 5 + xx, 232 - 5 + yy); pointSearchString = new Point(430 - 5 + xx, 207 - 5 + yy); pointIsFirstString1 = new PointColor(232 - 5 + xx, 292 - 5 + yy, 12000000, 6); pointIsFirstString2 = new PointColor(283 - 5 + xx, 301 - 5 + yy, 12000000, 6); pointQuantity1 = new Point(225 - 5 + xx, 240 - 5 + yy); pointQuantity2 = new Point(185 - 5 + xx, 240 - 5 + yy); pointPrice = new Point(185 - 5 + xx, 265 - 5 + yy); pointShadow = new Point(485 - 5 + xx, 265 - 5 + yy); pointTime = new Point(462 - 5 + xx, 240 - 5 + yy); pointTime48Hours = new Point(375 - 5 + xx, 260 - 5 + yy); pointTime = new Point(462 - 5 + xx, 240 - 5 + yy); pointButtonRegistration = new Point(670 - 5 + xx, 265 - 5 + yy); pointYesRegistration = new Point(470 - 5 + xx, 420 - 5 + yy); pointOkRegistration = new Point(525 - 5 + xx, 455 - 5 + yy); pointIsHideFamily1 = new PointColor(483 - 5 + xx, 267 - 5 + yy, 11700000, 5); pointIsHideFamily2 = new PointColor(485 - 5 + xx, 267 - 5 + yy, 11200000, 5); //pointFirstStringList = new Point(115 - 5 + xx, 333 - 5 + yy); //pointLastStringList = new Point(115 - 5 + xx, 576 - 5 + yy); //последняя строка списка выставленных на рынок товаров product = new Product(); //String fileName = "C:\\!! Суперпрограмма V&K\\Продукт.txt"; //product.Name = LoadProduct(fileName)[0]; //product.Quantity = int.Parse(LoadProduct(fileName)[1]); //product.MinPrice = int.Parse(LoadProduct(fileName)[2]); //product.Row = int.Parse(LoadProduct(fileName)[3]); //product.Column = int.Parse(LoadProduct(fileName)[4]); // ============ методы ======================== }
public Point(int id, PointColor c, PointType t, int maxM, List <int> lineList) { locate = id; color = c; type = t; MaxMagic = maxM; magic = maxM; line = lineList; isUnpassable = false; isBroken = false; isActivity = false; isDefence = false; isProtected = false; buff = new List <BuffBasic>(); }
public static PointColor getPointColorFromConfig(string section, string id) { PointColor _pc; var x = ConfigurationService.getConfig(section, getXKey(id)); var y = ConfigurationService.getConfig(section, getYKey(id)); var cl = ConfigurationService.getConfig(section, getColorKey(id)); try { _pc = new PointColor(id, decimal.Parse(x), decimal.Parse(y), decimal.Parse(cl)); } catch { _pc = new PointColor(id); } _pointColors.Add(_pc); return(_pc); }
public MMSing(botWindow botwindow) { #region общие this.botwindow = botwindow; this.xx = botwindow.getX(); this.yy = botwindow.getY(); #endregion pointIsMMSell1 = new PointColor(549 - 5 + xx, 606 - 5 + yy, 4370000, 4); pointIsMMSell2 = new PointColor(549 - 5 + xx, 607 - 5 + yy, 4370000, 4); pointIsMMBuy1 = new PointColor(572 - 5 + xx, 604 - 5 + yy, 7850000, 4); pointIsMMBuy2 = new PointColor(572 - 5 + xx, 605 - 5 + yy, 7850000, 4); pointGotoBuySell = new Point(670 - 5 + xx, 181 - 5 + yy); pointInitializeButton = new Point(670 - 5 + xx, 207 - 5 + yy); pointSearchButton = new Point(670 - 5 + xx, 232 - 5 + yy); pointSearchString = new Point(430 - 5 + xx, 207 - 5 + yy); pointIsFirstString1 = new PointColor(232 - 5 + xx, 292 - 5 + yy, 12000000, 6); pointIsFirstString2 = new PointColor(283 - 5 + xx, 301 - 5 + yy, 12000000, 6); pointQuantity1 = new Point(225 - 5 + xx, 240 - 5 + yy); pointQuantity2 = new Point(185 - 5 + xx, 240 - 5 + yy); pointPrice = new Point(185 - 5 + xx, 265 - 5 + yy); pointShadow = new Point(485 - 5 + xx, 265 - 5 + yy); pointTime = new Point(462 - 5 + xx, 240 - 5 + yy); pointTime48Hours = new Point(375 - 5 + xx, 260 - 5 + yy); pointTime = new Point(462 - 5 + xx, 240 - 5 + yy); pointButtonRegistration = new Point(670 - 5 + xx, 265 - 5 + yy); pointYesRegistration = new Point(470 - 5 + xx, 420 - 5 + yy); pointOkRegistration = new Point(525 - 5 + xx, 455 - 5 + yy); pointIsHideFamily1 = new PointColor(483 - 5 + xx, 267 - 5 + yy, 11700000, 5); pointIsHideFamily2 = new PointColor(485 - 5 + xx, 267 - 5 + yy, 11200000, 5); //pointFirstStringList = new Point(115 - 5 + xx, 333 - 5 + yy); //pointLastStringList = new Point(115 - 5 + xx, 576 - 5 + yy); //последняя строка списка выставленных на рынок товаров product = new Product(); // ============ методы ======================== }
/// <summary> /// Recognize itself on image /// </summary> /// <param name="verticalOffset">Used as offset for recognizing survivor result icons /// (escaped/killed/DCed) at the endgame scoreboard</param> public bool recognize(string resolution, int horizontalOffset = 0, int verticalOffset = 0, bool bDebug = false, PointColor color = PointColor.Default) { foreach (var gamePoint in gamePoints) { //if(Dbg.bTest) //{ // Debugger.Break(); //} bool bRecognized = isGamePointRecognized(gamePoint, resolution, horizontalOffset, verticalOffset, color); if (bDebug && !bRecognized) { //Debugger.Break(); //List<Point> point = gamePoint.getAlternatePoint( resolution ); //PointColor pointColor = gamePoint.getPointColor(); //var pixelColor = ScreenCapture.getScreenShot().GetPixel( point.X + horizontalOffset, // point.Y + verticalOffset ); //Log.log( "Point '" + gamePoint.getDescription() + ": " + gamePoint.getPointColor() + // "' not recognized (" + point.ToString() + " - " + pixelColor.ToString() + ")" ); Log.log("Point '" + gamePoint.getDescription() + ": " + gamePoint.getPointColor() + "' not recognized"); } if (!bRecognized) { return(false); } } return(true); }
// Custom constructor public Point(PointColor aColor) : this(0, 0, aColor) { }
public Point(PointColor pc) { Color = pc; }
public Point(int x, int y) { this.X = x; this.Y = y; this.Color = PointColor.Gold; }
public Point(PointColor color) { Color = color; }
public Point(PointColor ptColor) { Color = ptColor; }
public Point(int xPos, int yPos) { X = xPos; Y = yPos; Color = PointColor.Gold; }
public Point(PointColor color) { xPos = 0; yPos = 0; c = color; }
public Point(int x, int y) { xPos = x; yPos = y; c = PointColor.Gold; }
public Point(int x, int y) { xPos = x; yPos = y; pc = PointColor.gold; }
public Point(int xVal, int yVal) { X = xVal; Y = yVal; Color = PointColor.LightBlue; }
public Point(int xVal, int yVal) { X = xVal; Y = yVal; Color = PointColor.Gold; //Calling this will set the color to gold }
// Constructors public Point(int xVal, int yVal, PointColor aColor) { p_X = xVal; p_Y = yVal; p_Color = aColor; }
public Point(PointColor pcx) { pc = pcx; }
public Point(PointColor ptColor) { Console.WriteLine(@"----------------PointColor-------------"); Color = ptColor; }
public Point(int xVal, int yVal) { X = xVal; Y = yVal; Color = PointColor.Gold; }
} // Accessor for the PointColor ENUM public Point(int xVal, int yVal) { X = xVal; Y = yVal; Color = PointColor.Gold; // Requires an Accessor }
public Point(PointColor ptColor) { Color = ptColor; } // Default values for int: zero, so no entries needed
public Point(PointColor c) { Color = c; }
public Point(PointColor ptColor = PointColor.BloodRed) { Color = ptColor; }