Changeset 7547 for code/trunk/src/modules/pickup/items/ShieldPickup.h
- Timestamp:
- Oct 16, 2010, 12:37:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/items/ShieldPickup.h
r7493 r7547 40 40 41 41 #include <string> 42 #include "worldentities/pawns/Pawn.h"43 #include "worldentities/StaticEntity.h"44 42 45 43 #include "pickup/Pickup.h" … … 51 49 A Pickup which can add a Shield to the Pawn. 52 50 53 There are 4 parameters that can be cosen. 54 - The @b percentage The percentage the shield takes from the damage dealt to a Pawn 55 - The @b hit @b points The amount of damage points a shield can teake before collapsing 56 - The @b activation @b type 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it. 57 - The @b duration the activation time of the pickup. 51 There are 5 parameters that can be cosen. 52 - The @b shieldhealth< The amount of damage points a shield can take before collapsing. The default is 0. 53 - The @b shieldabsorption The percentage the shield takes from the damage dealt to a Pawn. The default is 0. 54 - The @b activationType, <em>immediate</em> or <em>onUse</em>. defines if the ShiedlPickup is used when it's picked up or only after the player chooses to use it. The default is <em>immediate</em>. 55 - The @b durationType, <em>once</em> means, that the shield will stay until it collapses, <em>continuous</em> means, that the shield only stays for a limited amount of time, specifiey by the duration. The default is <em>once</em>. 56 - The @b duration the time in seconds the shield is active at the most. The default is 0. 57 58 An example of a XML implementation of a ShieldPickup would be: 59 @code 60 <ShieldPickup 61 shieldhealth = 30 62 shieldabsorption = 0.8 63 activationType = "immediate" 64 durationtype = "continuous" 65 duration = 20.0 66 /> 67 @endcode 58 68 59 69 @author 60 70 Eric Beier 71 72 @ingroup PickupItems 61 73 */ 62 74 class _PickupExport ShieldPickup : public Pickup … … 72 84 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 73 85 74 inline float getDuration(void) 86 /** 87 @brief Get the duration, the time the shield is actvie at the most. 88 @return Returns the duration in seconds. 89 */ 90 inline float getDuration(void) const 75 91 { return this->duration_; } 76 inline float getShieldHealth() 92 /** 93 @brief Get the shield health, the amount of damage the shield can sustain. 94 @return Returns the shield health. 95 */ 96 inline float getShieldHealth() const 77 97 { return this->shieldHealth_; } 78 inline float getShieldAbsorption() 98 /** 99 @brief Get the shield absorption, the percentage of damage that is absorbed by the shield. 100 @return Returns the shield absorption. 101 */ 102 inline float getShieldAbsorption() const 79 103 { return this->shieldAbsorption_; } 80 104 81 105 protected: 82 106 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. 107 void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires. 83 108 84 void pickupTimerCallback(void); //!< Function that gets called when timer ends. 85 86 void setDuration(float duration); 87 void setShieldHealth(float shieldHealth); 88 void setShieldAbsorption(float shieldAbsorption); 109 void setDuration(float duration); //!< Sets the duration. 110 void setShieldHealth(float shieldHealth); //!< Sets the health of the shield. 111 void setShieldAbsorption(float shieldAbsorption); //!< Sets the percentage the shield absorbs of the dealt damage. 89 112 90 113 private: … … 95 118 96 119 float duration_; //!< The health that is transferred to the Pawn. 97 float shieldHealth_; 98 float shieldAbsorption_; // Has to be between 0 and 1120 float shieldHealth_; //!< The amount of damage the shield can sustain. 121 float shieldAbsorption_; //!< The percentage of damage that is absorbed by the shield. 99 122 100 123 };
Note: See TracChangeset
for help on using the changeset viewer.