Changeset 8782 in orxonox.OLD for branches/network/src/util
- Timestamp:
- Jun 26, 2006, 1:35:46 PM (19 years ago)
- Location:
- branches/network/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/multiplayer_team_deathmatch.cc
r8774 r8782 717 717 } 718 718 719 720 721 719 /** 720 * this function is called when a player kills another one or himself 721 * @param killedUserId 722 * @param userId 723 */ 724 void MultiplayerTeamDeathmatch::onKill( int killedUserId, int userId ) 725 { 726 assert( PlayerStats::getStats( killedUserId ) ); 727 assert( PlayerStats::getStats( userId ) ); 728 729 PlayerStats & killedStats = *PlayerStats::getStats( killedUserId ); 730 PlayerStats & stats = *PlayerStats::getStats( userId ); 731 732 if ( killedUserId != userId ) 733 stats.setScore( stats.getScore() + 1 ); 734 else 735 stats.setScore( stats.getScore() - 1 ); 736 737 killedStats.getPlayable()->toList( OM_DEAD ); 738 739 if ( killedUserId == SharedNetworkData::getInstance()->getHostID() ) 740 { 741 this->bLocalPlayerDead = true; 742 this->showStats(); 743 } 744 745 //TODO respawn killed palyer 746 747 } 748 749 /** 750 * this function is called on player respawn 751 * @param userId 752 */ 753 void MultiplayerTeamDeathmatch::onRespawn( int userId ) 754 { 755 if ( userId == SharedNetworkData::getInstance()->getHostID() ) 756 { 757 this->bLocalPlayerDead = false; 758 this->hideStats(); 759 } 760 } 761 -
branches/network/src/util/multiplayer_team_deathmatch.h
r8772 r8782 58 58 virtual void process(const Event &event); 59 59 60 void onKill( int killedUserId, int userId ); 61 void onRespawn( int userId ); 62 60 63 virtual void handleChatMessage( int userId, const std::string & message, int messageType ); 61 64
Note: See TracChangeset
for help on using the changeset viewer.