99 Commits
Author SHA1 Message Date
Asdow 4fcf03d31a Include cleanup Tactical/.*cpp 2025-12-09 00:35:18 +02:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03: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 2918801f75 AddSoldierToSector & OBJECTTYPE::soldierID changed to SoldierID 2024-11-16 20:55:08 +02:00
Asdow fcf2b27d1a More UINT8 -> UINT16 changes 2024-11-11 00:08:30 +02: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
AsdowandGitHub d296789929 LOBOT: enemies wear pistol holsters (by Seven) (#271) 2024-01-30 22:53:19 +02:00
sun-alf ab2a26accb [Fix] A bunch of fixes for artillery strike
* Avoid using hard-coded Signal and HE mortar shell indices. This caused art.strikes malfunctioning in item mods.
* Trim max nubers of waves to duration of signal smoke. Otherwise art.strike turns into unnatural stupidity.
* If enemy AI tried to get art.strike but lacked of resources, player will not a warning anymore.
2023-05-22 22:06:18 +03: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
rftrdevandGitHub d562424c4b LOBOT: enemies wear backpacks properly
If an enemy soldier gets a backpack when randomly generated, put it into the backpack inventory slot instead of a generic inventory slot.
2022-12-10 02:45:12 -08:00
rftrdevandGitHub 7a0a56762b Revert of 7baeb20 (#30) 2022-11-21 18:24:43 -08:00
rftrdev 7c6f7d6d09 Revert "Undo unrelated Chinese text changes"
This reverts commit 75332ea219.
2022-11-04 22:42:09 -07:00
rftrdev 75332ea219 Undo unrelated Chinese text changes 2022-11-04 22:39:33 -07:00
rftrdev 7b0830c060 Initial commit - SVN checkpoint to git branch 2022-10-11 00:17:12 -07:00
Shadooow 7baeb20175 INI option SOLDIERS_ALWAYS_WEAR_ANY_ARMOR works improperly at 100% game progress, so that a soldier lacks 1, 2 or all 3 armor items ('naked' guy). (by sun_alf)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-22 22:12:07 +00:00
Sevenfm 0fdaba84f6 World items patch (by Asdow).
Adds timing logs to savegame function, similar to how we already had in loading a save file. 
Uses a global struct for unloaded sectors' inventory instead of using map item temp files every time unloaded inventory is accessed.
From timing loading and saving functions with a save that has dozens of sectors with hundreds of items each, saving is a little bit slower than before, because map item temp files have to be written to disk just before the save, when that wasn't the case before (from ~0.3 s -> ~0.5s). It is offset by a decrease in loading a game (from ~1.1s -> 0.745s), once an older save is saved at least once. Any unloaded sector inventory access during gameplay is considerably faster and for example the autoresolve lag when militia is using sector equipment is completely gone for me.
Preserves save game compatibility

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9277 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-26 01:02:30 +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 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
silversurfer e39652f6e2 Feature enhancement: Drop All now allows to use the following settings:
0 = Drop All is off and drop chances are used
1 = Drop All is on and everything is dropped
2 = Mild Drop All which means that everything is dropped (like 1) but items that are usually not dropped (like 0) are severely damaged.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8675 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-04-22 11:12:13 +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 7246b671f8 - If NPC_AUTORESOLVE_DROP_ALL is TRUE (default FALSE), NPCs (enemies, militia, bandits, creatures...) drop items in autresolve like they would in tactical combat.
- Fix: dropped items are clones when dropping from autoresolve

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8594 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-08-15 14:47:43 +00:00
Flugente 80674249cc New feature: bloodcat/zombie/bandit raids on player-controlled sectors
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23711&goto=353154&#msg_353154

Requires GameDir >= r2420

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8554 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-04-15 14:42:01 +00:00
Flugente fcfab521fb unified code for enemy/militia gear selection
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8334 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-10-24 18:46:39 +00:00
Flugente 7bf2943849 If a tank just took a heavy hit, but cannot see an enemy to fire upon, it can detonate a smoke grenade on itself to hide.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8127 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-26 23:16:41 +00:00
Flugente 7e3d9e368c externalised maximum number of mortars per AI team to DifficultySettings.xml
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8120 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-24 23:16:52 +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 d1e1759aa2 Removed ENABLE_ZOMBIES-define
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8047 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-01-31 17:54:51 +00:00
Flugente 70b832d0b4 Militia equipment feature improvement:
- Attachments are rated depending on their class. The following attachments are used: Scopes, foregrip, bipod, lasers, sights, muzzle, stock, sling.
- Attachments are rated just like any other item during the militia equipment process is. For now this is simply status * coolness.
- After evaluation, attachments are added in the above order. This means that militia will now take bipod attachments, but always prefer foregrips for their shared slot.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8014 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-01-09 16:55:12 +00:00
Wanne 91eef3098c - Equip Milita Improvements: I've written code, which adds attachments to free positions on the gun militia chose to pick up (by navaroe)
- Bugfix: Reinforcements:  Parts of roadblocks were resurrected after reinforcements death (by navaroe)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7995 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-10-15 10:40:58 +00:00
Flugente 929d15ec8a changed several variable names for body types to 'ubBodyType', as this is more consistent and allows wider use of macros
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-08-07 20:09:10 +00:00
Flugente 89b9a69b9b Fix: Militia does not equip multi-shot launchers if there are less than 3 shots in the sector.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7735 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-02-13 20:47:54 +00:00
Flugente c9bcf90966 Expanded feature: Militia Strategic Movement is turned on with ALLOW_MILITIA_STRATEGIC_COMMAND set to TRUE and allows plotting paths for the militia just like for merc squads.
GameDir >= r2204 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7727 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-02-08 22:11:16 +00:00
Flugente 499ff2db06 If the itemlist is huge and one uses New Inventory System, New Attachment System and a lot of MOLLE items, there is a noticable slowdown if inventory is open in tactical. I cleaned up code to ease that somewhat, but the problem will likely persist.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7600 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-10-19 21:53:05 +00:00
Flugente 48819f860a Fix: Equipping militia with guns and ammo could lead to creation of ammo items with 0 bullets.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7518 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-09-14 21:23:16 +00:00
Wanne 981c81b4b4 Moving Tanks Feature (by anv)
- feature: tanks can move around in tactical. Set with Tactical Gameplay Settings > ENEMY_TANKS_CAN_MOVE.
- feature: tanks can ignore chance to get through and destroy enemy cover even if it probably won't hit anyone behind it. Set with Tactical Gameplay Settings > ENEMY_TANKS_BLOW_OBSTACLES_UP.
- feature: tanks can use cannon even against single mercs and in perfect health. Set with Tactical Gameplay Settings > ENEMY_TANKS_DONT_SPARE_SHELLS.
- feature: tanks can noticed as soon as any part of it is visible. Set with Tactical Gameplay Settings > ENEMY_TANKS_ANY_PART_VISIBLE.
- feature: depending on game difficulty enemy patrols at game start can be randomly reinforced with tank. Set with Strategic Gameplay Settings > ARMY_USES_TANKS_IN_PATROLS.
- feature: depending on game difficulty enemy groups created during offensives can include tanks. Set with trategic Gameplay Settings > ARMY_USES_TANKS_IN_ATTACKS.
- feature: mercs in vehicles automatically rest their guns,
- fix: guns can be rested on vehicles,
- rewritten code to allow putting enemies inside vehicles,
- added missing descriptions for all vehicle options to INIEditorJA2Options.xml.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7277 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-06-18 18:10:07 +00:00
Flugente 30060f0595 Merged revision(s) 7166-7177 from branches/ja2_source_official_2014:
- Flagmasks are unsigned, and should be called and treated as such
- Fix: experience gain from interrogation was too high
- Fix: chance of a prisoner becoming militia was calculated wrong
- default weight maximum for MOVE ITEM assignment increased from 30 to 40 kg
- Fix: snitches report the same event multiple times
- Fix: snitches treat vehicles as persons
- Fix: selection of launchables is inefficient, an does not take into account wether items are depending on day/night cycle
- new key combination: in strategic, pressing [CTRL] + [E] wile both a merc's inventory and the sector inventory are open will fill the merc's inventory with sector items
- trivial code cleanup
- if prisoners are taken in a sector that houses a prison, that prison can also be selected to house them
- Fix: distributing newly taken prisoners in a prison sector no longer redistributes all prisoners, only the new ones
- GetClosestFlaggedSoldierID can also be called without evaluation of sight
- Fix: Covert Ops: throwing/lobbing items or shooting rockets is deemed suspicious behaviour
- Fix: boxing was broken by loading a savegame
- Fix: campaign history rarely recorded kills in autoresolve
- There is no reason why the IDs that boxers are reset to before they are reinitialised would ever need to be altered by a modder. Required script change in stable GameDir r2024.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7178 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-04-30 21:36:18 +00:00
Flugente d6186aca15 Merged revision(s) 6826-6828 from branches/ja2_source_official_2014:
- Minor code improvements and cleanup
- Fix from r6775 is no longer necessary.
- Code improvement: Instead of calling inv.size() repeatedly, just call it once and remember that value

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6829 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-01-26 12:18:43 +00:00
Kriplo b91bc7b209 Brief: //dnl ch75
- More map editor fixes and map inventory pool performance improvement for big maps.
Details:
- Fix not showing expected messagebox on exit (ALT+x) which also throw exception and goes to improper mapeditor exit.
- Fix second annoying sticky message which shouldn't popup during map loading and performing RemoveProhibitedAttachments.
- Fix CTD when delete all enemies or civilians or all of them in map.
- Fix some std exception when reporting for missing optional xml file.
- Fix memory and map corruption in old mapeditors if loaded old map has item with invalid attachment and we try to attach something else.
- As years ago pInventoryPoolList had migrated from WORLDITEM* array to std::vector<WORLDITEM> it was time to do that with gWorldItems too, all necessary functions which need to be adopted to gWorldItems std::vector type are also changed.
- Resize code for gWorldItems is changed hoping will lead into less corruption problems as now could occur in mapeditor and game when code automatically doing attachment changes.
- Change code for handling map inventory which now should be fast enough to support AIMNAS project which will probably deal with thousands of items per map.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6554 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-11-03 16:26:30 +00:00
silversurfer 6e98818e16 New modifiers for enemy item quality in Ja2_Options.ini:
ADMIN_EQUIPMENT_QUALITY_MODIFIER = 0
REGULAR_EQUIPMENT_QUALITY_MODIFIER = 0
ELITE_EQUIPMENT_QUALITY_MODIFIER = 0

These modifiers work just like the existing ones for militia.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6535 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-10-27 09:04:57 +00:00
silversurfer c16971b9f2 New weapon type modifiers for:
- damage
- single shot AP
- burst AP
- auto fire AP

Fixed some parts where the raw item property was used instead of the Get... function that should be used.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6470 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-10-05 15:15:50 +00:00
Flugente 64f7d6e616 new item tag <ItemChoiceTimeSetting> forbids AI from picking an item at night if set to 1 and at day if set to 2
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6262 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-07-30 19:32:49 +00:00
Flugente b53fe0cd72 Militia equipped from sector inventory take along NVGs/sunglasses to use them later
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6259 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-07-29 20:04:45 +00:00
Flugente 7f467f4f80 Fix: militia equipment item fitness function still considered ammo even if MILITIA_USE_SECTOR_EQUIPMENT_AMMO was false, thus possibly ignored guns that had no ammo loaded
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6030 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-28 15:58:58 +00:00
Flugente bcbe006a4a feature improvement: if MILITIA_USE_SECTOR_EQUIPMENT_CLASS_SPECIFIC_TABOOS is TRUE, one can taboo equipment for specific militia classes
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6026 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-27 00:59:38 +00:00
Flugente a66a3ef61b - militia equipment choosing: object status is taken into consideration for NVGs and sungoggles
- militia equipemnt choosing: do not give a 'bonus' for excess ammo we wouldn't take anyway

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5987 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-07 00:49:08 +00:00
Flugente fe8d572068 Fix: ubGunAmmoItem was not set, which could lead to magazines disappearing during reloading
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5906 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-07 20:43:58 +00:00
Flugente 50c4982f91 - prisoners give information only on mobile patrols, not on city sectors
- if using militia equipment, items stolen by militia are dropped after combat if their class is distributed to militia by the player
- Fix: do not delete world items with invalid gridno
- Fix: militia drop gear on valid GridNo

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5892 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-03 23:26:03 +00:00
Flugente fc2e10314b - Fix: crash when trying to delete an item with invalid GridNo
- Fix: adjusted squadname when discovering NPCs

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5890 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-03 08:57:26 +00:00
Flugente 72dbd9e33f - fixed an instance of wrong assignment strings
- prisoner decision messagebox now allows to select a specific prison
- Fix: under certain conditions, calling militia reinforcements with militia equipment selection could get sector items with invalid GridNo to become lost

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5888 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-02 19:14:46 +00:00
Flugente c3462f9163 code improvement: no need to evaluate guns in 1st loop, do total evaluation with ammo in 2nd loop
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-01 20:19:55 +00:00