162 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 e59d915e58 Use SoldierID 2024-12-01 00:20:41 +02:00
Asdow 4e8c5fa9ab Remove unused function & globals 2024-11-30 23:50:17 +02:00
Asdow de56f653ec Use SoldierID 2024-11-30 23:47:00 +02:00
Asdow bc01bdb56d Convert to SoldierID 2024-11-18 23:12:43 +02:00
Asdow 657097aa54 Remove unused global 2024-11-17 23:47:26 +02:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +02:00
Asdow f50bdf99cc Convert to SoldierID 2024-11-17 20:41:09 +02:00
Asdow 74d752d452 More conversions to SoldierID 2024-11-17 18:15:36 +02:00
Asdow 34f0b40f93 Convert functions and globals to SoldierID 2024-11-17 14:53:52 +02:00
Asdow 30e6b9008c SetUIBusy() & UnSetUIBusy() to SoldierID 2024-11-17 11:15:39 +02:00
Asdow b98732daa7 Convert gusSelectedSoldier to SoldierID 2024-11-15 19:06:34 +02:00
Asdow 1345d92521 Convert Soldier Find.cpp to SoldierID 2024-11-14 00:45:50 +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
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
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
AsdowandGitHub 17a0a08097 Add Astars pathing to ingame options (#124)
* Enabled astars pathing

* Add toggleable pathfinding choice to ingame options

You can choose between original and A* pathfinding algorithms
2023-02-15 11:49:04 +02:00
rftrdevandGitHub b5ec955324 Disable backpack climb check for non-player soldiers (#117) 2023-01-27 17:56:46 -08: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
Asdow f733bda830 Fixed nullptr dereference in void CommonEnterCombatModeCode( ) & added two nullptr safety checks
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9393 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-08-02 22:29:00 +00:00
Sevenfm b2ea45b182 ESC for multiple selected mercs: first stop mercs, next press unready weapon.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9358 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-02 15:39:58 +00:00
Shadooow 61f1dd4acb fixed MAX_BACKPACK_WEIGHT_TO_CLIMB not being checked in all places which caused:
- mouse cursor showing blocked path incorrectly and jumping over fence via mouse failing
- endless clock issue at the end of the boxing match if player merc had backpack

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9238 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-10 22:44:52 +00:00
Shadooow 210101463e fixed inability to turn around or aim gun while standing in a knee deep water
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9220 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-12-20 16:36:53 +00:00
Sevenfm 1ee875be61 New ingame options screen (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-11-17 07:50:20 +00:00
Flugente 433a41f03b Fix: use of uninitialized variables
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9083 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-14 21:05:59 +00:00
Shadooow e3e0226071 fixed incorrect squad name when selecting merc with option USE_XML_SQUADNAMES = TRUE
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9045 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-24 17:07:53 +00:00
Shadooow 43dfa982a5 Bright future is here, introduced turning AP costs into pathing AP prediction. Full changelog:
- fixed camera action AP cost shown and made soldier to turn towards target
- fixed handcuffs, jar and can actions AP cost shown calculating pathing cost twice and not calculating stance change at all
- fixed refueling and repairing pathing leading to inside vehicle
- fixed endless clock issue when trying to refuel from spot next to vehicle
- fixed endless clock issue when trying to repair vehicle/SAM site during combat
- fixed refuel, repair and jar actions not costing any AP in turn based mode
- fixed multiple actions not calculating and substracting AP cost for turning
- fixed using toolkit asking whether player wants to attack ally
- fixed issue where the required AP cost for melee attack was not recalculated when changing movement mode
- allowed to start repairs on robot manually from tactical mode
still a problem:
- repairing during combat still does nothing as soldiers cannot go into assignment while there are enemies on map
- we need new function to return action gridno for actions on vehicles, FindAdjacentGridEx is not working very well
- soldiers doesn't turn during interactive actions

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9033 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-20 11:42:57 +00:00
Sevenfm a2e0080227 Re-allowed diagonal melee attacks, this time it will work correctly and game actually use this in pathing too, which was not the case before (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9030 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-16 18:46:37 +00:00
Sevenfm 09ea9f3fb7 Fix for knife and punch attacks attack from GridNo (by Shadooow).
This fixes punching and stabbing target through door and improves attacking at prone target which was previously calculating shortest route only to the "main" GridNo of the prone target despite he occupies two in this position. It also removes the possibility of attacking from diagonal tile - it was never intended to happen and was calculating APs incorrectly.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9024 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-14 19:50:22 +00:00
Sevenfm 9d4829ef5a Fix: incorrect cursor when using wire cutters (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8978 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-25 13:58:32 +00:00
Sevenfm e23e473333 Exploit fix: don't allow "apply item to others" cursor to reveal position of invisible enemy.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8976 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-25 12:26:58 +00:00
Sevenfm b8aac91b9e Fixes (by Shadooow):
- fixed AP cost shown at the cursor when pressing ALT during RUN mode since game doesn't allow to "reverse run" and forces walking
- shows walking cursor instead of running if ALT is held

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8966 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-23 06:42:09 +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 4cab0e2bdf Experimental tweak: stop muzzle flash at the end of the attack, to allow visibility check and interrupt to work correctly.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8954 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-03-14 18:33:06 +00:00
Sevenfm 1abb292f8e New militia order: Move to (works in realtime only, switches militia soldier to DTATIONARY/DEFENSIVE).
Cancel current AI order when giving militia order.
Check if desired stance is possible here when ordering militia to crouch/prone.
Green AI: reworked climb code (only climb up, only at the start of the turn, disable for STATIONARY).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8947 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-26 12:14:11 +00:00
Sevenfm f3d35c9401 Strip clothes: drop item to soldier's level if no place in inventory.
HandleTalkInit: 
- use SoldierToSoldierLineOfSightTest to check sight to person
- increased talking range for militia to TACTICAL_RANGE
When checking if radio set equipped for using with militia command feature, don't check for AP_RADIO as the game will deduct AP_TALK when giving order.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8942 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 20:31:44 +00:00
Sevenfm 417fa661c6 Smart tree top hiding: more optimization.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8941 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 15:36:02 +00:00
Sevenfm 75f5f35ea0 Added 0.1s delay to hide tree top when moving cursor to prevent flickering when moving mouse over trees.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8937 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 06:22:39 +00:00
Sevenfm 7c1e9e3200 New ingame option: Smart tree tops.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8936 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-16 17:22:44 +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
Sevenfm 02cba3e1e5 When changing stance from UI, first stop cowering.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8930 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-10 20:20:09 +00:00
Sevenfm e39158569b Long jump:
- change to stationary stance before jumping (fixes problems with jumping from moving animation)
- switch to standing animation before jumping if soldier is prone (allows to correctly jump from prone stance)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8921 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-14 17:40:33 +00:00
Flugente ce61a0b85b Fix: if no squad name is provided in xml, fall back on hardcoded name
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8867 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-15 21:23:53 +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
Sevenfm 7f8fc44a7d Improved code to update scope mode when changing stance.
ChangeScopeMode: use NOWHERE instead of 0 as incorrect target gridno.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8796 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-30 00:48:52 +00:00