diff --git a/src/Blaze-Brigade/Blaze_Brigade/Archer.cs b/src/Blaze-Brigade/Blaze_Brigade/Archer.cs index 351db93a3942b8b3402e75618d9fc26180c2b2cb..610211f6dc2151304b6da9bca4cb7a4eaeb2cf91 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Archer.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/Archer.cs @@ -391,7 +391,7 @@ namespace Model buttons[4].setPixelCoordinates(330, 120); for (int i = 5; i < 9; i++) { - buttons[i].setPixelCoordinates((int)(pixelCoordinates.X + 150), (int)(pixelCoordinates.Y + (i - 1 * 32))); + buttons[i].setPixelCoordinates((int)(pixelCoordinates.X + 160), (int)(pixelCoordinates.Y + (i * 32 - 96))); } } @@ -505,4 +505,4 @@ namespace Model #endregion } } -} +} \ No newline at end of file diff --git a/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj b/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj index bb5a045d3f1b59b57104f3be0f9655dccdf418eb..a0f5c32dd6c77d7704f7b10c17c5f94576d5e24d 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj +++ b/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj @@ -69,7 +69,10 @@ </ItemGroup> <ItemGroup> <Compile Include="Archer.cs" /> - <Compile Include="BronzeBow.cs" /> + <Compile Include="FireBlast.cs" /> + <Compile Include="IronSword.cs" /> + <Compile Include="LongBow.cs" /> + <Compile Include="ShortBow.cs" /> <Compile Include="BronzeSword.cs" /> <Compile Include="Camera.cs" /> <Compile Include="DamageCalculations.cs" /> diff --git a/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj.Debug.cachefile b/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj.Debug.cachefile index 022bec475583b334434756fafc651a6335616706..2b05cc6736239656867eb1cb08474a3f661a85d6 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj.Debug.cachefile +++ b/src/Blaze-Brigade/Blaze_Brigade/Blaze_Brigade.csproj.Debug.cachefile @@ -6,31 +6,31 @@ Content\attack.xnb Content\items.xnb Content\move.xnb Content\wait.xnb +Content\PixelFont.xnb +Content\warrior_stats.xnb +Content\PixelFontLarge.xnb Content\warrior.xnb Content\instructions1.xnb Content\instructions2.xnb Content\instructions3.xnb +Content\mage_stats.xnb +Content\archer_stats.xnb Content\archer.xnb Content\mage.xnb Content\2archer.xnb Content\2archer_attack.xnb +Content\2archer_stats.xnb Content\2mage.xnb Content\2mage_attack.xnb +Content\2mage_stats.xnb Content\2warrior.xnb Content\2warrior_attack.xnb +Content\2warrior_stats.xnb Content\archer_attack.xnb Content\mage_attack.xnb Content\warrior_attack.xnb Content\attack_confirm.xnb Content\confirm_attack.xnb -Content\archer_stats.xnb -Content\2archer_stats.xnb -Content\2mage_stats.xnb -Content\2warrior_stats.xnb -Content\mage_stats.xnb -Content\warrior_stats.xnb -Content\exit_game.xnb -Content\PixelFont.xnb -Content\PixelFontLarge.xnb Content\PixelFontLargest.xnb +Content\exit_game.xnb Content\Inventory_Button.xnb diff --git a/src/Blaze-Brigade/Blaze_Brigade/BronzeSword.cs b/src/Blaze-Brigade/Blaze_Brigade/BronzeSword.cs index fd81671a569befb1ddd83ec954288734c2049651..ddbfe478a6b38731acf9ea3c6d8ec619b27945bb 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/BronzeSword.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/BronzeSword.cs @@ -14,8 +14,6 @@ namespace Model */ class BronzeSword : Weapon { - private int minRange; - private int maxRange; public int modStr { get; } public int modInt { get; } public int modSkill { get; } @@ -27,7 +25,7 @@ namespace Model */ public BronzeSword() { - modStr = 50; + modStr = 5; modSkill = 5; modInt = 0; range = new int[2] { 1, 1 }; diff --git a/src/Blaze-Brigade/Blaze_Brigade/DamageCalculations.cs b/src/Blaze-Brigade/Blaze_Brigade/DamageCalculations.cs index c8510bbdf31803cdc23e3659e7b42d6eb0b34604..4f930ce030e459ff846dc2b811edd08d7716f427 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/DamageCalculations.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/DamageCalculations.cs @@ -19,7 +19,12 @@ namespace Model public static int getDamageDealt(Unit attacker, Unit defender, bool physOrMagic){ if(physOrMagic== false) { - return attacker.Str - defender.Def; //return physical damage dealt + int damage = attacker.Str - defender.Def; + if (damage < 0)// to prevent attacks from healing if defense is higher then attack + { + damage = 0; + } + return damage; //return physical damage dealt } else { @@ -34,7 +39,15 @@ namespace Model */ public static int getHitRate(Unit attacker, Unit defender) { - return (int) Math.Round( ( ( (attacker.Skill / 10.0) - (defender.Skill / 10.0) + 1.0) * 0.8)*100.0); + int hitRate = (int)Math.Round((((attacker.Skill / 10.0) - (defender.Skill / 10.0) + 1.0) * 0.8) * 100.0); + if (hitRate > 100) //to prevent hit rate over 100% + { + hitRate = 100; + }else if (hitRate < 0) //to prevent hit rate under 0% + { + hitRate = 0; + } + return hitRate; } /** @@ -44,7 +57,17 @@ namespace Model */ public static int getCritRate(Unit attacker, Unit defender) { - return (int)Math.Round( ( ( (attacker.Skill / 3.0) - (defender.Skill / 3.0) + 1.0) * 0.1) * 100.0); + + int critRate = (int)Math.Round((((attacker.Skill / 3.0) - (defender.Skill / 3.0) + 1.0) * 0.1) * 100.0); + if (critRate > 100) //to prevent crit rate over 100% + { + critRate = 100; + } + else if (critRate < 0) //to prevent crit rate under 0% + { + critRate = 0; + } + return critRate; } /** diff --git a/src/Blaze-Brigade/Blaze_Brigade/FireBall.cs b/src/Blaze-Brigade/Blaze_Brigade/FireBall.cs index 219fa8668080e435b219d9017082af4f12410f8d..335e35ea36a3475d9c106f37e54c907b7128ec1d 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/FireBall.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/FireBall.cs @@ -15,8 +15,6 @@ namespace Model */ class Fireball : Weapon { - private int minRange; - private int maxRange; public int modStr { get; } public int modInt { get; } public int modSkill { get; } @@ -29,7 +27,7 @@ namespace Model public Fireball() { modStr = 1; - modSkill = 2; + modSkill = 5; modInt = 5; range = new int[2] { 1, 2 }; name = "Fireball"; diff --git a/src/Blaze-Brigade/Blaze_Brigade/FireBlast.cs b/src/Blaze-Brigade/Blaze_Brigade/FireBlast.cs new file mode 100644 index 0000000000000000000000000000000000000000..e1d4818f10913979523ba77b884f5097455ce243 --- /dev/null +++ b/src/Blaze-Brigade/Blaze_Brigade/FireBlast.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Model +{ + /// <summary> + /// Ranged Magical Weapon. + /// </summary> + + /** + * This class represents a magic based weapon. + * It implements the Weapon interface. + */ + class Fireblast : Weapon + { + public int modStr { get; } + public int modInt { get; } + public int modSkill { get; } + public string name { get; } + public int[] range { get; } + + /** + Constructs a Fireball. + */ + public Fireblast() + { + modStr = 1; + modSkill = 3; + modInt = 7; + range = new int[2] { 1, 2 }; + name = "Fireblast"; + } + } +} + + + diff --git a/src/Blaze-Brigade/Blaze_Brigade/Game.cs b/src/Blaze-Brigade/Blaze_Brigade/Game.cs index 417c98213e819216f7b514fa854adb8549f48c24..c8a15e889d52220030059adb35fb36c25a6861d0 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Game.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/Game.cs @@ -399,9 +399,11 @@ namespace Controller spriteBatch.DrawString(largeFont, hitRate.ToString()+" %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws hit rate spriteBatch.DrawString(largeFont, critRate.ToString()+" %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws crit rate spriteBatch.DrawString(largestFont, unit.Hp.ToString(), new Vector2(342, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit health + spriteBatch.DrawString(largeFont, unit.equippedWeapon.name.ToString(), new Vector2(40, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon spriteBatch.Draw(attackedUnit.getCharAttackInfo(), attackInfoLocation2, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.7f); //draw charAttackInfoBackground for unit being attacked spriteBatch.DrawString(largestFont, attackedUnit.Hp.ToString(), new Vector2(862, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws enemy unit health + spriteBatch.DrawString(largeFont, attackedUnit.equippedWeapon.name.ToString(), new Vector2(715, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon if (GameFunction.isEnemyUnitInRange(graph, attackedUnit, unit)) { @@ -420,9 +422,12 @@ namespace Controller spriteBatch.DrawString(largeFont, hitRate.ToString()+" %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack hit rate spriteBatch.DrawString(largeFont, critRate.ToString()+" %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack crit rate spriteBatch.DrawString(largestFont, attackedUnit.Hp.ToString(), new Vector2(342, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws enemy unit health + spriteBatch.DrawString(largeFont, attackedUnit.equippedWeapon.name.ToString(), new Vector2(40, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon spriteBatch.Draw(unit.getCharAttackInfo(), attackInfoLocation2, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.7f); //draw charAttackInfoBackground for current character spriteBatch.DrawString(largestFont, unit.Hp.ToString(), new Vector2(862, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit health + spriteBatch.DrawString(largeFont, unit.equippedWeapon.name.ToString(), new Vector2(715, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon + if (GameFunction.isEnemyUnitInRange(graph, unit, attackedUnit)) { spriteBatch.DrawString(largeFont, damageDealt.ToString(), new Vector2(700, 458), Color.DarkRed, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws damage @@ -594,7 +599,7 @@ namespace Controller { Unit unit = new Warrior(Content.Load<Texture2D>("warrior"),unitButtons, Content.Load<Texture2D>("warrior_stats"), Content.Load<Texture2D>("warrior_attack"), unitPosition); Weapon startingWeap = new BronzeSword(); - Weapon startingWeap2 = new BronzeBow(); + Weapon startingWeap2 = new IronSword(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; @@ -606,7 +611,7 @@ namespace Controller { Unit unit = new Mage(Content.Load<Texture2D>("mage"),unitButtons, Content.Load<Texture2D>("mage_stats"), Content.Load<Texture2D>("mage_attack"), unitPosition); Weapon startingWeap = new Fireball(); - Weapon startingWeap2 = new BronzeBow(); + Weapon startingWeap2 = new Fireblast(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; @@ -617,8 +622,8 @@ namespace Controller if (unitType == UnitType.Archer) { Unit unit = new Archer(Content.Load<Texture2D>("archer"), unitButtons, Content.Load<Texture2D>("archer_stats"), Content.Load<Texture2D>("archer_attack"), unitPosition); - Weapon startingWeap = new BronzeBow(); - Weapon startingWeap2 = new BronzeSword(); + Weapon startingWeap = new ShortBow(); + Weapon startingWeap2 = new LongBow(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; @@ -634,7 +639,7 @@ namespace Controller { Unit unit = new Warrior(Content.Load<Texture2D>("2warrior"), unitButtons, Content.Load<Texture2D>("2warrior_stats"), Content.Load<Texture2D>("2warrior_attack"), unitPosition); Weapon startingWeap = new BronzeSword(); - Weapon startingWeap2 = new BronzeBow(); + Weapon startingWeap2 = new IronSword(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; @@ -646,7 +651,7 @@ namespace Controller { Unit unit = new Mage(Content.Load<Texture2D>("2mage"), unitButtons, Content.Load<Texture2D>("2mage_stats"), Content.Load<Texture2D>("2mage_attack"), unitPosition); Weapon startingWeap = new Fireball(); - Weapon startingWeap2 = new BronzeBow(); + Weapon startingWeap2 = new Fireblast(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; @@ -657,8 +662,8 @@ namespace Controller if (unitType == UnitType.Archer) { Unit unit = new Archer(Content.Load<Texture2D>("2archer"),unitButtons, Content.Load<Texture2D>("2archer_stats"), Content.Load<Texture2D>("2archer_attack"), unitPosition); - Weapon startingWeap = new BronzeBow(); - Weapon startingWeap2 = new BronzeBow(); + Weapon startingWeap = new ShortBow(); + Weapon startingWeap2 = new LongBow(); unit.equippedWeapon = startingWeap; unit.getButtonType(ButtonType.Inventory1).weapon = startingWeap; unit.getButtonType(ButtonType.Inventory2).weapon = startingWeap2; diff --git a/src/Blaze-Brigade/Blaze_Brigade/IronSword.cs b/src/Blaze-Brigade/Blaze_Brigade/IronSword.cs new file mode 100644 index 0000000000000000000000000000000000000000..c6cfdec1e56feba18bb7988355e4e818dc6dcbc4 --- /dev/null +++ b/src/Blaze-Brigade/Blaze_Brigade/IronSword.cs @@ -0,0 +1,35 @@ + + +using System; + +namespace Model +{ + /// <summary> + /// Melee Physical Weapon. + /// </summary> + + /** + * This class represents a melee weapon. + * It implements the Weapon interface. + */ + class IronSword : Weapon + { + public int modStr { get; } + public int modInt { get; } + public int modSkill { get; } + public string name { get; } + public int[] range { get; } + + /** + Constructs a Bronze Sword. + */ + public IronSword() + { + modStr = 7; + modSkill = 3; + modInt = 0; + range = new int[2] { 1, 1 }; + name = "Iron Sword"; + } + } +} diff --git a/src/Blaze-Brigade/Blaze_Brigade/LongBow.cs b/src/Blaze-Brigade/Blaze_Brigade/LongBow.cs new file mode 100644 index 0000000000000000000000000000000000000000..026b5ad2434240e833ded6f9c19ab7fdc881a0dc --- /dev/null +++ b/src/Blaze-Brigade/Blaze_Brigade/LongBow.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Model +{ + /// <summary> + /// Ranged physical Weapon. + /// </summary> + + /** + * This class represents a ranged weapon. + * It implements the Weapon interface. + */ + class LongBow : Weapon + { + private int minRange; + private int maxRange; + public int modStr { get; } + public int modInt { get; } + public int modSkill { get; } + public string name { get; } + public int[] range { get; } + + /** + Constructs a Long Bow. + */ + public LongBow() + { + modStr = 7; + modSkill = 8; + modInt = 0; + range = new int[2] { 2, 3 }; + name = "Long Bow"; + } + } +} + + + diff --git a/src/Blaze-Brigade/Blaze_Brigade/Mage.cs b/src/Blaze-Brigade/Blaze_Brigade/Mage.cs index a2e40feafc04eae69fd94efe341a77df75435c86..00c4ec88e118a944be8f0efe2f9630cf49e7b9df 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Mage.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/Mage.cs @@ -391,7 +391,7 @@ namespace Model buttons[4].setPixelCoordinates(330, 120); for (int i = 5; i < 9; i++) { - buttons[i].setPixelCoordinates((int)(pixelCoordinates.X + 150), (int)(pixelCoordinates.Y + (i - 1 * 32))); + buttons[i].setPixelCoordinates((int)(pixelCoordinates.X + 160), (int)(pixelCoordinates.Y + (i * 32 - 96))); } } @@ -505,4 +505,4 @@ namespace Model #endregion } } -} +} \ No newline at end of file diff --git a/src/Blaze-Brigade/Blaze_Brigade/BronzeBow.cs b/src/Blaze-Brigade/Blaze_Brigade/ShortBow.cs similarity index 74% rename from src/Blaze-Brigade/Blaze_Brigade/BronzeBow.cs rename to src/Blaze-Brigade/Blaze_Brigade/ShortBow.cs index ce396f1ff71199a82601d74d8754a5b9a072ed9b..4046eb67ca55b6385706918a0985cb177f3b4d2f 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/BronzeBow.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/ShortBow.cs @@ -13,10 +13,8 @@ namespace Model * This class represents a ranged weapon. * It implements the Weapon interface. */ - class BronzeBow : Weapon + class ShortBow : Weapon { - private int minRange; - private int maxRange; public int modStr { get; } public int modInt { get; } public int modSkill { get; } @@ -24,15 +22,15 @@ namespace Model public int[] range { get; } /** - Constructs a Bronze Bow. + Constructs a Short Bow. */ - public BronzeBow() + public ShortBow() { - modStr = 3; + modStr = 7; modSkill = 10; modInt = 0; range = new int[2] { 2, 2 }; - name = "Bronze Bow"; + name = "Short Bow"; } } } diff --git a/src/Blaze-Brigade/Blaze_Brigade/Warrior.cs b/src/Blaze-Brigade/Blaze_Brigade/Warrior.cs index 098ce7f6487e27bc1d7a46f7d3ca044e2dbd25a3..c31d733f0943c60d8e868cd663cb4181907ce784 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Warrior.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/Warrior.cs @@ -99,7 +99,7 @@ namespace Model Alive = true; Level = 1; Hp = 10; - Str = 7; + Str = 5; Int = 1; Skill = 6; Speed = 8;