#include <syringe.h>
Inheritance diagram for Syringe:
Public Member Functions | |
Syringe () | |
SyringeConfig & | cfg () |
Protected Member Functions | |
bool | p_Shoot () |
void | Refresh () |
void | Draw () |
Definition at line 42 of file syringe.h.
Syringe::Syringe | ( | ) |
Definition at line 29 of file syringe.cpp.
00029 : Weapon(WEAPON_SYRINGE, "syringe", new SyringeConfig()) 00030 { 00031 m_name = _("Syringe"); 00032 }
SyringeConfig & Syringe::cfg | ( | ) |
void Syringe::Draw | ( | ) | [protected, virtual] |
Reimplemented from Weapon.
Definition at line 34 of file syringe.cpp.
00034 { 00035 Weapon::Draw(); 00036 }
Here is the call graph for this function:
bool Syringe::p_Shoot | ( | ) | [protected, virtual] |
Implements Weapon.
Definition at line 38 of file syringe.cpp.
00038 { 00039 double angle = ActiveCharacter().GetFiringAngle(); 00040 double radius = 0.0; 00041 bool end = false; 00042 00043 jukebox.Play ("share","weapon/syringe"); 00044 00045 do 00046 { 00047 // Did we have finished the computation 00048 radius += 1.0; 00049 if (cfg().range < radius) 00050 { 00051 radius = cfg().range; 00052 end = true; 00053 } 00054 00055 // Compute point coordinates 00056 Point2i relative_pos(static_cast<int>(radius * cos(angle)), 00057 static_cast<int>(radius * sin(angle)) ); 00058 Point2i pos_to_check = ActiveCharacter().GetHandPosition() + relative_pos; 00059 FOR_ALL_LIVING_CHARACTERS(team, character) 00060 if (&(*character) != &ActiveCharacter()) 00061 { 00062 // Did we touch somebody ? 00063 if( character->ObjTouche(pos_to_check) ) 00064 { 00065 // Apply damage (*ver).SetEnergyDelta (-cfg().damage); 00066 character->SetDiseaseDamage(cfg().damage, cfg().turns); 00067 end = true; 00068 } 00069 } 00070 } while (!end); 00071 00072 return true; 00073 }
Here is the call graph for this function:
void Syringe::Refresh | ( | ) | [protected, virtual] |
Implements Weapon.
Definition at line 75 of file syringe.cpp.
00075 { 00076 if (m_is_active) 00077 m_is_active = false; 00078 }