View Javadoc

1   package cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor;
2   
3   /**
4    * Ammo desciptor describes the characteristics of an ammunition.
5    * 
6    * @author Ondrej, knight
7    */
8   public class AmmoDescriptor extends ItemDescriptor {
9   
10  	// This ammunition attributes
11  	@ItemDescriptorField
12  	private String priAmmoType;
13  	@ItemDescriptorField
14  	private int priInitialAmount = 0;
15  	@ItemDescriptorField
16  	private int priMaxAmount = 0;
17  	@ItemDescriptorField
18  	private double priMaxRange = 0;
19  
20  	// This ammo damage type
21  	@ItemDescriptorField
22  	private String priDamageType;
23  	@ItemDescriptorField
24  	private boolean priArmorStops = true;
25  	@ItemDescriptorField
26  	private boolean priAlwaysGibs = false;
27  	@ItemDescriptorField
28  	private boolean priSpecial = false;
29  	@ItemDescriptorField
30  	private boolean priDetonatesGoop = false;
31  	@ItemDescriptorField
32  	private boolean priSuperWeapon = false;
33  	@ItemDescriptorField
34  	private boolean priExtraMomZ = false;
35  
36  	// This ammo projectile
37  	@ItemDescriptorField
38  	private String priProjType;
39  	@ItemDescriptorField
40  	private double priDamage = 0;
41  	@ItemDescriptorField
42  	private double priSpeed = 0;
43  	@ItemDescriptorField
44  	private double priMaxSpeed = 0;
45  	@ItemDescriptorField
46  	private double priLifeSpan = 0;
47  	@ItemDescriptorField
48  	private double priDamageRadius = 0;
49  	@ItemDescriptorField
50  	private double priTossZ = 0;
51  	@ItemDescriptorField
52  	private double priMaxEffectDistance = 0;
53  
54  	@Override
55  	public String toString() {
56  		// TODO Auto-generated method stub
57  		return null;
58  	}
59  
60  	/**
61  	 * The class of this ammunition type.
62  	 * 
63  	 * @return priAmmoType
64  	 */
65  	public String getPriAmmoType() {
66  		return priAmmoType;
67  	}
68  
69  	/**
70  	 * Initial amount of ammunition. We get this if we pick up the item for the
71  	 * first time.
72  	 * 
73  	 * @return priInitialAmount
74  	 */
75  	public int getPriInitialAmount() {
76  		return priInitialAmount;
77  	}
78  
79  	/**
80  	 * Maximum amount of this ammunition we can hold in our inventory.
81  	 * 
82  	 * @return priMaxAmount
83  	 */
84  	public int getPriMaxAmount() {
85  		return priMaxAmount;
86  	}
87  
88  	/**
89  	 * Maximum firing range. 0 if not limited - probably.
90  	 * 
91  	 * @return priMaxRange
92  	 * @todo Find out how this works.
93  	 */
94  	public double getPriMaxRange() {
95  		return priMaxRange;
96  	}
97  
98  	/**
99  	 * Class of this ammunitions damage type. If ammo is not none, then this
100 	 * shouldn't be none either.
101 	 * 
102 	 * @return priDamageType
103 	 */
104 	public String getPriDamageType() {
105 		return priDamageType;
106 	}
107 
108 	/**
109 	 * If this damage can be stopped by an armor.
110 	 * 
111 	 * @return priArmorStops
112 	 */
113 	public boolean isPriArmorStops() {
114 		return priArmorStops;
115 	}
116 
117 	/**
118 	 * If this damage will kill us instantly.
119 	 * 
120 	 * @return priAlwaysGibs
121 	 */
122 	public boolean isPriAlwaysGibs() {
123 		return priAlwaysGibs;
124 	}
125 
126 	/**
127 	 * If this damage is special.
128 	 * 
129 	 * @return priSpecial
130 	 * @todo find out what it is.
131 	 */
132 	public boolean isPriSpecial() {
133 		return priSpecial;
134 	}
135 
136 	/**
137 	 * If this damage can detonate goop created by bio rifle (not sure).
138 	 * 
139 	 * @return priDetonatesGoop
140 	 * @todo Find out correct info.
141 	 */
142 	public boolean isPriDetonatesGoop() {
143 		return priDetonatesGoop;
144 	}
145 
146 	/**
147 	 * If this damage is caused by super weapon and will damage also team mates
148 	 * even if friendly fire is off.
149 	 * 
150 	 * @return priSuperWeapon
151 	 */
152 	public boolean isPriSuperWeapon() {
153 		return priSuperWeapon;
154 	}
155 
156 	/**
157 	 * If the hit by this damage will add some speed to the target (will "push"
158 	 * the target a bit).
159 	 * 
160 	 * @return priExtraMomZ
161 	 */
162 	public boolean isPriExtraMomZ() {
163 		return priExtraMomZ;
164 	}
165 
166 	/**
167 	 * Holds the class of the projectile spawn by this ammo type. If none, then
168 	 * the ammo does not spawn projectiles. all the info below is then not
169 	 * relevant and will have default values on.
170 	 * 
171 	 * @return priProjType
172 	 */
173 	public String getPriProjType() {
174 		return priProjType;
175 	}
176 
177 	/**
178 	 * Damage of the projectile.
179 	 * 
180 	 * @return priDamage
181 	 */
182 	public double getPriDamage() {
183 		return priDamage;
184 	}
185 
186 	/**
187 	 * Default speed of the projectile - probably the projectile has this speed
188 	 * when fired.
189 	 * 
190 	 * @return priSpeed
191 	 */
192 	public double getPriSpeed() {
193 		return priSpeed;
194 	}
195 
196 	/**
197 	 * Maximum possible speed of this projectile.
198 	 * 
199 	 * @return priMaxSpeed
200 	 */
201 	public double getPriMaxSpeed() {
202 		return priMaxSpeed;
203 	}
204 
205 	/**
206 	 * Life span of this projectile. How long the projectile lasts in the
207 	 * environment. If 0 than probably unlimited.
208 	 * 
209 	 * @return priLifeSpan
210 	 */
211 	public double getPriLifeSpan() {
212 		return priLifeSpan;
213 	}
214 
215 	/**
216 	 * If the projectile does splash damage, the value here won't be zero and
217 	 * will specify the radius of the splash damage in ut units.
218 	 * 
219 	 * @return priDamageRadius
220 	 */
221 	public double getPriDamageRadius() {
222 		return priDamageRadius;
223 	}
224 
225 	/**
226 	 * Probably the amount of speed added to Z velocity vector when this
227 	 * projectile is fired. In UT units.
228 	 * 
229 	 * @return priTossZ
230 	 * @todo Find out correct info.
231 	 */
232 	public double getPriTossZ() {
233 		return priTossZ;
234 	}
235 
236 	/**
237 	 * Maximum effective distance of the projectile. Probably 0 if not limited.
238 	 * 
239 	 * @return priMaxEffectDistance
240 	 * @todo Find out correct info.
241 	 */
242 	public double getPriMaxEffectDistance() {
243 		return priMaxEffectDistance;
244 	}
245 
246 }