- Timestamp:
- Jun 16, 2006, 12:36:51 AM (18 years ago)
- Location:
- branches/bsp_model/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/collision_reaction/cr_object_damage.cc
r8490 r8511 63 63 if( collision->isEntityACollide()) { 64 64 damage = collision->getEntityB()->getDamage(); 65 collision->getEntityA()-> decreaseHealth(damage);65 collision->getEntityA()->hit(damage); 66 66 } 67 67 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName()); … … 69 69 if( collision->isEntityBCollide()) { 70 70 damage = collision->getEntityA()->getDamage(); 71 collision->getEntityB()-> decreaseHealth(damage);71 collision->getEntityB()->hit(damage); 72 72 } 73 73 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName()); -
branches/bsp_model/src/world_entities/playable.cc
r8490 r8511 376 376 if (this->getHealth() <= 0.0f) 377 377 { 378 this->die();378 // this->destory(); 379 379 380 380 if( State::getGameRules() != NULL) … … 411 411 412 412 413 void Playable::die() 413 414 void Playable::destroy() 414 415 { 415 416 Explosion::explode(dynamic_cast<PNode*>(this), Vector(1.0f, 1.0f, 1.0f)); -
branches/bsp_model/src/world_entities/playable.h
r8055 r8511 76 76 77 77 // WorldEntity Extensions 78 virtual void d ie();78 virtual void destroy(); 79 79 virtual void respawn(); 80 80 virtual void collidesWith(WorldEntity* entity, const Vector& location); -
branches/bsp_model/src/world_entities/world_entity.cc
r8507 r8511 727 727 } 728 728 729 730 /** 731 * hit the world entity with 732 * @param damage damage to be dealt 733 */ 734 void WorldEntity::hit(float damage) 735 { 736 this->decreaseHealth(damage); 737 738 if( this->getHealth() > 0) 739 { 740 // any small explosion animaitions 741 } 742 else 743 { 744 this->destroy(); 745 746 // if( State::getGameRules() != NULL) 747 // State::getGameRules()->registerKill(Kill(NULL, this)); 748 } 749 } 750 751 729 752 /** 730 753 * @brief updates the HealthWidget -
branches/bsp_model/src/world_entities/world_entity.h
r8508 r8511 61 61 virtual void postSpawn (); 62 62 virtual void leaveWorld (); 63 virtual void destroy() {};64 63 65 64 virtual void tick (float time); … … 95 94 CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; } 96 95 96 virtual void hit(float damage); 97 virtual void destroy() {}; 98 97 99 98 100 /* @returns the Count of Faces on this WorldEntity */ … … 113 115 /** @returns a Reference to the Iterator */ 114 116 ObjectManager::EntityList::iterator& getEntityIterator() { return this->objectListIterator; } 115 116 /* --- Network Block --- */117 int writeState(const byte* data, int length, int sender);118 int readState(byte* data, int maxLength );119 117 120 118 /* --- Character Attribute Block --- */
Note: See TracChangeset
for help on using the changeset viewer.