View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.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  		return "AmmoDescriptor[pickupType=" + getPickupType() + ", inventoryType = " + getInventoryType() + ", amount=" + getAmount() + "]";
57  	}
58  
59  	/**
60  	 * The class of this ammunition type.
61  	 * 
62  	 * @return priAmmoType
63  	 */
64  	public String getPriAmmoType() {
65  		return priAmmoType;
66  	}
67  
68  	/**
69  	 * Initial amount of ammunition. We get this if we pick up the item for the
70  	 * first time.
71  	 * 
72  	 * @return priInitialAmount
73  	 */
74  	public int getPriInitialAmount() {
75  		return priInitialAmount;
76  	}
77  
78  	/**
79  	 * Maximum amount of this ammunition we can hold in our inventory.
80  	 * 
81  	 * @return priMaxAmount
82  	 */
83  	public int getPriMaxAmount() {
84  		return priMaxAmount;
85  	}
86  
87  	/**
88  	 * Maximum firing range. 0 if not limited - probably.
89  	 * 
90  	 * @return priMaxRange
91  	 * @todo Find out how this works.
92  	 */
93  	public double getPriMaxRange() {
94  		return priMaxRange;
95  	}
96  
97  	/**
98  	 * Class of this ammunitions damage type. If ammo is not none, then this
99  	 * shouldn't be none either.
100 	 * 
101 	 * @return priDamageType
102 	 */
103 	public String getPriDamageType() {
104 		return priDamageType;
105 	}
106 
107 	/**
108 	 * If this damage can be stopped by an armor.
109 	 * 
110 	 * @return priArmorStops
111 	 */
112 	public boolean isPriArmorStops() {
113 		return priArmorStops;
114 	}
115 
116 	/**
117 	 * If this damage will kill us instantly.
118 	 * 
119 	 * @return priAlwaysGibs
120 	 */
121 	public boolean isPriAlwaysGibs() {
122 		return priAlwaysGibs;
123 	}
124 
125 	/**
126 	 * If this damage is special.
127 	 * 
128 	 * @return priSpecial
129 	 * @todo find out what it is.
130 	 */
131 	public boolean isPriSpecial() {
132 		return priSpecial;
133 	}
134 
135 	/**
136 	 * If this damage can detonate goop created by bio rifle (not sure).
137 	 * 
138 	 * @return priDetonatesGoop
139 	 * @todo Find out correct info.
140 	 */
141 	public boolean isPriDetonatesGoop() {
142 		return priDetonatesGoop;
143 	}
144 
145 	/**
146 	 * If this damage is caused by super weapon and will damage also team mates
147 	 * even if friendly fire is off.
148 	 * 
149 	 * @return priSuperWeapon
150 	 */
151 	public boolean isPriSuperWeapon() {
152 		return priSuperWeapon;
153 	}
154 
155 	/**
156 	 * If the hit by this damage will add some speed to the target (will "push"
157 	 * the target a bit).
158 	 * 
159 	 * @return priExtraMomZ
160 	 */
161 	public boolean isPriExtraMomZ() {
162 		return priExtraMomZ;
163 	}
164 
165 	/**
166 	 * Holds the class of the projectile spawn by this ammo type. If none, then
167 	 * the ammo does not spawn projectiles. all the info below is then not
168 	 * relevant and will have default values on.
169 	 * 
170 	 * @return priProjType
171 	 */
172 	public String getPriProjType() {
173 		return priProjType;
174 	}
175 
176 	/**
177 	 * Damage of the projectile.
178 	 * 
179 	 * @return priDamage
180 	 */
181 	public double getPriDamage() {
182 		return priDamage;
183 	}
184 
185 	/**
186 	 * Default speed of the projectile - probably the projectile has this speed
187 	 * when fired.
188 	 * 
189 	 * @return priSpeed
190 	 */
191 	public double getPriSpeed() {
192 		return priSpeed;
193 	}
194 
195 	/**
196 	 * Maximum possible speed of this projectile.
197 	 * 
198 	 * @return priMaxSpeed
199 	 */
200 	public double getPriMaxSpeed() {
201 		return priMaxSpeed;
202 	}
203 
204 	/**
205 	 * Life span of this projectile. How long the projectile lasts in the
206 	 * environment. If 0 than probably unlimited.
207 	 * 
208 	 * @return priLifeSpan
209 	 */
210 	public double getPriLifeSpan() {
211 		return priLifeSpan;
212 	}
213 
214 	/**
215 	 * If the projectile does splash damage, the value here won't be zero and
216 	 * will specify the radius of the splash damage in ut units.
217 	 * 
218 	 * @return priDamageRadius
219 	 */
220 	public double getPriDamageRadius() {
221 		return priDamageRadius;
222 	}
223 
224 	/**
225 	 * Probably the amount of speed added to Z velocity vector when this
226 	 * projectile is fired. In UT units.
227 	 * 
228 	 * @return priTossZ
229 	 * @todo Find out correct info.
230 	 */
231 	public double getPriTossZ() {
232 		return priTossZ;
233 	}
234 
235 	/**
236 	 * Maximum effective distance of the projectile. Probably 0 if not limited.
237 	 * 
238 	 * @return priMaxEffectDistance
239 	 * @todo Find out correct info.
240 	 */
241 	public double getPriMaxEffectDistance() {
242 		return priMaxEffectDistance;
243 	}
244 
245 }