[Orxonox-commit 2940] r7640 - in code/branches/lastmanstanding: data/levels data/overlays src/orxonox/gametypes
jo at orxonox.net
jo at orxonox.net
Thu Nov 11 17:06:23 CET 2010
Author: jo
Date: 2010-11-11 17:06:23 +0100 (Thu, 11 Nov 2010)
New Revision: 7640
Modified:
code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw
code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
Log:
Hud works. There's at least on bug to repair.
Modified: code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw
===================================================================
--- code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw 2010-11-11 11:30:38 UTC (rev 7639)
+++ code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw 2010-11-11 16:06:23 UTC (rev 7640)
@@ -67,11 +67,11 @@
<!-- ---------------asteroid ellypse----------------- -->
<?lua
max = 20
-for i = 1, max, 1
+for i = 0, max, 1
do
y = math.sin(i/max*6)*4000
z = math.cos(i/max*6)*5000
- x = i*100
+ x = 0
?>
<?lua
for k = 1, 25, 1
Modified: code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo
===================================================================
--- code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo 2010-11-11 11:30:38 UTC (rev 7639)
+++ code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo 2010-11-11 16:06:23 UTC (rev 7640)
@@ -1,7 +1,7 @@
<Template name="LastmanstandingHUD">
<OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
- <GametypeStaticMessage
+ <!--GametypeStaticMessage
name = "staticmessage"
position = "0.5, 0.01"
font = "VeraMono"
@@ -9,46 +9,59 @@
textsize = 0.033
colour = "1.0, 1.0, 0.5, 1.0"
align = "center"
- />
+ /-->
<GametypeFadingMessage
name = "fadingmessage"
- position = "0.5, 0.05"
+ position = "0.5, 0.01"
font = "VeraMono"
textsize = 0.04
colour = "1.0, 1.0, 0.5, 1.0"
align = "center"
/>
+
+ <OverlayText
+ position = "0.02, 0.02"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Lives: "
+ />
+
<LastManStandingInfos
- position = "0.63, 0.05"
+ position = "0.15, 0.02"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
- colour = "0.8, 0.8, 1.0, 1.0"
- align = "right"
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
showlives = true
showplayers = false
/>
<OverlayText
- position = "0.02, 0.02"
+ position = "0.02, 0.055"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- caption = "Lives: "
+ caption = "Players: "
/>
- <OverlayText
- position = "0.02, 0.055"
+ <LastManStandingInfos
+ position = "0.15, 0.055"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- caption = "Players: "
+
+ showlives = false
+ showplayers = true
/>
<OverlayText
Modified: code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc 2010-11-11 11:30:38 UTC (rev 7639)
+++ code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc 2010-11-11 16:06:23 UTC (rev 7640)
@@ -63,13 +63,6 @@
{
this->spawnPlayer(it->first);
}
- else if (0>=playerLives_[it->first])
- {
- if (it->first->getClientID()== CLIENTID_UNKNOWN)
- continue;
- const std::string& message2 = "You have lost all " +multi_cast<std::string>(lives)+ " lives." ;
- this->gtinfo_->sendFadingMessage(message2,it->first->getClientID());
- }
}
}
@@ -114,6 +107,7 @@
COUT(0) << message << std::endl;
Host::Broadcast(message);
}
+
return true;
}
@@ -172,14 +166,6 @@
this->timeToAct_[player]=timeRemaining;
this->playerDelayTime_[player]=respawnDelay;
this->inGame_[player]=true;
- //Update: EachPlayer's "Players in Game"-HUD
- for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
- {
- if (it->first->getClientID() == CLIENTID_UNKNOWN)
- continue;
- const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
- this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
- }
}
bool LastManStanding::playerLeft(PlayerInfo* player)
@@ -191,14 +177,6 @@
this->playerLives_.erase (player);
this->playerDelayTime_.erase (player);
this->inGame_.erase (player);
- //Update: EachPlayer's "Players in Game"-HUD
- for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
- {
- if (it->first->getClientID() == CLIENTID_UNKNOWN)
- continue;
- const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
- this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
- }
}
return valid_player;
@@ -210,31 +188,17 @@
return;
this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
this->playerDelayTime_[player]=respawnDelay;
- //Update: Individual Players "lifes"-HUD
- std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(player);
- if (it2 != this->players_.end())
+
+ std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
+ if (it != this->players_.end())
{
- if (it2->first->getClientID()== CLIENTID_UNKNOWN)
+ if (it->first->getClientID()== CLIENTID_UNKNOWN)
return;
- const std::string& message = "Your Lives: " +multi_cast<std::string>(playerLives_[player]);
- this->gtinfo_->sendFadingMessage(message,it2->first->getClientID());
- const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
- this->gtinfo_->sendStaticMessage(message1,it2->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
- }
+ const std::string& message = ""; // resets Camper-Warning-message
+ this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
+ }
}
- void LastManStanding::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn)
- {
- //Update: EachPlayer's "Players in Game"-HUD
- for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
- {
- if (it->first->getClientID() == CLIENTID_UNKNOWN)
- continue;
- const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
- this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
- }
- }
-
void LastManStanding::punishPlayer(PlayerInfo* player)
{
if(!player)
Modified: code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
===================================================================
--- code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h 2010-11-11 11:30:38 UTC (rev 7639)
+++ code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h 2010-11-11 16:06:23 UTC (rev 7640)
@@ -74,10 +74,9 @@
virtual void end(); //!< Sends an end message.
int playerGetLives(PlayerInfo* player); //!< getFunction for the map "playerLives_".
int getNumPlayersAlive() const; //!< Returns the number of players that are still alive.
- virtual void playerEntered(PlayerInfo* player); //!< Initializes values. Manages the gametype's HUD. #Players alive via StaticMessage.
- virtual bool playerLeft(PlayerInfo* player); //!< Manages the gametype's HUD. #Players alive via StaticMessage.
- virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Manages the gametype's HUD. player's lives via FadingMessage.
- virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Manages the gametype's HUD. #Players alive via StaticMessage.
+ virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
+ virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
+ virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Resets punishment time and respawn delay.
void punishPlayer(PlayerInfo* player); //!< Function in order to kill a player. Punishment for hiding longer than "timeRemaining".
void tick (float dt); //!< used to end the game
More information about the Orxonox-commit
mailing list