1 ////////////////////////////////////////////////////////////////////////////////
2 //    Scorched3D (c) 2000-2011
3 //
4 //    This file is part of Scorched3D.
5 //
6 //    Scorched3D is free software; you can redistribute it and/or modify
7 //    it under the terms of the GNU General Public License as published by
8 //    the Free Software Foundation; either version 2 of the License, or
9 //    (at your option) any later version.
10 //
11 //    Scorched3D is distributed in the hope that it will be useful,
12 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //    GNU General Public License for more details.
15 //
16 //    You should have received a copy of the GNU General Public License along
17 //    with this program; if not, write to the Free Software Foundation, Inc.,
18 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ////////////////////////////////////////////////////////////////////////////////
20 
21 #if !defined(AFX_WEAPONPROJECTILE_H__70119A64_2064_4066_8EE5_FD6A3E24D5FC__INCLUDED_)
22 #define AFX_WEAPONPROJECTILE_H__70119A64_2064_4066_8EE5_FD6A3E24D5FC__INCLUDED_
23 
24 #include <weapons/Weapon.h>
25 #include <common/ModelID.h>
26 #include <engine/ObjectGroupEntryDefinition.h>
27 
28 class WeaponProjectile : public Weapon
29 {
30 public:
31 	WeaponProjectile();
32 	virtual ~WeaponProjectile();
33 
34 	virtual bool parseXML(AccessoryCreateContext &context,
35 		XMLNode *accessoryNode);
36 
getCollisionAction()37 	Weapon *getCollisionAction() { return collisionAction_; }
38 
39 	// Inherited from Weapon
40 	virtual void fireWeapon(ScorchedContext &context,
41 		WeaponFireContext &weaponContext, FixedVector &position, FixedVector &velocity);
42 
43 	REGISTER_ACCESSORY_HEADER(WeaponProjectile, AccessoryPart::AccessoryWeapon);
44 
getUnder()45 	bool getUnder() { return under_; }
getShowShotPath()46 	bool getShowShotPath() { return showShotPath_; }
getShowEndPoint()47 	bool getShowEndPoint() { return showEndPoint_; }
getApexCollision()48 	bool getApexCollision() { return apexCollision_; }
getWaterCollision()49 	bool getWaterCollision() { return waterCollision_; }
getWallCollision()50 	bool getWallCollision() { return wallCollision_; }
getApexNoDud()51 	bool getApexNoDud() { return apexNoDud_; }
getCreateSmoke()52 	bool getCreateSmoke() { return createSmoke_; }
getCreateFlame()53 	bool getCreateFlame() { return createFlame_; }
getTimedDud()54 	bool getTimedDud() { return timedDud_; }
55 	fixed getWindFactor(ScorchedContext &context);
56 	fixed getGravityFactor(ScorchedContext &context);
57 	fixed getShieldHurtFactor(ScorchedContext &context);
getTimedCollision(ScorchedContext & context)58 	fixed getTimedCollision(ScorchedContext &context) { return timedCollision_.getValue(context); }
getHeightCollision(ScorchedContext & context)59 	fixed getHeightCollision(ScorchedContext &context) { return heightCollision_.getValue(context); }
getSpinSpeed(ScorchedContext & context)60 	fixed getSpinSpeed(ScorchedContext &context) { return spinSpeed_.getValue(context); }
getStepSize()61 	fixed getStepSize() { return stepSize_; }
getFlameLife()62 	float getFlameLife() { return flameLife_; }
getFlameStartSize()63 	float getFlameStartSize() { return flameStartSize_; }
getFlameEndSize()64 	float getFlameEndSize() { return flameEndSize_; }
getSmokeLife()65 	float getSmokeLife() { return smokeLife_; }
getSmokeStartSize()66 	float getSmokeStartSize() { return smokeStartSize_; }
getSmokeEndSize()67 	float getSmokeEndSize() { return smokeEndSize_; }
getThrustAmount(ScorchedContext & context)68 	fixed getThrustAmount(ScorchedContext &context) { return thrustAmount_.getValue(context); }
getThrustTime(ScorchedContext & context)69 	fixed getThrustTime(ScorchedContext &context) { return thrustTime_.getValue(context); }
getDrag(ScorchedContext & context)70 	fixed getDrag(ScorchedContext &context) { return drag_.getValue(context); }
getWobbleSpin(ScorchedContext & context)71 	fixed getWobbleSpin(ScorchedContext &context) { return wobbleSpin_.getValue(context); }
getWobbleAmount(ScorchedContext & context)72 	fixed getWobbleAmount(ScorchedContext &context) { return wobbleAmount_.getValue(context); }
getFlameStartColor1()73 	Vector &getFlameStartColor1() { return flameStartColor1_; }
getFlameStartColor2()74 	Vector &getFlameStartColor2() { return flameStartColor2_; }
getFlameEndColor1()75 	Vector &getFlameEndColor1() { return flameEndColor1_; }
getFlameEndColor2()76 	Vector &getFlameEndColor2() { return flameEndColor2_; }
getEngineSound()77 	const char *getEngineSound() { return engineSound_.c_str(); }
getFlameTexture()78 	const char *getFlameTexture() { return flameTexture_.c_str(); }
getSmokeTexture()79 	const char *getSmokeTexture() { return smokeTexture_.c_str(); }
getAnimateFlameTexture()80 	bool getAnimateFlameTexture() { return animateFlameTexture_; }
getAnimateSmokeTexture()81 	bool getAnimateSmokeTexture() { return animateSmokeTexture_; }
getNoCameraTrack()82 	bool getNoCameraTrack() { return noCameraTrack_; }
getScale(ScorchedContext & context)83 	fixed getScale(ScorchedContext &context) { return scale_.getValue(context); }
getModelID()84 	ModelID &getModelID() { return modelId_; }
getLocalGroups()85 	ObjectGroupEntryDefinition &getLocalGroups() { return localGroups_; }
getGlobalGroups()86 	ObjectGroupEntryDefinition &getGlobalGroups() { return globalGroups_; }
87 
88 protected:
89 	bool under_;
90 	bool showShotPath_;
91 	bool showEndPoint_;
92 	bool apexCollision_;
93 	bool waterCollision_, wallCollision_;
94 	bool apexNoDud_, timedDud_;
95 	bool noCameraTrack_;
96 	NumberParser spinSpeed_;
97 	Vector spinAxis_;
98 
99 	bool createSmoke_, createFlame_;
100 	float flameLife_, smokeLife_;
101 	float flameStartSize_, flameEndSize_;
102 	float smokeStartSize_, smokeEndSize_;
103 	ObjectGroupEntryDefinition localGroups_, globalGroups_;
104 	NumberParser thrustTime_, thrustAmount_;
105 	NumberParser timedCollision_;
106 	NumberParser shieldHurtFactor_;
107 	NumberParser scale_;
108 	NumberParser windFactor_;
109 	NumberParser gravityFactor_;
110 	NumberParser drag_;
111 	NumberParser heightCollision_;
112 	NumberParser wobbleSpin_;
113 	NumberParser wobbleAmount_;
114 	fixed stepSize_;
115 	Vector flameStartColor1_, flameStartColor2_;
116 	Vector flameEndColor1_, flameEndColor2_;
117 	std::string engineSound_, flameTexture_, smokeTexture_;
118 	bool animateFlameTexture_, animateSmokeTexture_;
119 	Weapon *collisionAction_;
120 	ModelID modelId_;
121 	int flareType_;
122 
123 };
124 
125 #endif // !defined(AFX_WEAPONPROJECTILE_H__70119A64_2064_4066_8EE5_FD6A3E24D5FC__INCLUDED_)
126