Пример #1
0
 /// <summary>
 /// Constructor with provided name and stats
 /// </summary>
 /// <param name="name">Name of the player</param>
 /// <param name="stats">Stats of the player</param>
 public PlayerClass(string name, CharacterStats stats)
     : base(name, stats)
 {
 }
Пример #2
0
 /// <summary>
 /// Constructor with provided name and stats
 /// </summary>
 /// <param name="name">Name of the player</param>
 /// <param name="stats">Stats of the player</param>
 /// <param name="playerID">ID used in the party position</param>
 /// <param name="sprite">Textures used to represent the player</param>
 /// <param name="specialID">Special ID for specific players to determine skills and animations</param>
 public PlayerClass(string name, CharacterStats stats, AnimatingSprite sprite, int specialID)
     : base(name, stats, sprite)
 {
     this.specialID = specialID;
 }
Пример #3
0
 /// <summary>
 /// Constructor with provided name, stats, ID, and sprite
 /// </summary>
 /// <param name="name">Name of the player</param>
 /// <param name="stats">Stats of the player</param>
 /// <param name="playerID">ID used in the party position</param>
 public EnemyClass(string name, CharacterStats stats, AnimatingSprite sprite)
     : base(name, stats, sprite)
 {
 }
Пример #4
0
 /// <summary>
 /// Constructor with provided name and stats
 /// </summary>
 /// <param name="name">Name of the player</param>
 /// <param name="stats">Stats of the player</param>
 public EnemyClass(string name, CharacterStats stats)
     : base(name, stats)
 {
 }
Пример #5
0
 /// <summary>
 /// Constructor that loads the specific name, character stats, and ID in party
 /// </summary>
 /// <param name="nameArg">Name of the character</param>
 /// <param name="stats">Starting stats for the character</param>
 /// <param name="playerID">ID used for position in party</param>
 /// <param name="sprite">Textures that represent the character</param>
 public CombatCharacter(string nameArg, CharacterStats stats, AnimatingSprite sprite)
     : base(nameArg, sprite)
 {
     this.stats = stats;
 }
Пример #6
0
 /// <summary>
 /// Constructor that loads the specific name, character stats.
 /// </summary>
 /// <param name="nameArg">Name of the character</param>
 /// <param name="stats">Starting stats for the character</param>
 public CombatCharacter(string nameArg, CharacterStats stats)
     : base(nameArg)
 {
     this.stats = stats;
 }
Пример #7
0
        /// <summary>
        /// Load graphics content for the screen (in this case, the battle engine and all necessary classes).
        /// </summary>
        public override void LoadContent()
        {
            // Create the menu screen
            menuScreen = new BattleMenuScreen(new Vector2(10, 515));
            menuScreen.ScreenManager = this.ScreenManager;

            // Load the textures
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            battleDialog = content.Load<Texture2D>("battledialog");
            battleMenu = content.Load<Texture2D>("battlemenuback");
            battleTimer = content.Load<Texture2D>("battletime");
            redBox = content.Load<Texture2D>("redbox");
            blueBox = content.Load<Texture2D>("bluebox");

            // Load the character sprites
            AnimatingSprite playerSprite = new AnimatingSprite(redBox);
            AnimatingSprite enemySprite = new AnimatingSprite(blueBox);

            // DEBUG:  Create a dummy party
            List<CombatCharacter> testList = new List<CombatCharacter>(ChronoConstants.cMaxPartyMembers);
            CharacterStats testStat = new CharacterStats(1, 10, 10, 10, 10, 10, 10, 10);
            testStat.Speed = 50;
            PlayerClass testPlayer = new PlayerClass("Dummy", testStat, playerSprite, 0);
            testStat.Speed = 25;
            PlayerClass testPlayer2 = new PlayerClass("Dummy2", testStat, playerSprite, 0);
            testPlayer.HP = 25;
            testPlayer2.HP = 25;
            testList.Add(testPlayer);
            testList.Add(testPlayer2);
            PartyClass testParty = new PartyClass(testList);

            EnemyClass testEnemy = new EnemyClass("Enemy1", testStat, enemySprite);
            EnemyClass testEnemy2 = new EnemyClass("Enemy2", testStat, enemySprite);
            List<CombatCharacter> enemyList = new List<CombatCharacter>(ChronoConstants.cMaxPartyMembers);
            enemyList.Add(testEnemy);
            enemyList.Add(testEnemy2);
            PartyClass enemyParty = new PartyClass(enemyList);

            testParty.InBattle = true;
            enemyParty.InBattle = true;

            // Link events from the battle engine
            testParty.Ready += ReadyHandler;
            //enemyPlayer.Ready += EnemyReadyHandler;
            menuScreen.AttackSelected += AttackHandler;
            BattleEngine.Defeat += DefeatHandler;
            BattleEngine.Victory += VictoryHandler;

            // Initialize the engine
            BattleEngine.StartNewBattle(testParty, enemyParty);

            // Create the battle director
            battleDirector = new BattleDirector(ScreenManager.Arrow);
        }