Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 2:38:33 PM (16 years ago)
Author:
polakma
Message:

changed Weapon::fire and munition reloading

Location:
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc

    r2366 r2379  
    5050    }
    5151
    52     void LaserGun::fire()
     52    void LaserGun::takeBullets()
    5353    {
    54 COUT(0) << "LaserGun::fire, this=" << this << std::endl;
    55         if ( this->getBulletReadyToShoot() && this->getMagazineReadyToShoot() )
    56         {
    57 COUT(0) << "LaserGun::fire - ready to shoot" << std::endl;
    58             //take munition
    59             this->setBulletReadyToShoot(false);
    60             Weapon::bulletTimer();
    61             this->getAttachedMunition(this->munitionType_)->removeBullets(1,this);
    62 
    63             //create projectile
    64             BillboardProjectile* projectile = new ParticleProjectile(this);
    65             projectile->setOrientation(projectile->getOrientation());
    66             projectile->setPosition(projectile->getWorldPosition());
    67             projectile->setVelocity(WorldEntity::FRONT * this->speed_);
    68 
    69             //projectile->setColour(this->getProjectileColour());
    70         }
    71         else
    72         {
    73             //actions, when weapon is not reloaded if there are some
    74         }
     54        this->munition_->removeBullets(1,this);
     55        this->bulletTimer(this->bulletLoadingTime_);
    7556    }
    7657
     58    void LaserGun::takeMagazines()
     59    {
     60        this->munition_->removeMagazines(1);
     61        this->magazineTimer(this->magazineLoadingTime_);
     62    }
     63
     64    void LaserGun::createProjectile()
     65    {
     66        BillboardProjectile* projectile = new ParticleProjectile(this);
     67        projectile->setOrientation(projectile->getOrientation());
     68        projectile->setPosition(projectile->getWorldPosition());
     69        projectile->setVelocity(WorldEntity::FRONT * this->speed_);
     70    }
    7771}
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.h

    r2366 r2379  
    4747            LaserGun(BaseObject* creator);
    4848            virtual ~LaserGun();
    49 
    50             void fire();
     49           
     50            virtual void takeBullets();
     51            virtual void takeMagazines();
     52            virtual void createProjectile();
    5153
    5254        private:
Note: See TracChangeset for help on using the changeset viewer.