Skip to content
Snippets Groups Projects
Commit 4d9d2895 authored by Jeremy Klotz's avatar Jeremy Klotz
Browse files

Added Bronze Sword, Bronze Bow, Fireball weapon classes. Modified Weapon interface

parent 8ca3376d
Branches revert-afb15ea3
No related tags found
No related merge requests found
......@@ -67,13 +67,16 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Archer.cs" />
<Compile Include="BronzeBow.cs" />
<Compile Include="CharInfoScreen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CharInfoScreen.Designer.cs">
<DependentUpon>CharInfoScreen.cs</DependentUpon>
</Compile>
<Compile Include="BronzeSword.cs" />
<Compile Include="DamageCalculations.cs" />
<Compile Include="Fireball.cs" />
<Compile Include="GameFunction.cs" />
<Compile Include="GameState.cs" />
<Compile Include="Graph.cs" />
......
......@@ -8,7 +8,7 @@ Content\items.xnb
Content\move.xnb
Content\wait.xnb
Content\warrior_art.xnb
Content\PixelFont.xnb
Content\warrior_stats.xnb
Content\Warrior_Info.xnb
Content\PixelFont.xnb
Content\PixelFontLarge.xnb
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
class BronzeBow : Weapon
{
private int minRange;
private int maxRange;
private int modStr;
private int modSkill;
private int modInt;
private int[] range;
public BronzeBow()
{
minRange = 2;
maxRange = 2;
modStr = 3;
modSkill = 15;
modInt = 0;
range = new int[2];
range[0] = minRange;
range[1] = maxRange;
}
public int getInt()
{
return modInt;
}
public int[] getRange()
{
return range;
}
public int getSkill()
{
return modSkill;
}
public int getStrength()
{
return modStr;
}
public string getName()
{
return "Bronze Bow";
}
}
}
......@@ -10,32 +10,51 @@ namespace Model
private int maxRange;
private int modStr;
private int modSkill;
private int modIntelligence;
private int modInt;
private int[] range;
private bool equipped;
public int[] getRange()
public BronzeSword()
{
minRange = 1;
maxRange = 1;
modStr = 5;
modSkill = 10;
modInt = 0;
range = getRange();
range = new int[2];
range[0] = minRange;
range[1] = maxRange;
}
public int[] getRange()
{
return range;
}
public int getStrength()
{
return modStr;
}
public void statModifiers(Unit unit)
public int getSkill()
{
modStr = 5;
modIntelligence = 5;
modSkill = 10;
unit.setStrength(modStr); // Strength = Strength + 5
unit.setSkill(modSkill); // skill = skill + 10
unit.setIntelligence(modIntelligence); // int = int + 0
return modSkill;
}
public int getInt()
{
return modInt;
}
// perhaps put this in visual for inventory?
public string getName()
{
return "Bronze Sword";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
class Fireball : Weapon
{
private int minRange;
private int maxRange;
private int modStr;
private int modSkill;
private int modInt;
private int[] range;
public Fireball()
{
minRange = 1;
maxRange = 2;
modStr = 0;
modSkill = 5;
modInt = 5;
range = new int[2];
range[0] = minRange;
range[1] = maxRange;
}
public int getInt()
{
return modInt;
}
public string getName()
{
return "Fireball";
}
public int[] getRange()
{
return range;
}
public int getSkill()
{
return modSkill;
}
public int getStrength()
{
return modStr;
}
}
}
......@@ -30,7 +30,8 @@ namespace Controller
public static LinkedList<Unit> enemyUnitsInRange(Unit unit)
{
// TODO
int range = unit.getEquippedWeapon().getRange(); // use this to determine all hitable squares
int rangeMin = unit.getEquippedWeapon().getRange().ElementAt(1); // use this to determine all hitable squares
int rangeMax = unit.getEquippedWeapon().getRange().ElementAt(2);
return null;
}
......
......@@ -23,6 +23,7 @@ namespace Model
int getCriticalRate(); // returns unit's critical rate
int getMovability(); // returns the unit's movability (number of spaces the unit can move in one turn)
int getStats(int i); // returns stat located at i (in order from 0-6: lvl, str, mag, skill, spd, def, res)
Weapon[] getEquipableWeapons(); // returns array of equipable weapons
Weapon getEquippedWeapon(); // returns weapon the unit is currently equipping
int getLevel(); // returns unit's level
......@@ -32,9 +33,6 @@ namespace Model
Texture2D getCharInfo(); // returns the char info screen texture
Tuple<int, int> getPosition(); // returns the current position (by node) of the unit
Vector2 getPixelCoordinates(); // returns the pixel coordinates of the sprite
void setStrength(int mod);
void setIntelligence(int mod);
void setSkill(int mod);
void setPixelCoordinates(Vector2 p); // sets the pixel coordinates of the sprite
void setPosition(int x, int y); // sets the current position (by node) of the unit
void setEquippedWeapon(Weapon w); // sets the unit's currently equipped weapon
......
......@@ -64,17 +64,17 @@ namespace Model
public int getStr()
{
return str;
return str; //+ equippedWeapon.getStrength();
}
public int getInt()
{
return intelligence;
return intelligence; //+ equippedWeapon.getInt();
}
public int getSkill()
{
return skill;
return skill; //+ equippedWeapon.getInt();
}
public int getSpeed()
......
......@@ -7,14 +7,16 @@ namespace Model
{
interface Weapon
{
//int getPhysicalDamage();
// int getMagicDamage();
int[] getRange(); // get the range of the weapon, i believe that using Unit.equippedWeapon
// or weapon with largest range in inventory to determine attackable squares, as opposed to the unit itself.
bool isEquipped(Unit unit);
// or weapon with largest range in inventory to determine attackable squares, as opposed to the unit itself.
void statModifiers(Unit unit);
int getStrength();
int getSkill();
int getInt();
String getName(); // for inventory
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment