[Orxonox-commit 4095] r8766 - in code/branches/ai2/src/orxonox: controllers weaponsystem

jo at orxonox.net jo at orxonox.net
Tue Jul 19 22:27:16 CEST 2011


Author: jo
Date: 2011-07-19 22:27:15 +0200 (Tue, 19 Jul 2011)
New Revision: 8766

Modified:
   code/branches/ai2/src/orxonox/controllers/AIController.cc
   code/branches/ai2/src/orxonox/weaponsystem/WeaponSlot.h
Log:
Backup before taking the next step.

Modified: code/branches/ai2/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/ai2/src/orxonox/controllers/AIController.cc	2011-07-19 19:26:32 UTC (rev 8765)
+++ code/branches/ai2/src/orxonox/controllers/AIController.cc	2011-07-19 20:27:15 UTC (rev 8766)
@@ -225,7 +225,7 @@
                         {
                             this->aimAtTarget();
                             random = rnd(maxrand);
-                            if(this->botlevel_*100 > random)
+                            if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
                                 this->follow();  //If a bot is shooting a player, it shouldn't let him go away easily.
                         }
                     }
@@ -261,7 +261,8 @@
                     {
                         this->aimAtTarget();
                         random = rnd(maxrand);
-                        if(this->botlevel_*100 > random)
+
+                        if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
                             this->follow();//If a bot is shooting a player, it shouldn't let him go away easily.
                      }
                 }

Modified: code/branches/ai2/src/orxonox/weaponsystem/WeaponSlot.h
===================================================================
--- code/branches/ai2/src/orxonox/weaponsystem/WeaponSlot.h	2011-07-19 19:26:32 UTC (rev 8765)
+++ code/branches/ai2/src/orxonox/weaponsystem/WeaponSlot.h	2011-07-19 20:27:15 UTC (rev 8766)
@@ -34,6 +34,25 @@
 
 namespace orxonox
 {
+        /**
+        @brief
+            The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
+            In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
+            A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
+
+            A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
+            @code
+            <weaponslots>
+              <WeaponSlot position="-15.0,-1.5,0" />
+              <WeaponSlot position=" 15.0,-1.5,0" />
+              <WeaponSlot position="    0,   0,0" />
+            </weaponslots>
+
+        @author
+            Martin Polak
+
+        @ingroup Weaponsystem
+    */
     class _OrxonoxExport WeaponSlot : public StaticEntity
     {
         public:




More information about the Orxonox-commit mailing list