Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2005, 3:45:26 PM (19 years ago)
Author:
manuel
Message:

many changes:
created generic weapon_power_up that can contain any kind of weapon
space_ship is now extendable and can pickup weapon_power_ups

File:
1 edited

Legend:

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

    r5955 r5965  
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1818
     19#include "space_ship.h"
     20
    1921#include "executor/executor.h"
    20 #include "space_ship.h"
    2122
    2223#include "objModel.h"
     
    3031#include "factory.h"
    3132#include "key_mapper.h"
     33
     34#include "power_ups/weapon_power_up.h"
    3235
    3336using namespace std;
     
    368371}
    369372
     373/**
     374 *
     375 */
     376bool SpaceShip::pickup(PowerUp* powerUp)
     377{
     378  if(powerUp->isA(CL_WEAPON_POWER_UP)) {
     379    WeaponPowerUp* wpu = dynamic_cast<WeaponPowerUp*>(powerUp);
     380    WeaponManager* manager = this->getWeaponManager();
     381    int slot = manager->getNextFreeSlot(0, wpu->getCapsNeeded());
     382    if(slot >= 0) {
     383      manager->addWeapon(wpu->getWeapon(), 0, slot);
     384      return true;
     385    }
     386  }
     387  else if(powerUp->isA(CL_SHIELD_POWER_UP)) {
     388
     389  }
     390  return false;
     391}
     392
    370393#include "weapons/aiming_turret.h"
    371394// FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
Note: See TracChangeset for help on using the changeset viewer.