[Orxonox-commit 7802] r12394 - in code/branches/OrxoBlox_FS19: data/levels data/levels/includes data/levels/templates src/modules/OrxoBlox src/modules/weapons/projectiles src/modules/weapons/weaponmodes

pomselj at orxonox.net pomselj at orxonox.net
Thu May 16 18:27:53 CEST 2019


Author: pomselj
Date: 2019-05-16 18:27:53 +0200 (Thu, 16 May 2019)
New Revision: 12394

Modified:
   code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
   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/weaponmodes/BallGun.cc
Log:
almost done

Modified: code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 16:27:53 UTC (rev 12394)
@@ -1,5 +1,5 @@
     <weaponslots>
-      <WeaponSlot position="0,0,0" />/>
+      <WeaponSlot position="0,-5,0" />/>
     </weaponslots>
     <weaponsets>
       <WeaponSet firemode=0 />

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-16 16:27:53 UTC (rev 12394)
@@ -90,7 +90,7 @@
 
     <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
     <Light type=directional position="-100, 10000, -700" direction="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
-    <SpawnPoint team=0 position="0,-4.5,49" lookat="0,0,0" spawnclass= SpaceShip pawndesign=spaceshipOrxoBlox/>
+    <SpawnPoint team=0 position="0,-4.5,49" lookat="-10000,0,0" spawnclass= SpaceShip pawndesign=spaceshipOrxoBlox/>
 
     <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /--->
 

Modified: code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-16 16:27:53 UTC (rev 12394)
@@ -102,7 +102,7 @@
       <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
     </attached>
     <collisionShapes> 
-          <BoxCollisionShape position="0,0,0" halfExtents="2,2,2" /> 
+          <BoxCollisionShape position="0,0,0" halfExtents="4,4,4" /> 
     </collisionShapes> 
   </OrxoBloxStones>
 </Template>
\ No newline at end of file

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-16 16:27:53 UTC (rev 12394)
@@ -70,6 +70,7 @@
         this->futureWall_ = nullptr;
         this->player_ = nullptr;
         level_ = 0;
+        this->counter = 0;
 
         this->setHUDTemplate("OrxoBloxHUD");
         //Error when specified
@@ -143,7 +144,7 @@
         if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
         {
 
-            level_=1;
+            level_= 1;
 
         }
         else // If no centerpoint was specified, an error is thrown and the level is exited.
@@ -212,19 +213,18 @@
         int z_ = 0;
 
         orxout() << "level up called" << endl;
-        this->playerScored(this->player_);// add points
+        //this->playerScored(this->player_);// add points
 
         this->createWall();
         this->activeWalls_.push_back(this->futureWall_);
-        for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
-            if (this->futureWall_->getStone(i) == nullptr) {
-                orxout() << "Added nullptr to std::list stones_" << endl;
-            }
-
+/*        for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
             this->stones_.push_back(this->futureWall_->getStone(i));
-        }
+        }*/
 
         for(OrxoBloxWall* wall : this->activeWalls_) {
+            if(wall == nullptr) {
+                continue;
+            }
             if(wall->isEmpty()) {
                 wall->destroy();
             }
@@ -339,4 +339,16 @@
         }
     }
   */  
+    void OrxoBlox::count() {
+        if(this->counter >= this->max_counter) {
+            this->LevelUp();
+            counter = 0;
+            return;
+        }
+        else {
+            this->counter++;
+        }
+    }
+
+
 }

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-16 16:27:53 UTC (rev 12394)
@@ -90,6 +90,7 @@
                 { return this->center_; }
             //OrxoBloxStones* CheckForCollision(OrxoBloxBall* Ball);
             virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
+            void count();
         protected:
         private:
             void startWall(void);
@@ -107,7 +108,9 @@
             
             WeakPtr<OrxoBloxWall> futureWall_;
             std::vector<OrxoBloxWall*> activeWalls_;
-            std::list<StrongPtr<OrxoBloxStones>> stones_; //!< A list of all stones in play.
+            std::vector<OrxoBloxStones*> stones_; //!< A list of all stones in play.
+            int counter;
+            const int max_counter = 10;
 
     };
 }

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc	2019-05-16 16:27:53 UTC (rev 12394)
@@ -17,7 +17,7 @@
         RegisterObject(OrxoBloxStones);
 
         this->size_ = 9.0f;
-        this->health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
+        this->health_ = 1;
         this->delay_ = false;
     }
 
@@ -32,4 +32,11 @@
     float OrxoBloxStones::getSize() {
         return this->size_;
     }
+
+    bool OrxoBloxStones::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
+    {
+        orxout() << "a stone should die" << endl;
+        this->destroy();
+        return true;
+    }
 }
\ No newline at end of file

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h	2019-05-16 16:27:53 UTC (rev 12394)
@@ -69,6 +69,7 @@
             void reduceHealth();
 
             float getSize();
+            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
                 
         private:
             float size_; //!< The dimensions a stone has in the game world.

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 16:27:53 UTC (rev 12394)
@@ -59,6 +59,7 @@
         this->fieldHeight_ =  49;
         this->orxoblox_ = this->getOrxoBlox();
         this->setCollisionShapeRadius(2.5);
+        this->setDamage(1000);
 
         //setEffect("Orxonox/sparks2");
     }
@@ -185,7 +186,8 @@
                 // Set the ball to be exactly at the boundary.
                 position.z = this-> fieldHeight_;
                 
-                orxoblox_->LevelUp();
+                //orxoblox_->LevelUp();
+                orxoblox_->count();
                 suicidal = true;
                 
             }

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc	2019-05-16 15:16:22 UTC (rev 12393)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc	2019-05-16 16:27:53 UTC (rev 12394)
@@ -58,7 +58,7 @@
         RegisterObject(BallGun);
 
         this->reloadTime_ = 0.25f;
-        this->damage_ = 0.0f; //default 15
+        this->damage_ = 10000; //default 15
         this->speed_ = 100;
         this->delay_ = 100;
         this->setMunitionName("BallMunition");



More information about the Orxonox-commit mailing list