ClusterBomb Class Reference

#include <cluster_bomb.h>

Inheritance diagram for ClusterBomb:

Inheritance graph
[legend]
Collaboration diagram for ClusterBomb:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClusterBomb (ClusterBombConfig &cfg, WeaponLauncher *p_launcher)
void Refresh ()

Protected Member Functions

void DoExplosion ()
void SignalOutOfMap ()

Detailed Description

Definition at line 47 of file cluster_bomb.h.


Constructor & Destructor Documentation

ClusterBomb::ClusterBomb ( ClusterBombConfig cfg,
WeaponLauncher p_launcher 
)

Definition at line 69 of file cluster_bomb.cpp.

00071   : WeaponProjectile ("cluster_bomb", cfg, p_launcher)
00072 {
00073   m_rebound_sound = "weapon/grenade_bounce";
00074   explode_with_collision = false;
00075 }


Member Function Documentation

void ClusterBomb::DoExplosion (  )  [protected, virtual]

Reimplemented from WeaponProjectile.

Definition at line 89 of file cluster_bomb.cpp.

00090 {
00091   const uint nb = static_cast<ClusterBombConfig &>(cfg).nb_fragments;
00092   Cluster * cluster;
00093   for (uint i=0; i<nb; ++i) {
00094     double angle = randomSync.GetDouble(2.0 * M_PI);
00095     int x = GetX()+(int)(cos(angle) * (double)cfg.blast_range * 0.9);
00096     int y = GetY()+(int)(sin(angle) * (double)cfg.blast_range * 0.9);
00097     cluster = new Cluster(static_cast<ClusterBombConfig &>(cfg), launcher);
00098     cluster->Shoot(x,y);
00099     lst_objects.AddObject(cluster);
00100   }
00101   WeaponProjectile::DoExplosion();
00102 }

Here is the call graph for this function:

void ClusterBomb::Refresh (  )  [virtual]

Reimplemented from WeaponProjectile.

Definition at line 77 of file cluster_bomb.cpp.

00078 {
00079   WeaponProjectile::Refresh();
00080   image->SetRotation_rad(GetSpeedAngle());
00081 }

Here is the call graph for this function:

void ClusterBomb::SignalOutOfMap (  )  [protected, virtual]

Reimplemented from WeaponProjectile.

Definition at line 83 of file cluster_bomb.cpp.

00084 {
00085   GameMessages::GetInstance()->Add (_("The Cluster Bomb has left the battlefield before it could explode."));
00086   WeaponProjectile::SignalOutOfMap();
00087 }

Here is the call graph for this function:


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