Commit Graph
120 Commits
Author SHA1 Message Date
Asdow db15679ec1 Add missing Iter->Exists() checks 2026-06-12 15:52:24 +03:00
Asdow 4fcf03d31a Include cleanup Tactical/.*cpp 2025-12-09 00:35:18 +02:00
BeatAroundTheBuscherandGitHub ed00830202 Fixes Upper/Lower Casing for include paths (#487)
* Fixing upper/lower case for includes

types.h, zconf.h and zlib.h were renamed so that global includes like Types.h
are not used.
2025-08-16 22:01:12 -03:00
Asdow 222daead0e Remove unused ItemFlags
Detonator and Remote Detonator are specified by AttachmentClass
No items in items.xml actually even contained these flags.
2025-01-27 18:30:11 +02:00
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
This one is big, but unless I missed something, should be all be
trivial.

scripted-diff with the following, then manually tweaked whatever needed:
```

if [ $# -ne 3 ]; then
    echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
    exit 1
fi

pattern="$1"
replacement="$2"
filename="$3"

if [ ! -f "$filename" ]; then
    echo "Error: File $filename does not exist."
    exit 1
fi

sed -i '/'"$pattern"'/ {
    :loop
    $ !{
        N
        /'"$pattern"'.*\n.*#endif/ {
            s/'"$pattern"'/'"$replacement"'/
            s/#else/} else {/
            s/#endif/}/
            P
            D
        }
        /'"$pattern"'/ b loop
    }
}' "$filename"

echo "Replacement complete in $filename"
```

h/t to Grok2 for the sed command
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costaandmajcosta 897f684705 remove all #include's for Language Defines
scripted diff:

find . -type f -iname "*.h" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
find . -type f -iname "*.cpp" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
2024-12-27 02:35:29 -03:00
AsdowandGitHub 49a119e6b9 Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
2024-08-22 08:48:29 +03:00
sun-alfandGitHub 481e518790 Merge pull request #157 from 1dot13/master_1dot13
[Fix] Incorrect displaying info and tooltips in Advances Properties Tab
2023-05-29 21:46:38 +02:00
sun-alf 9fc9d1c6e8 [Fix] Incorrect displaying info and tooltips in Advances Properties Tab
* Tooltips were shifted by one position due to wrong handling "Accuracy modifier".

* DrawAdvancedValues():
    if ( iFloatModifier[0] > 1.0 || ( fComparisonMode && iComparedFloatModifier[0] > 1.0 ) )
it checks number of laser range tiles  (iFloatModifier[0] > 1.0, "meters" / CELL_X_SIZE) right before actual drawing a line with values. So if someone put 1..9 into XML (<BestLaserRange>) it will not print that value. But number of "meters" was checked (like x > 0) everywhere prior to this code.
so all the code before decided to draw line with icon for laser range, but the guilty code line didn't
I suppose not to draw laser info at all if a modder screwed up <BestLaserRange> putting a 1..9 value
so all values 0..9 basically mean 0 tiles, i.e. there is no laser ability.
2023-05-27 21:04:17 +03:00
AsdowandGitHub f2ab296b49 Display icon and tooltip for belt fed weapons (#155) 2023-05-26 08:12:55 +03:00
AsdowandGitHub 35bb9a70ec Do not load language specific icon file (#146)
Unnecessary, as there is no translated text in the image files
2023-05-19 16:47:42 +03:00
rftrdevandGitHub a0aa58f9e5 Update disease flags (hand and face) so that they can be used on the same item (#143)
* Allow an item to have both disease flags enabled

* Remove extra line break for disease hand protection helptext
2023-05-15 00:51:37 -07: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
Shadooow 1b63f1da01 Fixed bug, where scope mode icons were lost after exiting EDB.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9318 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-10 19:29:06 +00:00
Flugente 6f5e2471e0 Fix: display for other properties in EDB advanced page uses wrong line
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9151 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-08-14 15:56:14 +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
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
Flugente 098dc8e280 Disease update:
- <InfectionChance_WOUND_FIRE> can cause infections when taking fire damage
- <InfectionChance_WOUND_GAS> can cause infections when taking non-fire gas damage
- <fSpecialFlagLimitedUseArms> causes the infected to be unable to use one arm
- <fSpecialFlagLimitedUseLegs> causes the infected to be unable to run, and walk and travel slowly
- JA2_options.ini option DISEASE_SEVERE_LIMITATIONS controls whether <fSpecialFlagContractDisability>, <fSpecialFlagLimitedUseArms> and <fSpecialFlagLimitedUseLegs> are used

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=22099&goto=360451&#msg_360451

- Gas damage split up in fire and non-fire damage.
- Flamethrower projectile damaged is affected by fire resistance.

Requires GameDir >= r2553.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8828 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-06-25 22:42:44 +00:00
Flugente b25a4be4e7 Fix: compiler warnings
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8814 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-30 14:26:16 +00:00
Flugente 47a89e3725 New feature: mercs on administration assignment boost the effectivity of other mercs
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=356696&#msg_356696

Requires GameDir >= r2472

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8665 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-02-14 20:48:07 +00:00
Flugente de8bf8a7d6 Armour and its attachements can now alter the fire damage received by setting a value in the <sFireResistance>-tag. This is affected by item status.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8664 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-02-10 20:42:39 +00:00
Flugente 84d08a8821 A paramedic can use empty bloodbags (<emptybloodbag>-tag, item #1756) to create blood bags (<bloodbag>-tag, item #1757) from other mercs. These can then boost the health returned by surgery by ONTOP_PERCENT_SURGERY_HEAL_BLOODBAG percent.
Requires GameDir >= r2467.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8662 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-02-10 16:26:48 +00:00
Flugente a5e5ff6bd8 The new <BarrelConfiguration>-tag specifies how many bullets a gun shoots at once. Several values can be used. If no value is set, 1 will be used.
Toggling fire modes cycles between barrel configurations if several have been set.

Requires GameDir >= r2461

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8652 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-27 19:48:18 +00:00
Flugente 61553feb57 If CAN_FAN_THE_HAMMER is set for Gunslingers in Skills_Settings.ini, they can use burst fire if using revolvers with fBurstOnlyByFanTheHammer set to 1 and burst data set in Weapons.xml if they are in hipfire mode.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8651 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-24 21:48:44 +00:00
silversurfer 384572098b - fixed incorrect rounding in several places in the code
- diagonal movement now uses the proper amount of AP and BP

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8634 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-11-03 16:11:21 +00:00
Flugente 2dbacd32de The following options have been moved from the campaign the campaign start screen to JA2_Options.ini:
- Maximum number of IMPs (now MAX_IMP_CHARACTERS (Default: 10))
- Enemies drop all items (now DROP_ALL (Default: FALSE))
- Merc Story Backgrounds (now BACKGROUNDS (Default: TRUE))
- Food System (now FOOD (Default: FALSE))
- Improved Interrupt System (now IMPROVED_INTERRUPT_SYSTEM (Default: TRUE))
- Inventory Manipulation Costs AP (now INVENTORY_MANIPULATION_COSTS_AP (Default: FALSE))

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23855&goto=354656&#msg_354656

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8610 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-02 15:14:01 +00:00
Flugente a59b75b0be New feature: we have to bury corpses, or their rot causes diseases in sectors
Requires GameDir >= r2436.

Fopr more info, see http://thepit.ja-galaxy-forum.com/index.php?t=tree&th=23828&goto=354321&#msg_354321

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8591 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-08-12 12:42:38 +00:00
Flugente 52b7de54e1 If a gun's currently used ammotype has <numberOfBullets> > 1, display the gun damage in EDB in 'bullet damage X bullets fired' format, taking <multipleBulletDamageMultiplier> / <multipleBulletDamageDivisor> into account.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20659&goto=353533&#msg_353533

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8562 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-05-16 21:15:37 +00:00
Flugente e55b480996 New feature: Getting and using intel allows for more spy-related roleplay.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23643&goto=352475&#msg_352475

Requires GameDir >= r2401.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8522 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-02-18 23:17:34 +00:00
silversurfer 0450b7a32c Fixes:
- missing laser range in OCTH
- missing compare functionality for laser ranges
- missing ToHitBonus display for crouched stance

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8478 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-09-23 11:16:37 +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
silversurfer 372adc37b8 repair and dirt system change:
Dirt is now part of gun status. The original dirt system has been removed. For details see:
http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20198&goto=347370&#msg_347370


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8325 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-10-19 15:58:02 +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
silversurfer 5307881cb7 Fixes (by Sevenfm):
- incorrect sized array for secondary item stat regions
- incorrect check for secondary item stat display removed

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8248 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-05 13:23:26 +00:00
silversurfer 90ff5d5626 Fix: AimLevels bonus was displayed for OCTH although it doesn't apply there
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8247 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-04 09:56:46 +00:00
silversurfer e43d1b3fb3 Fix: The Brass Knuckles tag didn't count as bare hand attacks anymore since revision 6465. I changed that back because Martial Arts trait includes brass knuckle items. Single attack AP display of such items in EDB was fixed as well.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8207 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-08 15:19:39 +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
Wanne a2589f7034 Bugfixes / Improvements (macros) of Assignments (by Franimus)
- Fixed warning for INT8 overflow on scroll region priority, seemingly had no effect though
- Use new assignment macros
- Bugfix - POWs' activity level being overwritten
- Feature - automatically bandage bleeding mercs on a PATIENT assignment
- Bugfix - mercs treated at facilities should not use mercs' medkits
- Added 3 new enums for facility doctor, patient, and repair
- Bugfix for facility patients not detected as being in a facility
- Bugfix - iBurstAPCost was ignoring half of its calculation due to extraneous semicolon


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7988 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-09-12 11:27:28 +00:00
Flugente 4d9140da57 New Feature: Drug System Overhaul. The drug system has been completely overhauled.
Requires GameDir >= r2257.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=341541&#msg_341541

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7896 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-06-28 17:47:25 +00:00
Flugente 6c9d75480f Added range modifier for throwing knives
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-06-01 21:02:07 +00:00
Flugente b2217eaab9 Deleted Feature: The poison feature has been made obsolete by the disease feature and has been removed.
GameDir >= r2245 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7870 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-20 20:39:51 +00:00
Flugente c677c462bc In order to keep trait-related settings where traits are defined, moved MERCS_CAN_DO_ADVANCED_REPAIRS from JA2_Options.ini to Skills_Settings.ini under [Technician] settings.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7867 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-19 20:47:07 +00:00
silversurfer 51dcf322aa EDB now displays the spread pattern of shotguns on the description tab.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7859 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-13 20:10:08 +00:00
Flugente 1b8d898226 Disease protection items are no longer required to be worn in a faceslot. The point is that the player should acquire special gear, not inconvenience him to switch gear whenever a merc goes on assignment.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7852 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-08 19:08:54 +00:00
silversurfer 4b5fc5bc3c Fix:
- large MOLLE pockets didn't display their volume in EDB
- attaching a filled MOLLE pocket didn't show its contents. Now the contents will be removed and put in the soldiers inventory or on the ground if there is no space.

Enhancement:
Detaching filled MOLLE pockets is possible again. The contents will be moved to soldier inventory (if pocket was on the soldier before) or to the ground (in case of sector inventory manipulation).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7788 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-17 18:15:58 +00:00
silversurfer 2afa02c913 Requires GameDir >= 2227 because of new icons!
EDB now displays available volume and pocket volume for MOLLE items.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7784 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-16 09:56:29 +00:00
silversurfer 76689ab99d Enhancement: It is now possible to display attachments and contents of LBE at the same time when game option "Show LBE Content" is active.
http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20659&goto=340063&#msg_340063

Fixes for MOLLE display and handling:
- MOLLE didn't display attached pockets and their contents when the item was in sector inventory
- MOLLE pockets could be detached although there were still items inside the pocket. This led to items in invalid pockets (MOLLE on soldier) or items vanishing completely (MOLLE in sector inventory). Now it is not possible anymore to detach filled MOLLE pockets. You will have to empty them first.
- MOLLE in a stack displayed the wrong contents as long as their index was not 0.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7783 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-15 12:50:30 +00:00
silversurfer 8ae8c147f9 Fix (by Sevenfm): NCTH aperture was offset by 1 to the bottom right
EDB enhancement: rechamber display now includes effects from traits

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7765 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-02 17:15:29 +00:00
silversurfer 215550e8fc Fix: Machinegunner trait did only count once for LMG attack AP reduction
More updates to EDB:
- fixed gun range calculation
- trait modified values now shown for attack AP and reload AP

Cleaned up attack AP trait modifiers and moved them to a new function.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7764 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-01 16:25:58 +00:00