Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2010, 5:58:01 PM (14 years ago)
Author:
jo
Message:

Level is now fixed. Some further minor changes.

Location:
code/branches/lastmanstanding/src/orxonox/gametypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc

    r7605 r7617  
    4848        this->timeRemaining=15.0f;
    4949        this->respawnDelay=4.0f;
    50         this->noPunishment=false;
    51         this->hardPunishment=false;
     50        this->bNoPunishment=false;
     51        this->bHardPunishment=false;
    5252        this->punishDamageRate=0.4f;
    5353        this->setHUDTemplate("LastmanstandingHUD");
     
    6363                {
    6464                    this->spawnPlayer(it->first);
    65                 }
    66                 else if ((!inGame_[it->first])&&(0<playerLives_[it->first]))
    67                 {
    68                     if (it->first->getClientID()== CLIENTID_UNKNOWN)
    69                         continue;
    70                     const std::string& message = "Respawn in " +multi_cast<std::string>(respawnDelay)+ " seconds." ;
    71                     this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    7265                }
    7366                else if (0>=playerLives_[it->first])
     
    8780        SetConfigValue(timeRemaining, 15.0f);
    8881        SetConfigValue(respawnDelay, 4.0f);
    89         SetConfigValue(noPunishment, false);
    90         SetConfigValue(hardPunishment, false);
     82        SetConfigValue(bNoPunishment, false);
     83        SetConfigValue(bHardPunishment, false);
    9184    }
    9285
     
    10295                if (it->first->getClientID()== CLIENTID_UNKNOWN)
    10396                    return true;
    104                 const std::string& message = ""; // set blank - erases Camper-Warning-message
     97                const std::string& message = ""; // resets Camper-Warning-message
    10598                this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    10699            }   
     
    243236        if(!player)
    244237            return;
    245         if(noPunishment)
     238        if(bNoPunishment)
    246239            return;
    247240        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
     
    253246            if(!pawn)
    254247                return;
    255             if(hardPunishment)
     248            if(bHardPunishment)
    256249            {
    257250                pawn->kill();
    258251                this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
    259252            }
    260             /*else
    261             {
    262                 float damage=pawn->getMaxHealth()*punishDamageRate*0.5;
     253            else
     254            {
     255                float damage=pawn->getMaxHealth()*punishDamageRate*0.5;//TODO: Factor 0.5 is hard coded. Where is the ratio between MaxHealth actually defined?
    263256                pawn->removeHealth(damage);
    264257                this->timeToAct_[player]=timeRemaining;//reset timer
    265             }*/
     258            }
    266259        }
    267260    }
     
    297290                    it->second=timeRemaining+3.0f;//reset punishment-timer
    298291                    if (playerGetLives(it->first)>0)
     292                    {
    299293                        this->punishPlayer(it->first);
     294                        if (it->first->getClientID()== CLIENTID_UNKNOWN)
     295                            return;
     296                        const std::string& message = ""; // resets Camper-Warning-message
     297                        this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
     298                    }
    300299                }
    301300                else if (it->second<timeRemaining/5)//Warning message
  • code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h

    r7605 r7617  
    5555            float timeRemaining; //!< Each player has a certain time where he or she has to hit an opponent or will be punished.
    5656            std::map<PlayerInfo*, float> timeToAct_; //!< Each player's time till she/he will be punished is stored here.
    57             float respawnDelay;
     57            float respawnDelay; //!<Time in seconds when a player will respawn after death.
    5858            std::map<PlayerInfo*, float> playerDelayTime_; //!< Stores each Player's delay time.
    5959            std::map<PlayerInfo*, bool> inGame_; //!< Indicates each Player's state.
    60             bool noPunishment;
    61             bool hardPunishment;
    62             float punishDamageRate;
     60            bool bNoPunishment; //!< Config value to switch off Punishment function if it is set to true.
     61            bool bHardPunishment; //!< Switches between damage and death as punishment.
     62            float punishDamageRate; //!< Makes Damage adjustable.
    6363            virtual void spawnDeadPlayersIfRequested(); //!< Prevents dead players to respawn.
    6464            virtual int getMinLives(); //!< Returns minimum of each player's lives; players with 0 lives are skipped;
Note: See TracChangeset for help on using the changeset viewer.