#include <cluster_bomb.h>
Inheritance diagram for ClusterBomb:
Public Member Functions | |
ClusterBomb (ClusterBombConfig &cfg, WeaponLauncher *p_launcher) | |
void | Refresh () |
Protected Member Functions | |
void | DoExplosion () |
void | SignalOutOfMap () |
Definition at line 47 of file cluster_bomb.h.
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 }
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: