[Orxonox-commit 4356] r9027 - in code/branches/pCuts: data/levels src/orxonox/gametypes

jo at orxonox.net jo at orxonox.net
Wed Mar 14 23:21:04 CET 2012


Author: jo
Date: 2012-03-14 23:21:04 +0100 (Wed, 14 Mar 2012)
New Revision: 9027

Modified:
   code/branches/pCuts/data/levels/presentationHS11.oxw
   code/branches/pCuts/src/orxonox/gametypes/Dynamicmatch.cc
   code/branches/pCuts/src/orxonox/gametypes/TeamDeathmatch.cc
   code/branches/pCuts/src/orxonox/gametypes/TeamGametype.cc
Log:
Added in game documentation for new group behaviour.

Modified: code/branches/pCuts/data/levels/presentationHS11.oxw
===================================================================
--- code/branches/pCuts/data/levels/presentationHS11.oxw	2012-03-11 20:19:47 UTC (rev 9026)
+++ code/branches/pCuts/data/levels/presentationHS11.oxw	2012-03-14 22:21:04 UTC (rev 9027)
@@ -1,3 +1,6 @@
+<!-- TODO: add in level documentation !! -->
+
+
 <LevelInfo
  name = "Presentation HS 2011"
  description = "Oxonox Proudly Presents New Features From HS 2011"
@@ -80,6 +83,8 @@
     </SimpleNotification>
 
 
+
+
 <!-- ADDING FORMATION: 5 Swallows -->
 <?lua for i=0,4,1 do
 ?>
@@ -130,12 +135,100 @@
     </SpaceShip>
 <?lua end ?>
 
+<!-- @Triggers: "hintX" <->  delayed LetsGo -->
+    <EventTrigger name="hint1" activations="1" stayactive="true" delay=4.2>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint2" activations="1" stayactive="true" delay=8.4>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint3" activations="1" stayactive="true" delay=12.6>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint4" activations="1" stayactive="true" delay=16.8>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint5" activations="1" stayactive="true" delay=21>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint6" activations="1" stayactive="true" delay=25.2>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
 
 
 
+    <SimpleNotification message="Make bots follow you: Press (1)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint1 />
+            </trigger>
+        </events>
+    </SimpleNotification>
 
+    <SimpleNotification message="Toggle group behaviour: Press (1)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint2 />
+            </trigger>
+        </events>
+    </SimpleNotification>
 
+    <SimpleNotification message="Tell the bots to defend you: Press (2)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint3 />
+            </trigger>
+        </events>
+    </SimpleNotification>
 
+    <SimpleNotification message="Make them attack opponents: Press (2)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint4 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Let the bots behave normal: Press (2) "  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint5 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Have a look at the console to verify this."  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint6 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
 <!-- Generate asteroid field and asteroid belt -->
 <!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) --> 
     <?lua

Modified: code/branches/pCuts/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/pCuts/src/orxonox/gametypes/Dynamicmatch.cc	2012-03-11 20:19:47 UTC (rev 9026)
+++ code/branches/pCuts/src/orxonox/gametypes/Dynamicmatch.cc	2012-03-14 22:21:04 UTC (rev 9027)
@@ -30,18 +30,19 @@
 //killerfarbe schwarz; evtl. eigenes Raumfahrzeug;
 //Low; Codeoptimierung und Dokumentation
 
-/*
-short gaming manual:
-There are three different parties a player can belong to: victim, chaser or killer
-Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
-In order to win you have to earn as much points as possible:
-- as victim by escaping the chasers
-- as chaser by shooting the victim
-- as killer by killing the chasers
+/**
+ at brief
+    Short Gaming Manual:
+    There are three different parties a player can belong to: victim, chaser or killer
+    Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
+    In order to win you have to earn as much points as possible:
+    - as victim by escaping the chasers
+    - as chaser by shooting the victim
+    - as killer by killing the chasers
 
 
-What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
-P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
+    What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
+    P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
 */
 #include "Dynamicmatch.h"
 
@@ -94,7 +95,6 @@
             ColourValue(1.0f, 0.3f, 0.3f),  //chasercolour
             ColourValue(0.3f, 0.3f, 1.0f),  //piggycolour
             ColourValue(0.3f, 1.0f, 0.3f)   //killercolour  what about black: 0.0f, 0.0f, 0.0f
