Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2006, 4:22:38 PM (17 years ago)
Author:
marcscha
Message:

modifications done this afternoon

File:
1 edited

Legend:

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

    r9966 r9970  
    2323
    2424#include "weapons/test_gun.h"
     25#include "weapons/light_blaster.h"
     26#include "weapons/medium_blaster.h"
     27#include "weapons/heavy_blaster.h"
     28#include "weapons/boomerang_gun.h"
    2529#include "weapons/turret.h"
    2630#include "weapons/cannon.h"
     
    129133
    130134  //weapons:
    131   Weapon* wpRight = new TestGun(0);
    132   wpRight->setName("testGun Right");
    133   Weapon* wpLeft = new TestGun(1);
    134   wpLeft->setName("testGun Left");
    135 
    136   Weapon* cannon = new Cannon();
    137   cannon->setName("BFG");
     135  Weapon* wpRight = new LightBlaster ();
     136  wpRight->setName("Blaster Right");
     137  Weapon* wpLeft = new LightBlaster ();
     138  wpLeft->setName("Blaster Left");
     139
     140  Weapon* cannon = new BoomerangGun();//Cannon();
     141  cannon->setName("End of World");
    138142
    139143
     
    148152  cannon->requestAction(WA_ACTIVATE);
    149153
    150   this->curWeaponPrimary    = 0;
    151   this->curWeaponSecondary  = 0;
     154  curWeaponPrimary    = 0;
     155  curWeaponSecondary  = 0;
    152156
    153157  Playable::weaponConfigChanged();
    154158
    155   weaponEnergyRegen = 10;   // 10 einheiten pro Sekunde
     159  reactorOutput     = 10;
     160
     161  weaponEnergyRegen = 10;       // 10 einheiten pro Sekunde
     162  engineSpeedBase   = 5;
     163  shieldRegen       = 2;
     164
     165  shieldEnergyShare = 0.3;
     166  weaponEnergyShare = 0.3;
     167  engineEnergyShare = 0.4;
     168
     169  shieldCur         = 20;
     170  shieldMax         = 100;
    156171
    157172  /*
     
    163178  */
    164179
    165   this->loadModel("models/ships/hoverglider_mainbody.obj");
     180  this->loadModel("models/ships/mantawing.obj");
    166181
    167182  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
     
    176191  //  cycle = 0.0;
    177192
    178   this->setHealthMax(100);
    179   this->setHealth(80);
     193  this->setHealthMax(shieldMax);
     194  this->setHealth(shieldCur);
    180195
    181196  travelSpeed = 0.0;
     
    396411  }
    397412
     413
     414  // Shield Regeneration and other regular calculations on the ship
     415  this->regen(time);
     416
     417  // Weapon Regeneration and other regular calculations on the ship
    398418  this->weaponRegen(time);
     419
     420  // current engine speed output
     421  this->engineSpeedCur = this->engineSpeedBase + this->reactorOutput * this->engineEnergyShare;
     422
     423
    399424
    400425  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
     
    411436  }
    412437
    413   // Shield Regeneration and other regular calculations on the ship
    414   this->regen(time);
     438 
    415439
    416440
     
    628652  }
    629653  if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){
    630     tmp =  this->shieldCur + this->shieldRegen * time;
     654    tmp =  this->shieldCur + (this->shieldRegen + this->reactorOutput * this->shieldEnergyShare) * time;
    631655    if( tmp > shieldMax)
    632656      this->shieldCur = this->shieldMax;
     
    635659    this->shieldActive = ( this->shieldActive || this->shieldCur > shieldTH);
    636660  }
     661
     662  this->setHealth( this->shieldCur);      // FIXME currently just to test share system
     663
    637664  if (this->electronicCur != this->electronicMax || this->electronicRegen != 0){
    638665    tmp = this->electronicCur + this->electronicRegen * time;
Note: See TracChangeset for help on using the changeset viewer.