Blaze-Brigade
Public Member Functions | Properties | List of all members
Model.Unit_Module.Mage Class Reference

The Mage model class, extends Unit.
This Unit has strong magical capabilities, and is capable of powerful ranged magic attacks, but makes up with poor physical stats. More...

Inheritance diagram for Model.Unit_Module.Mage:
Model.Unit_Module.Unit

Public Member Functions

 Mage (Texture2D spriteImage, Button[] unitButtons, Texture2D charInfo, Texture2D charAttackInfo, Vector2 coordinates, Texture2D healthBar)
 
void setInitialStats ()
 
int getMovability ()
 
int [] getStats ()
 
Weapon [] getEquipableWeapons ()
 
UnitType getClass ()
 
Texture2D getSpriteImage ()
 
Texture2D getButtonImage (ButtonType buttonType)
 
bool isButtonActive (ButtonType buttonType)
 
Texture2D getCharInfo ()
 
Texture2D getCharAttackInfo ()
 
Button [] getButtons ()
 
Button getButtonType (ButtonType buttonType)
 
void setButtonCoordinates (Vector2 pixelCoordinates)
 
Rectangle getCurrentFrame ()
 
Texture2D getHealthBar ()
 
int getMaxHp ()
 

Properties

bool Alive [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]
 
int Str [get, set]
 
int Int [get, set]
 
int Skill [get, set]
 
int Hp [get, set]
 
Tuple< int, int > Position [get, set]
 
Vector2 PixelCoordinates [get, set]
 
- Properties inherited from Model.Unit_Module.Unit
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]
 

Detailed Description

The Mage model class, extends Unit.
This Unit has strong magical capabilities, and is capable of powerful ranged magic attacks, but makes up with poor physical stats.

Constructor & Destructor Documentation

§ Mage()

Model.Unit_Module.Mage.Mage ( Texture2D  spriteImage,
Button []  unitButtons,
Texture2D  charInfo,
Texture2D  charAttackInfo,
Vector2  coordinates,
Texture2D  healthBar 
)

The constructor for Unit Mage. Stores all relevent data in model.

Parameters
spriteImageThe character sprite texture.
unitButtonsThe Texture2D Array containing all the different textures for each button.
charInfoThe character info popup texture.
charAttackInfoThe character attack menu popup texture.
coordinatesThe unit's current vector coordinate on screen.
playerThe player of which the unit belongs to.

Member Function Documentation

§ getButtonImage()

Texture2D Model.Unit_Module.Mage.getButtonImage ( ButtonType  buttonType)

This method returns the texture associated with the bunttonType passed in, by going through a switch case and matching it.

Parameters
buttonTypeThe buttontype that was clicked.

Implements Model.Unit_Module.Unit.

§ getButtons()

Button [] Model.Unit_Module.Mage.getButtons ( )

Returns the dropdown menu buttons of the unit.

Implements Model.Unit_Module.Unit.

§ getButtonType()

Button Model.Unit_Module.Mage.getButtonType ( ButtonType  buttonType)

This method takes in the buttonType enum, then returns the object associated with that enum.

Parameters
buttonTypeThe button to return (Move, Attack, Item, Wait, and attack confirm).

Implements Model.Unit_Module.Unit.

§ getCharAttackInfo()

Texture2D Model.Unit_Module.Mage.getCharAttackInfo ( )

Returns the char attack info screen texture.

Implements Model.Unit_Module.Unit.

§ getCharInfo()

Texture2D Model.Unit_Module.Mage.getCharInfo ( )

Returns the char info screen texture.

Implements Model.Unit_Module.Unit.

§ getClass()

UnitType Model.Unit_Module.Mage.getClass ( )

Returns the unit's class.

Implements Model.Unit_Module.Unit.

§ getCurrentFrame()

Rectangle Model.Unit_Module.Mage.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.

Implements Model.Unit_Module.Unit.

§ getEquipableWeapons()

Weapon [] Model.Unit_Module.Mage.getEquipableWeapons ( )

Returns the list weapons the unit can equip (TODO).

Implements Model.Unit_Module.Unit.

§ getHealthBar()

Texture2D Model.Unit_Module.Mage.getHealthBar ( )

Returns the healthbar texture.

Implements Model.Unit_Module.Unit.

§ getMaxHp()

int Model.Unit_Module.Mage.getMaxHp ( )

Returns the character's max HP.

Implements Model.Unit_Module.Unit.

§ getMovability()

int Model.Unit_Module.Mage.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.

Implements Model.Unit_Module.Unit.

§ getSpriteImage()

Texture2D Model.Unit_Module.Mage.getSpriteImage ( )

Returns the sprite image of the unit.

Implements Model.Unit_Module.Unit.

§ getStats()

int [] Model.Unit_Module.Mage.getStats ( )

Returns all stats as an array, where the index in array corresponds to stats in this order:
Level, Strength, Int, Skill, Speed, Def, Res.

Implements Model.Unit_Module.Unit.

§ isButtonActive()

bool Model.Unit_Module.Mage.isButtonActive ( ButtonType  buttonType)

This method takes in the buttonType specified, and checks if that button is currently active by calling the getter in button.

Parameters
buttonTypeThe buttontype that was clicked.

Implements Model.Unit_Module.Unit.

§ setButtonCoordinates()

void Model.Unit_Module.Mage.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).

Parameters
pixelCoordinatesThe pixel coordinate of the button.

Implements Model.Unit_Module.Unit.

§ setInitialStats()

void Model.Unit_Module.Mage.setInitialStats ( )

Sets the initial unit stats before modifiers.

Implements Model.Unit_Module.Unit.

Property Documentation

§ Alive

bool Model.Unit_Module.Mage.Alive
getset

Sets and returns whether or not unit is alive.

§ currentFrame

int Model.Unit_Module.Mage.currentFrame
getset

Gets and sets current frame the sprite is on.

§ Def

int Model.Unit_Module.Mage.Def
getset

Sets and returns a unit's Defense.
Exceptions:
-Negative defense will result in an attacker doing more damage than their attack.

§ equippedWeapon

Weapon Model.Unit_Module.Mage.equippedWeapon
getset

Gets and sets the unit is currently equipping.

§ Hp

int Model.Unit_Module.Mage.Hp
getset

Sets and get a unit's HP. Should HP fall under 0, Unit's Alive Boolean should change to false.

§ Int

int Model.Unit_Module.Mage.Int
getset

Sets and gets the new intelligence value.
Gets the effective intelligence -> Unit intelligence + weapon intelligence
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative.

§ Level

int Model.Unit_Module.Mage.Level
getset

Sets and returns a unit's Level. Currently does not have any use.

§ PixelCoordinates

Vector2 Model.Unit_Module.Mage.PixelCoordinates
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.

§ Position

Tuple<int, int> Model.Unit_Module.Mage.Position
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.

§ Res

int Model.Unit_Module.Mage.Res
getset

Sets and returns a unit's Resistance.
Exceptions:
-Negative resistance will result in an attacker doing more damage than their intelligence.

§ Skill

int Model.Unit_Module.Mage.Skill
getset

Sets and gets the new skill value.
Gets the effective skill -> Unit skill + weapon skill
Exceptions:
-Negative skill will not result in an error, but will most likely result in a 0% hit and crit rate.

§ Speed

int Model.Unit_Module.Mage.Speed
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.

§ Str

int Model.Unit_Module.Mage.Str
getset

Sets and gets the new strength value.
Gets the effective strength -> Unit strength + weapon strength
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative.


The documentation for this class was generated from the following file: