193 Commits
Author SHA1 Message Date
olafwqqandGitHub fd4b531d53 Fix GetAllForticationGridNo (#259)
It was still returning gridnos as 16-bit integers.
2024-01-02 11:53:29 +02:00
olafwqqandGitHub 4d09bea13e Address two compiler warnings (#258) 2024-01-01 22:43:31 +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
Andrzej FałkowskiandGitHub 1e1d456fd2 Prevent deadlocks due to self-healing interactive spots and self-attacking (#205) 2023-08-21 19:44:02 +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
Sevenfm 1015614473 Play different sound when object drops into water, depending on object weight and type.
Play S_WATER_IMPACT1 when bullet hits water.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9294 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-08 10:17:38 +00:00
Shadooow c7139a2569 using an item will now close EDB if opened, this fixed bug where attaching a 40mm grenade into laucher via EDB box and firing from it without closing it didn't substract AP for attaching the grenade
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9197 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-26 22:44:19 +00:00
Flugente 6cad680b02 We can now use interactive actions to alter decals on walls, so it is possible to simulate taking off an object from the scenery and add it as an item.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=363513&#msg_363513

Requires GameDir >= r2601

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9141 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-13 19:50:49 +00:00
Shadooow 67a3a5e488 allowed to throw grenades from behind corners without need to move into open field
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9134 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-09 01:13:27 +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
Flugente 6f24fb89fd Fix: dragging a structure repaired it and removed all decals
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9120 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-28 14:52:12 +00:00
Flugente 7a866c5f29 If a container is destroyed by gunfire or vehicle collision, don't destroy the contents, reveal them instead.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9087 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-18 18:43:24 +00:00
Shadooow 95f4db9758 fixed can with string executing take blood action when used from spot directly next to doors
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9055 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-26 22:51:57 +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 cf55e6ddf3 Fix: removes the usMapPos code from actions that can be used by AI + improves function FindAdjacentGridEx to handle monsters and find adjacent tile for any of the tile they occupy (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9026 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-15 05:18:12 +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 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
Sevenfm e738e4424d Improved code to spawn item and it's attachments when disarming bomb.
Update sight after item transformation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8909 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-23 13:15:31 +00:00
Flugente 8e4961f021 Fix: various compile warnings
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8872 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-24 19:27:34 +00:00
Flugente 0c4997f6ec Improved feature: structures can be dragged. Which ones is defined in a new xml.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=360672&#msg_360672

Requires GameDir >= r2558

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8870 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-23 22:11:23 +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 22cb49668f Added dialogue event for planting bombs/mines (ADE_BOMB_HAS_BEEN_PLANTED)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8793 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-26 20:02:10 +00:00
Sevenfm 9e1b5338a6 More AI logging information.
PanicAI: use correct movement and stealth mode when determining AP needed.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8768 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-03-08 22:39:21 +00:00
Sevenfm 26a1b0aa5a New option SHOW_BACKPACK_OWNER (TRUE by default): show backpack owner's name on the ground and in taking items interface.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8735 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-01-19 19:38:30 +00:00
Sevenfm cbc1b8c5e3 New background property: <animal_friend> will refuse to attack animals, unless attacked by that animal.
New background property: <civgroup_loyal> will refuse to attack neutral members of the same civilian group.
Fixed array bound in GetTileSetIndexVector().

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8731 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-01-15 20:27:00 +00:00
Sevenfm d02a4ddd7d Implemented some of the merc05's fixes (http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=24256):
- fix for stopping snitches from preventing misbehavior
- fix for stopping snitches reports
- improved code for refused handcuffing
- fixed item bug with items dropping from backpack after using transformation in turnbased mode
- improved code for dart ammotype effect
- removed assert in AddCharacterToAnySquad to prevent crash when selecting merc in vehicle and plotting travel route
- added EXPLOSV_CREATUREGAS effect in UpdateAniTiles()

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8720 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-12-22 06:22:23 +00:00
Flugente 4c0b3264c8 Fix: bombs cannot be planted diagonally
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8670 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-02-22 21:10:34 +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 50d7b679c1 Added safety checks
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8626 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-30 19:40:55 +00:00
Flugente 494dbc6e69 Store the profile type in the profile structure and remove superfluous code
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8620 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-24 19:36:28 +00:00
Flugente 5501e390de Fix: math functions on VS2010
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8532 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-03-02 22:47:54 +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 a9452840af Fix: gear templates: when creating a new ammo stack from non-fitting magazines, fill up the stack
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8518 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-01-22 21:37:51 +00:00
Flugente e1f1437a95 Fix: some mercenaries can't refuel vehicles
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8451 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-15 13:48:02 +00:00
Flugente 874a006d06 Gear templates: multiple ammo item choices are possible via wildcards, but if item is a match, use ammo specified there
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8449 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-15 12:20:27 +00:00
Flugente 8e6cff9b5d Gear templates: An entry with '0' and a valid ammo item will try to fit that ammo to any gun used in the slot
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-12 12:45:33 +00:00
Flugente faf2d272bc Loading a gear template also fills up canteens if the sector has drinkable water
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8441 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-06 22:56:30 +00:00
Flugente f7423782db New Feature: gear templates allow us to save and load a merc's equipment, thereby speeding up the equipment process.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23462&goto=350497&#msg_350497

Requires GameDir >= r2384

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8440 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-06 21:06:49 +00:00
Flugente 8a82802932 - Fix: crash when handling flashing items
- Fix: bad argument

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8433 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-07-26 13:57:29 +00:00
Flugente 7163e98b6e Mercs won't attack teammates or neutrals (profile-based) if their opinion of them is > 20. For good guys, that value is -20.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8365 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-01-14 22:22:30 +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
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
Flugente e38e37d99c When buying soda from a machine, check inventory for cash first
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8313 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-10-13 18:22:47 +00:00
Flugente c32bf09bbb New feature: bear traps are mechanical traps that function like bombs, cause no explosion, can be reused, deal significant damage to legs and pin down the target.
GameDir >= r2338 is recommended.

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

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8287 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-12 20:48:34 +00:00
Flugente d000e8c1a3 Fix: invalid access to inventory
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8286 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-12 17:51:21 +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
Flugente 1565a9f67c 'Improve Gear'-function now also merges magazines and fills up ammo stacks
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8221 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-17 21:37:42 +00:00