Commit Graph
3365 Commits
Author SHA1 Message Date
Sevenfm f99f802e25 Removed AP_SUPPRESSION_SHOCK_DIVISOR option.
HandleSuppressionFire: improved code to calculate suppression shock, take into account 100AP / 25AP system.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8948 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-28 16:21:16 +00:00
Sevenfm 1abb292f8e New militia order: Move to (works in realtime only, switches militia soldier to DTATIONARY/DEFENSIVE).
Cancel current AI order when giving militia order.
Check if desired stance is possible here when ordering militia to crouch/prone.
Green AI: reworked climb code (only climb up, only at the start of the turn, disable for STATIONARY).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8947 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-26 12:14:11 +00:00
Sevenfm fe10587437 Show flash light when throwing flares.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8946 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-21 16:25:36 +00:00
Sevenfm 0e0d329b95 New option DEFEAT_MODE:
- 0: default, any lost battle is considered defeat
- 1: if enemy team was alerted
- 2: if at least one of retreating mercs is not covert
- 3: if at least one merc was killed in battle
- 4: if all mercs were killed in battle

MORALE_RAN_AWAY:
- apply penalty when retreating from sector only if enemy team was alerted
- improved check for mercs in sector
- no MORALE_HEARD_BATTLE_LOST penalty
- no reputation loss when retreating from battle

