Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7102 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Feb 7, 2006, 8:56:57 PM (19 years ago)
Author:
bensch
Message:

power ups can only be picked up once

Location:
trunk/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/ground_turret.cc

    r7076 r7102  
    6767  this->setHealth(300);
    6868
    69   /*  left = new Turret();
    70   left->setParent(this);
    71   left->setRelCoor(0,10,0);
    72   right = new Turret();
    73   right->setParent(this);
    74   right->setRelCoor(0,10,0);*/
     69  this->weaponHolder[0].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     70  this->weaponHolder[1].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     71
     72  this->weaponHolder[0].setRelCoor(0,25,0);
     73  this->weaponHolder[0].setParent(this);
     74  this->weaponHolder[1].setParent(this);
    7575}
    7676
     
    101101    this->left->setRelCoor(0,10,-5);
    102102    this->left->requestAction( WA_ACTIVATE);
     103    this->left->setParent(&this->weaponHolder[0]);
    103104  }
    104105
     
    112113    this->right->setRelCoor(0,10,5);
    113114    this->left->requestAction( WA_ACTIVATE);
     115    this->right->setParent(&this->weaponHolder[0]);
    114116  }
    115117}
  • trunk/src/world_entities/npcs/ground_turret.h

    r7076 r7102  
    3434
    3535 private:
     36   PNode  weaponHolder[2];
    3637   Weapon *left, *right;
    3738};
  • trunk/src/world_entities/power_ups/power_up.cc

    r7077 r7102  
    4747  this->pickupBuffer = NULL;
    4848  this->respawnBuffer = NULL;
     49
     50  this->collider = NULL;
    4951}
    5052
     
    120122  if(entity->isA(CL_EXTENDABLE))
    121123  {
     124    this->collider = entity;
    122125    if(dynamic_cast<Extendable*>(entity)->pickup(this))
    123126    {
     
    144147    {
    145148      this->toList(OM_COMMON);
     149      this->collider = NULL;
    146150      if (likely(this->respawnBuffer != NULL))
    147151        this->soundSource.play(this->respawnBuffer);
  • trunk/src/world_entities/power_ups/power_up.h

    r7077 r7102  
    5353  float respawnStart;
    5454  static const char* respawnTypes[];
     55
     56  WorldEntity* collider;
    5557};
    5658
  • trunk/src/world_entities/projectiles/guided_missile.cc

    r7086 r7102  
    4545  this->setHealthMax(10);
    4646  this->lifeSpan = 4.0;
    47   this->agility = 1;
     47  this->agility = 3.5;
    4848  this->maxVelocity = 75;
    4949
  • trunk/src/world_entities/weapons/weapon.cc

    r6920 r7102  
    115115  WorldEntity::loadParams(root);
    116116
    117   LoadParam(root, "projectile", this, Weapon, setProjectileType)
     117  LoadParam(root, "projectile", this, Weapon, setProjectileTypeC)
    118118  .describe("Sets the name of the Projectile to load onto the Entity");
    119119
     
    164164 * @param projectile the Name of the Projectile.
    165165 */
    166 void Weapon::setProjectileType(const char* projectile)
     166void Weapon::setProjectileTypeC(const char* projectile)
    167167{
    168168  if (projectile == NULL)
  • trunk/src/world_entities/weapons/weapon.h

    r6920 r7102  
    111111    inline long getCapability() const { return this->capability; };
    112112    void setProjectileType(ClassID projectile);
    113     void setProjectileType(const char* projectile);
     113    void setProjectileTypeC(const char* projectile);
    114114    /** @returns The projectile's classID */
    115115    inline ClassID getProjectileType() { return this->projectile; };
Note: See TracChangeset for help on using the changeset viewer.