Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2011, 3:05:26 PM (13 years ago)
Author:
dafrick
Message:

Cleaning up game immersion. Roughly documenting weapons module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file LightningGun.h
     31    @brief Implementation of the LightningGun class.
     32*/
     33
    2934#include "LightningGun.h"
    3035
    3136#include "core/CoreIncludes.h"
    32 #include "weapons/projectiles/LightningGunProjectile.h"
    3337#include "weaponsystem/Weapon.h"
    3438#include "weaponsystem/WeaponPack.h"
    3539#include "weaponsystem/WeaponSystem.h"
    3640#include "worldentities/pawns/Pawn.h"
     41
     42#include "weapons/projectiles/LightningGunProjectile.h"
    3743
    3844namespace orxonox
     
    4450        RegisterObject(LightningGun);
    4551
    46         this->reloadTime_ = 1;
    47         this->damage_ = 0; //default 100
    48         this->speed_ = 150;
     52        this->reloadTime_ = 1.0f;
     53        this->damage_ = 0.0f;
     54        this->speed_ = 250.0f;
    4955
    5056        this->setMunitionName("LaserMunition");
     
    5662    }
    5763
    58     /* Creates the projectile (LightningGunProjectile) object, sets its properties to the LightningGun properties
    59      */
     64    /**
     65    @brief
     66        Fires the weapon. Creates a projectile and fires it.
     67    */
    6068    void LightningGun::fire()
    6169    {
     
    6775        projectile->setPosition(this->getMuzzlePosition());
    6876        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    69         projectile->setAcceleration(this->getMuzzleDirection() * 1000);
    7077
    71         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     78        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7279        projectile->setDamage(this->getDamage());
    7380        projectile->setShieldDamage(this->getShieldDamage());
Note: See TracChangeset for help on using the changeset viewer.