Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10020 in orxonox.OLD for branches/playability/src/world_entities


Ignore:
Timestamp:
Dec 6, 2006, 1:11:02 PM (18 years ago)
Author:
nicolasc
Message:
 
Location:
branches/playability/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/projectile.cc

    r9969 r10020  
    192192void Projectile::tick (float dt)
    193193{
    194   float tti;  //!< time to impact
     194  float tti = 0;  //!< time to impact
    195195  Vector estTargetDir = (this->target->getRelCoor() + this->target->getVelocity());
    196196  this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * dt ) * this->velocity.len();
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10019 r10020  
    5151
    5252#include "util/loading/load_param.h"
     53#include "time.h"
    5354
    5455
     
    198199  shieldCur         = 20;
    199200  shieldMax         = 100;
     201  shieldTH          = .2* shieldMax;   // shield power must be 20% before shield kicks in again
     202
     203  electronicCur     = 10;
     204  electronicMax     = 50;
     205  electronicRegen   = 3;
     206  electronicTH      = .7 * electronicMax; // 30% of eDamage can be handled by the ship
    200207
    201208  /*
     
    372379  //this->airFriction = 0.0f;
    373380
     381  srand(time(0));  //initaialize RNG
     382
    374383  this->travelNode->debugDraw();
    375384}
     
    492501  this->weaponMan.tick(time);
    493502  this->secWeaponMan.tick(time);
     503
     504  if( this->systemFailure() )
     505    bFire = bSecFire = false;
    494506
    495507  if( this->bFire)
     
    755767
    756768
     769bool SpaceShip::systemFailure()
     770{
     771   return (this->electronicCur < /*this->rand() */ this->electronicTH); //TODO cleanup
     772}
     773
     774
    757775void SpaceShip::enterPlaymode(Playable::Playmode playmode)
    758776{
     
    856874  if (this->getRelCoor().z < this->travelDistanceMinus.y) this->setRelCoor(oldCoor.x, oldCoor.y, this->travelDistanceMinus.y);
    857875
     876  if( this->systemFailure() )
     877    bForward = bBackward = bLeft = bRight = false;
     878
     879
    858880  if( this->bForward )
    859881  {
  • branches/playability/src/world_entities/space_ships/space_ship.h

    r10019 r10020  
    8383    void weaponRegen(float time);   //!< weapon energy regeneration
    8484
     85    inline bool systemFailure();
     86
    8587    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
    8688    WeaponManager         secWeaponMan;       //!< the secondary weapon manager: managing a list of special weapons to weapon-slot mapping
     
    104106    float       electronicMax;      //!< maximum electronic
    105107    float       electronicRegen;    //!< electronic regenration rate per tick
     108    float       electronicTH;       //!< Threshhold for electronic failure
    106109
    107110    float       engineSpeedCur;     //!< speed output for movement = speed base + energy share part
Note: See TracChangeset for help on using the changeset viewer.