Changeset 7547 for code/trunk/src/modules/pickup/items/HealthPickup.h
- Timestamp:
- Oct 16, 2010, 12:37:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/items/HealthPickup.h
r7541 r7547 39 39 40 40 #include <string> 41 #include <worldentities/pawns/Pawn.h>42 #include "worldentities/StaticEntity.h"43 41 44 42 #include "pickup/Pickup.h" … … 65 63 /** 66 64 @brief 67 The Health Pickup is a Pickupable that can do (dependent upon the parameters) lots of different things to the health of a Pawn. 68 There are 4 parameters that can be chosen: 69 - The <b>health</b> The amount of health that (in a way dependent on the other parameters) is transferred to the Pawn. 70 - The <b>activation type</b> It can be chosen to be either <em>immediate</em> or <em>onUse</em>. The activation type essentially (as indicated by the name) defines when the health is transferred, either immediately after being picked up or only after the player uses it. 71 - The <b>duration type</b> It can be chosen to be either <em>once</em> or <em>continuous</em>. For <em>once</em> the specified health is transferred once to the Pawn, for <em>continuous</em> the set health is transferred over a span of time at a rate defined by the health rate parameter. 72 - The <b>health type</b> The health type can be chosen to be <em>limited</em>, <em>temporary</em> or <em>permanent</em>. <em>limited</em> means that the health is increased only to the maximum health of the Pawn. 'temporary' means that the maximum health is temporarily elevated but will be set back as soon as the pickup is no longer in use. <em>permanent</em> means that the maximum health of the Pawn is increased such that the health provided by the pickup will fit in and the maximum health stays that way. 65 The HealthPickup is a Pickupable that can do (dependent upon the parameters) lots of different things to the health of a Pawn. 66 There are 5 parameters that can be chosen: 67 - The @b activationType It can be chosen to be either <em>immediate</em> or <em>onUse</em>. The activation type essentially (as indicated by the name) defines when the health is transferred, either immediately after being picked up or only after the player uses it. The default is <em>immediate</em>. 68 - The @b durationType It can be chosen to be either <em>once</em> or <em>continuous</em>. For <em>once</em> the specified health is transferred once to the Pawn, for <em>continuous</em> the set health is transferred over a span of time at a rate defined by the health rate parameter. The default is <em>once</em>. 69 - The @b health The amount of health that (in a way dependent on the other parameters) is transferred to the Pawn. Default is 0. 70 - The @b healthType The health type can be chosen to be <em>limited</em>, <em>temporary</em> or <em>permanent</em>. <em>limited</em> means that the health is increased only to the maximum health of the Pawn. 'temporary' means that the maximum health is temporarily elevated but will be set back as soon as the pickup is no longer in use. <em>permanent</em> means that the maximum health of the Pawn is increased such that the health provided by the pickup will fit in and the maximum health stays that way. The default is <em>limited</em>. 71 - The @b healthRate If set to continuous, the health that is transferred per second is the <em>healthRate</em>. There is health transferred until the health set by <em>health</em> is depleted. The default is 0. 73 72 74 An exam le of a XML implementation of a HealthPickup would be:73 An example of a XML implementation of a HealthPickup would be: 75 74 @code 76 75 <HealthPickup … … 104 103 @return Returns the health. 105 104 */ 106 inline float getHealth(void) 105 inline float getHealth(void) const 107 106 { return this->health_; } 108 107 /** … … 110 109 @return Returns the rate. 111 110 */ 112 inline float getHealthRate(void) 111 inline float getHealthRate(void) const 113 112 { return this->healthRate_; } 114 113 … … 117 116 @return Returns the health type as an enum. 118 117 */ 119 inline pickupHealthType::Value getHealthTypeDirect(void) 118 inline pickupHealthType::Value getHealthTypeDirect(void) const 120 119 { return this->healthType_; } 121 const std::string& getHealthType(void) ; //!< Get the health type of this pickup.120 const std::string& getHealthType(void) const; //!< Get the health type of this pickup. 122 121 123 122 protected:
Note: See TracChangeset
for help on using the changeset viewer.