|
| | Pawn (tinyxml2::XMLElement *xml) |
| | Constructs a pawn from an xml element. Parses members from child xml tags. Requires child <Actor> tag for base class construction. More...
|
| |
|
void | makeSelfAware (std::shared_ptr< Pawn > const &smartThis) |
| |
| sf::Vector2f | getDestination () const |
| |
| virtual void | setDestination (sf::Vector2f const &destination) |
| | Sets the Pawn's destination. More...
|
| |
|
int | getMovementSpeed () const |
| |
|
void | setMovementSpeed (int newSpeed) |
| |
| virtual void | update (sf::Time const &elapsedTime) |
| | Updates the Pawn. State becomes MARCHING is goal is further than attack range. State becomes ATTACKING if has a target and target is within attack range. Else state become IDLE. More...
|
| |
|
void | kill () |
| | Kills the Pawn outright. Sets the Pawn's health to 0 and the state to DEAD.
|
| |
| bool | takeDamage (int amount, Damage::Type type) |
| |
| bool | takeDamage (int amount, Damage::Type type, std::shared_ptr< Pawn > const &sender) |
| | Same as takeDamage() Used when taking damage from another pawn, so that we can choose to retaliate if we so wish. More...
|
| |
| void | heal (int amount) |
| | Heals for the specified amount. Heals for the specified amount. Cannot heal beyond max health. More...
|
| |
| void | stun (sf::Time const &duration) |
| | Get stunned. Become stunned for the specified amount of time. Stuns do not stack. If a subsequant stun is applied, the stun with the longer duration is used. i.e. A stun of 1 second cannot cancel out a 5 second stun, nor does it becoe a 6 second stun. More...
|
| |
| void | beTaunted (std::shared_ptr< Pawn > const &taunter) |
| | Become forced to attack th taunter. Changes combat target to be the taunter. Has no associated duration so subsequent taunts will override each other. More...
|
| |
| bool | offerTarget (std::shared_ptr< Pawn > const &target) |
| | Offer a potential target to the Pawn. Offer a target to the Pawn, who then decides whether to accept it or not. More...
|
| |
| bool | targetIsDead () const |
| |
| void | wait (float seconds) |
| | Disallows the pawn to march for the specified time. More...
|
| |
|
int | getHealth () const |
| |
| State | getState () const |
| | Gets the current state of the Pawn. More...
|
| |
| bool | isDead () const |
| |
| Faction | getFaction () const |
| |
|
void | setOnDeath (std::function< void(Pawn *)> const &callback) |
| |
|
std::weak_ptr< Pawn > const & | getCombatTarget () const |
| |
|
Damage::Reduction const & | getArmour () const |
| |
|
Damage::Reduction const & | getMagicResist () const |
| |
|
sf::Color | getBloodColor () const |
| |
| virtual void | onCollide (std::shared_ptr< Collidable > &other, sf::Vector2f const &mtv) |
| | Called whenever the Pawn collides with something. Virtual method that is invoked whenver this Pawn collides with something. Moves the Pawn a portion of the minimum translation vector. More...
|
| |
| | Actor (sf::Texture &texture, sf::Shape *collisionMask, sf::Vector2f const &maskOffset) |
| |
|
| Actor (tinyxml2::XMLElement *xml) |
| |
|
void | animate (sf::Time const &elapsedTime) |
| | Updates the animator and applies it to ourself.
|
| |
|
bool | isPlayingAnimation () const |
| | Returns true if an animation is currently playing.
|
| |
|
std::string | getPlayingAnimation () const |
| | Gets the name of the playing animation. Undefined behaviour if no animation playing.
|
| |
|
void | playAnimation (std::string const &name, bool loop=false) |
| | Begins playing an animation by name.
|
| |
|
void | setVisible (bool isVisible=true) |
| |
|
bool | toggleVisible () |
| |
|
bool | getVisible () const |
| |
|
virtual void | draw (sf::RenderTarget &target) const |
| |
|
| Collidable (sf::Shape *mask, sf::Vector2f offset) |
| |
|
| Collidable (Collidable const &other) |
| |
| | Collidable (tinyxml2::XMLElement *xml) |
| | Constructs a Collidable from an xml tag. Tag requires pointCoint and type attributes in addition to child tags depending on type specified. More...
|
| |
|
const sf::Shape * | getMask () const |
| |
|
void | setMask (sf::Shape *mask, sf::Vector2f offset) |
| |
|
virtual void | onCollide (std::shared_ptr< Collidable > &other, sf::Vector2f const &mtv) |
| | Called when we collide with something.
|
| |
|
void | setDebugColour (sf::Color const &c) |
| |
|
void | debug_draw (sf::RenderTarget &target) |
| |
| void | getAxies (std::vector< sf::Vector2f > &axiesVector) |
| | Gets all axies of the mask. Gets all axies of the mask. Currently inefficient due to the fact that it iterates over all points and returns all axies (a duplicate of each axis is included!). More...
|
| |
|
size_t | getPointCount () const |
| | Gets the number of points in the mask. Calls mask->getPoint() and returns the result.
|
| |
| sf::Vector2f | projectOntoAxis (sf::Vector2f &axis) const |
| | Projects the mask onto an axis. Projects each point of the mask onto an axis and returns the min and max points it covers on that axis. More...
|
| |
Base class for all units in the game. If it walks and attacks, it's a Pawn. Walks toward a destination, attacks any hostile pawns it encounters. Dies when health reaches 0.