Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2011, 2:26:25 PM (14 years ago)
Author:
simonmie
Message:

SimpleRocket and Rocket are now BasicProjectiles - damage is working now correctly with these two. More spam messages removed.

Location:
code/branches/gameimmersion/src/modules/weapons/projectiles
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc

    r8492 r8533  
    3636#include "worldentities/pawns/Pawn.h"
    3737#include "graphics/ParticleSpawner.h"
    38 #include "BasicProjectile.h"
    3938
    4039namespace orxonox
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Rocket.cc

    r7848 r8533  
    4343#include "Scene.h"
    4444
     45#include "BasicProjectile.h"
     46
    4547namespace orxonox
    4648{
     
    5254        Constructor. Registers the object and initializes some default values.
    5355    */
    54     Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator)
     56    Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
    5557    {
    5658        RegisterObject(Rocket);// - register the Rocket class to the core
    5759
    5860        this->localAngularVelocity_ = 0;
    59         this->bDestroy_ = false;
     61//        this->bDestroy_ = false;
    6062        this->lifetime_ = 100;
    6163
     
    175177        if( GameMode::isMaster() )
    176178        {
    177             if( this->bDestroy_ )
     179            if( this->getBDestroy() )
    178180                this->destroy();
    179181
     
    183185    bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    184186    {
    185         if (!this->bDestroy_ && GameMode::isMaster())
     187        return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this);
     188
     189/* * /        if (!this->bDestroy_ && GameMode::isMaster())
    186190        {
    187191            if (otherObject == this->owner_)
     
    216220//             this->destroy();
    217221        }
    218         return false;
     222/ * */        return false;
    219223    }
    220224
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Rocket.h

    r7163 r8533  
    3535#include "worldentities/ControllableEntity.h"
    3636
     37#include "BasicProjectile.h"
     38
    3739namespace orxonox
    3840{
     
    4648        Oli Scheuss
    4749    */
    48     class _WeaponsExport Rocket : public ControllableEntity
     50    class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile
    4951    {
    5052        public:
     
    109111                { return this->owner_; }
    110112
    111             inline void setDamage(float damage)
     113/*            inline void setDamage(float damage)
    112114                { this->damage_ = damage; }
    113115            inline float getDamage() const
    114116                { return this->damage_; }
     117*/
     118
    115119            virtual void fired(unsigned int firemode);
    116120
     
    118122            WeakPtr<Pawn> owner_;
    119123            Vector3 localAngularVelocity_;
    120             float damage_;
    121             bool bDestroy_;
     124//            float damage_;
     125//            bool bDestroy_;
    122126
    123127            WeakPtr<PlayerInfo> player_;
  • code/branches/gameimmersion/src/modules/weapons/projectiles/SimpleRocket.cc

    r7163 r8533  
    4848    CreateFactory(SimpleRocket);
    4949
    50     SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator)
     50    SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
    5151    {
    5252        RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core
    5353
    5454        this->localAngularVelocity_ = 0;
    55         this->bDestroy_ = false;
     55//        this->bDestroy_ = false;
    5656        this->lifetime_ = 120;
    5757
     
    115115                this->disableFire();
    116116
    117             if( this->bDestroy_ )
     117            if( this->getBDestroy() )
    118118                this->destroy();
    119119        }
     
    167167    bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    168168    {
    169         if (!this->bDestroy_ && GameMode::isMaster())
     169        return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this);
     170/*        if (!this->bDestroy_ && GameMode::isMaster())
    170171        {
    171172            if (otherObject == this->owner_)
     
    204205        }
    205206        return false;
     207*/
    206208    }
    207209
  • code/branches/gameimmersion/src/modules/weapons/projectiles/SimpleRocket.h

    r7163 r8533  
    3636#include "graphics/ParticleSpawner.h"
    3737
     38#include "BasicProjectile.h"
     39
    3840namespace orxonox
    3941{
     
    4648       Gabriel Nadler (Original file: Oli Scheuss)
    4749    */
    48     class _WeaponsExport SimpleRocket : public ControllableEntity
     50    class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile
    4951    {
    5052        public:
     
    114116            { return this->fuel_; }
    115117
    116             inline void setDamage(float damage)
     118/*            inline void setDamage(float damage)
    117119                { this->damage_ = damage; }
    118120            inline float getDamage() const
    119121                { return this->damage_; }
    120 
     122*/
    121123
    122124        private:
    123125            WeakPtr<Pawn> owner_;
    124126            Vector3 localAngularVelocity_;
    125             float damage_;
    126             bool bDestroy_;
     127//            float damage_;
     128//            bool bDestroy_;
    127129            bool fuel_; //!< Bool is true while the rocket "has fuel"
    128130
Note: See TracChangeset for help on using the changeset viewer.