Shotgun Class Reference

#include <shotgun.h>

Inheritance diagram for Shotgun:

Inheritance graph
[legend]
Collaboration diagram for Shotgun:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Shotgun ()

Protected Member Functions

WeaponProjectileGetProjectileInstance ()
void IncMissedShots ()
bool p_Shoot ()

Private Member Functions

void ShootSound ()

Detailed Description

Definition at line 41 of file shotgun.h.


Constructor & Destructor Documentation

Shotgun::Shotgun (  ) 

Definition at line 60 of file shotgun.cpp.

00060                  : WeaponLauncher(WEAPON_SHOTGUN, "shotgun", new ExplosiveWeaponConfig())
00061 {
00062   m_name = _("Shotgun");
00063 
00064   override_keys = true ;
00065   announce_missed_shots = false;
00066   m_weapon_fire = new Sprite(resource_manager.LoadImage(weapons_res_profile,m_id+"_fire"));
00067   m_weapon_fire->EnableRotationCache(32);
00068 
00069   ReloadLauncher();
00070 }

Here is the call graph for this function:


Member Function Documentation

WeaponProjectile * Shotgun::GetProjectileInstance (  )  [protected, virtual]

Implements WeaponLauncher.

Definition at line 73 of file shotgun.cpp.

00074 {
00075   return dynamic_cast<WeaponProjectile *>
00076       (new ShotgunBuckshot(cfg(),dynamic_cast<WeaponLauncher *>(this)));
00077 }

Here is the call graph for this function:

void Shotgun::IncMissedShots (  )  [protected, virtual]

Reimplemented from WeaponLauncher.

Definition at line 84 of file shotgun.cpp.

00085 {
00086   if(missed_shots + 1 == nb_bullets)
00087     announce_missed_shots = true;
00088   WeaponLauncher::IncMissedShots();
00089 }

Here is the call graph for this function:

bool Shotgun::p_Shoot (  )  [protected, virtual]

Reimplemented from WeaponLauncher.

Definition at line 91 of file shotgun.cpp.

00092 {  
00093   missed_shots = 0;
00094   announce_missed_shots = false;
00095   if (m_is_active)
00096     return false;
00097   for(int i = 0; i < nb_bullets; i++) {
00098     projectile->Shoot(SHOTGUN_BUCKSHOT_SPEED);
00099     projectile = NULL;
00100     ReloadLauncher();
00101   }
00102   ShootSound();
00103   m_last_fire_time = Time::GetInstance()->Read();
00104   m_is_active = true;
00105   return true;
00106 }

Here is the call graph for this function:

void Shotgun::ShootSound (  )  [private]

Definition at line 79 of file shotgun.cpp.

00080 {
00081   jukebox.Play("share", "weapon/shotgun");
00082 }

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 14:15:11 2007 for Wormux by  doxygen 1.4.7