Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9235 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Jul 5, 2006, 4:39:02 PM (19 years ago)
Author:
bensch
Message:

merged the presentation back

Location:
trunk/src/util
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/hud.cc

    r9014 r9235  
    187187    this->_radar->setCenterNode(State::getPlayer()->getPlayable());
    188188    this->_radar->addEntityList(&State::getObjectManager()->getObjectList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
     189    this->_radar->addEntityList(&State::getObjectManager()->getObjectList(OM_GROUP_02), Color(1.0, .2, .2));
    189190    this->_radar->setAbsCoor2D(0.8 * this->resX, 0.01 * this->resY);
    190191    this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY);
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r9110 r9235  
    210210  while ( this->killList.begin() != this->killList.end() )
    211211  {
     212    PRINTF(0)("KKKKKKKKIIIIIIIIILLLLLLLLLLLLL\n");
    212213    onKill( this->killList.begin()->getVictim(), this->killList.begin()->getKiller() );
    213214    this->killList.erase( this->killList.begin() );
     
    305306    return "models/creatures/doom_guy.md2";
    306307  else if ( team == 1 )
    307     return "models/creatures/doom_guy.md2";
     308    return "models/creatures/male.md2";
    308309  else
    309310    return "";
    310311}
    311312
     313std::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
     326float 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
    312336/**
    313337 * calculate team score
     
    399423  if ( currentGameState == GAMESTATE_POST_GAME )
    400424  {
    401     State::getCurrentStoryEntity()->stop();
     425    //State::getCurrentStoryEntity()->stop();
    402426    this->bShowTeamChange = false;
    403427
     
    456480  std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );
    457481  std::string playableTexture = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId );
     482  float       playableScale = getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId );
    458483
    459484  BaseObject * bo = Factory::fabricate( playableClassId );
     
    464489  Playable & playable = *(dynamic_cast<Playable*>(bo));
    465490
    466   if ( playableTexture != "" )
    467     playable.loadMD2Texture( playableTexture );
    468   if ( playableModel != "" )
    469     playable.loadModel( playableModel );
     491  playable.loadMD2Texture( playableTexture );
     492  playable.loadModel( playableModel, playableScale );
    470493  playable.setOwner( userId );
    471494  playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
     
    687710{
    688711  if ( !victim )
    689     return;
     712  {
     713    PRINTF(0)("victim == NULL\n");
     714    return;
     715  }
    690716  if ( !killer )
    691     return;
     717  {
     718    PRINTF(0)("killer == NULL\n");
     719    return;
     720  }
    692721 
    693722  int killerUserId = killer->getOwner();
    694723  int victimUserId = victim->getOwner();
     724 
     725  PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName());
    695726
    696727  PlayerStats & victimStats = *PlayerStats::getStats( victimUserId );
     
    698729 
    699730  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  }
    701737
    702738  //check for suicide
     
    782818}
    783819
    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
  • trunk/src/util/multiplayer_team_deathmatch.h

    r9110 r9235  
    4141    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
    4242    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
     43    virtual float getPlayableScale( int userId, int team, ClassID classId );
    4344
    4445    virtual void registerSpawn( WorldEntity * we );
  • trunk/src/util/network_game_rules.cc

    r9110 r9235  
    6868
    6969
     70float NetworkGameRules::getPlayableScale( int userId, int team, ClassID classId )
     71{
     72  return 1.0f;
     73}
  • trunk/src/util/network_game_rules.h

    r9110 r9235  
    2424    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
    2525    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
     26    virtual float getPlayableScale( int userId, int team, ClassID classId );
    2627   
    2728    virtual PlayerStats * getNewPlayerStats( int userId ){ return new PlayerStats( userId ); }
Note: See TracChangeset for help on using the changeset viewer.