CheckForEndOfBattle:
- only apply morale and loyalty penalty if player was defeated
- only play death music if player is defeated
- log defeat only when player was defeated
- clear aware status for enemy team, clear enemy kill counter

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8945 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-21 13:18:04 +00:00
Sevenfm 02d19f3240 Update tree visibility after changing stance.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8944 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-20 17:38:38 +00:00
Sevenfm 6bb9759e75 LOBOT filters update (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8943 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-18 09:19:37 +00:00
Sevenfm f3d35c9401 Strip clothes: drop item to soldier's level if no place in inventory.
HandleTalkInit: 
- use SoldierToSoldierLineOfSightTest to check sight to person
- increased talking range for militia to TACTICAL_RANGE
When checking if radio set equipped for using with militia command feature, don't check for AP_RADIO as the game will deduct AP_TALK when giving order.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8942 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 20:31:44 +00:00
Sevenfm 417fa661c6 Smart tree top hiding: more optimization.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8941 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 15:36:02 +00:00
Sevenfm 27d681905d Smart tree top hiding: code optimization.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8940 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 15:24:00 +00:00
Sevenfm 4471b8ef97 Improved code to check if militia options are available.
Start radio animation when giving orders to militia.
FindClosestClimbPointAvailableToAI: don't check roaming range when searching climb spot for AI.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8939 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 15:01:57 +00:00
Sevenfm c72300d51f Fix crash when using LOBOT with certain sti size and offset (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8938 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 14:02:30 +00:00
Sevenfm 75f5f35ea0 Added 0.1s delay to hide tree top when moving cursor to prevent flickering when moving mouse over trees.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8937 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 06:22:39 +00:00
Sevenfm 7c1e9e3200 New ingame option: Smart tree tops.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8936 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-16 17:22:44 +00:00
Sevenfm 0ccecc472c Fix: UI attack handling prioritised interactive structures over target soldiers even if target soldier was explicitly provided causing deadlocks e.g. when trying to punch enemy overlapped by a door (by anv).
ReInitMergedItem: show item id, attachment id when doing assert.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8935 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-13 05:48:17 +00:00
Sevenfm 169e909b56 Minor code improvements.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8934 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-12 07:23:54 +00:00
Sevenfm f0693d4aad Black AI:
- fixed bug when AI soldier was ordered to move to his current spot when trying to get closer
- check if soldier can find cover before disabling the attack

Added more AI log info.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8933 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-12 07:15:03 +00:00
Sevenfm 39776dc569 Fix: guiBaseJA2Clock overflow (by MH17)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8932 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-12 05:31:14 +00:00
Sevenfm 18dcced82a Use TACTICAL_RANGE instead of DAY_VISION_RANGE for AI calculations.
Implemented Black cover advance code for AI: try to get closer to enemy using cover if soldier has low CTH or enemy too far for shooting or soldier has high morale or no cover at spot.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8931 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-11 19:11:54 +00:00
Sevenfm 02cba3e1e5 When changing stance from UI, first stop cowering.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8930 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-10 20:20:09 +00:00
Sevenfm a0a6396eaa Stop cowering when merc starts to move.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8929 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-10 19:17:44 +00:00
Sevenfm d66a05b0f4 NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT: apply only for player mercs, to avoid possible problems with AI.
CalcChanceHTH: only use reduced chance for boxers.
AIDoctorFriend, AIDoctorSelf: first change soldier to stationary.
AIDoctorFriend: change target to stationary.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8928 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-08 18:27:27 +00:00
Sevenfm 6ad8b22368 CalcChanceHTH: restored higher base chance for melee attacks.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8927 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-07 21:07:17 +00:00
Sevenfm 0abc2bf31f Features by rftr (http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=12557&goto=362288&#msg_362288)
New option BOBBY_RAY_TOOLTIPS_SHOW_LBE_DETAILS.
Stop Speck from spamming your email when multiple new mercs are available on the same day.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8926 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-01 08:25:59 +00:00
Sevenfm f8768a557d Minor code improvement for r8924.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8925 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-31 14:37:38 +00:00
Sevenfm bc3b398b63 Use MAXITEMS + 1 max limit when checking transformations.
UpdateAttachmentTooltips: 
- separate items, launchables and attachments checks as they have different max limits
- improved searching of existing item in vector

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-31 13:48:21 +00:00
Sevenfm 1256639fe5 AI_ACTION_STOP_MEDIC: also check START_AID, START_AID_PRN animations to prevent AI endless clock when first aid has just started and AI decides to move somewhere.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8923 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-30 23:22:59 +00:00
Sevenfm 2ff6826b8e Crash fix when using LOBOT: We never actually set the paletteTable->pForcedPalette, so it was doing some weird stuff when it got used. The flash white code sets the pSoldier's forced palette, so now it works as it should (by Asdow)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8922 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-26 20:54:59 +00:00
Sevenfm e39158569b Long jump:
- change to stationary stance before jumping (fixes problems with jumping from moving animation)
- switch to standing animation before jumping if soldier is prone (allows to correctly jump from prone stance)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8921 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-14 17:40:33 +00:00
Sevenfm 32e8f9d4ff EstimatePathCostToLocation: safety checks.
Main Red AI: fixed decision weight calculation.
Player mercs should avoid moving into gas/fire when in autobandage mode or under AI control.
IsLocationSittable, IsLocationSittableExcludingPeople: return FALSE if location on roof does not exist.
NWSS: play room effect for first shot only.
AI inventory choosing: more variety for mortar shells, improved hand/GL grenade choosing code.
Red AI: improved mortar use code: use next action to fire mortar after stepping back.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8920 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-14 15:45:11 +00:00
Sevenfm c6c0b09b70 Added basic requirements to start snitching (alive, conscious, not in transit etc).
When clicking on move equipment menu, check basic requirements.
If soldiers land into enemy sector from helicopter, use gsGridNoSweetSpot instead of default arrival location when ESC is pressed.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8919 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-14 15:17:56 +00:00
Sevenfm c32f5c76da VR r2698 fix: snitch assignments were not properly taking mercs out of vehicles (by anv)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8918 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-12-11 05:59:51 +00:00
Sevenfm 50f45bc2d9 Improved r8460 fix: also check for incorrect ammo item.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8917 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-12-06 13:17:42 +00:00
Sevenfm 87fc164f7a CalcMoraleNew (AI_NEW_MORALE option):
- more aggressive AI
- limit AI morale when soldier is under heavy fire

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8916 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-11-07 18:05:37 +00:00
Sevenfm bc7fe70fb7 CalcBestThrow: fixed bug ending throw search if one if the checked spots was too far for throw.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8915 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-11-01 16:44:37 +00:00
Sevenfm 191db0b2ac Fixed vs2010 compilation errors.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8914 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-11-01 05:01:11 +00:00
Sevenfm dd9c6b1f3e ArtilleryStrike: supply GetArtilleryLaunchParams with launcher item and not just mortar shell, as it will check it's range later.
Add smoke after explosion: improved code.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8913 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-30 17:55:11 +00:00
Sevenfm 1200ce8de3 Added new option BUCKSHOT_SUPPRESSION_EFFECTIVENESS, 50 by default, used both for NCTH and OCTH.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8912 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-29 13:21:57 +00:00
Sevenfm 80554bcde8 Hopefully improved AI code: don't try to resume movement after ActionDone was executed.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8911 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-26 17:37:44 +00:00
Sevenfm 3f2fd185e6 Improved EDB code: do not show PercentTargetTrackingSpeed and PercentDropCompensation when using OCTH.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8910 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-25 09:56:19 +00:00
Sevenfm e738e4424d Improved code to spawn item and it's attachments when disarming bomb.
Update sight after item transformation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8909 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-23 13:15:31 +00:00
Sevenfm 59f91fc065 SoldierAI: exclude civilians.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8908 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-21 18:12:58 +00:00
Sevenfm b174d2a8ba Improved AI RPG use:
- check for friendly fire chance when using rocket launcher
- only enemy team will try to use rocket launcher against single opponent in a room
- set min chance to hit 80% when deciding to use rocket launcher, except tanks or when shooting at tank
- changed min chance to hit to use launcher/RPG so that experienced soldiers prefer higher chance to hit

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8907 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-21 06:52:43 +00:00
Sevenfm 0d969503c5 PopupAttachmentInfo class: added missing initializations in constructor.
DragSelection class: added missing initialization in constructor.
MERCPROFILEGEAR class: added missing copy constructor.
WORLDITEM class: added missing copy constructor.
BuildString class: added missing assignment operator.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8906 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-21 06:28:15 +00:00
Sevenfm 2c2d8c9276 AI:
- improved civilian cower/run away code
- CancelAIAction: reset bNextAction and next action data
- clear next action data before making decisions
- militia always try to spare grenades unless under attack or using flares

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8905 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-20 21:20:26 +00:00
Sevenfm b45af3f575 FindNearestUngassedLand, FindNearbyDarkerSpot:
- optimization: don't check spots already checked in previous loop
- increase max distance to 35, reduce to 25 if complex AI not allowed, reduce to 15 in realtime
CanDragPerson: use world movement cost instead of LOS check.
Say TAUNT_RELOAD, TAUNT_OUT_OF_AMMO taunts if mag size > 4 or Chance (CHANCE_SAY_ANNOYING_PHRASE).
SpotDangerLevel: also check Water and CorpseWarning for danger level = 1.
ManSeesMan: only call SetNewSituation if location or level are different to reduce frequency of AI re-evaluation.
Only allow radio animation on initial red alert, if sector is not jammed.
Press ESC to stop dragging.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8904 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-17 06:30:23 +00:00
Sevenfm 43ab995ecd Only show "suppression fire" message if target soldier cannot be seen after turning.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8903 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-16 20:44:21 +00:00
Sevenfm b5cbc32261 EstimateStabDamage: updated code.
Black AI: 
- reduce stab attack attractiveness if target is not very close
- reduce stab attack attractiveness if soldier sees more than one opponent
- for HTH attacks, skills don't have effect on choosing attack type for boxers
- reduce HTH attack attractiveness if soldier sees more than one opponent
- allow to increase autofire bullets by reducing aim in NCTH if LIMIT_MAX_DEVIATION option is enabled

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8902 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-16 19:52:57 +00:00
Sevenfm 47c58e79d5 AI:
- new option AI_SAFE_SUPPRESSION adds additional checks for AI to avoid hitting friends when using suppression fire.
- chance to use suppression fire depends on actual chance to hit and SUPPRESSION_EFFECTIVENESS option
- reduced short burst to 2 bullets.
- improved code to use short burst

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8901 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-16 17:53:02 +00:00
silversurfer d867051cd6 fix: when multiple mercs are repairing, it could happen that one of them didn't spend any points, causing an error message about insufficient skill
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8900 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-16 07:52:46 +00:00
Wanne 8c74a30b35 Updated Chinese Text files (by TBS)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8898 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-01 09:42:09 +00:00