Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6243 in orxonox.OLD


Ignore:
Timestamp:
Dec 21, 2005, 3:41:11 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the power-ups to the tunk again

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/class_id.h

    r6222 r6243  
    7474
    7575  // subsuper-classes derivations taken : 1, 2, 5, a, b, c.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
     76
    7677  // subsuper-classes
    7778  CL_MASK_SUBSUPER_CLASS        =    0x00fff000,
     
    8788  CL_WEAPON                     =    0x00210000,
    8889  CL_POWER_UP                   =    0x00220000,
    89   CL_EXTENDABLE                  =    0x00220000,
    90 
     90  CL_EXTENDABLE                 =    0x00240000,
    9191  // SUPER-Modeling
    9292  CL_TEXTURE                    =    0x00c01000,
  • trunk/src/world_entities/power_ups/param_power_up.cc

    r6222 r6243  
    1919#include "factory.h"
    2020#include "state.h"
     21#include "list.h"
    2122
    2223#include "primitive_model.h"
  • trunk/src/world_entities/power_ups/power_up.cc

    r6150 r6243  
    2727PowerUp::PowerUp(float r, float g, float b)
    2828{
     29  this->respawnType = RESPAWN_NONE;
    2930  if(!PowerUp::sphereModel) {
    3031    PowerUp::sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
     
    3334  this->sphereMaterial->setTransparency(.1);
    3435  this->sphereMaterial->setDiffuse(r, g, b);
    35 
    3636  this->toList(OM_COMMON);
    3737}
     
    9090{
    9191  for(int i = 0; i < RESPAWN_size; ++i) {
    92     if(strcmp(type, respawnTypes[i]) == 0) {
     92    if(!strcmp(type, respawnTypes[i])) {
    9393      this->respawnType = (PowerUpRespawn)i;
    9494      break;
  • trunk/src/world_entities/power_ups/weapon_power_up.cc

    r6222 r6243  
    1919#include "factory.h"
    2020#include "state.h"
     21#include "list.h"
    2122
    2223#include "primitive_model.h"
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6241 r6243  
    3131#include "key_mapper.h"
    3232#include "event_handler.h"
     33
     34#include "power_ups/weapon_power_up.h"
     35#include "power_ups/param_power_up.h"
    3336
    3437#include "graphics_engine.h"
     
    432435  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    433436    this->getWeaponManager()->previousWeaponConfig();
    434 
    435437  else if( event.type == SDLK_w)
    436438    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
     
    445447     //this->setAbsDir(mouseDir);
    446448  }
     449}
     450
     451/**
     452 *
     453 */
     454bool SpaceShip::pickup(PowerUp* powerUp)
     455{
     456  if(powerUp->isA(CL_WEAPON_POWER_UP)) {
     457    Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon();
     458    WeaponManager* manager = this->getWeaponManager();
     459    int slot = manager->getNextFreeSlot(0, weapon->getCapability());
     460    if(slot >= 0) {
     461      manager->addWeapon(weapon, 0, slot);
     462      return true;
     463    }
     464  }
     465  else if(powerUp->isA(CL_PARAM_POWER_UP)) {
     466    ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp);
     467    switch(ppu->getType()) {
     468      case PARAM_SHIELD:
     469        break;
     470    }
     471  }
     472  return false;
    447473}
    448474
  • trunk/src/world_entities/space_ships/space_ship.h

    r6222 r6243  
    88
    99#include "playable.h"
     10#include "extendable.h"
    1011
    1112
     
    1415class Event;
    1516
    16 class SpaceShip : public Playable
     17class SpaceShip : public Playable, public Extendable
    1718{
    1819
     
    4142
    4243    virtual void process(const Event &event);
    43 
     44    bool pickup(PowerUp* powerUp);
    4445
    4546
Note: See TracChangeset for help on using the changeset viewer.