Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7617


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

Level is now fixed. Some further minor changes.

Location:
code/branches/lastmanstanding
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lastmanstanding/data/levels/gametype_lastmanstanding.oxw

    r7605 r7617  
    6666<!-- ---------------asteroid dome----------------- -->
    6767<?lua
    68 max = 17
    69 for i = 1, max, 1
     68max = 16
     69for i = 0, max, 1
    7070do
    7171    y = math.sin(i/max*6)*750
    7272    z = math.cos(i/max*6)*750
     73    j = 1
    7374    ?>
    74 <?lua
    75 for k = 1, 17, 1
    76 do
    77 j = math.random()
    78 ?>
    7975
    8076    <SpawnPoint team=0 position="<?lua print(y*1.4+z*0.2) ?>,0,<?lua print(z*1.4-y*0.2) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     
    142138
    143139
    144 <?lua
    145 end
    146 ?>
    147140<?lua end ?>
    148141
  • 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.