Commit Graph
154 Commits
Author SHA1 Message Date
Marco Antonio Jaguaribe CostaandAsdow 8b1c4effa0 nuke all the #if 0's
scripted commit:

find . -not -path '*/.*' -and -not -path '*/ext*' -type d -exec coan source -R -E {} ';'

https://coan2.sourceforge.net/coan_man_1.html
2023-01-19 00:13:08 +02:00
majcostaandGitHub 24425a82b1 More unused stuff removal (#49)
* More unused stuff removal

delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers

* remove mentions from vc proj files too

* remove preprocessor conditionals for unused definitions

find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'

then manually fixed a couple files the tool errored out on

* yes, the comments too

as title
2023-01-03 15:51:48 +02:00
Sevenfm 2874a0cb92 Damage lock with bullets:
- lockBustingPower works as percentage bonus to damage based on bullet impact
- only damage lock if opening possible
- allow damaging lock if ubSmashDifficulty <= lockBustingPower + bullet impact

AttemptToBlowUpLock: make noise when using shaped charge.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9384 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-05-11 15:23:23 +00:00
Sevenfm a658b5121f SIDE_FACING_DIVISOR: allow this option to work for crouched target, but with lowered divisor.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9377 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-05-04 16:46:35 +00:00
Sevenfm 5a498bc0ba SIDE_FACING_DIVISOR option tweaks:
- only for standing targets
- only for human bodytypes
- only when aiming at torso/legs
- added safety checks
- disabled divisor for vertical deviation

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9375 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-05-03 12:14:46 +00:00
Sevenfm 89e0fd33ec Get rid of buggy-style odd hits when a merc is on the middle of roof, not at enemy's line-of-fire, and prone. Shortly, suppression still affects hiding roofers, but accidental hits do not (by sun_alf).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9361 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-07 18:18:39 +00:00
rftr 87b0c7c6b7 new feature: madlab's robot can be upgraded
requires gamedir r2642

https://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=364403

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9338 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-21 17:34:49 +00:00
Sevenfm aaa88a11f3 Fix: shooting through roof.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9302 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-16 15:22:21 +00:00
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