Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2015, 4:56:39 PM (9 years ago)
Author:
maxima
Message:

Merged presentation and particleEffects branches. Added a new level, spaceshiptemplate and weaponsettings for the mine.

Location:
code/branches/presentationHS15
Files:
8 edited
6 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15

  • code/branches/presentationHS15/src/modules/weapons/WeaponsPrereqs.h

    r10961 r10963  
    102102    class LaserFire;
    103103    class LightningGun;
     104    class MineGun;
    104105    class RocketFire;
    105106    class RocketFireOld;
  • code/branches/presentationHS15/src/modules/weapons/munitions/CMakeLists.txt

    r10961 r10963  
    77  IceMunition.cc
    88  SplitMunition.cc
     9  MineMunition.cc
    910)
  • code/branches/presentationHS15/src/modules/weapons/munitions/MineMunition.cc

    r10962 r10963  
    4545        this->maxMunitionPerMagazine_ = 1;
    4646        this->maxMagazines_ = 100;
    47         this->magazines_ = 25;
     47        this->unassignedMagazines_ = 25;
    4848
    49         this->bUseSeparateMagazines_ = false;
    50         this->bStackMunition_ = true;
     49        this->deployment_ = MunitionDeployment::Stack;
    5150
    5251        this->bAllowMunitionRefilling_ = true;
    5352        this->bAllowMultiMunitionRemovementUnderflow_ = false;
     53
     54        this->reloadTime_ = 0.5f;
     55    }
     56
     57    void MineMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     58    {
     59        SUPER(MineMunition, XMLPort, xmlelement, mode);
    5460    }
    5561}
  • code/branches/presentationHS15/src/modules/weapons/munitions/MineMunition.h

    r10962 r10963  
    5353            MineMunition(Context* context);
    5454            virtual ~MineMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/branches/presentationHS15/src/modules/weapons/projectiles/CMakeLists.txt

    r10629 r10963  
    1212  GravityBomb.cc
    1313  GravityBombField.cc
     14  MineProjectile.cc
    1415)
  • code/branches/presentationHS15/src/modules/weapons/projectiles/IceGunProjectile.cc

    r10629 r10963  
    3434#include "IceGunProjectile.h"
    3535
     36#include <OgreSceneManager.h>
     37#include <OgreSceneNode.h>
     38
    3639#include "core/CoreIncludes.h"
    3740#include "graphics/Model.h"
     41#include "graphics/ParticleSpawner.h"
     42#include "Scene.h"
     43#include "core/command/Executor.h"
     44#include "tools/ParticleInterface.h"
    3845
    3946namespace orxonox
    4047{
    4148    RegisterClass(IceGunProjectile);
     49
     50    const float IceGunProjectile::particleDestructionDelay_ = 15.0f;
    4251
    4352    IceGunProjectile::IceGunProjectile(Context* context) : Projectile(context)
     
    5564        this->attach(model);
    5665        model->setPosition(Vector3(0,0,0));
     66
     67        // Add effect.
     68        emitter_ = new ParticleEmitter(this->getContext());
     69        this->attach(emitter_);
     70        emitter_->setOrientation(this->getOrientation());
     71        emitter_->setSource("Orxonox/ice");   
     72        emitter_->setDeleteWithParent(false);     
     73    }
     74
     75    IceGunProjectile::~IceGunProjectile()
     76    {
     77        if (this->isInitialized())
     78        {
     79            const Vector3& pos = emitter_->getWorldPosition();
     80            const Quaternion& rot = emitter_->getWorldOrientation();
     81            this->detach(emitter_);
     82            emitter_->setPosition(pos);
     83            emitter_->setOrientation(rot);
     84            emitter_->getParticleInterface()->setEnabled(false);
     85            this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(emitter_->getNode()));
     86
     87            const ExecutorPtr& executor = createExecutor(createFunctor(&ParticleEmitter::destroy, emitter_));
     88            new Timer(particleDestructionDelay_, false, executor, true);
     89        }
    5790    }
    5891
  • code/branches/presentationHS15/src/modules/weapons/projectiles/IceGunProjectile.h

    r10629 r10963  
    5656        public:
    5757            IceGunProjectile(Context* context);
    58             virtual ~IceGunProjectile() {}
     58            virtual ~IceGunProjectile();
    5959
    6060            virtual void setFreezeTime(float freezeTime);
     
    6363        protected:
    6464            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    65         private:         
     65            static const float particleDestructionDelay_;
     66        private:
     67            ParticleEmitter* emitter_;
    6668            float freezeTime_; //The duration of the freezing effect on a target
    6769            float freezeFactor_; //The strength of the freezing effect
  • code/branches/presentationHS15/src/modules/weapons/projectiles/Projectile.h

    r10629 r10963  
    6969        protected:
    7070            virtual void setCollisionShapeRadius(float radius);
     71            float lifetime_; //!< The time the projectile exists.
    7172
    7273        private:
    73             float lifetime_; //!< The time the projectile exists.
    7474            Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
    75             WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.           
     75            WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
    7676    };
    7777}
  • code/branches/presentationHS15/src/modules/weapons/weaponmodes/CMakeLists.txt

    r10629 r10963  
    1111  SimpleRocketFire.cc
    1212  GravityBombFire.cc
     13  MineGun.cc
    1314)
Note: See TracChangeset for help on using the changeset viewer.