Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10180 in orxonox.OLD for branches/playability


Ignore:
Timestamp:
Jan 4, 2007, 10:29:09 PM (18 years ago)
Author:
nicolasc
Message:

bump

Location:
branches/playability/src/world_entities
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/WorldEntities.am

    r10179 r10180  
    4242                world_entities/weapons/swarm_launcher.cc \
    4343                world_entities/weapons/spike_launcher.cc \
     44                world_entities/weapons/spike_thrower.cc \
    4445                world_entities/weapons/acid_launcher.cc \
    4546                \
     
    160161                weapons/swarm_launcher.h \
    161162                weapons/spike_launcher.h \
     163                weapons/spike_thrower.h \
    162164                weapons/acid_launcher.h \
    163165                \
  • branches/playability/src/world_entities/projectiles/hbolt.cc

    r10159 r10180  
    113113}
    114114
    115 
     115/*
    116116void HBolt::collidesWith(WorldEntity* entity, const Vector& location)
    117117{
     
    122122  dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
    123123  this->deactivate();
    124 }
     124}*/
    125125
    126126
  • branches/playability/src/world_entities/projectiles/hbolt.h

    r10104 r10180  
    2727    virtual void deactivate();
    2828
    29     virtual void collidesWith(WorldEntity* entity, const Vector& location);
     29//     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    3030
    3131    virtual void destroy (WorldEntity* killer);
  • branches/playability/src/world_entities/projectiles/lbolt.cc

    r10117 r10180  
    115115}
    116116
    117 
     117/*
    118118void LBolt::collidesWith(WorldEntity* entity, const Vector& location)
    119119{
     
    124124  dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0);
    125125//   this->deactivate();
    126 }
     126}*/
    127127
    128128/**
  • branches/playability/src/world_entities/projectiles/lbolt.h

    r10074 r10180  
    2727    virtual void deactivate();
    2828
    29     virtual void collidesWith(WorldEntity* entity, const Vector& location);
     29//     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    3030
    3131    virtual void destroy (WorldEntity* killer);
  • branches/playability/src/world_entities/projectiles/mbolt.cc

    r10170 r10180  
    141141}
    142142
    143 
     143/*
    144144void MBolt::collidesWith(WorldEntity* entity, const Vector& location)
    145145{
     
    157157  //entity->destroy(this);
    158158  //this->deactivate();
    159 }
     159}*/
    160160
    161161/**
  • branches/playability/src/world_entities/projectiles/mbolt.h

    r10117 r10180  
    2828    virtual void deactivate();
    2929
    30     virtual void collidesWith(WorldEntity* entity, const Vector& location);
     30//     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    3131
    3232    virtual void destroy (WorldEntity* killer);
  • branches/playability/src/world_entities/projectiles/spike_ball.cc

    r10170 r10180  
    3030
    3131#include "space_ships/space_ship.h"
     32
     33#include "weapons/weapon.h"
    3234
    3335
     
    5860
    5961  this->angle = 0;
    60   this->rotationSpeed = 130;
     62  this->rotationSpeed = 0;
    6163/*
    6264  this->halo = new Billboard();
  • branches/playability/src/world_entities/weapons/spike_launcher.cc

    r10170 r10180  
    6767SpikeLauncher::~SpikeLauncher ()
    6868{
     69  delete this->launcher;
     70
    6971  // model will be deleted from WorldEntity-destructor
    7072}
     
    9597
    9698  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
    97   this->setProjectileTypeC("SpikeBall");
     99  this->setProjectileTypeC("Spike");
    98100
    99   this->loadModel("models/guns/turret1.obj", 1.0);
     101//   this->loadModel("models/guns/turret1.obj", 1.0);
     102  this->size = 2.5;
    100103
    101   this->setEmissionPoint(1.684, 0.472, 0);
    102   this->getProjectileFactory()->prepare(50);
     104  this->spikes = 26;
     105  this->launcher = new Vector [this->spikes];
     106
     107  this->launcher[0] = Vector(1.0, 0.0, 0.0);
     108  this->launcher[1] = Vector(0.0, 1.0, 0.0);
     109  this->launcher[2] = Vector(0.0, 0.0, 1.0);
     110
     111  this->launcher[3] = Vector(1.0, 1.0, 0.0);
     112  this->launcher[4] = Vector(0.0, 1.0, 1.0);
     113  this->launcher[5] = Vector(1.0, 0.0, 1.0);
     114  this->launcher[6] = Vector(1.0, -1.0, 0.0);
     115  this->launcher[7] = Vector(0.0, 1.0, -1.0);
     116  this->launcher[8] = Vector(-1.0, 0.0, 1.0);
     117
     118  this->launcher[9] = Vector(-1.0, 1.0, 1.0);
     119  this->launcher[10] = Vector(1.0, 1.0, 1.0);
     120  this->launcher[11] = Vector(1.0, -1.0, 1.0);
     121  this->launcher[12] = Vector(-1.0, -1.0, 1.0);
     122
     123  int tmp = this->spikes / 2;
     124  for (int i = 0; i < tmp; i++)
     125  {
     126    this->launcher[i].normalize();
     127    this->launcher[tmp + i] =  this->launcher[i] * (-1);
     128  }
     129
     130//   this->setEmissionPoint(1.684, 0.472, 0);
     131  this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
    103132
    104133  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
     
    145174void SpikeLauncher::fire()
    146175{
    147   bool fired  = false;
     176  Projectile* pj = NULL;
     177//   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
     178  for (int i = 0; i < this->spikes; i++)
     179  {
     180    pj  = this->getProjectile();
     181    if (pj == NULL) // if true, we do have a problem!!
     182      return;
    148183
    149   Projectile* pj = NULL;
    150   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    151   {
    152     if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
    153     {
    154       pj  = this->getProjectile();
    155       if (pj == NULL)
    156         return;
    157      
    158       fired = true;
    159       pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
     184//     pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
     185    pj->setVelocity(this->launcher[i] * 200.0);
    160186
    161       pj->setParent(PNode::getNullParent());
    162       pj->setAbsCoor(this->getEmissionPoint());
    163       pj->setAbsDir(this->getAbsDir());
    164 //       dynamic_cast<SpikeProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
    165       pj->toList(OM_GROUP_01_PROJ);
    166       pj->activate();
    167     }
     187    pj->setParent(PNode::getNullParent());
     188    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
     189    pj->setAbsDir(Quaternion(this->launcher[i], 0));
     190    pj->activate();
    168191  }
    169   if( !fired)
    170     this->increaseEnergy( this->getProjectile()->getMinEnergy());
    171192}
  • branches/playability/src/world_entities/weapons/spike_launcher.h

    r10170 r10180  
    3030
    3131  private:
     32
     33  int           spikes;
     34  Vector*       launcher;
     35  float         size;
    3236  };
    3337
Note: See TracChangeset for help on using the changeset viewer.