public SpawnUtilityEvent(VTankBot bot, int utilityId, VTankObject.Utility utility, VTankObject.Point pos)
     : base(bot)
 {
     ID = utilityId;
     this.utility = utility;
     position = pos;
 }
 public FlagDroppedEvent(GamePlayState _game, int droppedId, VTankObject.Point where, GameSession.Alliance flagColor)
     : base(_game)
 {
     this.droppedId = droppedId;
     this.where = where;
     this.flagColor = flagColor;
 }
 public TurretSpinningEvent(VTankBot _game, int id, double angle, VTankObject.Direction direction)
     : base(_game)
 {
     this.id = id;
     this.angle = angle;
     this.direction = direction;
 }
 public PlayerRotateEvent(GamePlayState _game, int id, double angle, VTankObject.Direction direction)
     : base(_game)
 {
     this.id = id;
     this.angle = angle;
     this.direction = direction;
 }
 public AddUtilityEvent(GamePlayState _game, 
     int _utilityID, VTankObject.Utility _utility, Vector3 _position)
     : base(_game)
 {
     utilityID = _utilityID;
     utility = _utility;
     position = _position;
 }
 public SpawnEnvironmentEffectEvent(GamePlayState _game, int id, int typeId, VTankObject.Point location, int ownerId)
     : base(_game)
 {
     this.id = id;
     this.typeId = typeId;
     this.location = location;
     this.ownerId = ownerId;
 }
 public AddUtilityEvent(VTankBot _game, 
     int _utilityID, VTankObject.Utility _utility, VTankObject.Point _position)
     : base(_game)
 {
     utilityID = _utilityID;
     utility = _utility;
     position = _position;
 }
 public PlayerMoveEvent(VTankBot _game, int id, VTankObject.Point point,
     VTankObject.Direction direction)
     : base(_game)
 {
     this.id = id;
     this.direction = direction;
     this.point = point;
 }
 public ApplyUtilityEvent(VTankBot _game, int _utilityID, 
     VTankObject.Utility _utility, int _playerID)
     : base(_game)
 {
     utilityID = _utilityID;
     utility = _utility;
     playerID = _playerID;
 }
 public SpawnEnvironmentEffectEvent(VTankBot _game, int id, int typeId, VTankObject.Point location, int ownerId)
     : base(_game)
 {
     this.id = id;
     this.typeId = typeId;
     this.location = location;
     this.ownerId = ownerId;
     envEffect = WeaponLoader.GetEnvironmentProperty(typeId);
 }
Example #11
0
 public Projectile(int ID, int projectileTypeId, 
     VTankObject.Point position, double angle)
 {
     this.ID = ID;
     ProjectileTypeID = projectileTypeId;
     this.Data = WeaponLoader.GetProjectile(ProjectileTypeID);
     StartingPosition = position;
     Angle = angle;
 }
 public CreateProjectileEvent(GamePlayState _game, int projectileTypeId, 
                              VTankObject.Point point, int ownerId,
                              int projectileId)
     : base(_game)
 {
     this.projectileTypeId = projectileTypeId;
     this.point = point;
     this.ownerId = ownerId;
     this.projectileId = projectileId;
 }
 public CreateProjectileEvent(VTankBot _game, int projectileTypeId, 
                              VTankObject.Point point, int ownerId,
                              int projectileId)
     : base(_game)
 {
     this.type = WeaponLoader.GetProjectile(projectileTypeId);
     this.point = point;
     this.ownerId = ownerId;
     this.projectileId = projectileId;
 }
Example #14
0
        /// <summary>
        /// Constructor: Will automatically select the tank that is passed in if it exists.
        /// </summary>
        public TankListState(VTankObject.TankAttributes _selectedTank)
        {
            ServiceManager.Game.Renderer.ActiveScene.ClearAll();
            form = new TankList(ServiceManager.Game.Manager);
            form.CreateButton.Click += new TomShane.Neoforce.Controls.EventHandler(CreateButton_Click);
            form.EditButton.Click += new TomShane.Neoforce.Controls.EventHandler(EditButton_Click);
            form.DeleteButton.Click += new TomShane.Neoforce.Controls.EventHandler(DeleteButton_Click);
            form.PlayButton.Click += new TomShane.Neoforce.Controls.EventHandler(PlayButton_Click);
            form.BackButton.Click += new TomShane.Neoforce.Controls.EventHandler(BackButton_Click);
            form.SelectionChanged += new TomShane.Neoforce.Controls.EventHandler(SelectionChanged);

            form.PlayButton.Enabled = false;
            form.EditButton.Enabled = false;
            form.DeleteButton.Enabled = false;

            selectedTank = _selectedTank;
            RefreshTankList();

            ServiceManager.Game.Renderer.ActiveScene.SwitchCamera("Tank Display View");
            GraphicOptions.graphics.GraphicsDevice.RenderState.DepthBufferEnable = true;
            Renderer.GraphicOptions.BackgroundColor = Color.Black;
        }
Example #15
0
        private GameModeHandler CreateGameHandler(VTankObject.GameMode mode)
        {
            if (mode == VTankObject.GameMode.CAPTURETHEBASE)
                return new CaptureTheBaseMode(Game.CurrentMap);

            return null;
        }
Example #16
0
 public void InvokeSpawnUtility(int utilityID, VTankObject.Utility util, VTankObject.Point pos)
 {
 }
