Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2016, 3:33:48 PM (9 years ago)
Author:
sagerj
Message:

running backup

Location:
code/branches/sagerjFS16/src/modules/weapons/weaponmodes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc

    r11166 r11170  
    5151        RegisterObject(Discharger);
    5252
     53        this->reloadTime_ = 0.23f;
     54        this->damage_ = 90.01f;
     55        this->speed_ = 90.01f;
     56        this->charges_ = 0;
     57
    5358        this->setMunitionName("LaserMunition");
     59        this->setFireSound("sounds/Weapon_LaserFire.ogg");
     60        this->setReloadSound("sounds/Reload_LaserFire.ogg", 0.8);
    5461
    5562        hudImageString_ = "Orxonox/WSHUD_WM_LaserFire";
     
    5865    void Discharger::fire()
    5966    {
    60         orxout() << "fire dis " << endl;
     67        charges_ += 1;
     68        orxout() << "c = " << charges_ << endl;
    6169    }
    6270   
    63     bool Discharger::fire(float* reloadTime)
     71    void Discharger::release()
    6472    {
    65         orxout() << "fire Discharger " << endl;
    66         return false;
    67     }
    68     bool Discharger::release(float* reloadTime)
    69     {
    70         orxout() << "release Discharger " << endl;
    71         return false;
     73        orxout() << "release c = " << charges_ << endl;
     74        BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
     75
     76        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
     77        projectile->setOrientation(this->getMuzzleOrientation());
     78        projectile->setPosition(this->getMuzzlePosition());
     79        projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * charges_);
     80
     81        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     82        projectile->setDamage(this->getDamage() * charges_);
     83        projectile->setShieldDamage(this->getShieldDamage() * charges_);
     84        projectile->setHealthDamage(this->getHealthDamage() * charges_);
     85        this->charges_ = 0;
    7286    }
    7387}
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h

    r11166 r11170  
    5555
    5656            virtual void fire() override;
    57             virtual bool fire(float* reloadTime) override;
    58             virtual bool release(float* reloadTime) override;
     57            virtual void release() override;
    5958
    6059        private:
     60            float speed_; // The speed of the fired projectile.
     61            unsigned int charges_; // An indicator of how much you charged up.
    6162    };
    6263}
Note: See TracChangeset for help on using the changeset viewer.