Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10022 in orxonox.OLD


Ignore:
Timestamp:
Dec 6, 2006, 2:38:25 PM (17 years ago)
Author:
nicolasc
Message:

finished systemFailure(), included RNG

Location:
branches/playability/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10021 r10022  
    131131{
    132132
     133  srand(time(0));   //initialize Random Nomber Generator
     134
    133135  this->setSupportedPlaymodes(Playable::Vertical);
    134136
     
    201203  shieldTH          = .2* shieldMax;   // shield power must be 20% before shield kicks in again
    202204
    203   electronicCur = electronicMax = 50;
     205  electronicCur = 1;
     206  electronicMax = 50;
    204207  electronicRegen   = 3;
    205208  electronicTH      = .7 * electronicMax; // 30% of eDamage can be handled by the ship
     
    766769
    767770
    768 bool SpaceShip::systemFailure()
    769 {
    770   //srand(time(0)); TODO implement
    771   return (this->electronicCur < /*rand() */ this->electronicTH);
    772 }
    773 
    774 
    775771void SpaceShip::enterPlaymode(Playable::Playmode playmode)
    776772{
  • branches/playability/src/world_entities/space_ships/space_ship.h

    r10020 r10022  
    8383    void weaponRegen(float time);   //!< weapon energy regeneration
    8484
    85     inline bool systemFailure();
     85    inline bool systemFailure() {  return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };
    8686
    8787    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
Note: See TracChangeset for help on using the changeset viewer.