Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2008, 4:45:50 PM (16 years ago)
Author:
polakma
Message:

added munition, fixed reloadTimer_

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

    r2186 r2203  
    4444
    4545        //set weapon properties here
    46         this->loadingTime_ = 0.5;
     46        this->setLoadingTime(0.5);
     47
     48        //Hack --> will be loaded by XML
     49        this->attachNeededMunition("LaserGunMunition");
    4750    }
    4851
     
    5154    }
    5255
    53     LaserGun::fire()
     56    void LaserGun::fire()
    5457    {
    55         if { this->weaponReadyToShoot_ }
     58        if ( this->getWeaponReadyToShoot() )
    5659        {
    57             this->weaponReadyToShoot_ = false;
     60            this->setWeaponReadyToShoot(false);
     61
     62            Weapon::timer();
     63
    5864            //take munition
    59             //this->pointerToMunition_->
     65            this->getAttachedMunition()->decrementBullets();
    6066
    61             this->reloadTimer_.setTimer( loadingTime_ , false , this , &this->reloaded );
    62 
    63             BillboardProjectile* projectile = new ParticleProjectile(this);
    64             projectile->setColour(this->getProjectileColour());
     67            //create projectile
     68            //BillboardProjectile* projectile = new ParticleProjectile(this);
     69            //projectile->setColour(this->getProjectileColour());
    6570        }
    6671        else
    6772        {
    68             //actions, when weapon is not reloaded
     73            //actions, when weapon is not reloaded if there are some
    6974        }
    7075    }
     
    7580    }
    7681
     82
     83
    7784}
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.h

    r2186 r2203  
    3737#include "util/Math.h"
    3838#include "../Weapon.h"
     39#include "../projectiles/BillboardProjectile.h"
     40#include "../projectiles/ParticleProjectile.h"
    3941
    4042namespace orxonox
     
    5052            void fire();
    5153
    52 
    5354        private:
    5455
Note: See TracChangeset for help on using the changeset viewer.