public void OnHitRobotBehavior(HitRobotEvent evnt) { if (evnt.Bearing > -10 && evnt.Bearing < 10) { Robot.Fire(3); } if (evnt.IsMyFault) { Robot.TurnRight(10); } }
/// <summary> /// onHitRobot: Aim at it. Fire Hard! /// </summary> public override void OnHitRobot(HitRobotEvent e) { double turnGunAmt = Utils.NormalRelativeAngleDegrees(e.Bearing + Heading - GunHeading); TurnGunRight(turnGunAmt); Fire(3); }
public void OnHitRobotBehavior(HitRobotEvent evnt) { if (Robot.GunHeat == 0) { Robot.SafeFire(3, evnt.Name); } Robot.Back(100); if (Robot.GunHeat == 0) { Robot.SafeFire(3, evnt.Name); } Robot.Scan(); }
/// ///<summary> /// onHitRobot: If it's our fault, we'll stop turning and moving, /// so we need to turn again to keep spinning. ///</summary> public override void OnHitRobot(HitRobotEvent e) { if (e.Bearing > -10 && e.Bearing < 10) { Fire(3); } if (e.IsMyFault) { TurnRight(10); } }
/// ///<summary> /// onHitRobot: If it's our fault, we'll stop turning and moving, /// so we need to turn again to keep spinning. ///</summary> public override void OnHitRobot(HitRobotEvent e) { if (e.Bearing > -10 && e.Bearing < 10) { Fire(3); } if (e.IsMyFault) { //VelocityRate = (-1 * VelocityRate); //SetTurnRight(10); } }
/// <summary> /// onHitRobot: Move away a bit. /// </summary> public override void OnHitRobot(HitRobotEvent e) { // If he's in front of us, set back up a bit. if (e.Bearing > -90 && e.Bearing < 90) { Back(100); } // else he's in back of us, so set ahead a bit. else { Ahead(100); } }
public override void OnHitRobot(HitRobotEvent e) { if (e.Bearing > -10 && e.Bearing < 10) { Fire(Rules.MAX_BULLET_POWER); } if (e.IsMyFault) { MaxVelocity = 8; TurnRight(100); WaitFor(new TurnCompleteCondition(this)); SetAhead(100); } if (e.Energy < 50 && Energy > 50) { mode = "vuelticas"; } }
/// <summary> /// onHitRobot: Turn to face robot, fire hard, and ram him again! /// </summary> public override void OnHitRobot(HitRobotEvent e) { if (e.Bearing >= 0) { turnDirection = 1; } else { turnDirection = -1; } TurnRight(e.Bearing); // Determine a shot that won't kill the robot... // We want to ram him instead for bonus points if (e.Energy > 16) { Fire(3); } else if (e.Energy > 10) { Fire(2); } else if (e.Energy > 4) { Fire(1); } else if (e.Energy > 2) { Fire(.5); } else if (e.Energy > .4) { Fire(.1); } Ahead(40); // Ram him again! }
/// <summary> /// Handle robot hit event. /// Use anti-gravity movement to move away from the hit robot /// </summary> /// <param name="evnt"></param> /// <inheritdoc/> public override void OnHitRobot(HitRobotEvent evnt) { this.currentMovementMode = MovementMode.AntiGravity; this.collisionTime = evnt.Time; }
public void OnHitRobotBehavior(HitRobotEvent evnt) { //throw new NotImplementedException(); }
/// <summary> /// onHitRobot: Back up! /// </summary> public override void OnHitRobot(HitRobotEvent e) { // If we're moving the other robot, reverse! if (e.IsMyFault) { reverseDirection(); } }
public void OnHitRobot(HitRobotEvent evnt) { count(evnt); }
public override void OnHitRobot(HitRobotEvent evnt) { RobotBehavior.OnHitRobotBehavior(evnt); }
public override void OnHitRobot(HitRobotEvent evnt) { publisher.publish(evnt); }
public override void OnHitRobot(HitRobotEvent evnt) { RunProgram(TableRexPrograms.onHitRobot); }
public override void OnHitRobot(HitRobotEvent evnt) { hitBullet = 0; }
public void OnHitRobot(HitRobotEvent evnt) { double angle = robot.peer.GetBodyHeading() + evnt.BearingRadians; robot.hitRobotAngle = (int) (Utils.ToDegrees(Utils.NormalAbsoluteAngle(angle)) + 0.5); robot.hitRobotBearing = (int) (evnt.Bearing + 0.5); robot.OnHitRobot(); }
public override void OnHitRobot(HitRobotEvent evnt) { if (AllowChange()) { SwitchDirection(); SwitchTurningDirection(); SwitchTurning(); } }
public void OnHitRobotBehavior(HitRobotEvent evnt) { }
/// <inheritdoc /> public virtual void OnHitRobot(HitRobotEvent evnt) { }
public override void OnHitRobot(HitRobotEvent evnt) { if (!(evnt.IsMyFault)) { ReverseTurn *= -1; SetAhead(rnd.Next(100, 200) * ReverseTurn); Execute(); return; } // Calculate exact location of the robot double absoluteBearing = Heading + evnt.Bearing; double bearingFromGun = Robocode.Util.Utils.NormalRelativeAngleDegrees(absoluteBearing - GunHeading); SetTurnGunRight(Robocode.Util.Utils.NormalRelativeAngleDegrees(bearingFromGun)); Execute(); }
/// <summary> /// onHitRobot: Set him as our new target /// </summary> public override void OnHitRobot(HitRobotEvent e) { // Only print if he's not already our target. if (trackName != null && trackName != e.Name) { Out.WriteLine("Tracking " + e.Name + " due to collision"); } // Set the target trackName = e.Name; // Back up a bit. // Note: We won't get scan events while we're doing this! // An AdvancedRobot might use setBack(); Execute(); gunTurnAmt = Utils.NormalRelativeAngleDegrees(e.Bearing + (Heading - RadarHeading)); TurnGunRight(gunTurnAmt); Fire(3); Back(50); }
/// <summary> /// Handle crashing into another robot. Record the enemy robot's energy state (<c>AdvancedRobot</c>s take /// damage from collisions) and attempt to move away from the enemy robot. /// </summary> /// <param name="evnt">The <c>HitRobotEvent</c> args containing data about the collision.</param> public override void OnHitRobot(HitRobotEvent evnt) { _enemyPreviousEnergy = evnt.Energy; _treads.ReactToRobotImpact(evnt); }