예제 #1
0
        Inventory inventory; //character inventory - incudes all character items

        #endregion Fields

        #region Constructors

        public Character(StatSheet stats, Profession profession, Vector2 startPosition, bool ally = false)
        {
            this.stats = stats;
            this.profession = profession;
            this.position = startPosition;
            this.ally = ally;
            this.selected = false;
            this.state = charState.still;
            this.characterSpriteOffsetX = (int)Profession.getOffset(profession).X;
            int characterSpriteOffsetY = (int)Profession.getOffset(profession).Y;
            this.pixelPosition = this.getPixelPositionByTilePosition(startPosition);
        }
예제 #2
0
        //create charNumber enemies for testing (AI team)
        public static List<Character> createTestEnemies(int charNumber, Map map)
        {
            List<Character> enemies = new List<Character>();
            Random rand = new Random();
            Character currentChar;
            StatSheet currentCharStatSheet;
            Profession currentCharProf;
            Vector2 currentCharPos;

            for (int i = 0; i < charNumber; i++)
            {
                int currentCharPosX = rand.Next(16, 20);
                int currentCharPosY = rand.Next(16, 20);

                while (map.tiles[currentCharPosX, currentCharPosY].isOccupied == true)
                {
                    currentCharPosX = rand.Next(16, 20);
                    currentCharPosY = rand.Next(16, 20);
                }

                currentCharPos = new Vector2(currentCharPosX, currentCharPosY);
                currentCharStatSheet = new StatSheet(rand.Next(24, 40), rand.Next(3, 4), rand.Next(50, 70), Ability.createTestCharacterAbiities());
                currentCharProf = new Profession("test");

                currentChar = new Character(currentCharStatSheet, currentCharProf, currentCharPos);
                enemies.Add(currentChar);
                assignCharacterToTile(currentChar, map);
            }

            return enemies;
        }