[Orxonox-commit 7810] r12402 - in code/branches/OrxoBlox_FS19: data/levels/templates data/overlays src/modules/OrxoBlox src/modules/weapons/projectiles

ahuwyler at orxonox.net ahuwyler at orxonox.net
Mon May 20 15:09:55 CEST 2019


Author: ahuwyler
Date: 2019-05-20 15:09:55 +0200 (Mon, 20 May 2019)
New Revision: 12402

Modified:
   code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
   code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
Log:
last commit

Modified: code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-20 13:09:55 UTC (rev 12402)
@@ -6,10 +6,7 @@
    spawnparticleduration  = 3
    explosionchunks        = 4
 
-   health            = 10
-   maxhealth         = 10
-   initialhealth     = 10
-
+   
    shieldhealth        = 20
    initialshieldhealth = 20
    maxshieldhealth     = 20

Modified: code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo
===================================================================
--- code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo	2019-05-20 13:09:55 UTC (rev 12402)
@@ -20,18 +20,8 @@
      caption   = "Points: "
     />
 
-    <OverlayText
-     position  = "0.7, 0.20"
-     pickpoint = "0.0, 0.0"
-     font      = "ShareTechMono"
-     textsize  = 0.05
-     colour    = "1.0, 1.0, 1.0, 1.0"
-     align     = "left"
 
-     showhealth  = true
-    />
 
-
   </OverlayGroup>
 </Template>
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-20 13:09:55 UTC (rev 12402)
@@ -142,6 +142,9 @@
 
     void OrxoBlox::LevelUp(){
         level_++;
+        if((level_%10)==0){
+            --counter;
+        }
         int z_ = 0;
 
         orxout() << "level up called" << endl;

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc	2019-05-20 13:09:55 UTC (rev 12402)
@@ -17,7 +17,7 @@
         RegisterObject(OrxoBloxStones);
 
         this->size_ = 9.0f;
-        this->health_ = 1;
+        this->setHealth(1);
         this->delay_ = false;
     }
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h	2019-05-20 13:09:55 UTC (rev 12402)
@@ -39,27 +39,17 @@
             */
             float getSize(void) const
                 { return this->size_; }
-            /**
-            @brief Set the Health of the stone.
-            @param size The dimensions a stone has in the game world. (A stone is a cube)
-            */
-            void setHealth(unsigned int health)
-                { 
-                    this->health_ = health; 
-                }
-            /**
-            @brief Get the size of the stone.
-            @return Returns the dimensions a stone has in the game world. (A stone is a cube)
-            */
-            unsigned int getHealth(void) const
-                { return this->health_; }
-
+            
             void gotHit(){
-                if (this->health_ > 0){
-                    this->health_ -= this->health_; 
+                orxout()<<"GOT HIT"<<endl;
+                unsigned int health_ =this->getHealth();
+                if (health_> 0){
+                    this->setHealth(++health_); 
                     }
-                //  else ~OrxoBloxStones();
+                else {
+                    this->kill();
                 }
+                }
 
             void setGame(OrxoBlox* orxoblox)
                 { assert(orxoblox); orxoblox_ = orxoblox; }
@@ -73,7 +63,6 @@
                 
         private:
             float size_; //!< The dimensions a stone has in the game world.
-            unsigned int health_;
             bool delay_;
             
             OrxoBlox* orxoblox_;

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-20 13:09:55 UTC (rev 12402)
@@ -1,5 +1,39 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ParticleProjectile.h
+    @brief Implementation of the ParticleProjectile class.
+*/
+
 #include "BallProjectile.h"
 #include "gametypes/Gametype.h"
+#include <OrxoBlox/OrxoBloxStones.h>
 
 
 #include <OgreParticleEmitter.h>
@@ -26,8 +60,8 @@
         this->fieldHeight_ =  49;
         this->orxoblox_ = this->getOrxoBlox();
         this->setCollisionShapeRadius(2.5);
-        this->setDamage(1000);
-                //setEffect("Orxonox/sparks2");
+        
+        //setEffect("Orxonox/sparks2");
     }
 
     void BallProjectile::registerVariables()
@@ -80,17 +114,24 @@
             if (distance_Z < 0)
                 distance_Z = -distance_Z;
 
+            //orxout() << distance_X << endl;
+            //orxout() << distance_Z << endl;
+
             if (distance_X < distance_Z) {
                 velocity.z = -velocity.z;
+                //orxout() << "z" << endl;
             }
             if (distance_Z < distance_X) {
                 velocity.x = -velocity.x;
+                //orxout() << "x" << endl;
             }
             else {
                 velocity.x = -velocity.x;
                 velocity.z = -velocity.z;
+                //orxout() << "both" << endl;
             }
             this->setVelocity(velocity);
+        //}
     }
 
     
@@ -100,6 +141,7 @@
         if (result == true) {
             if (otherObject->isA(Class(OrxoBloxStones))) {
                 Bounce(otherObject, contactPoint, cs);
+                (orxonox_cast<OrxoBloxStones*>(otherObject))->gotHit();
                 
             }
         }
@@ -144,7 +186,6 @@
                 // Set the ball to be exactly at the boundary.
                 position.z = this-> fieldHeight_;
                 orxoblox_->count();
-
                 suicidal = true;
                 
             }
@@ -214,8 +255,6 @@
         }
     }
 
-
-    //This is an override to prevent getting killed by the program
     void BallProjectile::destroyObject(void)
     {
         if(GameMode::isMaster()) {

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	2019-05-20 13:07:57 UTC (rev 12401)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	2019-05-20 13:09:55 UTC (rev 12402)
@@ -37,6 +37,7 @@
             unsigned int maxTextureIndex_; //!< The maximal index.
             std::string materialBase_; //!< The base name of the material.
             OrxoBlox* orxoblox_;
+            OrxoBloxStones* stone_;
     };
 }
 



More information about the Orxonox-commit mailing list