Commit Graph
146 Commits
Author SHA1 Message Date
Sevenfm 4b646aad96 GetSightAdjustmentCamouflageOnTerrain: fix signed/unsigned calculation, limit effectiveness to +-100.
GetDetailedSightAdjustmentCamouflageOnTerrain: fix signed/unsigned calculation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9194 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-24 15:02:27 +00:00
Sevenfm 36d67602fd Added camouflage bonus to the survival trait (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9193 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-24 09:02:48 +00:00
Flugente 58379b84cd Minor code improvements
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9147 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-24 19:16:12 +00:00
Flugente e6ea95eb8b Whether a gun shoots fire or fire retardant is now set on the ammo with the <ammoflag>-tag, not the gun.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9144 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-15 18:22:53 +00:00
Flugente 6cad680b02 We can now use interactive actions to alter decals on walls, so it is possible to simulate taking off an object from the scenery and add it as an item.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=363513&#msg_363513

Requires GameDir >= r2601

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9141 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-13 19:50:49 +00:00
Flugente 3740d8b7c4 Anti-materiel bullets are no longer stopped when they apply damage to a structure, thus restoring piercing ability for them.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9114 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-27 15:32:02 +00:00
Flugente 89e2bd077a New feature: additional decals adds blood spatters and structural wear on walls
Requires GameDir >= r2595 to work

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9113 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-27 12:20:46 +00:00
Flugente a7d7f4b93b Fix: crash due to overflow as a result of very low reliability values
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9088 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-19 10:27:13 +00:00
Sevenfm 6d3dc29163 Fix for "bullets too high" sanity check in tilesets with non-zero floor height causing bullets to disappear when firing at roof from too steep degree. + fixed extra parameters inserted into debug messages (compiler warning) (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9013 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-09 03:24:02 +00:00
Sevenfm b6f15b2347 Add robots to enemy groups (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8956 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-03 03:32:40 +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 4344c2caf8 Suppression:
- disabled ubAdjacentSoldierCnt check as it doesn't work correctly
- improved adjacent tile check to avoid out of bounds values

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8891 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-20 04:24:44 +00:00
Sevenfm fa557a0dea New option AI_SHOOT_UNSEEN (disabled by default): allow AI to shoot at recently seen/heard enemies (targets that nobody from soldier's team sees currently).
CalcBestShot:
- improved hit rate calculation, take into account possible options INCREASE_AIMING_COSTS, FIRST_AIM_READY_COST_DIVISOR
- minor code improvements
New AI function LOS_Raised checks LOS with forced raised gun status, to get max view distance with scope

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8889 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-18 08:23:39 +00:00
Sevenfm 6b706f2747 Increased max possible soldiers stored for friendly fire check to 256.
Friendly fire chance code also checks for soldiers of the same side and optionally neutral civilians.
CalcCoverValue: check friendly fire chance for each position, penalize position if friendly fire chance is high (needs AI_BETTER_COVER = TRUE)

UnderFire::Add: 
- store friendly fire CTH for new added person
- use max value when replacing friendly fire CTH for existing person

CalcBestShot:
- check CTGT and friendly fire chance for every stance
- ignore possible shot if can hit friends in this stance

CalcMoraleNew: improved code to make enemy slightly more aggressive.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8873 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-31 10:26:07 +00:00
Flugente 8e4961f021 Fix: various compile warnings
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8872 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-24 19:27:34 +00:00
Flugente ce06c37827 Added safety check
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8840 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-04 18:52:34 +00:00
Sevenfm fac4927bc6 Bigmaps lockbusting fix: removed incorrect type cast (as suggested by Franimus).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8807 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-24 06:17:18 +00:00
Sevenfm 04a66f8b7c New experimental NCTH options: LIMIT_MAX_DEVIATION, LIMIT_GROUND_SHOTS.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8801 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-14 15:53:31 +00:00
Sevenfm 74443ca8a9 New option TAUNT_VOICE (FALSE by default): if true, will play sound file instead of showing text.
New option TAUNT_VOICE_SHOW_INFO (FALSE by default): if true, will show debug info when playing voice taunt.
Restored JA2TESTVERSION for SpreadPatternLog.txt
Allow taunts from militia when using voice taunts.
Don't show noise text messages from militia (if on our side).
Fixed incorrect OKLIFE check in CheckStatusNearbyFriendlies().

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8743 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-07 10:13:16 +00:00
Sevenfm 3efe899526 HandleItemPointerClick(): use correct target level.
CalcPreRecoilOffset(), CalcRecoilOffset(): fix counterforce calculation for weapon resting feature.
SOLDIERTYPE::GetAPBonus(): use THROUGH_STRATEGIC_MOVE instead of soldier's facing direction to determine sector type.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8719 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-12-22 05:57:52 +00:00
Sevenfm 0e8c086a9a NCTH: improved laser bonus code.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8716 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-12-05 08:48:26 +00:00
Sevenfm 30df6c350a CalcTargetMovementOffset: better integer calculation for max tiles penalty.
SOLDIERTYPE::initialize: initialize additional data.
EVENT_FireSoldierWeapon: if shooting soldier is invisible, locate screen to target spot.
CancelAIAction: reset next AI action.
FindBestPath: improved gas avoiding code.
InGas: improved code, also check the spot itself.
LegalNPCDestination: disabled additional checks to prevent AI deadlock.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8695 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-10-03 16:49:04 +00:00
silversurfer 037e877013 Fix (by Asdow): Enemy cover display performance improved.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8685 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-08-11 07:49:47 +00:00
Sevenfm d8ce2d312d ChanceToGetThrough: check that weapon exists, additionally initialize usAttackingWeapon, ubTargetID, bDoBurst and bDoAutofire which are used by FireBulletGivenTarget(), replace fake Glock17 with fake Minimi for better range
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8641 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-11-10 16:24:30 +00:00
Flugente 50d7b679c1 Added safety checks
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8626 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-30 19:40:55 +00:00
Flugente 79c41c3dbe Fix: throwing knives disappear when hitting corpses
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8596 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-08-18 14:12:54 +00:00
Flugente de22a5f9ab Print a warning if a riot shield is destroyed
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8437 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-01 17:35:34 +00:00
Flugente 11729a132e New feature: riot shields protect against damage from some directions.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23452&start=0&

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8434 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-07-29 21:18:13 +00:00
TheBob b60a94afc5 Added: Ctrl+Shift+E now fill LBE items in sector with other items and places them in vehicles first.
Added: Right-Click on remove attachments button on sector inventory screen will not empty LBE items in sector
Changed: SLAY_STAYS_FOREVER disables Slay's hourly chance to leave when unattended
Added: SLAY_HOURLY_CHANCE_TO_LEAVE setting to Ja2_Options.ini
Fixed: a bunch of array index out of bounds bugs
Fixed: a bunch of typos in if contitions
Fixed: BuildListFile() function loading items from index 1 instead 0
Added translation: Polish text for some map inventory screen items
Added translation: English texts for new functionality for other language files
Cleaned up some old TODOs

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8404 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-05-19 13:40:34 +00:00
Flugente d2a4d53a0a AmmoTypes.xml: tag <canGoThrough> replaced with <usPiercePersonChanceModifier> (unsigned integer). If value is > 0, a bullet can pierce a person after hitting. Higher values increase the chance to do so. Vehicles can now be pierced as well.
Requires GameDir >= r2360.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8378 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-01-27 22:35:31 +00:00
Wanne 835e948735 Fixed compilation errors in VS 2005: std::sqrt() -> sqrt()
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8291 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-22 19:24:14 +00:00
silversurfer 73e3e1172c Fix: gGameCTHConstants.BASE_CROUCHING_STANCE was missing from handling calculations in NCTH
- removed gGameExternalOptions.fUseNewCTHCalculation as it is not needed anymore
- cleaned up function CalcNewChanceToHitGun

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8281 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-06 10:44:42 +00:00
Flugente 2a7abe5b0d If ALLOW_TARGET_HEADANDLEG_IFPRONE is TRUE, head/torso/legs can be targetted on prone soldiers (until now, hits were always considered on torso).
Additionally soldiers are no longer protected from stray bullets in crouched and prone stance.

This option will be removed once this code change has been accepted (or deemed unacceptable).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8264 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-07-02 18:04:49 +00:00
Flugente 503523a9fa New feature: localized weather adds more weather types, different weather can happen in different sectors at the same time.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23094&#msg_345949

Requires GameDir >= r2325

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8253 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-18 20:57:03 +00:00
Flugente 88d60c8df1 Fix: corpses on a roof cannot be interacted with
Note that once a rooftop corpse has been decapitated, it cannot be accessed again, due to as of yet unclear structure handling.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8236 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-26 11:17:04 +00:00
Flugente d913cf5ad8 Fix: crash in autoresolve
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8149 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-04-10 15:39:41 +00:00
Flugente dba9e3eb88 AI update (by sevenfm):
- removed AI_EXTRA_FLANKING option
- LocationToLocationLineOfSightTest allows to check sight with specified height
- IsActionAffordable allows to specify action to check without faking it
- ClosestReachableDisturbance: correctly calculate path to each disturbance, added safety checks, update for noise checks
- CalcMoraleNew: update
- CalcBestShot: allow shooting at empty vehicles, but they have low priority
- allow AI to fire at dying opponents to avoid AI decision problems
- CheckIfShotPossible: allow any soldier with long range weapon to shoot in RED state (if he can hit)
- Flanking update
- WATCH decision update
- removed distance check for HELP decision to allow vanilla behavior, don't help if seen enemy recently or under fire
- suppression fire update
- pick up item decision: check that location is safe

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8125 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-26 13:41:54 +00:00
Flugente 285a7841c2 The flak jacket bonus now also applies to fragments.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8124 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-25 22:58:37 +00:00
Flugente 0ddb33576a - When a roof collapses, 'debris smoke' can briefly cloud the debris. Requires GameDir >= r2309.
- Improved roof collapsing for small roofs.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8121 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-25 11:30:18 +00:00
Flugente 9e97538d89 New feature: enemy combat jeeps fill the role between infantry and tanks. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=344628&#msg_344628
This is savegame compatible. GameDir >= r2305 required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8114 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-20 18:45:51 +00:00
Flugente b8c0036396 - Fix: When targetting a tank, mercs always aim for the 'head'. This results in misses if one changes the tank's JSD to a lower silhouette.
- Fix: crash during loading of a game, as a tanks animation required sounds which were missing due to vehicle list not yet bein initialised
- Fix: soldier's damaged by a blast always receive at least 1 damage, even if damage calculation results in 0
- If vehicles destroy a wall, this can now bring down a building's roof

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8112 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-17 21:45:10 +00:00
Flugente 330925b0ef When displaying a merc's maximum assignment points, factor in backgrounds values.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8050 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-02-05 22:18:05 +00:00
silversurfer dcf8b3abaf AI improvements (by Sevenfm):
Bugfixes:
- Fix: Watched Locations system (never worked in 1.13)
- Fix: LineOfSight test with NO_DISTANCE_LIMIT (stopped on trees previously)

AI/tactical improvements:
- EstimateThrowDamage additionally calculates damage from fragments (important for AI to use frag grenades with low main damage and many fragments)
- EstimateThrowDamage correctly adds IndoorModifier
- Additional checks for RED suppression (check that the soldier will not shoot his friends, check that he has extra clip to reload weapon, check that target is not cowering, don't suppress when flanking)
- ClosestReachableDisturbance will use general noise only if cannot find any enemy
- Allow RED seeking in prone stance if we haven't seen enemy for several turns

Flanking improvements:
- allow YELLOW flanking for CLOSEPATROL at night
- better YELLOW/RED flanking start/stop conditions
- better RED AI behavior when finished flanking (try to reach flanking spot)
- allow RED flanking for CLOSEPATROL soldiers when at night, overcrowded or no other flanking soldiers yet

Optional AI improvements:
AI_EXTRA_SUPPRESSION
- AI will use suppression fire more often in RED state (set minimum AI CTH to 1)

AI_NEW_MORALE
- Better dynamic morale calculation depending on tactical situation.
- Additional min/max limits for AI morale
- Disabled HOPELESS morale for soldiers without guns (they can pick up weapon or attack with hands sometimes)

AI_BETTER_COVER
- Additional checks for line of sight, fresh corpses and overcrowded locations

AI_EXTRA_FLANKING
- Allow flanking for BRAVEAID/BRAVESOLO

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8006 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-12-19 14:22:47 +00:00
Flugente 2470880bae Fix: absurd stat gains when hitting a target in NCTH
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7873 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-21 21:24:03 +00:00
Flugente a572703bf9 New ammo properties:
- <dDamageModifierLife> alters the life damage a bullet deals. Default 1.0, valied values from 0.0 to 100.0
- <dDamageModifierBreath> alters the breath damage a bullet deals. Default 1.0, valied values from 0.0 to 100.0

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7803 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-31 19:16:54 +00:00
silversurfer 181f6eba63 Fix (by Sevenfm):
- calculation error in sight adjustment for stealth at light level
- calculation error in sight adjustment for movement at light level

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7780 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-11 19:38:47 +00:00
silversurfer 1d1616707d fix: Mercs were always complaining that they can't hit a target with buckshot. Problem was that only one pellet was considered for the fake shot. Now all are calculated and the best result is returned.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7741 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-02-16 19:23:09 +00:00
Flugente 4f00ce2ffd Merged revision(s) 7659 from branches/ja2_source_official_2014:
Fix: memory corruption in CalcChanceToGetThrough() causes game crash


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7660 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-11-18 20:53:39 +00:00
Flugente b5ed7df390 DISEASE_CONTAMINATES_ITEMS controls wether contaminated food/blades/throwing knifes can infect people.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7649 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-11-05 22:01:14 +00:00
silversurfer 60bffb1352 Fix: Removed invalid item property "counterforcefrequencymodifier" and all code parts associated with it. It was not used anymore by the game but fragments of it were still displayed in EDB which lead to confusion.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7644 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-11-03 13:23:05 +00:00