public Game(int cellSize) { gameMatrix = GameMatrices.gameMatrixWithDots; GameMatrixSize[0] = GameMatrix.GetLength(0); GameMatrixSize[1] = GameMatrix.GetLength(1); Human = new Human(this.GameMatrixSize, cellSize, this, new int[] { 23, 14 }, Directions.Left, 1); blinky = new Red(this.GameMatrixSize, cellSize, this, new int[] { 5, 6 }, Directions.Down, 1); pinky = new Pink(this.GameMatrixSize, cellSize, this, new int[] { 29, 1 }, Directions.Right, 1); inky = new Blue(this.GameMatrixSize, cellSize, this, new int[] { 29, 26 }, Directions.Up, 1); clyde = new Orange(this.GameMatrixSize, cellSize, this, new int[] { 5, 26 }, Directions.Left, 1); Players = new Player[] { Human, blinky, pinky, inky, clyde }; foreach (Player ght in Players) { if (ght is AI) { Human.HumanPositionChanged += ((AI)ght).OnHumanPositionChanged; } } blinky.RedPositionChanged += inky.OnRedPositionChanged; this.cellSize = cellSize; dotsCount = CountDots(); frameTimer = new DispatcherTimer(); frameTimer.Interval = TimeSpan.FromMilliseconds(interval); frameTimer.Tick += Timer_Tick; frameTimer.Start(); gameTimer = new Timer(); gameTimer.Interval = gameTimerIntervals[gameTimerCounter]; gameTimer.Elapsed += GameTimer_Elapsed; gameTimer.Start(); stopwatch.Start(); scaredTimer = new DispatcherTimer(); scaredTimer.Tick += ScaredTimer_Tick; }
public void ToggleCreepyOn(Pink p) { if (!activeCreepyTimers.Contains(p)) { activeCreepyTimers.Add(p); Debug.Log("added"); } }
public void ToggleCreepyOff(Pink p) { if (activeCreepyTimers.Contains(p)) { activeCreepyTimers.Remove(p); Debug.Log("removed"); } }
protected override void OnPaint(PaintEventArgs e) //vykreslovanie mapy { base.OnPaint(e); DrawMap(e.Graphics); //vykresli sa mapa pacman.DrawPM(e.Graphics); //vykresleny pacman Red.DrawGhost(e.Graphics); //vykresleny cerveny duch Yellow.DrawGhost(e.Graphics); //vykresleny zlty duch Pink.DrawGhost(e.Graphics); //vykresleny ruzovy duch }
public GameState(Pacman pacman, Red red, Pink pink, Blue blue, Brown brown) { loadMazes(); map = maps[Level]; this.Pacman = pacman; Ghosts[0] = this.Red = red; Ghosts[1] = this.Pink = pink; Ghosts[2] = this.Blue = blue; Ghosts[3] = this.Brown = brown; }
public GameState() { loadMazes(); map = maps[Level]; // default position ... find out where Pacman = new Pacman(Pacman.StartX, Pacman.StartY, this); Ghosts[0] = Red = new Red(Red.StartX, Red.StartY, this); Ghosts[1] = Pink = new Pink(Pink.StartX, Pink.StartY, this); Ghosts[2] = Blue = new Blue(Blue.StartX, Blue.StartY, this); Ghosts[3] = Brown = new Brown(Brown.StartX, Brown.StartY, this); }
public GameState(Pacman pacman, Red red, Pink pink, Blue blue, Brown brown) { if (!mapsHaveBeenPreloaded) { PreloadMazes(); } maps = GameState.preloadedMaps; map = maps[Level]; this.Pacman = pacman; Ghosts[0] = this.Red = red; Ghosts[1] = this.Pink = pink; Ghosts[2] = this.Blue = blue; Ghosts[3] = this.Brown = brown; }
private static void test01() //****************************************************************************80 // // Purpose: // // TEST01 tests WRAP2. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 31 May 2010 // // Author: // // John Burkardt // { int m; Console.WriteLine(""); Console.WriteLine("TEST01"); Console.WriteLine(" WRAP2 performs a circular wrap."); Console.WriteLine(" Q is expected to range between 0 and M."); Console.WriteLine(" WRAP2 takes an input value of Q, and either"); Console.WriteLine(" increments it by M+1 until in the range, or"); Console.WriteLine(" decrements it by M+1 until in the range,"); Console.WriteLine(" and returns the result as the function value."); for (m = 2; m <= 4; m++) { Console.WriteLine(""); Console.WriteLine(" M Qin Qout"); Console.WriteLine(""); int i; for (i = -5; i < 3 * m; i++) { int q = i; int q_in = q; Pink.wrap2(m, ref q); Console.WriteLine(" " + m.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + q_in.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + q.ToString(CultureInfo.InvariantCulture).PadLeft(2) + ""); } } }
private static void test02() //****************************************************************************80 // // Purpose: // // TEST02 tests CDELAY2. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 31 May 2010 // // Author: // // John Burkardt // { int m; Console.WriteLine(""); Console.WriteLine("TEST02"); Console.WriteLine(" CDELAY2 is a circular buffer implementation"); Console.WriteLine(" of an M-fold delay. Q is a counter"); Console.WriteLine(" which is decremented by CDELAY2, but reset to M"); Console.WriteLine(" after it reaches 0."); for (m = 2; m <= 4; m++) { Console.WriteLine(""); Console.WriteLine(" I M Qin Qout"); Console.WriteLine(""); int q = m; int i; for (i = 1; i <= 3 * (m + 1); i++) { int q_in = q; Pink.cdelay2(m, ref q); Console.WriteLine(" " + i.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + m.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + q_in.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + q.ToString(CultureInfo.InvariantCulture).PadLeft(2) + ""); } } }
private static void test03() //****************************************************************************80 // // Purpose: // // TEST03 tests RANH. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 31 May 2010 // // Author: // // John Burkardt // { int d; Console.WriteLine(""); Console.WriteLine("TEST03"); Console.WriteLine(" RANH is a random hold function."); Console.WriteLine(" Given a value U and a delay D, it returns the value"); Console.WriteLine(" U for D calls, then resets U."); for (d = 5; 1 <= d; d--) { Console.WriteLine(""); Console.WriteLine(" I D Q U Y"); Console.WriteLine(""); double u = 0.5; int q = 3; int i; for (i = 1; i <= 20; i++) { double y = Pink.ranh(d, ref u, ref q); Console.WriteLine(" " + i.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + d.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + q.ToString(CultureInfo.InvariantCulture).PadLeft(2) + " " + u.ToString(CultureInfo.InvariantCulture).PadLeft(10) + " " + y.ToString(CultureInfo.InvariantCulture).PadLeft(10) + ""); } } }
private static void Game_OnStart(EventArgs args) { Menu = MainMenu.AddMenu("Brain.exe", "braindotexe"); Menu.AddSeparator(); Menu.AddLabel("By KK2 & MrArticuno"); DrawMenu = Menu.AddSubMenu("Draw", "brainDraw"); DrawMenu.Add("drawDisable", new CheckBox("Turn off all drawings", false)); DrawMenu.Add("streamMode", new CheckBox("Stream Mode", false)); JungleTimers.Init(); Cooldown.Init(); CloneRevelaer.Init(); Pink.Init(); TowerUtil.Init(); SmiteME.Init(); BlinkDetector.Init(); WardTracker.Init(); }
private Pink Branch(Vector3 startPoint, float overshotBy = 0f, bool extraBranch = false, Directions2D._directions direction = Directions2D._directions.numDirections, _hallwayMode hall = _hallwayMode.off) { if (normalBranches == maxBranches) { Debug.Log("ERROR: attmepted to branch from pink object (" + this.name + ") when already at max branches"); return(null); } branches [branchCount] = Instantiate(pinkTemplate[0], startPoint, Quaternion.identity) as GameObject; Pink newBranchPink = branches [branchCount].GetComponentInChildren <Pink> (); if (direction == Directions2D._directions.numDirections) { Directions2D._directions newDir = NewBranchDirection(startPoint); newBranchPink.SetDirection(newDir); } else { newBranchPink.SetDirection(direction); } if (overshotBy >= 0.05f) { newBranchPink.AddGrowthBurst(overshotBy); } newBranchPink.hallwayMode = hall; branchCount++; if (!extraBranch) { normalBranches++; } newBranchPink.DEBUGHALL = false; return(newBranchPink); }
public Pink_MeleeAttackState(Entity _entity, FiniteStateMachine _stateMachine, string _animBoolName, Transform _attackPosition, D_MeleeAttackState _stateData, Pink _pink) : base(_entity, _stateMachine, _animBoolName, _attackPosition, _stateData) { pink = _pink; }
private void Pink_pressed(object sender, TappedRoutedEventArgs e) { Pink.Play(); }
private void HallwayTriggers(Collider other) { if (DEBUGHALL) { //Debug.Log ("HallwayTriggers called for trigger = " + other.gameObject.tag + " object = " + other.gameObject.name); } if (other.gameObject.CompareTag("Hall Start Trigger") && !other.GetComponent <HallwayTrigger> ().hall.pinkHasTraversed) { if (DEBUGHALL) { Debug.Log("hit hall start trigger"); } HallwayTrigger hallTrig = other.GetComponent <HallwayTrigger> (); if (hallwayMode == _hallwayMode.off) { if (DEBUGHALL) { Debug.Log("hallway mode was off when hit"); } if (growDir == hallTrig.hallDirection) { // confirmed pink is growing in same direction as the length of the hallway float otherPos = Directions2D.FlattenToDirection(Directions2D.OppositeAxis(growDir), other.transform.position); float pairPos = Directions2D.FlattenToDirection(Directions2D.OppositeAxis(growDir), hallTrig.pairedTrigger.transform.position); float thisPos = Directions2D.FlattenToDirection(Directions2D.OppositeAxis(growDir), transform.position); float otherScale = Directions2D.FlattenToDirection(Directions2D.OppositeAxis(growDir), other.transform.lossyScale); float thisScale = Directions2D.FlattenToDirection(Directions2D.OppositeAxis(growDir), transform.lossyScale); float triggerDistance = Mathf.Abs(pairPos - otherPos); float midpoint = triggerDistance / 2 + otherPos; float allowance = thisScale - (triggerDistance - otherScale); if (DEBUGHALL) { Debug.Log("growdir same as hallway, triggerDistance = " + triggerDistance + " midpoint = " + midpoint + " allowance = " + allowance); } if (thisPos > midpoint - allowance && thisPos < midpoint + allowance) { // confirmed pink is centered enough that it has hit both hall triggers // it will clear the hallway walls and only needs to be extended if (DEBUGHALL) { Debug.Log("start traversing"); } float hallLength = Directions2D.FlattenToDirection(growDir, other.transform.position - hallTrig.oppositeTrigger.transform.position); maxScaling += Mathf.Abs(hallLength); hallwayMode = _hallwayMode.traversing; hallTrig.hall.pinkHasTraversed = true; } else { // pink is not centered enough and needs to branch to align // create connecting branch Pink newBranch = Branch(FrontBranchPoint(), 0f, true, hallTrig.pairDirection, _hallwayMode.connecting); } } else if (growDir == hallTrig.pairDirection) { // confirmed pink is growing in direction of paired hallway trigger float connectionLength = Directions2D.FlattenToDirection(growDir, other.transform.position - hallTrig.pairedTrigger.transform.position); maxScaling += Mathf.Abs(connectionLength); hallwayMode = _hallwayMode.connecting; } } else if (hallwayMode == _hallwayMode.connecting && hallStartTriggersHit % 2 == 1) { // create traversing branch Pink newBranch = Branch(FrontBranchPoint(), 0f, true, hallTrig.hallDirection, _hallwayMode.traversing); float hallLength = Directions2D.FlattenToDirection(hallTrig.hallDirection, other.transform.position - hallTrig.oppositeTrigger.transform.position); newBranch.maxScaling += Mathf.Abs(hallLength); hallwayMode = _hallwayMode.off; hallTrig.hall.pinkHasTraversed = true; } hallStartTriggersHit++; } else if (other.gameObject.CompareTag("Hall End Trigger") && !hallTriggersHit.Contains(other)) { // hit end point if (hallwayMode == _hallwayMode.traversing && hallTriggersHit.Count > 0) { // branch both directions if (DEBUGHALL) { Debug.Log("hit hall end trigger while traversing"); } BranchBloom(FrontBranchPoint(), 0f, true); hallwayMode = _hallwayMode.off; } hallTriggersHit.Add(other); } }
private void CarregandoTema(Theme theme) { switch (theme) { case Theme.Principal: var principal = new Principal(); ColorPrimary = principal.ColorPrimary; ColorDark = principal.ColorDark; ColorLight = principal.ColorLight; ColorAccent = principal.ColorAccent; ColorTextIcons = principal.ColorTextIcons; ColorTextPrimary = principal.ColorTextPrimary; ColorTextSecondary = principal.ColorTextSecondary; ColorDivider = principal.ColorDivider; ColorButtonPrimary = principal.ColorButtonPrimary; ColorButtonSecondary = principal.ColorButtonSecondary; break; case Theme.Red: var red = new Red(); ColorPrimary = red.ColorPrimary; ColorDark = red.ColorDark; ColorLight = red.ColorLight; ColorAccent = red.ColorAccent; IconCart = red.IconCart; IconChat = red.IconChat; IconCatalogo = red.IconCatalogo; break; case Theme.Pink: var pink = new Pink(); ColorPrimary = pink.ColorPrimary; ColorDark = pink.ColorDark; ColorLight = pink.ColorLight; ColorAccent = pink.ColorAccent; IconCart = pink.IconCart; IconChat = pink.IconChat; IconCatalogo = pink.IconCatalogo; break; case Theme.Purple: var purple = new Purple(); ColorPrimary = purple.ColorPrimary; ColorDark = purple.ColorDark; ColorLight = purple.ColorLight; ColorAccent = purple.ColorAccent; IconCart = purple.IconCart; IconChat = purple.IconChat; IconCatalogo = purple.IconCatalogo; break; case Theme.DeepPurple: var deepPurple = new DeepPurple(); ColorPrimary = deepPurple.ColorPrimary; ColorDark = deepPurple.ColorDark; ColorLight = deepPurple.ColorLight; ColorAccent = deepPurple.ColorAccent; IconCart = deepPurple.IconCart; IconChat = deepPurple.IconChat; IconCatalogo = deepPurple.IconCatalogo; break; case Theme.Indigo: var indigo = new Indigo(); ColorPrimary = indigo.ColorPrimary; ColorDark = indigo.ColorDark; ColorLight = indigo.ColorLight; ColorAccent = indigo.ColorAccent; IconCart = indigo.IconCart; IconChat = indigo.IconChat; IconCatalogo = indigo.IconCatalogo; break; case Theme.Blue: var blue = new Blue(); ColorPrimary = blue.ColorPrimary; ColorDark = blue.ColorDark; ColorLight = blue.ColorLight; ColorAccent = blue.ColorAccent; IconCart = blue.IconCart; IconChat = blue.IconChat; IconCatalogo = blue.IconCatalogo; break; case Theme.LightBlue: var lightBlue = new LightBlue(); ColorPrimary = lightBlue.ColorPrimary; ColorDark = lightBlue.ColorDark; ColorLight = lightBlue.ColorLight; ColorAccent = lightBlue.ColorAccent; IconCart = lightBlue.IconCart; IconChat = lightBlue.IconChat; IconCatalogo = lightBlue.IconCatalogo; break; case Theme.Cyan: var cyan = new Cyan(); ColorPrimary = cyan.ColorPrimary; ColorDark = cyan.ColorDark; ColorLight = cyan.ColorLight; ColorAccent = cyan.ColorAccent; IconCart = cyan.IconCart; IconChat = cyan.IconChat; IconCatalogo = cyan.IconCatalogo; break; case Theme.Teal: var teal = new Teal(); ColorPrimary = teal.ColorPrimary; ColorDark = teal.ColorDark; ColorLight = teal.ColorLight; ColorAccent = teal.ColorAccent; IconCart = teal.IconCart; IconChat = teal.IconChat; IconCatalogo = teal.IconCatalogo; break; case Theme.Brown: var brown = new Brown(); ColorPrimary = brown.ColorPrimary; ColorDark = brown.ColorDark; ColorLight = brown.ColorLight; ColorAccent = brown.ColorAccent; IconCart = brown.IconCart; IconChat = brown.IconChat; IconCatalogo = brown.IconCatalogo; break; default: break; } }
private void Drawing_OnEndScene(EventArgs args) { if (Config.Item("disableDraws").GetValue<bool>()) return; bool blink = true; if ((int)(Game.Time * 10) % 2 == 0) blink = false; var minimap = Config.Item("minimap").GetValue<bool>(); var HpBar = Config.Item("HpBar").GetValue<bool>(); var championInfo = Config.Item("championInfo").GetValue<bool>(); var ScreenRadar = Config.Item("ScreenRadar").GetValue<bool>(); var ScreenRadarEnemy = Config.Item("ScreenRadarEnemy").GetValue<bool>(); var ScreenRadarJungler = Config.Item("ScreenRadarJungler").GetValue<bool>(); var SpellTrackerEnemy = Config.Item("SpellTrackerEnemy").GetValue<bool>(); var SpellTrackerAlly = Config.Item("SpellTrackerAlly").GetValue<bool>(); var SpellTrackerMe = Config.Item("SpellTrackerMe").GetValue<bool>(); var SpellTrackerLvl = Config.Item("SpellTrackerLvl").GetValue<bool>(); var ShowClicks = Config.Item("ShowClicks").GetValue<bool>(); var championInfoHD = Config.Item("championInfoHD").GetValue<bool>(); float posY = (Config.Item("posY").GetValue<Slider>().Value * 0.001f) * Drawing.Height; float posX = (Config.Item("posX").GetValue<Slider>().Value * 0.001f) * Drawing.Width; int Width = 103; int Height = 8; int XOffset = 10; int YOffset = 20; var FillColor = System.Drawing.Color.GreenYellow; var Color = System.Drawing.Color.Azure; var hudSpace = 0; var area = 5000; var notPos = new Vector2(Drawing.Width / 2 - 150, Drawing.Height / 6); var centerScreenWorld = Drawing.ScreenToWorld(centerScreen); if (Config.Item("Notification").GetValue<bool>()) { var noti = NotificationsList.FirstOrDefault(); if (noti != null) { if (noti.TimeRec == 0) { noti.TimeRec = Utils.TickCount; } else if (Utils.TickCount - noti.TimeRec > 3000) { NotificationsList.Remove(noti); } else { float time = Utils.TickCount - noti.TimeRec; float calcOpacity = 1; if (time < 500) calcOpacity = time / 500; else if (time > 2500) calcOpacity = (3000 - time) / 500; var opacity = new ColorBGRA(256, 256, 256, 0.9f * calcOpacity); Not.Position = notPos; if (noti.Lost) Not.Color = new ColorBGRA(0, 0.5f, 1f, 0.6f * calcOpacity); else Not.Color = new ColorBGRA(0.5f, 0, 0, 0.6f * calcOpacity); Not.OnEndScene(); if (noti.Lost) { Lost.Position = notPos + new Vector2(81, 8); Lost.Color = opacity; Lost.OnEndScene(); } else { Isready.Position = notPos + new Vector2(81, 8); Isready.Color = opacity; Isready.OnEndScene(); } noti.SpellIco.Position = notPos + new Vector2(8, 8); noti.SpellIco.Color = opacity; noti.SpellIco.OnEndScene(); noti.Hero.Position = notPos + new Vector2(152, 8); noti.Hero.Color = opacity; noti.Hero.Scale = new Vector2(0.547f, 0.547f); noti.Hero.OnEndScene(); } } } if (Config.Item("showWards").GetValue<bool>()) { #region showWards var circleSize = 30; foreach (var obj in OKTWward.HiddenObjList.Where(obj => Render.OnScreen(Drawing.WorldToScreen(obj.pos)))) { if (obj.pos.IsOnScreen()) { var pos = Drawing.WorldToScreen(obj.pos) + new Vector2(-50, -50); ; if (obj.type == 1) { Drawing.DrawText(pos.X - 15, pos.Y - 13, System.Drawing.Color.YellowGreen, MakeNiceNumber(obj.endTime - Game.Time)); Ward.Position = pos + new Vector2(10, 10); Ward.OnEndScene(); DrawFontTextMap(Tahoma13, ((int)(obj.endTime - Game.Time)).ToString(), obj.pos + new Vector3(-18, 18, 0), SharpDX.Color.White); } else if (obj.type == 2) { Pink.Position = pos + new Vector2(10, 10); Pink.OnEndScene(); } else if (obj.type == 3) { OktwCommon.DrawTriangleOKTW(circleSize, obj.pos, System.Drawing.Color.Orange); DrawFontTextMap(Tahoma13, "! " + (int)(obj.endTime - Game.Time), obj.pos, SharpDX.Color.Orange); } } { var pos = Drawing.WorldToMinimap(obj.pos); if (obj.type == 1) { WardMM.Position = pos; WardMM.OnEndScene(); } else if (obj.type == 2) { PinkMM.Position = pos; PinkMM.OnEndScene(); } else if (obj.type == 3) { } } } #endregion } foreach (var hero in OKTWtracker.ChampionInfoList.Where(x => !x.Hero.IsDead)) { var barPos = hero.Hero.HPBarPosition; var q = hero.Hero.Spellbook.GetSpell(SpellSlot.Q); var w = hero.Hero.Spellbook.GetSpell(SpellSlot.W); var e = hero.Hero.Spellbook.GetSpell(SpellSlot.E); var r = hero.Hero.Spellbook.GetSpell(SpellSlot.R); if (hero.Hero.IsVisible && ((SpellTrackerAlly && (hero.Hero.IsAlly && !hero.Hero.IsMe)) || (SpellTrackerEnemy && hero.Hero.IsEnemy) || (SpellTrackerMe && hero.Hero.IsMe))) { if (hero.Hero.IsAlly) barPos = barPos + new Vector2(0, -4); if (hero.Hero.IsMe) barPos = barPos + new Vector2(25, -7); Drawing.DrawLine(barPos + new Vector2(7, 34), barPos + new Vector2(115, 34), 9, System.Drawing.Color.DimGray); Drawing.DrawLine(barPos + new Vector2(8, 35), barPos + new Vector2(113, 35), 7, System.Drawing.Color.Black); var qCal = Math.Max(Math.Min((q.CooldownExpires - Game.Time) / q.Cooldown, 1), 0); var wCal = Math.Max(Math.Min((w.CooldownExpires - Game.Time) / w.Cooldown, 1), 0); var eCal = Math.Max(Math.Min((e.CooldownExpires - Game.Time) / e.Cooldown, 1), 0); var rCal = Math.Max(Math.Min((r.CooldownExpires - Game.Time) / r.Cooldown, 1), 0); if (q.Level > 0) { Drawing.DrawLine(barPos + new Vector2(9, 36), barPos + new Vector2(33 - (24 * qCal), 36), 5, qCal > 0 ? System.Drawing.Color.Orange : System.Drawing.Color.YellowGreen); if (SpellTrackerLvl) for (int i = 0 ; i < Math.Min(q.Level, 5) ; i++) Drawing.DrawLine(barPos + new Vector2(10 + i * 5, 37), barPos + new Vector2(11 + i * 5, 37), 3, System.Drawing.Color.Black); } if (w.Level > 0) { Drawing.DrawLine(barPos + new Vector2(35, 36), barPos + new Vector2(59 - (24 * wCal), 36), 5, wCal > 0 ? System.Drawing.Color.Orange : System.Drawing.Color.YellowGreen); if (SpellTrackerLvl) for (int i = 0 ; i < Math.Min(w.Level, 5) ; i++) Drawing.DrawLine(barPos + new Vector2(36 + i * 5, 37), barPos + new Vector2(37 + i * 5, 37), 3, System.Drawing.Color.Black); } if (e.Level > 0) { Drawing.DrawLine(barPos + new Vector2(61, 36), barPos + new Vector2(85 - (24 * eCal), 36), 5, eCal > 0 ? System.Drawing.Color.Orange : System.Drawing.Color.YellowGreen); if (SpellTrackerLvl) for (int i = 0 ; i < Math.Min(e.Level, 5) ; i++) Drawing.DrawLine(barPos + new Vector2(62 + i * 5, 37), barPos + new Vector2(63 + i * 5, 37), 3, System.Drawing.Color.Black); } if (r.Level > 0) { Drawing.DrawLine(barPos + new Vector2(87, 36), barPos + new Vector2(112 - (24 * rCal), 36), 5, rCal > 0 ? System.Drawing.Color.Orange : System.Drawing.Color.YellowGreen); if (SpellTrackerLvl) for (int i = 0 ; i < Math.Min(r.Level, 5) ; i++) Drawing.DrawLine(barPos + new Vector2(88 + i * 5, 37), barPos + new Vector2(89 + i * 5, 37), 3, System.Drawing.Color.Black); } } if (hero.Hero.IsMe) continue; if (hero.Hero.IsEnemy) { if (ShowClicks && hero.Hero.IsValidTarget() && hero.LastWayPoint.IsValid() && hero.Hero.Position.Distance(hero.LastWayPoint) > 100) { drawLine(hero.Hero.Position, hero.LastWayPoint, 1, System.Drawing.Color.Red); DrawFontTextMap(Tahoma13, hero.Hero.ChampionName, hero.LastWayPoint, SharpDX.Color.WhiteSmoke); } #region Damage indicators if (HpBar && hero.Hero.IsHPBarRendered && hero.Hero.Position.IsOnScreen()) { if (HpBar) { float QdmgDraw = 0, WdmgDraw = 0, EdmgDraw = 0, RdmgDraw = 0, damage = 0; bool qRdy = Player.Spellbook.GetSpell(SpellSlot.Q).IsReady(); bool wRdy = Player.Spellbook.GetSpell(SpellSlot.W).IsReady(); bool eRdy = Player.Spellbook.GetSpell(SpellSlot.E).IsReady(); bool rRdy = Player.Spellbook.GetSpell(SpellSlot.R).IsReady(); float qDmg = 0; float wDmg = 0; float eDmg = 0; float rDmg = 0; if (qRdy) qDmg = (float)Player.GetSpellDamage(hero.Hero, SpellSlot.Q); if (wRdy) wDmg = (float)Player.GetSpellDamage(hero.Hero, SpellSlot.W); if (eRdy) eDmg = (float)Player.GetSpellDamage(hero.Hero, SpellSlot.E); if (rRdy) rDmg = (float)Player.GetSpellDamage(hero.Hero, SpellSlot.R); damage = qDmg + wDmg + eDmg + rDmg; if (qRdy) QdmgDraw = (qDmg / damage); if (wRdy && Player.ChampionName != "Kalista") WdmgDraw = (wDmg / damage); if (eRdy) EdmgDraw = (eDmg / damage); if (rRdy) RdmgDraw = (rDmg / damage); var percentHealthAfterDamage = Math.Max(0, hero.Hero.Health - damage) / hero.Hero.MaxHealth; var yPos = barPos.Y + YOffset; var xPosDamage = barPos.X + XOffset + Width * percentHealthAfterDamage; var xPosCurrentHp = barPos.X + XOffset + Width * hero.Hero.Health / hero.Hero.MaxHealth; float differenceInHP = xPosCurrentHp - xPosDamage; var pos1 = barPos.X + XOffset + (107 * percentHealthAfterDamage); for (int i = 0; i < differenceInHP; i++) { if (qRdy && i < QdmgDraw * differenceInHP) Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Cyan); else if (wRdy && i < (QdmgDraw + WdmgDraw) * differenceInHP) Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Orange); else if (eRdy && i < (QdmgDraw + WdmgDraw + EdmgDraw) * differenceInHP) Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Yellow); else if (rRdy && i < (QdmgDraw + WdmgDraw + EdmgDraw + RdmgDraw) * differenceInHP) Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.YellowGreen); } } } #endregion if (minimap) { if (!hero.Hero.IsVisible) { var minimapSprite = hero.MinimapSprite; var lastWP = hero.LastWayPoint; var heroPos = hero.PredictedPos; if (!hero.LastWayPoint.IsZero) { if (heroPos.Distance(lastWP) < 1200) lastWP = heroPos.Extend(lastWP, 1200); Drawing.DrawLine(Drawing.WorldToMinimap(heroPos), Drawing.WorldToMinimap(lastWP), 2, System.Drawing.Color.OrangeRed); } minimapSprite.Position = Drawing.WorldToMinimap(heroPos) - new Vector2(10, 10); minimapSprite.OnEndScene(); } } if (championInfo && championInfoHD) { var hudSprite = hero.HudSprite; if (!hero.Hero.IsVisible) hudSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); else hudSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); Vector2 hudPos = new Vector2(posX + hudSpace, posY); float scale = 0.5f; hudSprite.Scale = new Vector2(scale, scale); hudSprite.Position = hudPos - new Vector2(12, 10); hudSprite.OnEndScene(); var vec1manaB = new Vector2(hudPos.X - 9, hudPos.Y + 48); var vec2manaB = new Vector2(hudPos.X - 8 + 50 + 3, hudPos.Y + 48); Drawing.DrawLine(vec1manaB, vec2manaB, 18, System.Drawing.Color.DarkGoldenrod); var vec1hpB = new Vector2(hudPos.X - 8, hudPos.Y + 49); var vec2hpB = new Vector2(hudPos.X - 8 + 50 + 2, hudPos.Y + 49); Drawing.DrawLine(vec1hpB, vec2hpB, 16, System.Drawing.Color.Black); System.Drawing.Color color = System.Drawing.Color.LimeGreen; if (hero.Hero.HealthPercent < 30) color = System.Drawing.Color.OrangeRed; else if (hero.Hero.HealthPercent < 50) color = System.Drawing.Color.DarkOrange; var vec1hp = new Vector2(hudPos.X - 7, hudPos.Y + 50); var vec2hp = new Vector2(hudPos.X - 7 + hero.Hero.HealthPercent / 2, hudPos.Y + 50); Drawing.DrawLine(vec1hp, vec2hp, 7, color); var vec1mana = new Vector2(hudPos.X - 7, hudPos.Y + 59); var vec2mana = new Vector2(hudPos.X - 7 + hero.Hero.ManaPercent / 2, hudPos.Y + 59); Drawing.DrawLine(vec1mana, vec2mana, 5, System.Drawing.Color.DodgerBlue); var vecHudLevel = new Vector2(hudPos.X + 30, hudPos.Y + 33); DrawFontTextScreen(HudLevel, hero.Hero.Level.ToString(), vecHudLevel.X, vecHudLevel.Y, SharpDX.Color.White); { if (Game.Time - hero.FinishRecallTime < 4) { DrawFontTextScreen(RecFont, " FINISH", hudPos.X - 10, hudPos.Y + 18, SharpDX.Color.YellowGreen); } else if (hero.StartRecallTime <= hero.AbortRecallTime && Game.Time - hero.AbortRecallTime < 4) { DrawFontTextScreen(RecFont, " ABORT", hudPos.X - 10, hudPos.Y + 18, SharpDX.Color.Yellow); } else if (Game.Time - hero.StartRecallTime < 8) { var recallPercent = (Game.Time - hero.StartRecallTime) / 8; var vec1rec = new Vector2(hudPos.X - 9, hudPos.Y + 35); var vec2rec = new Vector2(hudPos.X - 8 + 50 + 3, hudPos.Y + 35); Drawing.DrawLine(vec1rec, vec2rec, 14, System.Drawing.Color.DarkGoldenrod); vec1rec = new Vector2(hudPos.X - 8, hudPos.Y + 36); vec2rec = new Vector2(hudPos.X - 8 + 50 + 2, hudPos.Y + 36); Drawing.DrawLine(vec1rec, vec2rec, 12, System.Drawing.Color.Black); vec1rec = new Vector2(hudPos.X - 7, hudPos.Y + 37); vec2rec = new Vector2(hudPos.X - 7 + 100 * recallPercent / 2, hudPos.Y + 37); Drawing.DrawLine(vec1rec, vec2rec, 10, System.Drawing.Color.Yellow); if (blink) DrawFontTextScreen(RecFont, "RECALLING", hudPos.X - 10, hudPos.Y + 18, SharpDX.Color.White); } } var ult = hero.Hero.Spellbook.Spells[3]; var sum1 = hero.Hero.Spellbook.Spells[4]; var sum2 = hero.Hero.Spellbook.Spells[5]; if (ult != null) { var sumTime = ult.CooldownExpires - Game.Time; var spritePos = new Vector2(hudPos.X + 3, hudPos.Y - 53); var vecHudCd = new Vector2(hudPos.X + 10, hudPos.Y - 46); var sumSprite = GetSummonerIcon("r"); sumSprite.Position = spritePos; sumSprite.Scale = new Vector2(0.4f, 0.4f); if (hero.Hero.Level < 6) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); } else if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } if (sum1 != null) { var sumTime = sum1.CooldownExpires - Game.Time; var vecFlashPos = new Vector2(hudPos.X - 10, hudPos.Y - 30); var vecHudCd = new Vector2(hudPos.X - 4, hudPos.Y - 24); var sumSprite = GetSummonerIcon(sum1.Name); sumSprite.Position = vecFlashPos; sumSprite.Scale = new Vector2(0.4f, 0.4f); if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } if (sum2 != null) { var sumTime = sum2.CooldownExpires - Game.Time; var vecHealPos = new Vector2(hudPos.X + 15, hudPos.Y - 30); var vecHudCd = new Vector2(hudPos.X + 22, hudPos.Y - 24); var sumSprite = GetSummonerIcon(sum2.Name); sumSprite.Position = vecHealPos; sumSprite.Scale = new Vector2(0.4f, 0.4f); if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } hudSpace += 65; } else if (championInfo) { var hudSprite = hero.HudSprite; if (!hero.Hero.IsVisible) hudSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); else hudSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); Vector2 hudPos = new Vector2(posX + hudSpace, posY); float scale = 0.33f; hudSprite.Scale = new Vector2(scale, scale); hudSprite.Position = hudPos - new Vector2(11, -8); hudSprite.OnEndScene(); var vec1manaB = new Vector2(hudPos.X - 9, hudPos.Y + 48); var vec2manaB = new Vector2(hudPos.X - 8 + 33 + 3, hudPos.Y + 48); Drawing.DrawLine(vec1manaB, vec2manaB, 18, System.Drawing.Color.DarkGoldenrod); var vec1hpB = new Vector2(hudPos.X - 8, hudPos.Y + 49); var vec2hpB = new Vector2(hudPos.X - 8 + 33 + 2, hudPos.Y + 49); Drawing.DrawLine(vec1hpB, vec2hpB, 16, System.Drawing.Color.Black); System.Drawing.Color color = System.Drawing.Color.LimeGreen; if (hero.Hero.HealthPercent < 30) color = System.Drawing.Color.OrangeRed; else if (hero.Hero.HealthPercent < 50) color = System.Drawing.Color.DarkOrange; var vec1hp = new Vector2(hudPos.X - 7, hudPos.Y + 50); var vec2hp = new Vector2(hudPos.X - 7 + 33 * hero.Hero.HealthPercent * 0.01f, hudPos.Y + 50); Drawing.DrawLine(vec1hp, vec2hp, 7, color); var vec1mana = new Vector2(hudPos.X - 7, hudPos.Y + 59); var vec2mana = new Vector2(hudPos.X - 7 + 33 * hero.Hero.ManaPercent * 0.01f, hudPos.Y + 59); Drawing.DrawLine(vec1mana, vec2mana, 5, System.Drawing.Color.DodgerBlue); var vecHudLevel = new Vector2(hudPos.X + 15, hudPos.Y + 36); DrawFontTextScreen(HudLevel2, hero.Hero.Level.ToString(), vecHudLevel.X, vecHudLevel.Y, SharpDX.Color.White); { if (Game.Time - hero.FinishRecallTime < 4) { DrawFontTextScreen(HudLevel2, "FINISH", hudPos.X - 9, hudPos.Y + 18, SharpDX.Color.YellowGreen); } else if (hero.StartRecallTime <= hero.AbortRecallTime && Game.Time - hero.AbortRecallTime < 4) { DrawFontTextScreen(HudLevel2, "ABORT", hudPos.X - 9, hudPos.Y + 18, SharpDX.Color.Yellow); } else if (Game.Time - hero.StartRecallTime < 8) { var recallPercent = (Game.Time - hero.StartRecallTime) / 8; var vec1rec = new Vector2(hudPos.X - 9, hudPos.Y + 35); var vec2rec = new Vector2(hudPos.X - 8 + 33 + 3, hudPos.Y + 35); Drawing.DrawLine(vec1rec, vec2rec, 14, System.Drawing.Color.DarkGoldenrod); vec1rec = new Vector2(hudPos.X - 8, hudPos.Y + 36); vec2rec = new Vector2(hudPos.X - 8 + 33 + 2, hudPos.Y + 36); Drawing.DrawLine(vec1rec, vec2rec, 12, System.Drawing.Color.Black); vec1rec = new Vector2(hudPos.X - 7, hudPos.Y + 37); vec2rec = new Vector2(hudPos.X - 7 + 33 * recallPercent, hudPos.Y + 37); Drawing.DrawLine(vec1rec, vec2rec, 10, System.Drawing.Color.Yellow); if (blink) DrawFontTextScreen(HudLevel2, "RECALL", hudPos.X - 9, hudPos.Y + 18, SharpDX.Color.White); } } var ult = hero.Hero.Spellbook.Spells[3]; var sum1 = hero.Hero.Spellbook.Spells[4]; var sum2 = hero.Hero.Spellbook.Spells[5]; if (ult != null) { var sumTime = ult.CooldownExpires - Game.Time; var spritePos = new Vector2(hudPos.X - 2, hudPos.Y - 30); var vecHudCd = new Vector2(hudPos.X + 2, hudPos.Y - 24); var sumSprite = GetSummonerIcon("r"); sumSprite.Position = spritePos; sumSprite.Scale = new Vector2(0.35f, 0.35f); if (hero.Hero.Level < 6) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); } else if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } if (sum1 != null) { var sumTime = sum1.CooldownExpires - Game.Time; var vecFlashPos = new Vector2(hudPos.X - 13, hudPos.Y - 10); var vecHudCd = new Vector2(hudPos.X - 8, hudPos.Y - 5); var sumSprite = GetSummonerIcon(sum1.Name); sumSprite.Position = vecFlashPos; sumSprite.Scale = new Vector2(0.35f, 0.35f); if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } if (sum2 != null) { var sumTime = sum2.CooldownExpires - Game.Time; var vecHealPos = new Vector2(hudPos.X + 9, hudPos.Y - 10); var vecHudCd = new Vector2(hudPos.X + 15, hudPos.Y - 5); var sumSprite = GetSummonerIcon(sum2.Name); sumSprite.Position = vecHealPos; sumSprite.Scale = new Vector2(0.35f, 0.35f); if (sumTime < 0) { sumSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); sumSprite.OnEndScene(); } else { sumSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); sumSprite.OnEndScene(); DrawFontTextScreen(HudCd, MakeNiceNumber(sumTime), vecHudCd.X, vecHudCd.Y, SharpDX.Color.White); } } hudSpace += 45; } } if (ScreenRadar && !hero.Hero.Position.IsOnScreen() && (!ScreenRadarEnemy || hero.Hero.IsEnemy) && (!ScreenRadarJungler || hero.IsJungler)) { var dis = centerScreenWorld.Distance(hero.Hero.Position); if (dis < area) { float scale = 1.1f; if (dis < area) scale -= dis / area; var normalSprite = hero.NormalSprite; Vector2 dupa2 = centerScreen.Extend(Drawing.WorldToScreen(hero.Hero.Position), Drawing.Height / 2 - 120); normalSprite.Scale = new Vector2(scale, scale); if (hero.Hero.IsEnemy) { if (!hero.Hero.IsHPBarRendered) { dupa2 = centerScreen.Extend(Drawing.WorldToScreen(hero.LastWayPoint), Drawing.Height / 2 - 120); normalSprite.Color = new ColorBGRA(System.Drawing.Color.DimGray.ToArgb()); } else normalSprite.Color = new ColorBGRA(System.Drawing.Color.White.ToArgb()); } normalSprite.Scale = new Vector2(scale, scale); normalSprite.Position = dupa2; normalSprite.OnEndScene(); } } } }
public Pink_StunState(Entity _entity, FiniteStateMachine _stateMachine, string _animBoolName, D_StunState _stateData, Pink _pink) : base(_entity, _stateMachine, _animBoolName, _stateData) { pink = _pink; }
private void Timer_Tick(object sender, EventArgs e) //vsetko co sa udeje pocas jedneho ticku timeru { int pacManX, pacManY; //premenne ktore hovoria na ktorom indexe na mape map pacman stoji pacManX = pacman.PM_X / 40; //preratavanie suradnice X pacManY = pacman.PM_Y / 40; //preratavanie suradnice Y if (TestCollision() == true) { goToMenu(); //ak nastala kolizia ukonci hru return; } //skontroluj ci nezjedol mincu a vymaz ju if (map[pacManX, pacManY] == 2) { map[pacManX, pacManY] = 0; zostavajuciPocetPenazi--; userScore++; } //posun pacmana if ((pacman.PM_direction == 0) && (map[pacManX, pacManY - 1] != 1)) { pacman.PM_Y = pacman.PM_Y - 40; } if ((pacman.PM_direction == 1) && (map[pacManX - 1, pacManY] != 1)) { pacman.PM_X = pacman.PM_X - 40; } if ((pacman.PM_direction == 2) && (map[pacManX, pacManY + 1] != 1)) { pacman.PM_Y = pacman.PM_Y + 40; } if ((pacman.PM_direction == 3) && (map[pacManX + 1, pacManY] != 1)) { pacman.PM_X = pacman.PM_X + 40; } //skontroluj koliziu ducha a pacmana if (TestCollision() == true) { goToMenu(); //ak nastala kolizia ukonci hru return; } //pohyb duchov, cerveny duch chodi dokola po krajoch, zlty a ruzovy sa pohybuju nahodne //funkcia OneStep() vrati true ak sa pohli Random rnd = new Random(); //pre zlteho a ruzoveho ducha //cerveny duch if (Red.OneStep() == false) //ak sa cerveny neposunul, otoci sa dolava a posunie sa { if (Red.direction == 0) { Red.direction = 1; } else if (Red.direction == 1) { Red.direction = 2; } else if (Red.direction == 2) { Red.direction = 3; } else if (Red.direction == 3) { Red.direction = 0; } Red.OneStep(); } //zlty duch if (Yellow.OneStep() == false) //ak sa zlty neposunul, otoci sa nahodne a pokracuje { while (Yellow.OneStep() == false) //kym sa nemoze posunut, toci sa { Yellow.direction = rnd.Next(0, 4); } } else //nahodne sa moze otocit aj ked nenarazi na stenu, je tu 30 percentna sanca, inak by sa po case jeho trasa zmenila na trasu cerveneho { int zmena = rnd.Next(0, 10); if (zmena < 3) { Yellow.direction = rnd.Next(0, 4); } } //ruzovy duch, robi to iste co zlty if (Pink.OneStep() == false) //ak sa ruzovy neposunul, otoci sa nahodne a pokracuje { while (Pink.OneStep() == false) //kym sa nemoze posunut, toci sa { Pink.direction = rnd.Next(0, 4); } } else //nahodne sa moze otocit aj ked nenarazi na stenu, je tu 30 percentna sanca, inak by sa po case jeho trasa zmenila na trasu cerveneho { int zmena = rnd.Next(0, 10); if (zmena < 3) { Pink.direction = rnd.Next(0, 4); } } //skontroluj ci hrac nepresiel level if (zostavajuciPocetPenazi == 0) { if (momentalnyLevel == 3) //vyhral hru { //vypyta si username a ulozi ho do tabulky (cize do textfile Score.txt v priecinku Debug) na prve miesto timer.Stop(); string username = Microsoft.VisualBasic.Interaction.InputBox("Zadaj svoje meno:", "Gratulujem! Vyhral si hru so skore 300!", "unknown", -1, -1); UpdateScore(300, username); //300 je high score (maximalne 50+100+150 penazi moze pozbierat) goToMenu(); //vrati sa do menu } else //nastavi ho o level vyssie { timer.Stop(); MessageBox.Show("Gratulujem! Postupujes do dalsieho levelu!"); timer.Start(); momentalnyLevel++; zostavajuciPocetPenazi = momentalnyLevel * 50; RozmiestniPeniaze(zostavajuciPocetPenazi); //rozmiestni mince nahodne timer.Interval = timer.Interval - 100; //nastavi hru rychlejsie } } Invalidate(); //updatnutie celej mapy }