Here's the .diff file.
But first, some reading :
Context notes :
- I started editing UFO AI source to test personnal gameplay ideas and tweaks a few things to my taste. So the modifications arent limited to a new Reaction Fire mode (see below).
- Im not familiar with the project structure and some modifications might be out of place.
- The modifications could break game balance (not sure if really sensible), and probably differs from UFO:AI creator's vision.
- The modifications most certainly arent compatible with multiplayer games (stuning does not apply to aliens, mobility for multiplayer weapons are not set, im pretty sure some network code is missing).
- I like well enclosed things. i will use { } for even the simplest "if", and over parenthesis maths things.
- Ive added "(yatta)" in most comments so if something breaks arrounds those comments, you know you can blame me.
- I used lots of "gi.BroadcastPrintf(PRINT_CONSOLE ..." for debugging, so you'll find quite a few, commented out.
- Novice coding errors or complexity is to be expected.
- No difference between the two RF modes.
WTF ?!
This might be your reaction in some situations, where soldiers start shooting altough you didnt give them the order.
What happens is the following : you have soldiers ON RF. One of them moves, trigerring an alien RF, but as the alien start aiming/shooting, one of your other soldier, who had the alien well spotted already, start shooting too. Follows a quick gun fight for the burst duration. Yes two burst can be fired at the same time.
What it does :
- Changed Reaction Fire behavior. RF now depends on character's mind (mainly) and speed. Other factors included : target's speed, position and activity, weapon mobility ...
- Point survey : When you right-click with the mouse to make your soldier face a direction, you now also register an "Aim Point" : if an enemy enters that point, your soldier has a bonus to trigger its reaction fire. Very good to guard doors & building corners.
- Changed burst fire system. Your soldier wont discharge the full burst at one point when RF shooting at a moving enemy, but rather will shoot while the enemy move.
- Added critical hits : depending on the type of weapons, you can inflict more damage, or do special effect sur has making fall (well, sit), lose weapon, stun (except aliens), panic, ...
- Stun on hard hits : your soldiers might faint when badly hit. Bad : you have one less active soldier on the field. Good : he can be healed at the hospital. A little chance to keep good soldiers alive, and makes accepting combat losses easier.
- Tried to tweak camera travels during shoots to gain time and lose sickness. Not so successful.
- Dazed (flashbang grenade) now makes the actor start with half the TU on next round
- Actors loses a few TU when hit.
Precise changes in the files :
weapons ufo files : added 'mobility' parameter
cl_actor : added message writing PA_POINT when orienting a soldier with mouse
e_time : barbaricly tried to reduce camera travels delay
e_event_actormove : ActorDoMove returns on actor death
e_event_actorstartshoot : changed cameraroute to reduce camera travels in ActorStartShoot
scripts : added the mobility parameter for weapon defs
g_actor : RF modes reserves no TU, dazed unit start round with half TU, barbaric return on ActorInvMove to handle (in case of weapon drop/destruction by RF), changed how TU are handled at some points, added func g_ActorUseTU needed for RF
g_client : when reseting time units, reset a param for RF, modified how TU are used, added message PA_POINT handling (for aiming point)
g_combat : added critical hits & effects (can be turned off by setting the COMBAT_CRITICAL_FACTOR to 0, critical effects table depending on weapons damage type, stun chance on hard hits (for humans only to avoid easy capture of live alien), TU loss on hit, modified ShootSingle to add inaccuracy on RF, removed obsolete RF functions, modified ClientShoot to handle new RF and new management of bursts
g_local : added / removed stuff for new RF
g_main : remove of prototype of obsolete RF functions
g_match : made uncouncious-yet-alive soldiers have low health after a mission (so they HAVE to be healed before next mission
g_move : added a default AimAt point when moving soldiers, flag IsMoving for ents to manage RF accuracy
g_reaction : well ... mostly rewritten / changed
g_round : removed a call to an obsolete RF function
game_h : added an array to manage awareness of actors
inv_shared : added 'mobility' parameter
q_shared : added 'PA_POINT' message for AimAts