1 #ifndef __POINTS_H_
2 #define __POINTS_H_
3 
4 #include "Item_Types.h"
5 
6 
7 #define AP_MINIMUM			10 // no merc can have less for his turn
8 #define AP_MAXIMUM			25 // no merc can have more for his turn
9 #define AP_MONSTER_MAXIMUM		40 // no monster can have more for his turn
10 #define AP_VEHICLE_MAXIMUM		50 // no merc can have more for his turn
11 #define AP_INCREASE			10 // optional across-the-board AP boost
12 #define MAX_AP_CARRIED			5 // APs carried from turn-to-turn
13 
14 // monster AP bonuses, expressed in 10ths (12 = 120% normal)
15 #define AP_YOUNG_MONST_FACTOR		15
16 #define AP_ADULT_MONST_FACTOR		12
17 #define AP_MONST_FRENZY_FACTOR		13
18 
19 // AP penalty for a phobia situation (again, in 10ths)
20 #define AP_CLAUSTROPHOBE		9
21 #define AP_AFRAID_OF_INSECTS		8
22 
23 #define AP_EXCHANGE_PLACES		5
24 
25 // Action Point values
26 #define AP_REVERSE_MODIFIER		1
27 #define AP_STEALTH_MODIFIER		2
28 
29 #define AP_STEAL_ITEM			10 // APs to steal item....
30 
31 #define AP_TAKE_BLOOD			10
32 
33 #define AP_TALK			6
34 
35 #define AP_MOVEMENT_FLAT		3 // div by 2 for run, +2, for crawl, -1 for swat
36 #define AP_MOVEMENT_GRASS		4
37 #define AP_MOVEMENT_BUSH		5
38 #define AP_MOVEMENT_RUBBLE		6
39 #define AP_MOVEMENT_SHORE		7 // shallow wade
40 
41 #define AP_MOVEMENT_LAKE		9 // deep wade -> slowest
42 #define AP_MOVEMENT_OCEAN		8 // swimming is faster than deep wade
43 
44 #define AP_CHANGE_FACING		1 // turning to face any other direction
45 #define AP_CHANGE_TARGET		1 // aiming at a new target
46 
47 #define AP_CATCH_ITEM			5 // turn to catch item
48 #define AP_TOSS_ITEM			8 // toss item from inv
49 
50 #define AP_REFUEL_VEHICLE		10
51 /*
52 #define AP_MOVE_ITEM_FREE		0 // same place, pocket->pocket
53 #define AP_MOVE_ITEM_FAST		2 // hand, holster, ground only
54 #define AP_MOVE_ITEM_AVG		4 // everything else!
55 #define AP_MOVE_ITEM_SLOW		6 // vests, protective gear
56 */
57 #define AP_MOVE_ITEM_FAST		4 // hand, holster, ground only
58 #define AP_MOVE_ITEM_SLOW		6 // vests, protective gear
59 
60 #define AP_RADIO			5
61 #define AP_CROUCH			2
62 #define AP_PRONE			2
63 
64 #define AP_LOOK_STANDING		1
65 #define AP_LOOK_CROUCHED		2
66 #define AP_LOOK_PRONE			2
67 
68 #define AP_READY_KNIFE			0
69 #define AP_READY_PISTOL		1
70 #define AP_READY_RIFLE			2
71 #define AP_READY_SAW			0
72 // JA2Gold: reduced dual AP cost from 3 to 1
73 //#define AP_READY_DUAL		3
74 #define AP_READY_DUAL			1
75 
76 
77 #define AP_MIN_AIM_ATTACK		0 // minimum permitted extra aiming
78 #define AP_MAX_AIM_ATTACK		4 // maximum permitted extra aiming
79 
80 #define AP_BURST			5
81 
82 #define AP_DROP_BOMB			3
83 
84 #define AP_RELOAD_GUN			5 // loading new clip/magazine
85 
86 #define AP_START_FIRST_AID		5 // get the stuff out of medic kit
87 #define AP_PER_HP_FIRST_AID		1 // for each point healed
88 #define AP_STOP_FIRST_AID		3 // put everything away again
89 
90 #define AP_START_REPAIR		5 // get the stuff out of repair kit
91 
92 #define AP_GET_HIT			2 // struck by bullet, knife, explosion
93 #define AP_GET_WOUNDED_DIVISOR		4 // 1 AP lost for every 'divisor' dmg
94 #define AP_FALL_DOWN			4 // falling down (explosion, exhaustion)
95 #define AP_GET_THROWN			2 // get thrown back (by explosion)
96 
97 #define AP_GET_UP			5 // getting up again
98 #define AP_ROLL_OVER			2 // flipping from back to stomach
99 
100 #define AP_OPEN_DOOR			3 // whether successful, or not (locked)
101 #define AP_PICKLOCK			10 // should really be several turns
102 #define AP_EXAMINE_DOOR		5 // time to examine door
103 #define AP_BOOT_DOOR			8 // time to boot door
104 #define AP_USE_CROWBAR			10 // time to crowbar door
105 #define AP_UNLOCK_DOOR			6 // time to unlock door
106 #define AP_LOCK_DOOR			6 // time to lock door
107 #define AP_EXPLODE_DOOR		10 // time to set explode charge on door
108 #define AP_UNTRAP_DOOR			10 // time to untrap door
109 
110 #define AP_USEWIRECUTTERS		10 // Time to use wirecutters
111 
112 #define AP_CLIMBROOF			10 // APs to climb roof
113 #define AP_CLIMBOFFROOF		6 // APs to climb off roof
114 #define AP_JUMPFENCE			6 // time to jump over a fence
115 
116 
117 #define AP_OPEN_SAFE			8 // time to use combination
118 
119 
120 #define AP_USE_REMOTE			2
121 #define AP_PULL_TRIGGER		2 // operate nearby panic trigger
122 
123 #define AP_FORCE_LID_OPEN		10
124 #define AP_SEARCH_CONTAINER		5 // boxes, crates, safe, etc.
125 
126 #define AP_READ_NOTE			10 // reading a note's contents in inv.
127 
128 #define AP_SNAKE_BATTLE		10 // when first attacked
129 #define AP_KILL_SNAKE			7 // when snake battle's been won
130 
131 #define AP_USE_SURV_CAM		5
132 
133 #define AP_PICKUP_ITEM			3
134 #define AP_GIVE_ITEM			1
135 
136 #define AP_BURY_MINE			10
137 #define AP_DISARM_MINE			10
138 
139 #define AP_DRINK			5
140 #define AP_CAMOFLAGE			10
141 
142 #define AP_TAKE_PHOTOGRAPH		5
143 #define AP_MERGE			8
144 
145 #define AP_OTHER_COST			99
146 
147 #define AP_START_RUN_COST		1
148 
149 #define AP_ATTACH_CAN			5
150 
151 #define AP_JUMP_OVER			6
152 
153 // special Breath Point related constants
154 
155 #define BP_RATIO_RED_PTS_TO_NORMAL	100
156 
157 #define BP_RUN_ENERGYCOSTFACTOR	3 // Richard thinks running is 3rd most strenous over time... tough, Mark didn't. CJC increased it again
158 #define BP_WALK_ENERGYCOSTFACTOR	1 // walking subtracts flat terrain breath value
159 #define BP_SWAT_ENERGYCOSTFACTOR	2 // Richard thinks swatmove is 2nd most strenous over time... tough, Mark didn't
160 #define BP_CRAWL_ENERGYCOSTFACTOR	4 // Richard thinks crawling is the MOST strenuous over time
161 
162 #define BP_RADIO			0 // no breath cost
163 #define BP_USE_DETONATOR		0 // no breath cost
164 
165 #define BP_REVERSE_MODIFIER		0 // no change, a bit more challenging
166 #define BP_STEALTH_MODIFIER		-20 // slow & cautious, not too strenuous
167 #define BP_MINING_MODIFIER		-30 // pretty relaxing, overall
168 
169 
170 // end-of-turn Breath Point gain/usage rates
171 #define BP_PER_AP_NO_EFFORT		-200 // gain breath!
172 #define BP_PER_AP_MIN_EFFORT		-100 // gain breath!
173 #define BP_PER_AP_LT_EFFORT		-50 // gain breath!
174 #define BP_PER_AP_MOD_EFFORT		25
175 #define BP_PER_AP_HVY_EFFORT		50
176 #define BP_PER_AP_MAX_EFFORT		100
177 
178 
179 // Breath Point values
180 #define BP_MOVEMENT_FLAT		5
181 #define BP_MOVEMENT_GRASS		10
182 #define BP_MOVEMENT_BUSH		20
183 #define BP_MOVEMENT_RUBBLE		35
184 #define BP_MOVEMENT_SHORE		50 // shallow wade
185 #define BP_MOVEMENT_LAKE		75 // deep wade
186 #define BP_MOVEMENT_OCEAN		100 // swimming
187 
188 #define BP_CHANGE_FACING		10 // turning to face another direction
189 
190 #define BP_CROUCH			10
191 #define BP_PRONE			10
192 
193 #define BP_CLIMBROOF			500 // BPs to climb roof
194 #define BP_CLIMBOFFROOF		250 // BPs to climb off roof
195 #define BP_JUMPFENCE			200 // BPs to jump fence
196 
197 
198 /*
199 #define BP_MOVE_ITEM_FREE		0 // same place, pocket->pocket
200 #define BP_MOVE_ITEM_FAST		0 // hand, holster, ground only
201 #define BP_MOVE_ITEM_AVG		0 // everything else!
202 #define BP_MOVE_ITEM_SLOW		20 // vests, protective gear
203 */
204 #define BP_MOVE_ITEM_FAST		0 // hand, holster, ground only
205 #define BP_MOVE_ITEM_SLOW		20 // vests, protective gear
206 
207 #define BP_READY_KNIFE			0 // raise/lower knife
208 #define BP_READY_PISTOL		10 // raise/lower pistol
209 #define BP_READY_RIFLE			20 // raise/lower rifle
210 #define BP_READY_SAW			0 // raise/lower saw
211 
212 #define BP_STEAL_ITEM			50 // BPs steal item
213 
214 #define BP_PER_AP_AIMING		5 // breath cost while aiming
215 #define BP_RELOAD_GUN			20 // loading new clip/magazine
216 
217 #define BP_THROW_ITEM			50 // throw grenades, fire-bombs, etc.
218 
219 #define BP_START_FIRST_AID		0 // get the stuff out of medic kit
220 #define BP_PER_HP_FIRST_AID		-25 // gain breath for each point healed
221 #define BP_STOP_FIRST_AID		0 // put everything away again
222 
223 #define BP_GET_HIT			200 // struck by bullet, knife, explosion
224 #define BP_GET_WOUNDED			50 // per pt of GUNFIRE/EXPLOSION impact
225 #define BP_FALL_DOWN			250 // falling down (explosion, exhaustion)
226 #define BP_GET_UP			50 // getting up again
227 #define BP_ROLL_OVER			20 // flipping from back to stomach
228 
229 #define BP_OPEN_DOOR			30 // whether successful, or not (locked)
230 #define BP_PICKLOCK			-250 // gain breath, not very tiring...
231 #define BP_EXAMINE_DOOR		-250 // gain breath, not very tiring...
232 #define BP_BOOT_DOOR			200 // BP to boot door
233 #define BP_USE_CROWBAR			350 // BP to crowbar door
234 #define BP_UNLOCK_DOOR			50 // BP to unlock door
235 #define BP_EXPLODE_DOOR		-250 // BP to set explode charge on door
236 #define BP_UNTRAP_DOOR			150 // BP to untrap
237 #define BP_LOCK_DOOR			50 // BP to untrap
238 
239 #define BP_USEWIRECUTTERS		200 // BP to use wirecutters
240 
241 
242 #define BP_PULL_TRIGGER		0 // for operating panic triggers
243 
244 #define BP_FORCE_LID_OPEN		50 // per point of strength required
245 #define BP_SEARCH_CONTAINER		0 // get some breath back (was -50)
246 
247 #define BP_OPEN_SAFE			-50
248 #define BP_READ_NOTE			-250 // reading a note's contents in inv.
249 
250 #define BP_SNAKE_BATTLE		500 // when first attacked
251 #define BP_KILL_SNAKE			350 // when snake battle's been won
252 
253 #define BP_USE_SURV_CAM		-100
254 
255 #define BP_BURY_MINE			250 // involves digging & filling again
256 #define BP_DISARM_MINE			0 // 1/2 digging, 1/2 light effort
257 
258 #define BP_FIRE_HANDGUN		25 // preatty easy, little recoil
259 #define BP_FIRE_RIFLE			50 // heavier, nasty recoil
260 #define BP_FIRE_SHOTGUN		100 // quite tiring, must be pumped up
261 
262 #define BP_STAB_KNIFE			200
263 
264 #define BP_TAKE_PHOTOGRAPH		0
265 #define BP_MERGE			50
266 
267 #define BP_FALLFROMROOF		1000
268 
269 #define BP_JUMP_OVER			250
270 
271 
272 
273 #define DEFAULT_APS			20
274 #define DEFAULT_AIMSKILL		80
275 
276 UINT8 BaseAPsToShootOrStab(INT8 bAPs, INT8 bAimSkill, OBJECTTYPE const&);
277 
278 INT16 TerrainActionPoints(const SOLDIERTYPE* s, INT16 sGridno, INT8 bDir, INT8 bLevel);
279 INT16 ActionPointCost(const SOLDIERTYPE* s, INT16 sGridNo, INT8 bDir, UINT16 usMovementMode);
280 INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bDir, UINT16 usMovementMode, INT8 bPathIndex, INT8 bPathLength );
281 
282 BOOLEAN EnoughPoints(const SOLDIERTYPE* pSoldier, INT16 sAPCost, INT16 sBPCost, BOOLEAN fDisplayMsg);
283 void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT16 sBPCost );
284 void UnusedAPsToBreath(SOLDIERTYPE *pSold);
285 INT16 TerrainBreathPoints(SOLDIERTYPE * pSoldier, INT16 sGridno,INT8 bDir, UINT16 usMovementMode);
286 UINT8 MinAPsToAttack(SOLDIERTYPE*, GridNo, UINT8 add_turning_cost);
287 INT8  MinPtsToMove(const SOLDIERTYPE* pSoldier);
288 INT8 MinAPsToStartMovement(const SOLDIERTYPE* pSoldier, UINT16 usMovementMode);
289 INT8 PtsToMoveDirection(const SOLDIERTYPE* pSoldier, UINT8 bDirection);
290 UINT8 MinAPsToShootOrStab(SOLDIERTYPE&, GridNo, bool add_turning_cost);
291 BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos );
292 void DeductAmmo( SOLDIERTYPE *pSoldier, INT8 bInvPos );
293 
294 
295 UINT16 GetAPsToPickupItem( SOLDIERTYPE *pSoldier, UINT16 usMapPos );
296 UINT8 CalcTotalAPsToAttack( SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost, INT8 bAimTime );
297 UINT8 CalcAPsToBurst(INT8 bBaseActionPoints, OBJECTTYPE const&);
298 UINT16 GetAPsToChangeStance(const SOLDIERTYPE* pSoldier, INT8 bDesiredHeight);
299 
300 UINT16 GetAPsToLook(const SOLDIERTYPE* pSoldier);
301 UINT16 GetAPsToGiveItem( SOLDIERTYPE *pSoldier, UINT16 usMapPos );
302 
303 BOOLEAN CheckForMercContMove( SOLDIERTYPE *pSoldier );
304 
305 INT16 GetAPsToReadyWeapon(const SOLDIERTYPE* pSoldier, UINT16 usAnimState);
306 
307 INT8 GetAPsToClimbRoof( SOLDIERTYPE *pSoldier, BOOLEAN fClimbDown );
308 
309 INT8 GetAPsToJumpFence( const SOLDIERTYPE *pSoldier );
310 
311 INT8 GetAPsToCutFence( SOLDIERTYPE *pSoldier );
312 INT8 GetAPsToBeginFirstAid( SOLDIERTYPE *pSoldier );
313 INT8 GetAPsToBeginRepair( SOLDIERTYPE *pSoldier );
314 INT8 GetAPsToRefuelVehicle( SOLDIERTYPE *pSoldier );
315 
316 INT16 MinAPsToThrow(SOLDIERTYPE const&, GridNo, bool add_turning_cost);
317 
318 UINT16 GetAPsToDropBomb( SOLDIERTYPE *pSoldier );
319 UINT16 GetTotalAPsToDropBomb( SOLDIERTYPE *pSoldier, INT16 sGridNo );
320 UINT16 GetAPsToUseRemote( SOLDIERTYPE *pSoldier );
321 
322 INT8 GetAPsToStealItem( SOLDIERTYPE *pSoldier, INT16 usMapPos );
323 
324 INT8 GetAPsToUseJar( SOLDIERTYPE *pSoldier, INT16 usMapPos );
325 INT8 GetBPsTouseJar( SOLDIERTYPE *pSoldier );
326 
327 INT8 GetAPsToJumpOver(const SOLDIERTYPE* pSoldier);
328 
329 void GetAPChargeForShootOrStabWRTGunRaises(SOLDIERTYPE const*, GridNo, UINT8 ubAddTurningCost, BOOLEAN* charge_turning, BOOLEAN* charge_raise);
330 
331 UINT16 GetAPsToReloadRobot(SOLDIERTYPE* pSoldier, const SOLDIERTYPE* pRobot);
332 INT8 GetAPsToReloadGunWithAmmo( OBJECTTYPE * pGun, OBJECTTYPE * pAmmo );
333 INT8 GetAPsToAutoReload( SOLDIERTYPE * pSoldier );
334 
335 
336 #endif
337