Inheritance: GameState
 public Creature(SwordeningGame game, InGame gameState, Vector3 position)
     : base(game)
 {
     _game = game;
     _gameState = gameState;
     Position = position;
 }
        /// <summary>
        /// Creates a new empty grid.
        /// </summary>
        public MapGrid(SwordeningGame game,InGame gameState)
        {
            _game = game;
            _gameState = gameState;

            _tiles = new SerializableDictionary<string, MapTile>();
        }
 /// <summary>
 /// Default contructor.
 /// </summary>
 /// <param name="game">the XNA game</param>
 /// <param name="gameState">InGame gamestate</param>
 /// <param name="textures">ground texture</param>
 public MapTile(SwordeningGame game, InGame gameState, int x, int z, int[,] grid)
 {
     tileX = x;
     tileZ = z;
     Grid = grid;
     Initialize(game, gameState);
 }
 public BaseAbility(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game)
 {
     _game = game;
     _gameState = gameState;
     Position = position;
 }
 public WeakSkeleton(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     //modifiers inherited from Creature:
     name = "Homicidal skeleton";
     movementSpeedFactor = 0.85f;
     attackSpeedFactor = 0.7;
     CurrentHitPoints = 3;
     MaxHitPoints = 3;
     MaxMana = 0;
     CurrentMana = 0;
     camera = camera;
     graphics = graphics;
     Rotation = Quaternion.Identity;
     exp = 100;
     //modifiers inherited from Monster:
     loot = lootRandomiser.Next(1, 4);
     basedmg = 1;
 }
Beispiel #6
0
        public Wizard(SwordeningGame game, InGame gameState, Vector3 position)
            : base(game,gameState,position)
        {
            //modifiers inherited from Creature:

            name = "Saruman of Many Colors";
            Rotation = Quaternion.Identity;
            previousFireTime = TimeSpan.Zero;
            movementSpeedFactor = 1;
            attackSpeedFactor = 1;
            CurrentHitPoints = 10;
            MaxHitPoints = 10;
            MaxMana = 30;
            CurrentMana = 30;
            ManaRegenPerTick = 1;
            exp = 0;
            tnl = 1000;
            level = 1;
            //modifiers inherited from Hero
            gold = 0; //Our hero is the 99%. :<
        }
 public Utility(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
 public MissileSpell(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
        /// <summary>
        /// Separated from constructor for deserialization.
        /// </summary>
        /// <param name="game">the XNA game</param>
        /// <param name="gameState">InGame gamestate</param>
        /// <param name="textures">ground texture</param>
        public void Initialize(SwordeningGame game, InGame gameState)
        {
            _game = game;
            _graphics = game.Graphics;
            _gameState = gameState;
            camera = gameState.camera;
            effects = game.Services.GetService(typeof(Effect)) as Effect;
            _tileVertexBufferDict = new Dictionary<TileType,VertexBuffer>();
            _textures = new Dictionary<TileType,Texture2D>();

            SetUpTextures();
            SetUpVertices();
        }
Beispiel #10
0
 public Attack(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
        /// <summary>
        /// Creates a MapTile.
        /// </summary>
        /// <returns></returns>
        public static MapTile CreateMapTile(SwordeningGame game,InGame gameState, int x, int z)
        {
            int[,] grid = new[,]
            {
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0},
                 {0,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,1,1,0},
                 {1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0},
                 {0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
                 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0},
                 {0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0},
                 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
                 {1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0},
                 {0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
                 {0,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0},
                 {1,1,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
            };

            if (RANDOM_TILES)
            {
                var rand = new Random();

                for (int i = 0; i < grid.GetLength(0); i++)
                {
                    for (int j = 0; j < grid.GetLength(1); j++)
                    {
                        if (rand.Next() % 4 == 0)
                            grid[i,j] = 1;
                        else
                            grid[i,j] = 0;
                    }
                }
            }

            MapTile newTile = new MapTile(game,gameState,x,z,grid);

            /*
            int objectAmount = 5 + rand.Next() % 3;
            var takenSpots = new bool[objectAmount, objectAmount];
            int differenceX = MapTile.Width / (objectAmount + 2);
            int differenceY = MapTile.Length / (objectAmount + 2);

            for (int i = 0; i < objectAmount; i++)
            {
                int x = rand.Next() % objectAmount;
                int y = rand.Next() % objectAmount;
                while (!takenSpots[x,y])
                {
                    x = rand.Next() % objectAmount;
                    y = rand.Next() % objectAmount;
                }
                takenSpots[x,y] = true;
                x++;
                y++;
                x *= differenceX;
                y *= differenceY;

                var size = (StationaryObject.Size)(rand.Next() % 3 + 1);

                StationaryObject stationary = new StationaryRockSmall(game);
                stationary.SetPosition(x,y);
                stationary.Theme = theme;
                stationary.Name = StationaryObject.NewStationaryID();

                newTile.AddStationary(stationary);
            }*/

            return newTile;
        }
 public Fireball(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     ManaCost = 2;
     MovementSpeed = 4.0f;
 }
 /// <summary>
 /// SaveGame constructor.
 /// </summary>
 /// <param name="inGame">InGame ref to get data to save</param>
 public SaveGame(InGame inGame)
 {
     _inGame = inGame;
 }
Beispiel #14
0
 public Monster(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     lootRandomiser = new Random();
 }