Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 7, 2011, 3:59:54 PM (13 years ago)
Author:
jo
Message:

Adjust weapon behaviour if bot dies and is respawned with a different weaponsetting than before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/orxonox/controllers/ArtificialController.h

    r8723 r8735  
    149149
    150150            int numberOfWeapons; //< Used for weapon init function. Displayes number of weapons available for a bot.
    151             int weapons[WeaponSystem::MAX_WEAPON_MODES];
    152             int projectiles[WeaponSystem::MAX_WEAPON_MODES];
     151            bool weapons[WeaponSystem::MAX_WEAPON_MODES]; //<! Displays if a weapon is available - managed by setupWeapons()
     152            int projectiles[WeaponSystem::MAX_WEAPON_MODES]; //<! Displays amount of projectiles. - managed by setupWeapons()
    153153            float botlevel_; //< Makes the level of a bot configurable.
    154154            float timeout_; //< Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
     
    156156            enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
    157157            Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_;
    158             void setPreviousMode();
    159 
    160         private:
    161             void setupWeapons();
    162             const std::string& getWeaponname(int i, Pawn* pawn);
    163             bool bSetupWorked;
     158            void setPreviousMode();
     159            void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed.
     160            const std::string& getWeaponname(int i, Pawn* pawn); //<! Function that links a weapon's firemode to its name.
     161            bool bSetupWorked; //<! If false, setupWeapons() is called.
    164162    };
    165163}
Note: See TracChangeset for help on using the changeset viewer.