示例#1
0
void CPlasmaShot::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
   // Save the type of object that shot this weapon
   SetOwner(shotowner);
   
   // Damage of the projectile
   SetDamage((int)damage);

   m_ProjectileOwner = projectileowner;

   if(shotowner == PLAYER_SHOT || FRIENDLY_SHOT)
   {
      m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
      m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 1);
   }
   else if(shotowner == ENEMY_SHOT)
   {
      m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
      m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 6);    
   }

   m_PlasmaInAir->Play3DAudio(10.0f, 10000.0f, 100);

   m_Active = true;
   m_Velocity = velocity;
   m_DamageRadius = damageradius;

   m_CreationTime = g_time;
   m_LifeTime = 3.0f;

   // Get the position of the object
   GetPosition(&m_CurPosition, 0);
   m_LastPosition = m_CurPosition; 
}
void CTrackingMissile::SetUp(int shotOwner, int damage, bool left, float damageradius, float accuracy, CGameObject * projectileowner)
{
   // Save the type of object that shot this weapon
   SetOwner(shotOwner);

	m_Tracking = false;
	m_UpdatePeriod = accuracy;
	m_SlerpScale = 1.0f / m_UpdatePeriod;
   m_DamageRadius = damageradius;
   
   // Damage of the projectile
   SetDamage(damage);
   m_Velocity = 40.0f;

   // Pointer to the game object that owns this shot
   m_ProjectileOwner = projectileowner;

   if(shotOwner == PLAYER_SHOT)
   {
      m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
      m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 7);
   }
   else if(shotOwner == ENEMY_SHOT)
   {
      m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
      m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 6);
   }

   m_MissileInAir->Play3DAudio(10.0f, 10000.0f, 75);
   
   m_Active = true;

   m_CreationTime = g_time;
   m_LifeTime = 10.0f;

	CObjFrame temp = *m_RenderObj.GetFrame(0);
	temp.GetOrientation(&m_Q0);
	m_Q2 = m_Q0;
	temp.RotateLocalX(-PI / 6.0f);
	temp.GetOrientation(&m_Q1);

   // Get the position of the object
   GetPosition(&m_CurPosition, 0);
   m_LastPosition = m_CurPosition; 
}
示例#3
0
void CIonFlare::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
   // Save the type of object that shot this weapon
   SetOwner(shotowner);
   
   // Damage of the projectile
   SetDamage((int)damage);

   m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLAYER_IONCANNON], 10);

   m_Active = true;
   m_Velocity = velocity;
   m_DamageRadius = damageradius;

   m_CreationTime = g_time;
   m_LifeTime = 3.0f;
}