Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10650 for code


Ignore:
Timestamp:
Oct 12, 2015, 10:57:00 PM (9 years ago)
Author:
fvultier
Message:

There is now a spaceship that uses the gravity bomb. Minor documentation improvements.

Location:
code/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/includes/weaponSettingsRing.oxi

    r10629 r10650  
    11<weaponslots>
    22  <WeaponSlot position="11,0,-7" />
     3  <WeaponSlot position="0,0,-7" />
    34  <WeaponSlot position="-11,0,-7" />
    45</weaponslots>
     
    1415    </links>
    1516    <Weapon>
    16       <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" 0.1, 1.4,-3" freezefactor=0.5 freezetime=2.0 />
     17      <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset="11,0,-3" freezefactor=0.5 freezetime=2.0 />
    1718    </Weapon>
    1819    <Weapon>
    19       <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" 0.1, 1.4,-3" freezefactor=0.5 freezetime=2.0 />
     20      <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" -11,0,-3" freezefactor=0.5 freezetime=2.0 />
     21    </Weapon>
     22    <Weapon>
     23      <GravityBombFire mode=1 munitionpershot=0 delay=0.125 damage=3 muzzleoffset="0,0,-7"/>
    2024    </Weapon>
    2125  </WeaponPack>
  • code/trunk/src/orxonox/weaponsystem/Weapon.cc

    r9667 r10650  
    9595    }
    9696
     97    /**
     98    @brief
     99        Fire this Weapon with the the WeaponMode defined by @param mode
     100    */
    97101    void Weapon::fire(unsigned int mode)
    98102    {
  • code/trunk/src/orxonox/weaponsystem/Weapon.h

    r9667 r10650  
    3939namespace orxonox
    4040{
     41    /**
     42    @brief
     43        A Weapon is a StaticEntity that can be attached to a WeaponSlot. A Weapon can shoot with different @ref orxonox::WeaponMode modes.
     44        Imagine for example that a machine gun can shoot normal bullets, tracer bullets or even grenades.
     45    */   
    4146    class _OrxonoxExport Weapon : public StaticEntity
    4247    {
     
    5358            WeaponMode* getWeaponmode(unsigned int index) const;
    5459
     60            /**
     61            @brief
     62                This function is called by a @ref orxonox::WeaponPack if this Weapon is added to the WeaponPack.
     63            */
    5564            inline void setWeaponPack(WeaponPack * weaponPack)
    5665                { this->weaponPack_ = weaponPack; this->notifyWeaponModes(); }
     
    5867                { return this->weaponPack_; }
    5968
     69            /**
     70            @brief
     71                This function is called by a @ref orxonox::WeaponSlot if this Weapon gets attached to the WeaponSlot.
     72            */
    6073            inline void setWeaponSlot(WeaponSlot * wSlot)
    6174                { this->weaponSlot_ = wSlot; }
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.cc

    r10624 r10650  
    128128        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
    129129        {
    130             float reloadtime = this->reloadTime_;
     130            float tempReloadtime = this->reloadTime_;
    131131
    132132            if (this->bAutoReload_ && this->munition_->needReload(this))
     
    135135                {
    136136                    if (this->bParallelReload_)
    137                         reloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
     137                        tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
    138138                    else
    139                         reloadtime = this->reloadTime_ + this->munition_->getReloadTime();
     139                        tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime();
    140140                }
    141141            }
    142142
    143143            this->bReloading_ = true;
    144             this->reloadTimer_.setInterval(reloadtime);
     144            this->reloadTimer_.setInterval(tempReloadtime);
    145145            this->reloadTimer_.startTimer();
    146146
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.h

    r9667 r10650  
    4141namespace orxonox
    4242{
     43    /**
     44    @brief
     45        A WeaponMode defines how a Weapon is used. It specifies what kind of @ref orxonox::Projectile is created when you fire it, how much time it takes to reload, what sound you hear while shooting, how much damage the projectile deals to a target, ...
     46    */
    4347    class _OrxonoxExport WeaponMode : public BaseObject
    4448    {
  • code/trunk/src/orxonox/weaponsystem/WeaponPack.cc

    r9667 r10650  
    7070    }
    7171
     72    /**
     73    @brief
     74        Fire all weapons in this WeaponSet with the defined weaponmode.
     75    */
    7276    void WeaponPack::fire(unsigned int weaponmode)
    7377    {
     
    7680    }
    7781
     82    /**
     83    @brief
     84        Reload all weapons in this WeaponSet.
     85    */
    7886    void WeaponPack::reload()
    7987    {
  • code/trunk/src/orxonox/weaponsystem/WeaponSet.cc

    r9667 r10650  
    6262    void WeaponSet::fire()
    6363    {
    64         // fire all WeaponPacks with their defined weaponmode
     64        // Fire all WeaponPacks with their defined weaponmode
    6565        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
    6666            if (it->second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
     
    7070    void WeaponSet::reload()
    7171    {
    72         // fire all WeaponPacks with their defined weaponmode
     72        // Reload all WeaponPacks with their defined weaponmode
    7373        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
    7474            it->first->reload();
  • code/trunk/src/orxonox/weaponsystem/WeaponSlot.h

    r10648 r10650  
    3737    /**
    3838    @brief
    39         The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
     39        The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. A WeaponSlot is a @ref orxonox::StaticEntity, therefore it has a position and orientation.
    4040        In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
    4141        A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
  • code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc

    r9667 r10650  
    283283    }
    284284
     285    /**
     286    @brief
     287        Fires the @ref Orxonox::WeaponSet with the specified firemode.
     288    */
    285289    void WeaponSystem::fire(unsigned int firemode)
    286290    {
  • code/trunk/src/orxonox/weaponsystem/WeaponSystem.h

    r9667 r10650  
    4040namespace orxonox
    4141{
     42    /**
     43    @brief
     44        An @ref orxonox::Pawn that is able to fire weapons always need to have a WeaponSystem. The WeaponSystem manages all the @ref orxonox::WeaponSet, @ref orxonox::WeaponPack and @ref orxonox::WeaponSlot classes.
     45       
     46    */       
    4247    class _OrxonoxExport WeaponSystem : public BaseObject
    4348    {
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r10624 r10650  
    299299    }
    300300
    301 
    302301    void Pawn::kill()
    303302    {
     
    319318        }
    320319    }
    321 
    322320
    323321    void Pawn::death()
     
    472470    }
    473471
     472    /**
     473    @brief
     474        Check whether the Pawn has a @ref Orxonox::WeaponSystem and fire it with the specified firemode if it has one.
     475    */
    474476    void Pawn::fired(unsigned int firemode)
    475477    {
Note: See TracChangeset for help on using the changeset viewer.