Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2015, 7:33:37 PM (10 years ago)
Author:
meggiman
Message:
 
Location:
code/branches/weaponFS15/src/modules/weapons/weaponmodes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weaponFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc

    r10438 r10455  
    33 *
    44 *  Created on: Apr 16, 2015
    5  *      Author: meggiman
     5 *      Author: Manuel Eggimann
    66 */
    77#include "GravityBombFire.h"
     
    1919        RegisterClass(GravityBombFire);
    2020
    21         const float GravityBombFire::BOMB_VELOCITY = 400.0;
     21        const float GravityBombFire::BOMB_VELOCITY = 400.0; ///< The velocity of the bomb after launch
    2222
    2323        GravityBombFire::GravityBombFire(Context* context) : WeaponMode(context)
     
    2525                RegisterObject(GravityBombFire);
    2626
    27                 this->reloadTime_ = 0.50f;
     27                this->reloadTime_ = 0.50f; 
    2828                this->bParallelReload_ = false;
    29                 this->damage_ = 0.0f;
    30                 this->speed_ = BOMB_VELOCITY;
     29                this->damage_ = 20.0f;  ///< The damage of the Bomb if it hits a pawn.
    3130
    3231                this->setMunitionName("GravityBombMunition");
    33                 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8);
     32                this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8);        ///< sets sound of the bomb as it is fired.
    3433        }
    3534
     
    3938        {
    4039                GravityBomb* bomb = new GravityBomb(this->getContext());
    41         this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
     40        //Create a new Bomb in 3D-Space and set the right direction speed and orientation.
     41                this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    4242        bomb->setOrientation(this->getMuzzleOrientation());
    4343        bomb->setPosition(this->getMuzzlePosition());
    44         bomb->setVelocity(this->getMuzzleDirection() * (this->speed_+this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity().length()));
     44        bomb->setVelocity(this->getMuzzleDirection() * (this->BOMB_VELOCITY+this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity().length()));
    4545
     46                //Set the shooter of the bomb so it is possible to determine the pawn that killed another one and define damage to shield and healt the bomb does.
    4647        bomb->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    4748                bomb->setDamage(this->getDamage());
  • code/branches/weaponFS15/src/modules/weapons/weaponmodes/GravityBombFire.h

    r10435 r10455  
    1 /**
    2  *   ORXONOX - the hottest 3D action shooter ever to exist
    3  *                    > www.orxonox.net <
    4  *
    5  *
    6  *   License notice:
    7  *
    8  *   This program is free software; you can redistribute it and/or
    9  *   modify it under the terms of the GNU General Public License
    10  *   as published by the Free Software Foundation; either version 2
    11  *   of the License, or (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    21  *
    22  *   Author:
    23  *      Oliver Scheuss
    24  *   Co-authors:
    25  *      ...
    26  *
    27  */
     1/*
     2* GravityBombFire.h
     3*
     4*  Created on: Apr 16, 2015
     5*      Author: Manuel Eggimann
     6*/
    287
    298/**
     
    4221
    4322    /**
    44     @brief
    45         Fires the GravityBomb
    46     @author
    47         Manuel Eggimann
    48     @ingroup WeaponsWeaponModes
     23    *@brief
     24    *   Fires the GravityBomb. This class implements everything needed to fire the BasicProjectile GravityBomb.
     25    *   Everything that has to do with the bombs behaviour after launching it is implemented in GravityBomb and GravityBombField.
     26    *@author
     27    *    Manuel Eggimann
     28    *@ingroup WeaponsWeaponModes
    4929    */
    5030    class _WeaponsExport GravityBombFire : public WeaponMode
     
    5737
    5838        private:
    59             float speed_; //!< The initial speed of the bomb when it is launched.
    60             static const float BOMB_VELOCITY;
     39            static const float BOMB_VELOCITY; //!< The initial speed of the bomb when it is launched.
    6140    };
    6241}
Note: See TracChangeset for help on using the changeset viewer.