private static void LoadScreen(String line, BattleScreen BS)
 {
     char[] delims = { '<', '>' };
     String[] tokens = line.Substring(8).Split(delims);
     String texture = tokens[1];
     BS.Texture = texture;
 }
        public BattleScreenPlayer(String textureFile, BattleScreen owner)
            : base(textureFile, owner)
        {
            maxHP = 100;
            currentHP = 100;
            //TextureFileName = "tempface";
            NameText = "Bill";
            OwnerScreen = owner;
            IsPlayer = true;
            IsPlayerCharacter = true;
            combatActions = new CombatAction[4];
            Position = new Vector2(200, 200);
            InitializeCombatActions();
            font = OwnerScreen.ScreenManager.Font;

            actionMenu = new RectangleOverlay(new Rectangle(
               350,
               OwnerScreen.ScreenManager.GraphicsDevice.Viewport.Height - 100,
               115,
               100),
               OwnerScreen);

            combatActions[0].Selected += CombatActionAttackSelected;
            combatActions[1].Selected += CombatActionHealSelected;
        }
        public static void LoadBattle(String filename, BattleScreen BS)
        {
            StreamReader reader = new StreamReader(filename);
            String line = reader.ReadLine();

            // Regex patterns
            String player = "^player:.*";
            String enemy = "^enemy:.*";
            String laptop = "^laptop:.*";
            String screen = "^screen:.*";

            while (line != null)
            {
                // use System.Text.RegularExpressions.Regex.IsMatch(String s, String pattern)
                if (System.Text.RegularExpressions.Regex.IsMatch(line, player))
                    LoadPlayer(line, BS);
                else if (System.Text.RegularExpressions.Regex.IsMatch(line, enemy))
                    LoadEnemy(line, BS);
                else if (System.Text.RegularExpressions.Regex.IsMatch(line, laptop))
                    LoadLaptop(line, BS);
                else if (System.Text.RegularExpressions.Regex.IsMatch(line, screen))
                    LoadScreen(line, BS);
                line = reader.ReadLine();
            }
        }
        public BattleScreenPlayer(String textureFile, BattleScreen owner)
            : base(textureFile, owner)
        {
            maxHP = PlayerStats.MaximumEnergy;
            currentHP = PlayerStats.CurrentEnergy;
            strength = PlayerStats.Strength;
            defense = PlayerStats.Defense;
            NameText = "Bill";
            OwnerScreen = owner;
            IsPlayer = true;
            IsPlayerCharacter = true;
            combatActions = new CombatAction[4];
            Position = new Vector2(200, 200);
            InitializeCombatActions();
            font = OwnerScreen.ScreenManager.Font;

            actionMenu = new RectangleOverlay(new Rectangle(
               350,
               OwnerScreen.ScreenManager.GraphicsDevice.Viewport.Height - 100,
               115,
               100),
               OwnerScreen);

            combatActions[0].Selected += CombatActionAttackSelected;
            combatActions[1].Selected += CombatActionHealSelected;
            drawBox = new Rectangle(0, 0, 40, 40);
        }
 private static void LoadPlayer(String line, BattleScreen BS)
 {
     char[] delims = { '<', '>' };
     String[] tokens = line.Substring(8).Split(delims);
     String texture = tokens[1];
     BattleScreenPlayer player = new BattleScreenPlayer(texture, BS);
     BS.AddBattleMember(player);
 }
예제 #6
0
        // Huehuehahuehauueha.
        public BattleUI(BattleScreen owner)
        {
            battleScreen = owner;

            mainHUD = new RectangleOverlay(new Rectangle(
                0,
                battleScreen.ScreenManager.GraphicsDevice.Viewport.Height - 100,
                battleScreen.ScreenManager.GraphicsDevice.Viewport.Width,
                100),
                battleScreen);
        }
 public BattleScreenEnemy(String textureFile, BattleScreen owner)
     : base(textureFile, owner)
 {
     maxHP = 50;
     currentHP = 50;
     NameText = "Enemy";
     OwnerScreen = owner;
     IsPlayer = false;
     IsPlayerCharacter = false;
     combatActions = new CombatAction[2];
     Position = new Vector2(400, 200);
     InitializeCombatActions();
 }
 private static void LoadLaptop(String line, BattleScreen BS)
 {
     char[] delims = { '<', '>' };
     String[] tokens = line.Substring(8).Split(delims);
     String texture = tokens[1];
     int str = Int32.Parse(tokens[3]);
     int def = Int32.Parse(tokens[5]);
     int maxHP = Int32.Parse(tokens[7]);
     BattleScreenAIPartyMember laptop = new BattleScreenAIPartyMember(texture, BS);
     laptop.Strength = str;
     laptop.Defense = def;
     laptop.MaxHP = maxHP;
     BS.AddBattleMember(laptop);
 }
 private static void LoadEnemy(String line, BattleScreen BS)
 {
     char[] delims = { '<', '>' };
     String[] tokens = line.Substring(7).Split(delims);
     String texture = tokens[1];
     int str = Int32.Parse(tokens[3]);
     int def = Int32.Parse(tokens[5]);
     int maxHP = Int32.Parse(tokens[7]);
     BattleScreenEnemy enemy = new BattleScreenEnemy(texture, BS);
     enemy.Strength = str;
     enemy.Defense = def;
     enemy.MaxHP = maxHP;
     BS.AddBattleMember(enemy);
 }
 private static void LoadPlayer(String line, BattleScreen BS)
 {
     char[] delims = { '<', '>' };
     String[] tokens = line.Substring(8).Split(delims);
     String texture = tokens[1];
     int str = Int32.Parse(tokens[3]);
     int def = Int32.Parse(tokens[5]);
     int maxHP = Int32.Parse(tokens[7]);
     BattleScreenPlayer player = new BattleScreenPlayer(texture, BS);
     player.Strength = str;
     player.Defense = def;
     player.MaxHP = maxHP;
     BS.AddBattleMember(player);
 }
 public BattleScreenAIPartyMember(string textureFileName, BattleScreen ownerScreen)
     : base(textureFileName, ownerScreen)
 {
     maxHP = 50;
     currentHP = 50;
     NameText = "Lappy";
     OwnerScreen = owner;
     IsPlayer = false;
     IsPlayerCharacter = true;
     combatActions = new CombatAction[3];
     Position = new Vector2(300, 200);
     InitializeCombatActions();
     targets = new List<int>();
     gen = new Random(DateTime.Now.Millisecond);
 }
 public BattleScreenAIPartyMember(string textureFileName, BattleScreen ownerScreen)
     : base(textureFileName, ownerScreen)
 {
 }
예제 #13
0
 public BattleScreenMember(string textureFileName, BattleScreen ownerScreen)
     : base(textureFileName)
 {
     owner = ownerScreen;
 }