Changeset 10718 in orxonox.OLD for branches/presentation/src/world_entities
- Timestamp:
- Jun 18, 2007, 5:06:59 PM (18 years ago)
- Location:
- branches/presentation/src/world_entities
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/creatures/fps_player.cc
r10714 r10718 42 42 #include "shared_network_data.h" 43 43 44 #include "event_handler.h" 45 46 #include "story_entity.h" 44 47 45 48 … … 126 129 registerEvent(KeyMapper::PEV_FIRE1); 127 130 registerEvent(EV_MOUSE_MOTION); 131 132 this->deadBox = NULL; 128 133 129 134 // weapon manager for the fps … … 276 281 void FPSPlayer::tick (float time) 277 282 { 278 // Second init-step 283 if ( deadBox != NULL ) 284 { 285 OrxGui::GLGuiHandler::getInstance()->tick( time ); 286 } 287 288 // Second init-step 279 289 if ( !this->initWeapon ) 280 290 { … … 587 597 { 588 598 Playable::destroy( killer ); 589 599 this->showDeadScreen(); 600 myList = this->getOMListNumber(); 590 601 toList( OM_DEAD ); 591 602 } … … 595 606 State::getPlayer()->hud().notifyUser(message); 596 607 } 608 609 void FPSPlayer::onButtonContinue( ) 610 { 611 OrxGui::GLGuiHandler::getInstance()->deactivateCursor( true ); 612 EventHandler::getInstance()->popState(); 613 WorldEntity::reset(); 614 toList( myList ); 615 deadBox->hideAll(); 616 } 617 618 void FPSPlayer::onButtonExit( ) 619 { 620 State::getCurrentStoryEntity()->setNextStoryID( 0 ); 621 State::getCurrentStoryEntity()->stop(); 622 } 623 624 void FPSPlayer::showDeadScreen( ) 625 { 626 EventHandler::getInstance()->pushState( ES_MENU ); 627 628 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 629 630 if ( deadBox ) 631 delete deadBox; 632 deadBox = new OrxGui::GLGuiBox(); 633 deadBox->setAbsCoor2D( 100, 100 ); 634 635 OrxGui::GLGuiText* text = new OrxGui::GLGuiText(); 636 text->setText( "Game Over! - You died!" ); 637 OrxGui::GLGuiPushButton* exitButton = new OrxGui::GLGuiPushButton( "exit" ); 638 exitButton->released.connect(this, &FPSPlayer::onButtonExit); 639 OrxGui::GLGuiPushButton* continueButton = new OrxGui::GLGuiPushButton( "continue" ); 640 continueButton->released.connect(this, &FPSPlayer::onButtonContinue); 641 642 deadBox->pack( text ); 643 deadBox->pack( continueButton ); 644 deadBox->pack( exitButton ); 645 646 deadBox->showAll(); 647 } -
branches/presentation/src/world_entities/creatures/fps_player.h
r10705 r10718 9 9 10 10 #include "playable.h" 11 #include "glgui.h" 11 12 12 13 … … 76 77 FPSSniperRifle* weapon; 77 78 79 OM_LIST myList; 80 OrxGui::GLGuiBox* deadBox; 81 void onButtonContinue(); 82 void onButtonExit(); 83 void showDeadScreen(); 84 78 85 }; 79 86 -
branches/presentation/src/world_entities/npcs/adm_turret.cc
r10708 r10718 174 174 dv2.normalize(); 175 175 float angle = dv1.dot(dv2); 176 if ( angle > 0.999)176 if ( angle > 0.999 && this->myTarget->getOMListNumber()!=OM_DEAD ) 177 177 { 178 178 if (this->weapon) this->weapon->fire(true); -
branches/presentation/src/world_entities/weapons/aiming_system.cc
r10698 r10718 100 100 } 101 101 102 PRINTF(0)("entity: %s\n", nearestEntity->getClassCName()); 103 return nearestEntity; 102 return nearestEntity; 104 103 } 105 104 -
branches/presentation/src/world_entities/weapons/bsp_weapon.cc
r10713 r10718 170 170 if ( shortestDist < (pos - target->getAbsCoor()).len() ) 171 171 { 172 173 #ifdef DEBUG_AIMING 172 174 printf("HIT WALL\n"); 173 #ifdef DEBUG_AIMING174 175 this->debugDist = shortestDist; 175 176 #endif … … 190 191 if (r < p ) 191 192 { 193 #ifdef DEBUG_AIMING 192 194 printf( "HIT %s\n", target->getClassName().c_str() ); 195 #endif 193 196 target->hit( this->damage, this ); 194 197 } 198 #ifdef DEBUG_AIMING 195 199 else 196 200 printf( "MISHIT %s\n", target->getClassName().c_str() ); 201 #endif 197 202 198 203 } 199 204 else 200 205 { 206 #ifdef DEBUG_AIMING 201 207 printf( "HIT %s\n", target->getClassName().c_str() ); 208 #endif 202 209 target->hit( this->damage, this ); 203 210 } … … 217 224 (*it)->draw(); 218 225 } 219 #if 1226 #ifdef DEBUG_AIMING 220 227 glMatrixMode(GL_MODELVIEW); 221 228 glPushMatrix(); … … 231 238 Vector mp = this->getAbsCoor(); 232 239 Vector op = this->getAbsDir().apply( Vector(1, 0, 0) ); 233 #ifdef DEBUG_AIMING 240 234 241 op *= debugDist; 235 #else236 op *= 1000;237 #endif238 242 op += mp; 239 243 -
branches/presentation/src/world_entities/weapons/fps_sniper_rifle.cc
r10711 r10718 154 154 void FPSSniperRifle::fire() 155 155 { 156 PRINTF(0)("sniper fire\n");157 156 this->bFire = true; 158 157 } … … 193 192 this->weapon->fire( bFire ); 194 193 195 if ( bFire ){196 PRINTF(0)("REAL FIRE\n");197 }198 194 bFire = false; 199 195 } -
branches/presentation/src/world_entities/world_entity.cc
r10714 r10718 990 990 void WorldEntity::hit(float damage, WorldEntity* killer) 991 991 { 992 PRINTF(0)("TESTS: %i %i %i\n", (forwardDamageToParent), (this->getParent() != NullParent::getNullParent()), (this->getParent()->isA( WorldEntity::staticClassID() )));993 992 if ( forwardDamageToParent && this->getParent() != NullParent::getNullParent() && this->getParent()->isA( WorldEntity::staticClassID() ) ) 994 993 { … … 1004 1003 1005 1004 this->decreaseHealth(damage); 1006 1007 PRINTF(0)("Hit me: %s::%s now only %f/%f health\n", this->getClassCName(), this->getCName(), this->getHealth(), this->getHealthMax());1008 1005 1009 1006 if( this->getHealth() > 0)
Note: See TracChangeset
for help on using the changeset viewer.