Base class for usable abilities or spells. Abilities must be initialized through xml.
More...
|
| | Ability (tinyxml2::XMLElement *xml) |
| | Constructs an Ability from xml. Only description is read from xml in this base class, derived classes will require more. More...
|
| |
| virtual void | execute (Pawn *user) |
| | Calls doExecuteLogic() if ability has fully cooled since last use. More...
|
| |
| void | update (sf::Time const &elapsedTime) |
| | Checks if ability is active and does update logic if it is. More...
|
| |
| const std::string & | getDescription () const |
| | Gets a user-friendly description of the ability, as it might appear in a tooltip, etc. More...
|
| |
| const std::string & | getName () const |
| | Gets the user-friendly name of the ability. More...
|
| |
|
bool | canCast () const |
| |
|
float | getRemainingCooldown () const |
| | Gets the remaining time, in seconds, before the ability can be used again.
|
| |
|
float | getTotalCooldown () const |
| | The time, in seconds, that the ability's cooldown lasts.
|
| |
|
sf::Time const & | getCastDuration () const |
| |
| bool | isActive () const |
| | Gets whether the ability has been activated or not. More...
|
| |
| void | setPawnList (std::shared_ptr< const std::list< std::shared_ptr< Pawn >>> const &list) |
| | Sets the pawn list to be used when the Ability wishes to find pawns in the game. The pawn list cannot be used for directly adding Pawns to the game. More...
|
| |
| void | setProjectileManager (std::shared_ptr< ProjectileManager > const &manager) |
| | Sets the ProjectileManager to be used when the Ability wishes to add projectiles to the game. More...
|
| |
| void | setSpawnCallback (std::function< void(std::shared_ptr< Minion >)> const &callback) |
| | Sets the callback used for adding units to the game. Adding a unit to the pawn list won't add flocking or collision, so we've a callback that will. More...
|
| |
|
bool | checkHotkey (char key) const |
| |
|
char | getHotkey () const |
| |
|
void | setHotkey (char hotkey) |
| |
|
|
void | activate () |
| |
|
void | deactivate () |
| |
| virtual void | doExecuteLogic (Pawn *user)=0 |
| |
|
virtual void | doUpdateLogic (sf::Time const &deltaTime)=0 |
| | Does everything necessary to update the ability. Only called if the ability is active.
|
| |
|
void | draw (sf::RenderTarget &target, sf::RenderStates states) const override final |
| | Calls doDraw() if ability is active.
|
| |
|
virtual void | doDraw (sf::RenderTarget &target, sf::RenderStates states) const =0 |
| |
| void | spawnMinion (std::shared_ptr< Minion > const &pawn) const |
| | Adds a Pawn to the game. More...
|
| |
| void | spawnProjectile (std::shared_ptr< Projectile > const &projectile) const |
| | Adds a projectile to the game. More...
|
| |
|
|
bool | mIsActive |
| | True if the ability has been activated and should be updated.
|
| |
|
const std::string | M_DESCRIPTION |
| | User-friendly description of ability.
|
| |
|
const std::string | M_NAME |
| | User-friendly name of ability.
|
| |
|
const sf::Time | M_CAST_TIME |
| | Time it takes to use the ability.
|
| |
|
const float | M_COOLDOWN |
| | How many seconds must pass before the ability can be used subsequently.
|
| |
|
float | mSecondsSinceCast |
| | The number of seconds since the ability was last deactivated.
|
| |
|
sf::Sound | mExecutionSound |
| | The sound played when the ability is executed.
|
| |
|
char | mHotkey |
| | Keyboard shortcut to activate this ability.
|
| |
|
std::shared_ptr< const std::list< std::shared_ptr< Pawn > > > | mPawnList |
| |
|
std::shared_ptr< ProjectileManager > | mProjectileManager |
| |
|
std::function< void(std::shared_ptr< Minion >)> | mSpawnUnitCallback |
| |
Base class for usable abilities or spells. Abilities must be initialized through xml.