- Timestamp:
- Mar 9, 2009, 3:21:12 AM (16 years ago)
- Location:
- code/branches/miniprojects/src/orxonox/objects/worldentities
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/miniprojects/src/orxonox/objects/worldentities/Billboard.h
r2662 r2768 34 34 #include "util/Math.h" 35 35 #include "tools/BillboardSet.h" 36 #include "objects/Teamcolourable.h" 36 37 37 38 namespace orxonox 38 39 { 39 class _OrxonoxExport Billboard : public StaticEntity 40 class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable 40 41 { 41 42 public: … … 61 62 { return this->colour_; } 62 63 64 virtual void setTeamColour(const ColourValue& colour) 65 { this->setColour(colour); } 66 63 67 protected: 64 68 inline BillboardSet& getBillboardSet() -
code/branches/miniprojects/src/orxonox/objects/worldentities/CMakeLists.txt
r2710 r2768 19 19 Planet.cc 20 20 SpawnPoint.cc 21 TeamSpawnPoint.cc 21 22 ) 22 23 -
code/branches/miniprojects/src/orxonox/objects/worldentities/Light.h
r2662 r2768 37 37 38 38 #include "util/Math.h" 39 #include "objects/Teamcolourable.h" 39 40 40 41 namespace orxonox 41 42 { 42 class _OrxonoxExport Light : public StaticEntity 43 class _OrxonoxExport Light : public StaticEntity, public Teamcolourable 43 44 { 44 45 public: … … 68 69 inline const ColourValue& getSpecularColour() const 69 70 { return this->specular_; } 71 72 virtual void setTeamColour(const ColourValue& colour) 73 { this->setDiffuseColour(colour); this->setSpecularColour(colour); } 70 74 71 75 /** -
code/branches/miniprojects/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2662 r2768 140 140 void Pawn::damage(float damage, Pawn* originator) 141 141 { 142 this->setHealth(this->health_ - damage); 143 this->lastHitOriginator_ = originator; 144 145 // play damage effect 142 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) 143 { 144 this->setHealth(this->health_ - damage); 145 this->lastHitOriginator_ = originator; 146 147 // play damage effect 148 } 146 149 } 147 150 148 151 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) 149 152 { 150 this->damage(damage, originator); 151 this->setVelocity(this->getVelocity() + force); 152 153 // play hit effect 153 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator)) 154 { 155 this->damage(damage, originator); 156 this->setVelocity(this->getVelocity() + force); 157 158 // play hit effect 159 } 154 160 } 155 161 … … 176 182 void Pawn::death() 177 183 { 178 // Set bAlive_ to false and wait for PawnManager to do the destruction 179 this->bAlive_ = false; 180 181 this->setDestroyWhenPlayerLeft(false); 182 183 if (this->getGametype()) 184 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 185 186 if (this->getPlayer()) 187 this->getPlayer()->stopControl(this); 188 189 if (Core::isMaster()) 190 this->deatheffect(); 184 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 185 { 186 // Set bAlive_ to false and wait for PawnManager to do the destruction 187 this->bAlive_ = false; 188 189 this->setDestroyWhenPlayerLeft(false); 190 191 if (this->getGametype()) 192 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 193 194 if (this->getPlayer()) 195 this->getPlayer()->stopControl(this); 196 197 if (Core::isMaster()) 198 this->deatheffect(); 199 } 200 else 201 this->setHealth(1); 191 202 } 192 203
Note: See TracChangeset
for help on using the changeset viewer.