Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2019, 3:51:04 PM (5 years ago)
Author:
cwaupoti
Message:

comment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Boxhead_FS19/src/modules/weapons/weaponmodes/HoverGun.cc

    r12262 r12273  
    2121 *
    2222 *   Author:
    23  *      Hagen Seifert
     23 *      Joel Smely
    2424 *   Co-authors:
    2525 *      simonmie
     
    2828
    2929/**
    30     @file HsW01.h
    31     @brief Implementation of the HsW01 class.
     30    @file HoverGun.h
     31    @brief Implementation of the HoverGun class.
    3232*/
    3333
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/XMLPort.h"
    38 #include "core/command/Executor.h"
    39 
    40 #include "graphics/Model.h"
    4137#include "weaponsystem/Weapon.h"
    4238#include "weaponsystem/WeaponPack.h"
    4339#include "weaponsystem/WeaponSystem.h"
    44 #include "worldentities/WorldEntity.h"
    4540#include "worldentities/pawns/Pawn.h"
    4641
    4742#include "weapons/projectiles/HoverGunProjectile.h"
    48 #include "weapons/MuzzleFlash.h"
    4943
    5044namespace orxonox
     
    5650        RegisterObject(HoverGun);
    5751
    58         this->reloadTime_ = 0.25f;
    59         this->damage_ = 0.0f; //default 15
     52        this->reloadTime_ = 1.0f;
     53        this->damage_ = 0.0f;
    6054        this->speed_ = 750.0f;
    61         this->delay_ = 0.0f;
    62         this->setMunitionName("LaserMunition");
    63         this->mesh_ = "laserbeam.mesh";
    6455
     56        this->setMunitionName("HoverMunition");
     57        this->setFireSound("sounds/Weapon_HoverGun.ogg");
    6558
    66         this->delayTimer_.setTimer(this->delay_, false, createExecutor(createFunctor(&HoverGun::shot, this)));
    67         this->delayTimer_.stopTimer();
    68 
    69         this->setFireSound("sounds/Weapon_HsW01.ogg");
    70         this->setReloadSound("sounds/Reload_HsW01.ogg", 0.5);
    71 
    72         hudImageString_ = "Orxonox/WSHUD_WM_HsW01";
     59        hudImageString_ = "Orxonox/WSHUD_WM_HoverGun";
    7360    }
    7461
     
    7663    {
    7764    }
    78 
    79     void HoverGun::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    80     {
    81         SUPER(HoverGun, XMLPort, xmlelement, mode);
    82 
    83         XMLPortParam(HoverGun, "delay", setDelay, getDelay, xmlelement, mode);
    84         XMLPortParam(HoverGun, "material", setMaterial, getMaterial, xmlelement, mode);
    85         XMLPortParam(HoverGun, "projectileMesh", setMesh, getMesh, xmlelement, mode);
    86         XMLPortParam(HoverGun, "sound", setSound, getSound, xmlelement, mode);
    87     }
    88 
    89     /**
    90     @brief
    91         Set the firing delay.
    92     @param delay
    93         The firing delay in seconds.
    94     */
    95     void HoverGun::setDelay(float delay)
    96     {
    97         this->delay_ = delay;
    98         this->delayTimer_.setInterval(this->delay_);
    99     }
    100 
    101     // void HoverGun::fire()
    102     // {
    103     //     this->delayTimer_.startTimer();
    104     // }
    10565
    10666    /**
     
    11070    void HoverGun::fire()
    11171    {
    112         assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
    113 
    114         // Create the projectile.
    11572        HoverGunProjectile* projectile = new HoverGunProjectile(this->getContext());
    116         Model* model = new Model(HoverGunprojectile->getContext());
    117         model->setMeshSource(mesh_);
    118         model->setCastShadows(false);
    119         projectile->attach(model);
    120         model->setScale(5);
     73        projectile->setMaterial("Flares/HoverBall_");
    12174
    12275        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
     
    12982        projectile->setShieldDamage(this->getShieldDamage());
    13083        projectile->setHealthDamage(this->getHealthDamage());
    131 
    132         // Display the muzzle flash.
    133         // this->HoverGun::muzzleflash();
    13484    }
    135 
    136     /**
    137     @brief
    138         Displays the muzzle flash.
    139     */
    140     // void HoverGun::muzzleflash()
    141     // {
    142     //     MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
    143     //     this->getWeapon()->attach(muzzleFlash);
    144     //     muzzleFlash->setPosition(this->getMuzzleOffset());
    145     //     muzzleFlash->setMaterial(this->material_);
    146     // }
    14785}
Note: See TracChangeset for help on using the changeset viewer.