76 Commits
Author SHA1 Message Date
Asdow 6a8a22aba2 Move iter->exists() check to first 2026-06-12 15:52:24 +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 f49013307f Convert to SoldierID 2024-11-18 01:01:57 +02:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +02:00
Asdow b98732daa7 Convert gusSelectedSoldier to SoldierID 2024-11-15 19:06:34 +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 3985dca2c1 Add on option to start at maximum aiming level (#112)
* Add on option to start at maximum aiming level

When hovering mouse on an enemy, aiming level is started at maximum instead of no aiming when this option is toggled.
2023-01-22 23:35:42 +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
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 9756cf33f4 - fixed manual autofire bullet selection in realtime (hold left mouse button in autofire mode) to work properly instead of always fire 6 bullets
- additionally made mouse wheel to adjust number of autofire bullets in realtime mode

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9130 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-06 23:04:06 +00:00
Flugente 461f16eacb Added several interactive actions that play a sound when clicking on a structure
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9125 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-04 15:59:58 +00:00
Shadooow fe9dd67edc Fixed bug that resets melee attack aim location if the attack was stopped in interrupt.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9059 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-01 15:21:56 +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 77980dd2cc Fixes mouse wheel not working with knife cursor (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9021 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-13 04:52:01 +00:00
Sevenfm 57003e1802 Fixes issues with AP costs for aimed melee attack that allowed to make such attack even without required action points. Note for coders - #defines using conditionals needs to be in parenthesis, otherwise they won't work properly when used in conditionals - which was the case here on many places. (SANDRO catched only few of them. His fixes are reverted since the fix is now in #define itself) (by Shadooow)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9020 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-13 04:43:06 +00:00
Sevenfm 3146cd9b9d Fix for for using items on enemies on roofs from inside room below. This includes multiple actions like first aid kit, blade or punch that shown path into room below enemy on roof and even allowed to stab from there (with zero chance to hit) or punch from there (clocks running for minute) (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9016 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-11 04:50:27 +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 72c20b724f Exploit fix: don't allow "handcuff" cursor to reveal position of invisible enemy.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8977 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-25 13:43:08 +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
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 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 253db89460 - Drug effects on first aid kits can be applied during bandaging
- Drug consumption opinion event, Larry personality change and increase of 'drugs taken' counter only occur if a drug if genuine drug effects were applied. As a result purely disease-causing items no longer cause these events.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8649 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-24 21:38:08 +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
Flugente d08b4d13b9 New feature: Minigames are interactive actions that happen in a dedicated screen. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=347722&#msg_347722
GameDir >= r2350 is required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8346 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-12-11 12:43:41 +00:00
Flugente 99f5be0ed7 New feature: interactive actions allow various actions (hacking/reading/drinking/...) from user-defined xml acttions. The exact results can be set in a lua function.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23144&goto=346447&#msg_346447

This is fully savegame compatible.

GameDir >= r2333 is required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8278 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-02 19:03:28 +00:00
Sevenfm 9b2e65cade Punching: don't use kick animation when attacking with weapon in hand
Stealing: don't turn to attacker when lying prone (to prevent possible endless clock)
Bayonet:
- fix: disable wirecutters cursor in bayonet mode
- always use STAB attack for bayonet
- always give MELEE bonus when using bayonet

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8263 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-25 10:52:47 +00:00
Flugente 2defb8259b Fix: after firing an underbarrel GL, it was possible to reload via leftclick for a short time, leading to reload of main gun with a grenade
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8235 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-25 19:39:10 +00:00
Wanne 23d4051473 Fixed problems with enemy rooftop climbing (by sevenfm)
- Also updated "Water", "DeepWater" and "WaterTooDeepForAttacks" methods: Added bLevel parameter (by sevenfm)
- see: http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=22966&start=0&

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8110 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-15 12:40:54 +00:00
Wanne a3806919ad Bugfix: Allow shooting on "water tiles" instead of showing the "?", if our soldier is on ground level > 0
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7998 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-10-23 14:47:15 +00:00
Flugente 7fed5fd5dd - Sandbags no longer need to be filled.
- Item flags 1 and 4 (EMPTY_SANDAG and SHOVEL) are no longer used.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7968 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-08-12 21:14:48 +00:00
Flugente 9d8e5a4c3a - New prisoner class: Civilians can be interrogated. Does not work for profile-based charcters.
- Capturing civilians is possible if their faction has <fCanBeCaptured> set to 1.

Requires GameDir >= r2215.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7762 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-02-28 22:35:30 +00:00
Flugente 7a61eec3e0 Merged revision(s) 7634 from branches/ja2_source_official_2014:
Fix: NPCs could be handcuffed. This is useless as long as there are no routines that handle their removal and interrogation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7635 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-11-02 03:11:19 +00:00
Flugente 760a1b16f1 Feature improvement:
- via StructureConstruct.xml and StructureDeconstruct.xml, one can now define which structures can be removed and created via items and the fortifications feature.

For more information, see http://www.ja-galaxy-forum.com/ubbthreads.php/topics/335557#Post335557

does not break savegame compatibility. Requires GameDir >= r2140.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7491 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-09-07 00:11:16 +00:00
Wanne fa29d9be26 Merged from revision: 7258
- Translated russian source code comments (by Sevenfm)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7259 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-06-03 18:13:23 +00:00
Flugente 6448b332ec Merged revision(s) 7251 from branches/ja2_source_official_2014:
code cleanup & removed some warnings

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7252 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-06-01 21:50:14 +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
Wanne cfed0ed8a1 Merged from revision: 6981
Enabled auto-taking for concertina/sandbags (by Sevenfm)
- items are taken from current merc's inventory
- works only in realtime
- when filling sandbags, filled sandbag is dropped, and new empty is taken from inventory
- you need to press [shift] while clicking with hammer for this feature to be activated

Autofire bullets (by Sevenfm)
Set default number of autofire bullets:
0 = Max bullets allowed with max aiming
1..10 = Set default number of bullets

1. For MPs and SMGs
SET_DEFAULT_AUTOFIRE_BULLETS_SMG = 1
2. For ARs, Rifles and Shotguns
SET_DEFAULT_AUTOFIRE_BULLETS_AR = 1
3. For MGs
SET_DEFAULT_AUTOFIRE_BULLETS_MG = 1

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6982 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-02-26 18:56:22 +00:00
Wanne d643847f42 Merged from revision: 6792
Fixes (by Buggler)
- draw NCTH cursor indicator after health bar indicator due to potential overlap (thanks to Sevenfm)
- removed IMPROVED_BOMB_PLANTING option, enabled by default
- removed AIMED_BURST_ALTERNATE_KEY option, enabled by default. Alternate Aiming Hotkey reassigned to ',' (comma) for increasing aim
- streamlined burst & auto mode right click aim mechanism

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6793 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-01-20 08:49:56 +00:00
silversurfer 8257d11276 -Fix for throwing explosives with attachments (by Sevenfm)
Weight is now considered correctly.

-Civilians now take care not to step on player placed tripwire. (by Sevenfm)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6585 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-11-12 11:46:45 +00:00
Flugente c85471ecd6 If USE_AIMED_BURST and AIMED_BURST_ALTERNATE_KEY are TRUE, we now use [o] intead of [Alt] + [t] to toggle aiming. This is for people who have no working mousewheel and thus couldn't aim with auto-only weapons.
This is necessary as [ALT] switches the mousewheel function between increasing aiming levels and adding more bullets.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6583 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-11-11 22:11:45 +00:00
Flugente 59646b9dcd - Fix: crash when switching to bayonet while aimed
- Fix: batteries were drained for inactive flashlights

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6067 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-05-06 23:35:17 +00:00
Flugente 1435e4a679 - Fix: applying canteens/camo/clothes on persons still cost them APs
- Fix: planting bombs was impossible

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5964 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-29 22:32:13 +00:00
Flugente 49932ef904 - new feature: items can be applied to other persons
- reduced cyanide drug effect to more reasonable values

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5962 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-03-27 22:06:26 +00:00
Flugente 3bb14a870b - Prisoner system can now be correctly turned off.
- improved handcuffing checks

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5712 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2012-12-04 00:57:19 +00:00