-
         };
         static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
 
@@ -110,8 +110,8 @@
             return false;
         if (victim && victim->getPlayer()) //&& originator && originator->getPlayer() ??
         {
-        int target= playerParty_[victim->getPlayer()];
-        int source= playerParty_[originator->getPlayer()];
+            int target = playerParty_[victim->getPlayer()];
+            int source = playerParty_[originator->getPlayer()];
 
             //Case: Not Enough Pigs: party change (= party management)
             if (notEnoughPigs)
@@ -308,13 +308,13 @@
 
     /**
     @brief
-        Grant the piggy a boost.
+        Grant the victim a boost.
     @param spaceship
         The SpaceShip to give the boost.
     */
     void Dynamicmatch::grantPigBoost(SpaceShip* spaceship)
     {
-        // Give pig boost
+        // Give victim boost
         if (spaceship)
         {
             spaceship->addSpeedFactor(5);
@@ -373,11 +373,15 @@
         SUPER(Dynamicmatch, tick, dt);
 
         if (this->hasStarted() && !gameEnded_)
-        {   pointsPerTime =pointsPerTime + dt;
-            gameTime_ = gameTime_ - dt;
-            if (pointsPerTime > 2.0f)//hard coded!! should be changed
+        {
+orxout() << " number of chasers:  " << numberOf[chaser] << endl;
+orxout() << " number of killers:  " << numberOf[killer] << endl;
+orxout() << " number of victims:  " << numberOf[piggy] << endl;
+            pointsPerTime = pointsPerTime + dt; //increase points
+            gameTime_ = gameTime_ - dt; // decrease game time
+            if (pointsPerTime > 2.0f) //hard coded points for victim! should be changed
             {
-                pointsPerTime=0.0f;
+                pointsPerTime = 0.0f;
                 rewardPig();
             }
             if (gameTime_<= 0)
@@ -407,6 +411,9 @@
         }
     }
 
+/**
+    @brief The reward function is called every 2 seconds via the tick function and makes the victim score points.
+*/
     void Dynamicmatch::rewardPig()
     {
         for (std::map< PlayerInfo*, int >::iterator it = this->playerParty_.begin(); it != this->playerParty_.end(); ++it) //durch alle Spieler iterieren und alle piggys finden
@@ -414,7 +421,7 @@
             if (it->second==piggy)
             {
                  //Spieler mit der Pig-party frags++
-                 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);// still not sure if right syntax
+                 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);
                  if (it2 != this->players_.end())
                  {
                      it2->second.frags_++;

Modified: code/branches/pCuts/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/branches/pCuts/src/orxonox/gametypes/TeamDeathmatch.cc	2012-03-11 20:19:47 UTC (rev 9026)
+++ code/branches/pCuts/src/orxonox/gametypes/TeamDeathmatch.cc	2012-03-14 22:21:04 UTC (rev 9027)
@@ -29,11 +29,8 @@
 #include "TeamDeathmatch.h"
 
 #include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
 #include "chat/ChatManager.h"
-#include "interfaces/TeamColourable.h"
 #include "infos/PlayerInfo.h"
-#include "worldentities/TeamSpawnPoint.h"
 #include "worldentities/pawns/Pawn.h"
 
 namespace orxonox

Modified: code/branches/pCuts/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/pCuts/src/orxonox/gametypes/TeamGametype.cc	2012-03-11 20:19:47 UTC (rev 9026)
+++ code/branches/pCuts/src/orxonox/gametypes/TeamGametype.cc	2012-03-14 22:21:04 UTC (rev 9027)
@@ -88,6 +88,11 @@
         }
     }
 
+    /**
+    @brief
+        Function that determines the player's team number when entering the game for the first time.
+        Override this function for other team structures.
+    */
     void TeamGametype::findAndSetTeam(PlayerInfo* player)
     {
         if(player == NULL) return; // catch null pointers
@@ -130,7 +135,6 @@
             this->allowedInGame_.erase(player);
         }
 
-
         return valid_player;
     }
 




More information about the Orxonox-commit mailing list