Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10504 for code


Ignore:
Timestamp:
May 28, 2015, 10:41:23 AM (9 years ago)
Author:
maxima
Message:

Bugfix: See Commit 10502. New orbStation Template.

Location:
code/branches/presentationFS15
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS15/data/levels/presentationFS15.oxw

    r10498 r10504  
    1515  include("templates/spaceshipRing.oxt")
    1616  include("templates/spaceshipFS15.oxt")
     17  include("templates/orbStation.oxt")
    1718
    1819?>
     
    3031
    3132    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
    32     <SpawnPoint team=0 position="-2000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipfs15/>
    33    
    34    
    35     <SpaceShip position="0,500,500" lookat="0,1000,0" >
    36       <attached>
    37         <DistanceTriggerBeacon name="bcnDestroyer" />
    38         <DockingTarget name="destroyer" />
    39       </attached>
    40       <templates>
    41         <Template link=spaceshipring />
    42       </templates>
    43     </SpaceShip>
     33    <SpawnPoint team=0 position="-500,0,0" lookat="-1000,0,0" spawnclass=SpaceShip pawndesign=spaceshipfs15/>
    4434
    4535    <!-- Docking  -->
     
    6151      </events>
    6252    </Dock>
     53
     54    <SpaceShip position="0,0,0" lookat="0,1000,1000" >
     55      <attached>
     56        <DistanceTriggerBeacon name="bcnDestroyer" />
     57        <DockingTarget name="destroyer" />
     58      </attached>
     59      <templates>
     60        <Template link=spaceshipring />
     61      </templates>
     62      <events>
     63        <visibility>
     64          <EventListener event="dockMe" />
     65        </visibility>
     66      </events>
     67    </SpaceShip>
     68
     69    <Billboard position="0,500,500" material="Flares/ringflare2" colour="0.8,0.4,0.2" scale=1 />
     70    <DistanceTrigger position="0,500,500" distance="200" target="Pawn" name="takeControl"/>
     71
     72    <MovableEntity position="0,1000,1000" >
     73      <templates>
     74        <Template link=orbStation/>
     75      </templates>
     76      <events>
     77        <visibility>
     78          <EventListener event="dockMe" />
     79        </visibility>
     80      </events>
     81    </MovableEntity>
     82
     83    <ControllerDirector position="0,0,0" scriptname="presentation">
     84      <events>
     85        <takeControl>
     86          <EventListener event="takeControl" />
     87        </takeControl>
     88      </events>
     89    </ControllerDirector>
     90
     91
    6392  </Scene>
    6493</Level>
  • code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc

    r10486 r10504  
    1212        RegisterClass(GravityBomb);
    1313
    14         const float GravityBomb::LIFETIME = 5;  ///< The gravity bomb lifetime in seconds.
     14        const float GravityBomb::LIFETIME = 2.5;  ///< The gravity bomb lifetime in seconds.
    1515
    1616        GravityBomb::GravityBomb(Context* context):
     
    2222
    2323                        this->setMass(10.0);
    24                         this->isDetonated_ = false;
     24                        this->hasCollided_ = false;
    2525                        if (GameMode::isMaster())
    2626                        {
     
    6767        void GravityBomb::tick(float dt)
    6868        {
    69                         timeToLife_ -= dt;
    70                         if(timeToLife_ < 0)
    71                         {
    72                                 //orxout(debug_output) << "bomb has stoped moving" <<endl;
    73                                 setVelocity(Vector3::ZERO); //Stop the bomb.
    74                                 isDetonated_ = true;
    75                         }
    76                         else
    77                         {
    78                                 //orxout(debug_output)<< "Time to live:" << timeToLife_ <<endl;
    79                                 destroyCheck(); //Every BasicProjectil has to call this method in each tick.
    80                         }
    81                         if(isDetonated_) detonate();
    82                         else SUPER(GravityBomb, tick, dt);
     69                SUPER(GravityBomb, tick, dt);
     70                timeToLife_ -= dt;
     71                if (timeToLife_ < 0)
     72                {
     73                        //orxout(debug_output) << "bomb has stoped moving" <<endl;
     74                        setVelocity(Vector3::ZERO); //Stop the bomb.
     75                        detonate();
     76                        this->destroy();
     77                }
     78                else
     79                {
     80                        if (hasCollided_) detonate();
     81                        destroyCheck(); //Bomb is going to be destroyed by destroyCheck(). As written in BasicProectile, this Method should be called by every Projectile.
     82                }
    8383        }
    8484
    8585        bool GravityBomb::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
    8686        {
    87                 if(otherObject != getShooter()) //Ensure that the bomb cannot collide with its shooter.
    88                 {
    89                         orxout(debug_output) << "collides" << endl;
    90                         processCollision(otherObject, contactPoint,cs);
    91                         isDetonated_ = true;
    92                         return true;
    93                 }
    94                 else{
    95                         //orxout(debug_output) << "collided with shooter. Has no effect..." << endl;
    96                         return false;
    97                 }
     87                hasCollided_ = processCollision(otherObject, contactPoint, cs);
     88                return hasCollided_;
    9889        }
    9990
     
    10697                //orxout(debug_output) << "detonating. Creating GravityBombField." <<endl;
    10798                //orxout(debug_output) << "Field is at Position: " << getPosition() << endl;
    108                 this->destroy();
    10999        }
    110100}
  • code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h

    r10487 r10504  
    4848                static const float LIFETIME;
    4949
    50                 bool isDetonated_; //Used to check whether the Bomb has to be destroyed during next tick.
     50                bool hasCollided_;
    5151                float timeToLife_; //Time the bomb flies before it explodes.
    5252                WorldSound* bombSound_;
  • code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc

    r10486 r10504  
    1616        const float GravityBombField::FORCE_FIELD_LIFETIME = 15;
    1717        const float GravityBombField::FORCE_SPHERE_START_RADIUS = 250;
    18         const float GravityBombField::FORCE_SPHERE_START_STRENGTH = -500;
     18        const float GravityBombField::FORCE_SPHERE_START_STRENGTH = -700;
    1919        const float GravityBombField::PEAK_EXPLOSION_FORCE = 5e4;
    2020        const float GravityBombField::FORCE_FIELD_EXPLOSION_DAMMAGE = 100;
     
    4040
    4141                //Make the Field visible on Radar and minimap.
    42                 this->setRadarObjectColour(ColourValue(0.2, 0.2, 1.0,1)); // Blue
     42                this->setRadarObjectColour(ColourValue(1.0, 0.0, 0.2,1)); // Red
    4343                this->setRadarObjectShape(RadarViewable::Dot);
    44                 this->setRadarObjectScale(0.5f);
     44                this->setRadarObjectScale(1.0f);
    4545               
    4646
  • code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc

    r10486 r10504  
    1919        RegisterClass(GravityBombFire);
    2020
    21         const float GravityBombFire::BOMB_VELOCITY = 400.0; ///< The velocity of the bomb after launch
     21        const float GravityBombFire::BOMB_VELOCITY = 600.0; ///< The velocity of the bomb after launch
    2222
    2323        GravityBombFire::GravityBombFire(Context* context) : WeaponMode(context)
Note: See TracChangeset for help on using the changeset viewer.