- Timestamp:
- May 25, 2011, 9:07:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h
r8386 r8577 53 53 inline bool isAlive() const 54 54 { return this->bAlive_; } 55 56 ///////////////////////////////// me57 virtual void setReloadRate(float reloadrate);58 inline float getReloadRate() const59 { return this->reloadRate_; }60 61 inline void addShieldHealth(float amount)62 { this->setShieldHealth(this->shieldHealth_ + amount); }63 64 inline bool hasShield()65 { return (this->getShieldHealth() > 0); }66 67 virtual void setReloadWaitTime(float reloadwaittime);68 inline float getReloadWaitTime() const69 { return this->reloadWaitTime_; }70 71 inline void resetReloadCountdown()72 { this->reloadWaitCountdown_ = 0; }73 74 inline void startReloadCountdown()75 { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } //in projectile.cc einbauen!!!!!!1111!!111!76 77 virtual void decreaseReloadCountdownTime(float dt);78 79 virtual void setMaxShieldHealth(float maxshieldhealth);80 inline float getMaxShieldHealth() const81 { return this->maxShieldHealth_; }82 83 inline void setInitialShieldHealth(float initialshieldhealth)84 { this->initialShieldHealth_ = initialshieldhealth; this->setShieldHealth(initialshieldhealth); }85 inline float getInitialShieldHealth() const86 { return this->initialShieldHealth_; }87 88 inline void restoreInitialShieldHealth()89 { this->setShieldHealth(this->initialShieldHealth_); }90 inline void restoreMaxShieldHealth()91 { this->setShieldHealth(this->maxShieldHealth_); }92 93 94 ///////////////////////////////// end me95 55 96 56 virtual void setHealth(float health); … … 117 77 { return this->shieldHealth_; } 118 78 79 inline void addShieldHealth(float amount) 80 { this->setShieldHealth(this->shieldHealth_ + amount); } 81 82 inline bool hasShield() 83 { return (this->getShieldHealth() > 0); } 84 85 virtual void setMaxShieldHealth(float maxshieldhealth); 86 inline float getMaxShieldHealth() const 87 { return this->maxShieldHealth_; } 88 89 inline void setInitialShieldHealth(float initialshieldhealth) 90 { this->initialShieldHealth_ = initialshieldhealth; this->setShieldHealth(initialshieldhealth); } 91 inline float getInitialShieldHealth() const 92 { return this->initialShieldHealth_; } 93 94 inline void restoreInitialShieldHealth() 95 { this->setShieldHealth(this->initialShieldHealth_); } 96 inline void restoreMaxShieldHealth() 97 { this->setShieldHealth(this->maxShieldHealth_); } 98 119 99 inline void setShieldAbsorption(float shieldAbsorption) 120 100 { this->shieldAbsorption_ = shieldAbsorption; } … … 122 102 { return this->shieldAbsorption_; } 123 103 104 // TODO: Rename to shieldRechargeRate 105 virtual void setReloadRate(float reloadrate); 106 inline float getReloadRate() const 107 { return this->reloadRate_; } 108 109 virtual void setReloadWaitTime(float reloadwaittime); 110 inline float getReloadWaitTime() const 111 { return this->reloadWaitTime_; } 112 113 inline void resetReloadCountdown() 114 { this->reloadWaitCountdown_ = 0; } 115 116 inline void startReloadCountdown() 117 { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } // TODO: Implement in Projectile.cc 118 119 virtual void decreaseReloadCountdownTime(float dt); 120 124 121 inline ControllableEntity* getLastHitOriginator() const 125 122 { return this->lastHitOriginator_; } 126 123 127 virtual void hit(Pawn* originator, const Vector3& force, float damage); 128 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 129 /////////me 130 virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage); 131 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage); 132 ////////end me 124 //virtual void hit(Pawn* originator, const Vector3& force, float damage); 125 //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 126 virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 127 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 128 133 129 virtual void kill(); 134 130 … … 186 182 virtual void spawneffect(); 187 183 188 virtual void damage(float damage, Pawn* originator = 0); 189 //////////me 190 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator); 191 /////////end me 184 //virtual void damage(float damage, Pawn* originator = 0); 185 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL); 192 186 193 187 bool bAlive_; … … 198 192 { return NULL; } 199 193 200 /////////////////////////// me 194 float health_; 195 float maxHealth_; 196 float initialHealth_; 197 198 float shieldHealth_; 199 float maxShieldHealth_; 200 float initialShieldHealth_; 201 float shieldAbsorption_; // Has to be between 0 and 1 201 202 float reloadRate_; 202 203 float reloadWaitTime_; 203 204 float reloadWaitCountdown_; 204 205 float maxShieldHealth_;206 float initialShieldHealth_;207 208 ////////////////////////// end me209 210 float health_;211 float maxHealth_;212 float initialHealth_;213 float shieldHealth_;214 float shieldAbsorption_; // Has to be between 0 and 1215 205 216 206 WeakPtr<Pawn> lastHitOriginator_;
Note: See TracChangeset
for help on using the changeset viewer.