Changeset 9214 in orxonox.OLD for branches/presentation
- Timestamp:
- Jul 5, 2006, 12:20:34 PM (18 years ago)
- Location:
- branches/presentation/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/creatures/fps_player.cc
r9213 r9214 169 169 170 170 this->initWeapon = false; 171 this->damageTicker = 0.0f; 172 171 173 toList( OM_PLAYERS ); 172 174 } … … 275 277 this->getWeaponManager().fire(); 276 278 277 WorldEntity* target = this->aimingSystem->getNearestTarget(); 278 if( target != NULL) 279 // WorldEntity* target = this->aimingSystem->getNearestTarget(); 280 // if( target != NULL) 281 // { 282 // PRINTF(0)("hit hit hit, got: %s\n", target->getClassName()); 283 // } 284 // else 285 // { 286 // PRINTF(0)("nothing hit\n"); 287 // } 288 } 289 290 291 //dealing damage 292 293 if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer() ) 294 { 295 this->damageTicker -= time; 296 297 if ( this->damageTicker <= 0.0f && this->beFire() ) 279 298 { 280 PRINTF(0)("hit hit hit, got: %s\n", target->getClassName()); 299 this->damageTicker = 0.25; 300 301 WorldEntity * victim = aimingSystem->getNearestTarget(); 302 303 if ( victim ) 304 { 305 PRINTF(0)("FIRE: hit %s\n", victim->getClassName()); 306 victim->hit( 20, this ); 307 } 308 else 309 { 310 PRINTF(0)("FIRE: nothing hit\n"); 311 } 281 312 } 282 else 283 { 284 PRINTF(0)("nothing hit\n"); 285 } 286 } 287 288 313 } 289 314 290 315 … … 462 487 if( State::isOnline()) 463 488 toList( OM_PLAYERS ); 489 490 this->damageTicker = 0.0f; 464 491 } 465 492 -
branches/presentation/src/world_entities/creatures/fps_player.h
r9166 r9214 65 65 66 66 AimingSystem* aimingSystem; //!< aiming system of the player 67 68 float damageTicker; //!< ticker for dealing damage 67 69 }; 68 70 -
branches/presentation/src/world_entities/playable.h
r9162 r9214 90 90 static const std::string& playmodeToString(Playable::Playmode playmode); 91 91 static const std::string playmodeNames[]; 92 93 inline bool beFire(){ return this->bFire; } 92 94 93 95 protected:
Note: See TracChangeset
for help on using the changeset viewer.