#include <suicide.h>
Inheritance diagram for Suicide:
Public Member Functions | |
Suicide () | |
ExplosiveWeaponConfig & | cfg () |
Protected Member Functions | |
bool | p_Shoot () |
void | p_Select () |
void | Refresh () |
Private Attributes | |
int | sound_channel |
bool | is_dying |
Definition at line 28 of file suicide.h.
Suicide::Suicide | ( | ) |
Definition at line 31 of file suicide.cpp.
00031 : Weapon(WEAPON_SUICIDE, "suicide", new ExplosiveWeaponConfig()) 00032 { 00033 m_name = _("Commit Suicide"); 00034 sound_channel = -1; 00035 }
ExplosiveWeaponConfig & Suicide::cfg | ( | ) |
void Suicide::p_Select | ( | ) | [protected, virtual] |
Reimplemented from Weapon.
Definition at line 37 of file suicide.cpp.
00038 { 00039 is_dying = false; 00040 }
bool Suicide::p_Shoot | ( | ) | [protected, virtual] |
Implements Weapon.
Definition at line 42 of file suicide.cpp.
00043 { 00044 sound_channel = jukebox.Play ("share", "weapon/suicide"); 00045 00046 GameLoop::GetInstance()->interaction_enabled=false; 00047 is_dying = true; 00048 00049 return true; 00050 }
Here is the call graph for this function:
void Suicide::Refresh | ( | ) | [protected, virtual] |
Implements Weapon.
Definition at line 52 of file suicide.cpp.
00053 { 00054 if (!is_dying) return; 00055 00056 m_is_active = sound_channel != -1 && Mix_Playing(sound_channel); 00057 00058 if(!m_is_active && !ActiveCharacter().IsDead()) 00059 { 00060 ActiveCharacter().DisableDeathExplosion(); 00061 ActiveCharacter().body->MakeParticles(ActiveCharacter().GetPosition()); 00062 Action* a = new Action(Action::ACTION_SET_CHARACTER_ENERGY); 00063 a->Push((int)ActiveCharacter().GetTeamIndex()); 00064 a->Push((int)ActiveCharacter().GetCharacterIndex()); 00065 a->Push(0); // Set energy to 0 => death 00066 ActionHandler::GetInstance()->NewAction(a); 00067 ApplyExplosion(ActiveCharacter().GetCenter(),cfg()); 00068 } 00069 }
Here is the call graph for this function:
bool Suicide::is_dying [private] |
int Suicide::sound_channel [private] |