Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2016, 4:03:47 PM (9 years ago)
Author:
sagerj
Message:

fix the charging during reloadtime, the hudchargebar working so far…

Location:
code/branches/sagerjFS16
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sagerjFS16/data/levels/includes/weaponSettingsEscort.oxi

    r11170 r11185  
    2424            munitionpershot=1
    2525            delay=0
    26             damage=9.3
     26            damage=0.5
    2727            material="Flares/point_lensflare"
    2828            muzzleoffset=" 1.6, 1.3, -2.0"
     
    3636    <munition>
    3737      <LaserMunition
    38         initialmagazines=8
    39         maxmagazines=8
     38        initialmagazines=2
     39        maxmagazines=2
    4040        munitionpermagazine=10
    4141        replenishamount=1
    42         replenishinterval=7.5
     42        replenishinterval=2
    4343      />
    4444    </munition>
  • code/branches/sagerjFS16/data/levels/missionOne.oxw

    r11052 r11185  
    1212  include("templates/lodInformation.oxt")
    1313  include("templates/spaceshipAssff.oxt")
     14  include("templates/spaceshipEscort.oxt")
    1415  include("templates/spaceshipPirate.oxt")
    1516  include("templates/spaceshipSpacecruiser.oxt")
     
    5758        <events>
    5859            <trigger>
    59                 <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff>
     60                <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort>
    6061                  <EventTrigger invert=true>
    6162                    <events>
  • code/branches/sagerjFS16/data/overlays/HUDTemplates3.oxo

    r11052 r11185  
    184184     weaponModeHUDSize      = "0.09, 0.03"
    185185    />
     186
     187    <HUDChargeBar
     188     name                   = "ChargeBar"
     189     background    = "Orxonox/BarBackground"
     190     size          = "0.40, 0.04"
     191     position      = "0.0 , 0.5 "
     192     pickpoint     = "0, 1"
     193     correctaspect = true
     194     iconmaterial  = "Orxonox/BarIconSpeed"
     195    >
     196      <BarColour position = 0.0 colour = "0.7,0.5,0.2" />
     197      <BarColour position = 0.5 colour = "0.2,0.7,0.2" />
     198      <BarColour position = 1.0 colour = "0.7,0.2,0.2" />
     199    </HUDChargeBar>
    186200   
    187201    <HUDTimer
  • code/branches/sagerjFS16/src/modules/overlays/hud/CMakeLists.txt

    r11052 r11185  
    1414  HUDWeapon.cc
    1515  HUDWeaponSystem.cc
     16  HUDChargeBar.cc
    1617  ChatOverlay.cc
    1718  AnnounceMessage.cc
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc

    r11175 r11185  
    2121 *
    2222 *   Author:
    23  *      Martin Polak
     23 *      God of everything
    2424 *   Co-authors:
    25  *      simonmie
     25 *   
    2626 *
    2727 */
     
    5151        RegisterObject(Discharger);
    5252
    53         this->reloadTime_ = 0.23f;
    54         this->damage_ = 90.01f;
    55         this->speed_ = 90.01f;
     53        this->reloadTime_ = 3.14159f;
     54        this->damage_ = 0.0f;
     55        this->speed_ = 100.0f;
    5656        this->chargeable_ = true;
    5757
     
    6565    void Discharger::fire()
    6666    {
    67         // orxout() << "release" << cTime_ << endl;
    6867        BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
    6968
     
    7170        projectile->setOrientation(this->getMuzzleOrientation());
    7271        projectile->setPosition(this->getMuzzlePosition());
    73         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     72        projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * this->charges_ / 5);
    7473
    7574        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    76         projectile->setDamage(this->getDamage() * charges_);
    77         projectile->setShieldDamage(this->getShieldDamage());
    78         projectile->setHealthDamage(this->getHealthDamage());
    79         //  this->charges_ = 0;
     75        projectile->setDamage(this->getDamage() * this->charges_);
     76        projectile->setShieldDamage(this->getShieldDamage() * this->charges_);
     77        projectile->setHealthDamage(this->getHealthDamage() * this->charges_);
     78        this->charges_ = 0;
    8079    }
    8180}
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h

    r11175 r11185  
    2121 *
    2222 *   Author:
    23  *      Martin Polak
     23 *       God of everything
    2424 *   Co-authors:
    25  *      ...
     25 *     
    2626 *
    2727 */
     
    5858
    5959        private:
    60             //bool chargeable_;     // An indicator that this weapon type is chargeable.
    61             int charges_;
    6260            float speed_;                  // The speed of the fired projectile.
    63             float ctime_;                  // time the weapon has charged.
     61           
    6462    };
    6563}
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc

    r11175 r11185  
    6464        this->bParallelReload_ = true;
    6565        this->chargeable_ = false;
     66        this->charges_ = 0;
     67        this->maxCharges_ = 100;
    6668
    6769        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
     
    172174    bool WeaponMode::push(float* reloadTime)
    173175    {
    174         orxout() << "push " << chargeable_ << endl;
     176
    175177        if( this->chargeable_)
    176178        {
    177             // setting up a timer for knowing how long the weapon was charged
    178             // and passes the value to this->cTime_
    179             orxout() << "if " << endl;
     179            if(this->charges_ < this->maxCharges_){
     180                this->charges_ += 1;
     181            }
    180182            return false;
    181183        } else {
    182             orxout() << "else " << endl;
    183184            return fire(reloadTime);
    184185        }
     
    187188    bool WeaponMode::release(float* reloadTime)
    188189    {
    189         orxout() << "release " << endl;
    190190        if( this->chargeable_)
    191191        {
    192             orxout() << "if " << endl;
    193192            return fire(reloadTime);
    194193        }else{
    195             orxout() << "else " << endl;
    196194            return false;
    197195        }
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h

    r11175 r11185  
    110110
    111111            // Fire
     112            inline unsigned int getMaxCharges()
     113                { return this->maxCharges_;}
     114            inline unsigned int getCharges()
     115                { return this->charges_;}
     116            inline bool isChargeable()
     117                { return this->chargeable_;}
    112118            inline void setDamage(float damage)
    113119                { this->damage_ = damage;}
     
    170176            unsigned int initialMagazines_;
    171177            unsigned int munitionPerShot_;
     178            unsigned int charges_;
     179            unsigned int maxCharges_;
    172180
    173181            float reloadTime_;
Note: See TracChangeset for help on using the changeset viewer.