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(__INCLUDE_NapalmParamsh_INCLUDE__)
22 #define __INCLUDE_NapalmParamsh_INCLUDE__
23 
24 #include <string>
25 #include <common/fixed.h>
26 
27 struct lua_State;
28 class XMLNode;
29 class NapalmParams
30 {
31 public:
32 	NapalmParams();
33 	~NapalmParams();
34 
35 	bool parseXML(XMLNode *accessoryNode);
36 	void parseLUA(lua_State *L, int position);
37 
setNapalmTime(fixed value)38 	void setNapalmTime(fixed value) { napalmTime_ = value; }
setNapalmHeight(fixed value)39 	void setNapalmHeight(fixed value) { napalmHeight_ = value; }
setStepTime(fixed value)40 	void setStepTime(fixed value) { stepTime_ = value; }
setHurtStepTime(fixed value)41 	void setHurtStepTime(fixed value) { hurtStepTime_ = value; }
setHurtPerSecond(fixed value)42 	void setHurtPerSecond(fixed value) { hurtPerSecond_ = value; }
setLandscapeErosion(fixed value)43 	void setLandscapeErosion(fixed value) { landscapeErosion_ = value; }
44 
getNapalmTime()45 	fixed getNapalmTime() { return napalmTime_; }
getNapalmHeight()46 	fixed getNapalmHeight() { return napalmHeight_; }
getStepTime()47 	fixed getStepTime() { return stepTime_; }
getHurtStepTime()48 	fixed getHurtStepTime() { return hurtStepTime_; }
getHurtPerSecond()49 	fixed getHurtPerSecond() { return hurtPerSecond_; }
getGroundScorchPer()50 	fixed getGroundScorchPer() { return groundScorchPer_; }
getLandscapeErosion()51 	fixed getLandscapeErosion() { return landscapeErosion_; }
getEffectRadius()52 	int getEffectRadius() { return effectRadius_; }
getNumberParticles()53 	int getNumberParticles() { return numberParticles_; }
getNoSmoke()54 	bool getNoSmoke() { return noSmoke_; }
getNoObjectDamage()55 	bool getNoObjectDamage() { return noObjectDamage_; }
getAllowUnderWater()56 	bool getAllowUnderWater() { return allowUnderWater_; }
getLuminance()57 	bool getLuminance() { return luminance_; }
getSingleFlow()58 	bool getSingleFlow() { return singleFlow_; }
getNoCameraTrack()59 	bool getNoCameraTrack() { return noCameraTrack_; }
getNapalmTexture()60 	const char *getNapalmTexture() { return napalmTexture_.c_str(); }
getDeformTexture()61 	const char *getDeformTexture() { return deformTexture_.c_str(); }
62 
63 protected:
64 	fixed napalmTime_;   // The time to generate napalm
65 	fixed napalmHeight_; // The height of a napalm point
66 	fixed stepTime_;     // Add/rm napalm every StepTime secs
67 	fixed hurtStepTime_; // Calculate damage every HurtStepTime secs
68 	fixed hurtPerSecond_;// Damage per second
69 	fixed groundScorchPer_; // The percentage chance the ground will be scorched
70 	fixed landscapeErosion_; // How much height will be removed for the erosion
71 	int effectRadius_;   // How close do tanks take damage
72 	int numberParticles_;// How many napalm particles can be created
73 	bool noSmoke_;       // Turns off smoke emitted by napalm
74 	bool noObjectDamage_;// Turns off burning damage to landscape objects
75 	bool allowUnderWater_;// Turns on/off napalm working under water
76 	bool singleFlow_;    // Use a single flow of napalm or cover the whole downward area
77 	bool luminance_;     // The texutre luminance
78 	bool noCameraTrack_;
79 	std::string napalmTexture_;
80 	std::string deformTexture_;
81 
82 };
83 
84 #endif
85