30 #ifndef _WeaponMode_H__ 31 #define _WeaponMode_H__ 57 virtual bool fire(
float* reloadTime);
62 {
return this->munition_; }
66 {
return this->munitiontype_; }
68 void setMunitionName(
const std::string& munitionname);
70 {
return this->munitionname_; }
73 { this->initialMunition_ = amount; }
75 {
return this->initialMunition_; }
78 { this->initialMagazines_ = amount; }
80 {
return this->initialMagazines_; }
83 { this->munitionPerShot_ = amount; }
85 {
return this->munitionPerShot_; }
90 { this->reloadTime_ = time; }
92 {
return this->reloadTime_; }
95 { this->bAutoReload_ = autoreload; }
97 {
return this->bAutoReload_; }
100 { this->bParallelReload_ = parallelreload; }
102 {
return this->bParallelReload_; }
104 {
return this->bReloading_; }
109 { this->damage_ = damage;}
111 {
return this->damage_; }
113 { this->healthdamage_ = healthdamage; }
115 {
return this->healthdamage_; }
118 { this->shielddamage_ = shielddamage;}
120 {
return this->shielddamage_; }
123 { this->muzzleOffset_ = offset; }
125 {
return this->muzzleOffset_; }
127 void computeMuzzleParameters(
const Vector3& target);
129 {
return this->muzzlePosition_; }
131 {
return this->muzzleOrientation_; }
132 Vector3 getMuzzleDirection()
const;
137 { this->weapon_ = weapon; this->updateMunition(); }
139 {
return this->weapon_; }
142 { this->mode_ = mode; }
144 {
return this->mode_; }
149 {
return this->hudImageString_; }
151 void updateMunition();
154 void setFireSound(
const std::string& soundPath,
const float soundVolume = 1.0);
156 void playFireSound();
159 void setReloadSound(
const std::string& soundPath,
const float soundVolume = 1.0);
161 void playReloadSound();
163 virtual void fire() = 0;
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
Definition of SubclassIdentifier.
bool getReloading() const
Definition: WeaponMode.h:103
void setReloadTime(float time)
Definition: WeaponMode.h:89
void setHealthDamage(float healthdamage)
Definition: WeaponMode.h:112
void setMunitionPerShot(unsigned int amount)
Definition: WeaponMode.h:82
const Quaternion & getMuzzleOrientation() const
Definition: WeaponMode.h:130
The WorldSound class is to be used for sounds with position and orientation.
Definition: WorldSound.h:44
Definition: Munition.h:48
const Vector3 & getMuzzleOffset() const
Definition: WeaponMode.h:124
Vector3 muzzleOffset_
Definition: WeaponMode.h:176
::std::string string
Definition: gtest-port.h:756
std::string reloadSoundPath_
Definition: WeaponMode.h:199
float healthdamage_
Definition: WeaponMode.h:174
void setInitialMunition(unsigned int amount)
Definition: WeaponMode.h:72
void setAutoReload(bool autoreload)
Definition: WeaponMode.h:94
float fireSoundVolume_
Definition: WeaponMode.h:197
unsigned int mode_
Definition: WeaponMode.h:184
unsigned int initialMunition_
Definition: WeaponMode.h:165
const Vector3 & getMuzzlePosition() const
Definition: WeaponMode.h:128
void setWeapon(Weapon *weapon)
Definition: WeaponMode.h:136
void setMode(unsigned int mode)
Definition: WeaponMode.h:141
float shielddamage_
Definition: WeaponMode.h:175
float reloadSoundVolume_
Definition: WeaponMode.h:200
std::string fireSoundPath_
Definition: WeaponMode.h:196
void setDamage(float damage)
Definition: WeaponMode.h:108
float getShieldDamage() const
Definition: WeaponMode.h:119
bool bReloading_
Definition: WeaponMode.h:191
void setShieldDamage(float shielddamage)
Definition: WeaponMode.h:117
Vector3 muzzlePosition_
Definition: WeaponMode.h:193
std::string munitionname_
Definition: WeaponMode.h:188
Munition * getMunition() const
Definition: WeaponMode.h:61
xmlelement
Definition: Super.h:519
Munition * munition_
Definition: WeaponMode.h:186
unsigned int getInitialMagazines() const
Definition: WeaponMode.h:79
const std::string & getHUDImageString() const
Definition: WeaponMode.h:148
A WeaponMode defines how a Weapon is used.
Definition: WeaponMode.h:49
Weapon * weapon_
Definition: WeaponMode.h:183
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
std::string hudImageString_
Definition: WeaponMode.h:178
Declaration of the Timer class, used to call functions after a given time-interval.
bool bAutoReload_
Definition: WeaponMode.h:170
Quaternion muzzleOrientation_
Definition: WeaponMode.h:194
SubclassIdentifier< Munition > munitiontype_
Definition: WeaponMode.h:187
const std::string & getMunitionName() const
Definition: WeaponMode.h:69
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
bool getParallelReload() const
Definition: WeaponMode.h:101
unsigned int getMode() const
Definition: WeaponMode.h:143
void setMuzzleOffset(const Vector3 &offset)
Definition: WeaponMode.h:122
Mode
Definition: CorePrereqs.h:102
A Weapon is a StaticEntity that can be attached to a WeaponSlot.
Definition: Weapon.h:46
The Identifier is used to identify the class of an object and to store information about the class...
Definition: Identifier.h:109
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Identifier * getMunitionType() const
Definition: WeaponMode.h:65
Declaration of BaseObject, the base class of all objects in Orxonox.
float getDamage() const
Definition: WeaponMode.h:110
float getHealthDamage() const
Definition: WeaponMode.h:114
Timer reloadTimer_
Definition: WeaponMode.h:190
std::vector< WorldSound * > fireSounds_
Definition: WeaponMode.h:198
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
unsigned int initialMagazines_
Definition: WeaponMode.h:166
bool bParallelReload_
Definition: WeaponMode.h:171
float getReloadTime() const
Definition: WeaponMode.h:91
unsigned int getInitialMunition() const
Definition: WeaponMode.h:74
void setParallelReload(bool parallelreload)
Definition: WeaponMode.h:99
bool getAutoReload() const
Definition: WeaponMode.h:96
float damage_
Definition: WeaponMode.h:173
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
void setInitialMagazines(unsigned int amount)
Definition: WeaponMode.h:77
The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
Definition: SubclassIdentifier.h:90
Weapon * getWeapon() const
Definition: WeaponMode.h:138
unsigned int getMunitionPerShot() const
Definition: WeaponMode.h:84
WorldSound * reloadSound_
Definition: WeaponMode.h:201
float reloadTime_
Definition: WeaponMode.h:169
unsigned int munitionPerShot_
Definition: WeaponMode.h:167