Example #17
0
 public void InvokeResetPosition(VTankObject.Point position)
 {
     Game.LocalPlayer.Position = position;
     OnPositionReset();
 }
Example #18
0
        public void InvokePlayerHasRespawned(int playerID, VTankObject.Point position)
        {
            Player player = Game.GetPlayerByID(playerID);
            if (player != null)
            {
                player.Respawn(position);

                PlayerRespawnEventArgs args = new PlayerRespawnEventArgs(player);
                PlayerHasRespawned(args);
                args.Dispose();
            }
        }
Example #19
0
        public void InvokeOnProjectileFired(int projectileID, int ownerID,
            int projectileTypeId, VTankObject.Point projectilePosition)
        {
            Player owner = Game.GetPlayerByID(ownerID);
            if (owner != null)
            {
                double angle = Math.Atan2(owner.Position.y - projectilePosition.y,
                    owner.Position.x - projectilePosition.x);

                Projectile projectile = new Projectile(
                    projectileID, owner.Weapon.ProjectileID, projectilePosition, angle);
                ProjectileFiredEventArgs args = new ProjectileFiredEventArgs(
                    owner, projectile);

                Game.AddProjectile(projectile);

                OnProjectileFired(args);

                args.Dispose();
            }
        }
Example #20
0
        /// <summary>
        /// Ask the game tracker to move a player to a certain position.
        /// </summary>
        /// <param name="player">Player to move.</param>
        /// <param name="x">X-position to move to.</param>
        /// <param name="y">Y-position to move to.</param>
        public void StartMoving(VTankObject.Direction direction)
        {
            MetaPlayer movingPlayer = players[LocalPlayer.ID];

            SetPlayerMovement(LocalPlayer, LocalPlayer.Position, direction);
            bot.GameServer.Move(movingPlayer.Player.Position.x, movingPlayer.Player.Position.y,
                direction);
        }
 public ResetPositionEvent(GamePlayState _game, VTankObject.Point position)
     : base(_game)
 {
     this.position = position;
 }
Example #22
0
        public override void ice_response(VTankObject.Map ret__)
        {
            Map = ret__;

            if (callback != null)
            {
                callback(new Result<VTankObject.Map>(ret__));
            }
        }
Example #23
0
        /// <summary>
        /// Start moving forward.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="pos"></param>
        private void StartMovingForward(MetaPlayer player, VTankObject.Point pos)
        {
            player.Player.MovementDirection = VTankObject.Direction.FORWARD;
            player.Player.Position = pos;

            bot.GameServer.Move(pos.x, pos.y, VTankObject.Direction.FORWARD);
        }
Example #24
0
        /// <summary>
        /// Perform a movement on the player if that player wants to move.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="deltaTimeSeconds"></param>
        private bool CheckCollision(VTankObject.Point position)
        {
            return false;
            /*const float TANK_RADIUS = 25f;

            int tileX = (int)Math.Round(position.x / Tile.TILE_SIZE_IN_PIXELS);
            int tileY = (int)Math.Round((-position.y) / Tile.TILE_SIZE_IN_PIXELS);

            Circle circle = new Circle(position.x, position.y, TANK_RADIUS);

            for (int y = tileY - 2; y < tileY + 2 && y < CurrentMap.Height; ++y)
            {
                if (y < 0) continue;
                for (int x = tileX - 2; x < tileX + 2 && x < CurrentMap.Width; ++x)
                {
                    if (x < 0) continue;

                    Tile currentTile = CurrentMap.GetTile(x, y);
                    Rectangle tileRect = new Rectangle(x * Tile.TILE_SIZE_IN_PIXELS,
                        -(y * Tile.TILE_SIZE_IN_PIXELS + 64),
                        Tile.TILE_SIZE_IN_PIXELS, Tile.TILE_SIZE_IN_PIXELS);
                    if (!currentTile.IsPassable && circle.CollidesWith(tileRect))
                    {
                        return true;
                    }
                }
            }

            return false;*/
        }
Example #25
0
 public override void ice_response(VTankObject.TankAttributes[] ret__)
 {
     if (callback != null)
     {
         callback(new Result<VTankObject.TankAttributes[]>(ret__));
     }
 }
Example #26
0
 public void InvokeApplyUtility(int utilityId, VTankObject.Utility utility, int playerId)
 {
 }
 public PlayerRespawnedEvent(GamePlayState _game, int id, VTankObject.Point where)
     : base(_game)
 {
     this.id = id;
     this.where = where;
 }
Example #28
0
 public void InvokeOnPlayerMove(int playerID, VTankObject.Point position,
     VTankObject.Direction direction)
 {
     Player player = Game.GetPlayerByID(playerID);
     if (player != null)
     {
         Game.SetPlayerMovement(player, position, direction);
     }
 }
Example #29
0
        /// <summary>
        /// Stop moving forward.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="pos"></param>
        private void StopMovingForward(MetaPlayer player, VTankObject.Point pos)
        {
            player.Player.Position = pos;

            //if (player.Player.MovementDirection != VTankObject.Direction.NONE)
            //{
                player.Player.MovementDirection = VTankObject.Direction.NONE;

                bot.GameServer.Move(pos.x, pos.y, VTankObject.Direction.NONE);
            //}
        }
Example #30
0
 public void InvokeOnPlayerRotate(int playerID, double angle,
     VTankObject.Direction direction)
 {
     Player player = Game.GetPlayerByID(playerID);
     if (player != null)
     {
         Game.SetPlayerRotation(player, angle, direction);
     }
 }