Blaze-Brigade
|
Unit Interface for Warrior, Mage, and Archer More...
Public Member Functions | |
int | getMovability () |
int [] | getStats () |
void | setInitialStats () |
bool | isButtonActive (ButtonType buttonType) |
void | setButtonCoordinates (Vector2 pixelCoordinates) |
Texture2D | getSpriteImage () |
Texture2D | getButtonImage (ButtonType buttonType) |
Texture2D | getCharInfo () |
Texture2D | getCharAttackInfo () |
Button [] | getButtons () |
Button | getButtonType (ButtonType buttonType) |
Rectangle | getCurrentFrame () |
Weapon [] | getEquipableWeapons () |
UnitType | getClass () |
Texture2D | getHealthBar () |
int | getMaxHp () |
Properties | |
bool | Alive [get, set] |
int | Hp [get, set] |
int | Str [get, set] |
int | Int [get, set] |
int | Skill [get, set] |
int | Speed [get, set] |
int | Def [get, set] |
int | Res [get, set] |
int | Level [get, set] |
Weapon | equippedWeapon [get, set] |
int | currentFrame [get, set] |
Tuple< int, int > | Position [get, set] |
Vector2 | PixelCoordinates [get, set] |
Unit Interface for Warrior, Mage, and Archer
This is the interface for the 3 playable unit classes, where the only differences in the units will be their statistics and graphical assets
Texture2D Model.Unit.getButtonImage | ( | ButtonType | buttonType | ) |
returns the button texture at index i
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Button [] Model.Unit.getButtons | ( | ) |
returns the dropdown menu buttons of the unit
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Button Model.Unit.getButtonType | ( | ButtonType | buttonType | ) |
Method takes in the buttonType enum, then returns the object associated with that enum
buttonType | The button to return (Move, Attack, Item, Wait, and attack confirm) |
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Texture2D Model.Unit.getCharAttackInfo | ( | ) |
returns the char attack info screen texture
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Texture2D Model.Unit.getCharInfo | ( | ) |
returns the char info screen texture
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
UnitType Model.Unit.getClass | ( | ) |
returns unit's class (warrior, mage, archer)
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Rectangle Model.Unit.getCurrentFrame | ( | ) |
returns the current sprite frame in animation sequence. The rectangle starts at currentFrame * 32, where 32 is the sprite sheet offset between frames, and is 32 high and wide.
Exceptions:
-Assumes that each sprite frame is 32pixels wide
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Weapon [] Model.Unit.getEquipableWeapons | ( | ) |
TODO - Not yet used
returns array of equipable weapons
Exceptions:
-If this array is empty, unit cannot equip any weapons
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Texture2D Model.Unit.getHealthBar | ( | ) |
Returns the healthBar Texture
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
int Model.Unit.getMaxHp | ( | ) |
Returns the unit's max HP
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
int Model.Unit.getMovability | ( | ) |
Returns the unit's movability range on grid (number of spaces the unit can move in one turn)
Exceptions:
-Negative movement will be treated as 0 in path finding algorithm
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
Texture2D Model.Unit.getSpriteImage | ( | ) |
returns the sprite image of the unit
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
int [] Model.Unit.getStats | ( | ) |
returns all stats as an array
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
bool Model.Unit.isButtonActive | ( | ButtonType | buttonType | ) |
indicates whether a button has already been previously selected or not
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
void Model.Unit.setButtonCoordinates | ( | Vector2 | pixelCoordinates | ) |
Sets the coordinates of menu buttons. One for loop will position the main Drop Down menu (potentailly containing attack, move, item and wait directly 32 pixels to the right of unit (so the tile to right of unit) , and for each active button, increment it downwards by 32 pixels (height of each button). The second for loop is similiar and is for the inventory menu buttons, except it starts 160 pixels offsetted to right (to the right of the main drop down menu).
pixelCoordinates | The pixel coordinate of the button |
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
void Model.Unit.setInitialStats | ( | ) |
sets initial unit stats upon creation
Implemented in Model.Mage, Model.Archer, and Model.Warrior.
|
getset |
Sets and returns whether or not unit is alive
|
getset |
Sets and gets the current frame of the animation sequence
|
getset |
Sets and returns a unit's Defense
Exceptions:
-Negative defense will result in an attacker doing more damage than their attack
|
getset |
returns weapon the unit is currently equipping
|
getset |
Sets and returns a unit's HP. Should HP fall under 0, Unit's Alive Boolean should change to false
|
getset |
Sets and returns a unit's Intelliegence
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative
|
getset |
Sets and returns a unit's Level. Currently does not have any use
|
getset |
returns the pixel coordinate of the unit
sets the pixel coordinate, and also sets Position (which is the tile location of that coordinate)
Exceptions:
-Dead units will still have a position, but won't impact the rest of the game
|
getset |
gets and sets unit's position by tile. The set also updates pixelCoordinate's location by making that vector equivalent to position*32 (since each tile is 32x32).
Exceptions:
-Dead units will still have a position, but won't impact the rest of the game
|
getset |
Sets and returns a unit's Resistance
Exceptions:
-Negative resistance will result in an attacker doing more damage than their intelligence
|
getset |
Sets and returns a unit's Skill
Exceptions:
-Negative skill will not result in an error, but will most likely result in a 0% hit and crit rate
|
getset |
Sets and returns a unit's Speed
Exceptions:
-Negative skill will not result in an error as speed is only used for checking double attack boolean, which is binary
|
getset |
Sets and returns a unit's Strength
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative