Commit Graph
361 Commits
Author SHA1 Message Date
GreysaandAsdow bb55299ff6 Basic implementaion of unjamming on reload hotkey.
TODO:
text strings
check dual wielding
2026-05-23 21:22:28 +03:00
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 fd9611ae04 Remove compiler warnings 2025-08-08 18:38:53 +03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow b7bfd8a2eb Use FLAGS64 for flagmasks 2025-08-08 17:42:25 +03:00
kitty624 4ae331c19e IniOption Food items can show without using Food
- food items are usualy not shown in game without using Food
- option ALWAYS_FOOD allows them to be shown even without
- default is false, no food items without Food
2025-08-03 08:12:48 +02: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
kitty624 0bd932f20f Simplified rework foodsystem allowed items
simplified the previous commit, now no more need for a tag
when checking IsItemLegal for Food System, ontop of checking for foodpoints, now also check if is drug
as a result, as previously, all eatable food will be excluded without food system, but now only if it isn't a drug at the same time
and no more tag to check for that in items.xml needed
2024-12-17 13:13:37 +01:00
kitty624 2fcba8b9f7 Reworked foodsystem exclusive items:
no food items if the food system is off
whether the item is exclusive is defined by tag in items.xml
replaced previous way of decision, which used Item[usItemIndex].foodtype > 0 as criteria
that also restricted dual use items (i.e. drugs that also have a foodtype, like coffee, etc.)
2024-12-16 09:54:54 +01:00
Asdow e59d915e58 Use SoldierID 2024-12-01 00:20:41 +02:00
Asdow ef9aa1b027 Convert to SoldierID 2024-11-17 22:29:31 +02:00
Asdow f50bdf99cc Convert to SoldierID 2024-11-17 20:41:09 +02:00
Asdow 8ef7fb5ae4 Convert SOLDIERTYPE::usDragPersonID to SoldierID 2024-11-16 00:09:48 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +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
kitty624 b13bcaac71 Update Items.cpp
reworking r9343

- the part about Food System is obsolete, already was happening in code prior to r9343

- the flags got removed and a boolean is used instead, allowing a simpler function for the remaining disease

- wether an item is considered exclusive to disease feature or not is decided by usage of tag in items.xml
2024-04-15 01:33:47 +02:00
AsdowandGitHub b8a870df02 Reduce code duplication (#233)
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Add direction utility function

We have a lot of places in the code that calculate direction based on center cell coordinates, but lack a utility function for it similar to other direction methods.

* Use utility function for calculating direction

* Use ConvertGridNoToCenterCellXY

* Use utility function for direction

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Remove CenterX & CenterY functions

Use ConvertGridNoToCenterCellXY instead

* Remove CenterX & CenterY calls from UB configuration

* Address review feedback

* Remove duplicate function

ConvertGridNoToCenterCellXY and ConvertMapPosToWorldTileCenter do the exact same thing

* Use PythSpacesAway instead of GetRangeFromGridNoDiff

Both functions calculate the same thing

* Remove GetRangeFromGridNoDiff

* Remove calls to abs()

The values end up being squared anyways making these unnecessary
2023-10-07 15:14:15 +03:00
Marco Antonio Jaguaribe Costaandmajcosta b68f206969 remove annoying warning on MSVC 19.37.32822
`register` keyword does exactly nothing:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5033?view=msvc-170
2023-10-07 09:13:55 -03:00
sun-alf 5bfd19e5a8 [Fix] One of optimizations in (2482234e) commit is not suitable for MOLLE stuff in 1.13
It is revealed, MOLLE things in 1.13 are configured in XMLs using both NAS and OAS (old attachment system) methods even if NAS is enabled in New Game Options. Given this, logic of SetAttachmentSlotsFlag() cannot be splitted onto NAS and OAS parts, and both Attachment[] and AttachmentPoints must be checked disregarding the NAS option.
2023-09-14 01:04:55 +03:00
sun-alf f8637e5972 [~] Performance optimizations around Attachment[] and Launchable[] arrays
AIMNAS with its ~50K elements in Attachment[] suffered of performance drop when MOLLE stuff is in the visible inventory. To resolve it the following is done:
* Introduce gMAXATTACHMENTS_READ with actual number of elements in Attachment[]; according refactoring.
* Introduce gMAXLAUNCHABLES_READ with actual number of elements in Launchable[]; according refactoring.
* Introduce std::multimap AttachmentBackmap for quick access to attachments using itemId as a key.
* Sort Attachment[] by attachmentIndex right after loading from XML. According order in XML is not needed anymore.
* Introduce FindAttachmentRange() for quick access to attachments using attachmentId as a key (binary search in Attachment[]).
In a few words, GetHelpTextForItemInLaptop(), ValidAttachment(), SetAttachmentSlotsFlag() were heavily optimized.
2023-09-08 21:58:14 +03:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03: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
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
Marco Antonio Jaguaribe CostaandAsdow d4abc82488 Address review feedback 2023-01-19 00:13:08 +02:00
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
Asdow 1f0a8f46e8 Import changes from the local SVN working copy 2022-10-10 10:08:44 +03:00
Sevenfm 904fae7a96 CancelDrag, StartDrag: update interface panel to change drag icon status.
DrawTraitRadius uses usColour.
Allow to start dragging from any stance, soldier will crouch automatically.
Show draggable objects when drag skill menu is active.
Press [\] key to start dragging object/solder/corpse in front of merc.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9369 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-24 18:21:44 +00:00
rftr 746d15a1ba remove magic numbers from the usLimitedToSystem bitflag
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9355 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-02 01:11:25 +00:00
Asdow c334d4a0d4 Optimize RandomMagazine() called when deploying to tactical sector (by sun_alf)
Timings
Before:
RandomMagazine: 90044 us (total 90044 us)
RandomMagazine: 90007 us (total 180051 us)
RandomMagazine: 100009 us (total 280060 us)

After:
RandomMagazine: 0 us (total 0 us)
RandomMagazine: 0 us (total 0 us)
RandomMagazine: 0 us (total 0 us)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9354 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-31 15:10:19 +00:00
Shadooow 033ae4a191 Added two new tags into Items.xml, <FoodSystemExclusive> and <DiseaseSystemExclusive> which prevents specific items to appear without these systems enabled.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9343 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-24 05:40:46 +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 aa5e2dc4c3 PlaceObject: don't show incompatible face item message when doing autoplacement.
SwapGoggles: swap face item to helmet if possible.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9301 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-15 12:03:54 +00:00
Sevenfm d02547c7c8 When attaching launchable to attached launcher, use launcher's reload AP cost.
Don't apply ambidextrous attach speed bonus when attaching launchable to launcher.
When playing reload sounds, set volume and pan based on soldier's location.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9196 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-26 13:49:55 +00:00
Sevenfm 8413c5ee8f GetReliability: attached weapons should not add reliability.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9195 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-26 07:06:43 +00:00
Sevenfm b11957691c Fix for critical bug introduced in r9182: replace CoweringShockLevel check which calculates suppression tolerance every time, with IsCowering, which uses cowering animation check.
DrawBarsInUIBox: fix possible divide by zero.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9184 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-16 16:07:31 +00:00
Flugente a93e9b4a9c Added helper functions to easier determine gun stats
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9158 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-08-27 20:48:19 +00:00
Sevenfm a8c2fa6788 ADD_SMOKE_AFTER_EXPLOSION option:
- use default item SMOKE_GRENADE (151) if it's available
- search for first smoke grenade if default item is not grenade
- check that correct smoke grenade was found

Also added new functions:
- ItemIsHandGrenade to check if item is hand grenade
- GetFirstHandGrenadeOfType to find first item which is hand grenade of selected type
- GetHandGrenadeOfType same as GetFirstHandGrenadeOfType, but first check if provided default item is hand grenade of needed type

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9156 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-08-27 17:30:27 +00:00
Flugente ed82841e3c Fix: when using two guns, both are reloaded on the reload cursor prompt, even if one of them still has ammo. This has been changed so that now only empty guns get reloaded
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9146 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-24 19:15:18 +00:00
Shadooow 5e4d587baf fixed: KAC masterkey and other items without attachment flag to work
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9110 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-27 02:36:46 +00:00
Sevenfm 39b8911803 Fix: attaching guns to tripwire.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9027 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-15 06:26:37 +00:00
Sevenfm fc3869bcd6 Fixed function PickPocket to work with MOLLE type of LBEs (by Shadooow).
Changed code that handles putting medical kit from merc inventory into his main hand to respect pockets restrictions to avoid putting gun into medkit only pocket etc.. Writes an error in case that medical kit cannot be put into hands due to no suitable place for currently held items (by Shadooow).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9015 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-11 04:40:54 +00:00
Sevenfm e4f12a68aa Reverted optimization code which prevented 40mm grenades to load if <attachment> tag is not set in mod (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9003 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-05 08:08:37 +00:00
Sevenfm d41c0f2f93 Efficiency improvements for code dealing with attachments validity to fix any potential lag issues (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8997 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-02 05:23:52 +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 c8cb9a0d6c SetAttachmentSlotsFlag: improved code to check array bounds.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8952 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-03-11 06:51:12 +00:00
Sevenfm d1de51605c TransformObject: disabled interrupt after sight check.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8951 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-03-09 22:26:02 +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