Changeset 9235 in orxonox.OLD for trunk/src/util/multiplayer_team_deathmatch.cc
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/multiplayer_team_deathmatch.cc
r9110 r9235 210 210 while ( this->killList.begin() != this->killList.end() ) 211 211 { 212 PRINTF(0)("KKKKKKKKIIIIIIIIILLLLLLLLLLLLL\n"); 212 213 onKill( this->killList.begin()->getVictim(), this->killList.begin()->getKiller() ); 213 214 this->killList.erase( this->killList.begin() ); … … 305 306 return "models/creatures/doom_guy.md2"; 306 307 else if ( team == 1 ) 307 return "models/creatures/ doom_guy.md2";308 return "models/creatures/male.md2"; 308 309 else 309 310 return ""; 310 311 } 311 312 313 std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassID classId ) 314 { 315 if ( classId == CL_FPS_PLAYER ) 316 { 317 if ( team == 0 ) 318 return "maps/doom_guy.png"; 319 else 320 return "maps/male_fiend.pcx"; 321 } 322 323 return ""; 324 } 325 326 float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, ClassID classId ) 327 { 328 if ( classId == CL_FPS_PLAYER ) 329 { 330 return 10.0f; 331 } 332 333 return 1.0f; 334 } 335 312 336 /** 313 337 * calculate team score … … 399 423 if ( currentGameState == GAMESTATE_POST_GAME ) 400 424 { 401 State::getCurrentStoryEntity()->stop();425 //State::getCurrentStoryEntity()->stop(); 402 426 this->bShowTeamChange = false; 403 427 … … 456 480 std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId ); 457 481 std::string playableTexture = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId ); 482 float playableScale = getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId ); 458 483 459 484 BaseObject * bo = Factory::fabricate( playableClassId ); … … 464 489 Playable & playable = *(dynamic_cast<Playable*>(bo)); 465 490 466 if ( playableTexture != "" ) 467 playable.loadMD2Texture( playableTexture ); 468 if ( playableModel != "" ) 469 playable.loadModel( playableModel ); 491 playable.loadMD2Texture( playableTexture ); 492 playable.loadModel( playableModel, playableScale ); 470 493 playable.setOwner( userId ); 471 494 playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() ); … … 687 710 { 688 711 if ( !victim ) 689 return; 712 { 713 PRINTF(0)("victim == NULL\n"); 714 return; 715 } 690 716 if ( !killer ) 691 return; 717 { 718 PRINTF(0)("killer == NULL\n"); 719 return; 720 } 692 721 693 722 int killerUserId = killer->getOwner(); 694 723 int victimUserId = victim->getOwner(); 724 725 PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName()); 695 726 696 727 PlayerStats & victimStats = *PlayerStats::getStats( victimUserId ); … … 698 729 699 730 if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim ) 700 return; 731 { 732 PRINTF(0)("killerStats.getPlayable() != killer || victimStats.getPlayable() != victim\n"); 733 PRINTF(0)("%x %x %x %x\n", killerStats.getPlayable(), killer, victimStats.getPlayable(), victim ); 734 PRINTF(0)("%d %d %d %d\n", killerStats.getPlayable()->getUniqueID(), killer->getUniqueID(), victimStats.getPlayable()->getUniqueID(), victim->getUniqueID() ); 735 return; 736 } 701 737 702 738 //check for suicide … … 782 818 } 783 819 784 std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassID classId ) 785 { 786 if ( classId == CL_FPS_PLAYER ) 787 { 788 return "maps/doom_guy.png"; 789 } 790 791 return ""; 792 } 793 820
Note: See TracChangeset
for help on using the changeset viewer.