Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 17, 2015, 10:30:24 PM (9 years ago)
Author:
fvultier
Message:
 
Location:
code/branches/fabienHS15/src
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • code/branches/fabienHS15/src/modules/overlays/CMakeLists.txt

    r7163 r10814  
    1616  LINK_LIBRARIES
    1717    orxonox
     18    weapons
    1819  SOURCE_FILES ${OVERLAYS_SRC_FILES}
    1920)
  • code/branches/fabienHS15/src/modules/overlays/OverlaysPrereqs.h

    r9939 r10814  
    9090    class HUDRadar;
    9191    class HUDSpeedBar;
     92    class HUDShieldBar;
    9293    class HUDBoostBar;
     94    class HUDRocketFuelBar;
    9395    class HUDTimer;
    9496    class HUDAimAssistant;
  • code/branches/fabienHS15/src/modules/overlays/hud/CMakeLists.txt

    r10746 r10814  
    77  HUDShieldBar.cc
    88  HUDHealthBar.cc
     9  HUDRocketFuelBar.cc
    910  HUDTimer.cc
    1011  HUDEnemyHealthBar.cc
  • code/branches/fabienHS15/src/modules/weapons/WeaponsPrereqs.h

    r10622 r10814  
    6969{
    7070    class MuzzleFlash;
     71    class IceGunFreezer;
     72    class RocketController;
    7173
    7274    // munitions
    7375    class FusionMunition;
    7476    class LaserMunition;
    75     class ReplenishingMunition;
    7677    class RocketMunition;
    7778    class GravityBombMuntion;
     79    class IceMunition;
     80    class LightningMunition;
     81    class SplitMunition;
    7882
    7983    // projectiles
     
    8185    class LightningGunProjectile;
    8286    class ParticleProjectile;
     87    class IceProjectile;
     88    class SplitProjectile;
    8389    class Projectile;
     90    class BasicProjectile;
    8491    class Rocket;
    8592    class RocketOld;
     
    9198    class FusionFire;
    9299    class HsW01;
     100    class IceGun;
     101    class SplitGun;
    93102    class LaserFire;
    94103    class LightningGun;
  • code/branches/fabienHS15/src/modules/weapons/projectiles/Rocket.cc

    r10795 r10814  
    6666
    6767        this->localAngularVelocity_ = 0;
    68         this->lifetime_ = 100.0f;
     68        this->lifetime_ = 20.0f;
    6969
    7070        if (GameMode::isMaster())
     
    100100            this->attachCollisionShape(collisionShape);
    101101
    102             this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
    103 
    104102            // Add sound
    105103            this->defSndWpnEngine_ = new WorldSound(this->getContext());
     
    114112            this->defSndWpnLaunch_->setVolume(1.0f);
    115113            this->attach(defSndWpnLaunch_);
     114
     115            this->setHudTemplate("rockethud");
    116116        }
    117117        else
     
    320320    }
    321321
     322    float Rocket::getFuel() const
     323    {
     324        return this->destroyTimer_.getRemainingTime();
     325    }
     326
     327    void Rocket::setMaxFuel(float fuel)
     328    {
     329        this->lifetime_ = fuel;
     330        this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
     331    }
    322332}
  • code/branches/fabienHS15/src/modules/weapons/projectiles/Rocket.h

    r10216 r10814  
    118118            virtual void fired(unsigned int firemode);
    119119
     120            /**
     121            @brief Set the maximum lifetime of the rocket.
     122            */
     123            virtual void setMaxFuel(float fuel);
     124            /**
     125            @brief Get the maximum lifetime of the rocket.
     126            */
     127            inline float getMaxFuel() const
     128                { return lifetime_; }
     129            virtual float getFuel() const;
     130
    120131        private:
    121132            Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
  • code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFire.cc

    r10794 r10814  
    4141#include "weaponsystem/WeaponSystem.h"
    4242#include "worldentities/pawns/Pawn.h"
    43 
     43#include "core/XMLPort.h"
    4444#include "weapons/projectiles/Rocket.h"
    4545
     
    5656        this->damage_ = 0.0f;
    5757        this->speed_ = 500.0f;
     58        this->fuel_ = 10.0f;
    5859
    5960        this->setMunitionName("RocketMunition");
     
    6566    RocketFire::~RocketFire()
    6667    {
     68    }
     69
     70    /**
     71    @brief
     72        XMLPort for the RocketFire. You can define the maximum lifetime of the rockets
     73    */
     74    void RocketFire::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     75    {
     76        SUPER(RocketFire, XMLPort, xmlelement, mode);
     77
     78        XMLPortParam(RocketFire, "fuel", setFuel, getFuel, xmlelement, mode);
    6779    }
    6880
     
    8597        rocket->setShieldDamage(this->getShieldDamage());
    8698        rocket->setHealthDamage(this->getHealthDamage());
     99        rocket->setMaxFuel(this->fuel_);
    87100    }
    88101}
  • code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFire.h

    r9667 r10814  
    5454            virtual ~RocketFire();
    5555
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     57
    5658            virtual void fire();
     59            inline void setFuel(float fuel)
     60                { this->fuel_ = fuel; }
     61            inline float getFuel() const
     62                { return this->fuel_; }
    5763
    5864        private:
    5965            float speed_; //!< The speed of the Rocket.
     66            float fuel_; //!< The maximum lifetime of the rocket
    6067    };
    6168}
  • code/branches/fabienHS15/src/modules/weapons/weaponmodes/SplitGun.cc

    r10688 r10814  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/XMLPort.h"   
     37#include "core/XMLPort.h"
    3838#include "weaponsystem/Weapon.h"
    3939#include "weaponsystem/WeaponPack.h"
  • code/branches/fabienHS15/src/orxonox/OrxonoxPrereqs.h

    r10624 r10814  
    167167    class DefaultWeaponmodeLink;
    168168    class Munition;
     169    class ReplenishingMunition;
    169170    class Weapon;
    170171    class WeaponMode;
  • code/branches/fabienHS15/src/orxonox/infos/PlayerInfo.cc

    r10624 r10814  
    202202
    203203        this->changedControllableEntity();
     204
     205         // HACK-ish
     206        if(this->isHumanPlayer())
     207            entity->createHud();
    204208    }
    205209
     
    252256        if( !entity || this->previousControllableEntity_.size() == 0 )
    253257            return;
     258
     259        entity->destroyHud(); // HACK-ish
    254260
    255261        this->controllableEntity_->setController(0);
  • code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10791 r10814  
    143143        XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode);
    144144
    145         XMLPortParam(Pawn, "reloadrate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
    146         XMLPortParam(Pawn, "reloadwaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
     145        XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
     146        XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
    147147
    148148        XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
  • code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.h

    r10791 r10814  
    4646        or below zero. If it is, the pawn gets killed.
    4747
    48         Pawns can carry pickups and fire weapons. The can also have shields.
     48        Pawns can carry pickups and fire weapons. They can also have shields.
    4949
    5050        Notice that every Pawn is a ControllableEntity.
Note: See TracChangeset for help on using the changeset viewer.