Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 5, 2006, 12:20:34 PM (18 years ago)
Author:
rennerc
Message:

new weapon demage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9213 r9214  
    169169
    170170  this->initWeapon = false;
     171  this->damageTicker = 0.0f;
     172
    171173  toList( OM_PLAYERS );
    172174}
     
    275277    this->getWeaponManager().fire();
    276278
    277     WorldEntity* target = this->aimingSystem->getNearestTarget();
    278     if( target != NULL)
     279//     WorldEntity* target = this->aimingSystem->getNearestTarget();
     280//     if( target != NULL)
     281//     {
     282//       PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
     283//     }
     284//     else
     285//     {
     286//       PRINTF(0)("nothing hit\n");
     287//     }
     288  }
     289
     290
     291  //dealing damage
     292 
     293  if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer() )
     294  {
     295    this->damageTicker -= time;
     296 
     297    if ( this->damageTicker <= 0.0f && this->beFire() )
    279298    {
    280       PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
     299      this->damageTicker = 0.25;
     300   
     301      WorldEntity * victim = aimingSystem->getNearestTarget();
     302   
     303      if ( victim )
     304      {
     305        PRINTF(0)("FIRE: hit %s\n", victim->getClassName());
     306        victim->hit( 20, this );
     307      }
     308      else
     309      {
     310        PRINTF(0)("FIRE: nothing hit\n");
     311      }
    281312    }
    282     else
    283     {
    284       PRINTF(0)("nothing hit\n");
    285     }
    286   }
    287 
    288 
     313  }
    289314
    290315
     
    462487  if( State::isOnline())
    463488    toList( OM_PLAYERS );
     489 
     490  this->damageTicker = 0.0f;
    464491}
    465492
Note: See TracChangeset for help on using the changeset viewer.