Commit Graph
150 Commits
Author SHA1 Message Date
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 1a8db5d15b More conversions to SoldierID 2025-06-27 19:58:20 +03:00
Asdow bfb724eab9 Use SoldierID 2024-12-01 18:23:52 +02:00
Asdow 0d97e36c34 Use SoldierID 2024-11-21 23:56:44 +02:00
Asdow 99703fa8b6 Use SoldierID 2024-11-20 21:52:28 +02:00
Asdow 274be524e6 More functions converted to SoldierID 2024-11-17 16:25:12 +02:00
Asdow 34f0b40f93 Convert functions and globals to SoldierID 2024-11-17 14:53:52 +02:00
Asdow f58cf588a6 Mark TacticalStatusType::sSlideReason as _UNUSED
Removed from function call parameters at the same time.
It was supplied to SlideTo, SlideToLocation and SoldierLocationRelativeToScreen but was never used.
2024-11-17 14:20:37 +02:00
Asdow f0be44bb42 Convert to SoldierID
TacticalStatusType::ubEnemySightingOnTheirTurnEnemyID
TacticalStatusType::ubEnemySightingOnTheirTurnPlayerID
TacticalTeamType::ubLastMercToRadio
2024-11-17 10:23:01 +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 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
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
rftrdev feaf9827c9 Set up ASSIGNMENT_REBELCOMMAND
Hook up Start Mission button
2022-10-13 11:31:48 -07: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
Sevenfm f51c1b1e8d CalcEffVolume: removed bCheckTerrain as it's not used in the code.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9299 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-13 10:23:53 +00:00
Sevenfm e887f85a44 ProcessNoise: fixed incorrect noise terrain check.
Reverted r9259.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9274 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-25 04:15:39 +00:00
Sevenfm 94b7d5611d Improved door noise sound playing: only play sound if merc opening/closing door is visible on screen or if player team hears noise from door.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9259 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-16 13:33:11 +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 960bb2d4ba New feature (by rftr): Mini events are a feature where the player can receive short text blurbs, and pick one of two outcomes.
Based on game implementations like Gloomhaven (road/city events) or Battletech (travel events).

For more info, see https://thepit.ja-galaxy-forum.com/index.php?t=msg&th=24865&goto=363481&#msg_363481

Requires GameDir >= r2599

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9137 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-09 19:38:55 +00:00
Shadooow e0e45b83cd Significant overhaul on handling doors regarding to noise:
- significantly increased base noise volume of opening or closing doors
- adjusted the noise volume based on type of the door (metal louder etc.)
- can with string adds +4 points to the noise volume and disallows to use stealth to prevent any noise
- removed the code for movement noise from door handling and replaced it with simpler stealth check
- noise will now come from GridNo of doors, not soldier opening them
- disabled terrain check when the noise comes from doors
- fixed doors always playing sound of closing even when there was no noise (stealth mode)
- whether game plays sounds of opening/closing doors will now be based on whether any of player mercs heard it or not
- game will now show doors being opened/closed if any of our mercs heard it
- disabled the message for player about soldiers hearing noise from doors being opened/closed (no point imo when player can hear it)
- added locator ping when someone opens doors with can with string attached on them

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9056 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-27 23:32:50 +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 b45af3f575 FindNearestUngassedLand, FindNearbyDarkerSpot:
- optimization: don't check spots already checked in previous loop
- increase max distance to 35, reduce to 25 if complex AI not allowed, reduce to 15 in realtime
CanDragPerson: use world movement cost instead of LOS check.
Say TAUNT_RELOAD, TAUNT_OUT_OF_AMMO taunts if mag size > 4 or Chance (CHANCE_SAY_ANNOYING_PHRASE).
SpotDangerLevel: also check Water and CorpseWarning for danger level = 1.
ManSeesMan: only call SetNewSituation if location or level are different to reduce frequency of AI re-evaluation.
Only allow radio animation on initial red alert, if sector is not jammed.
Press ESC to stop dragging.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8904 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-17 06:30:23 +00:00
Sevenfm 32b6ffe70f Improved watched location AI code:
- check that we can see enemy if we raise weapon when considering using noise spot as watched location
- prefer hiding first when in dangerous place if hiding is possible

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8790 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-20 22:14:45 +00:00
Sevenfm 3fe13b9161 Increment watched location when soldier hears enemy and can possibly see noise location.
Suppression:
- when calculating suppression effectiveness for shotgun, modify damage for pellets.
- set attacker spot as watched location
- alert enemy soldier if he is under fire

Red AI:
- no Main Red AI for civilians
- set watched location to closest position where enemy can appear
- snipers and soldiers with scoped guns should decide watch more often

Improved Red AI watch code:
- crouch if not crouched
- raise weapon if not raised
- turn to watched location
- possibly go prone, if soldier has LOS to watched location

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8789 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-20 20:10:30 +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 8b53d273f9 New tags in CivGroupNames.xml: Side, CustomSide allow setting custom side for civilian group.
NewEye: fix possible bug.
InitShopKeeperSubTitledText: correctly initialize data.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8764 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-27 10:51:45 +00:00
Sevenfm 73cbc27ea4 Play sound when dragging something (Sounds\Misc\DragBody1.ogg .. DragBodyN.ogg).
Mercs always make movement noise when dragging.
Stop dragging if another merc starts dragging this merc/body.
Stop dragging if dragged merc gets up from collapsed state.
Stop dragging when changing stance/cowering under suppression.
Fixed grenade pin sound for signal smoke.
CalcBestShot: if new opponent is dying and best opponent is ok, ignore new opponent.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8759 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-20 12:28:55 +00:00
Sevenfm 74443ca8a9 New option TAUNT_VOICE (FALSE by default): if true, will play sound file instead of showing text.
New option TAUNT_VOICE_SHOW_INFO (FALSE by default): if true, will show debug info when playing voice taunt.
Restored JA2TESTVERSION for SpreadPatternLog.txt
Allow taunts from militia when using voice taunts.
Don't show noise text messages from militia (if on our side).
Fixed incorrect OKLIFE check in CheckStatusNearbyFriendlies().

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8743 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-07 10:13:16 +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
Sevenfm e1657cefb7 Improved movement noise calculation.
Fixed max array size bugs.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8698 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-10-22 20:45:43 +00:00
silversurfer 037e877013 Fix (by Asdow): Enemy cover display performance improved.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8685 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-08-11 07:49:47 +00:00
silversurfer 3723ebfa43 Fix (by Sevenfm) - noise volume was capped so less important noises could be stored in the AI noise memory
New feature - mercs can now also open doors from the side instead of the front

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8630 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-10-30 14:16:51 +00:00
silversurfer 54d5bb0317 fix (by Sevenfm): some functions ignored the last member of a team
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8629 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-10-16 11:59:54 +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 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 e205697804 Fix: possible underflow in UB code
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8605 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-08-28 20:44:16 +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
TheBob b60a94afc5 Added: Ctrl+Shift+E now fill LBE items in sector with other items and places them in vehicles first.
Added: Right-Click on remove attachments button on sector inventory screen will not empty LBE items in sector
Changed: SLAY_STAYS_FOREVER disables Slay's hourly chance to leave when unattended
Added: SLAY_HOURLY_CHANCE_TO_LEAVE setting to Ja2_Options.ini
Fixed: a bunch of array index out of bounds bugs
Fixed: a bunch of typos in if contitions
Fixed: BuildListFile() function loading items from index 1 instead 0
Added translation: Polish text for some map inventory screen items
Added translation: English texts for new functionality for other language files
Cleaned up some old TODOs

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8404 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-05-19 13:40:34 +00:00
Sevenfm 762fb79c09 CalcEffVolume fix: sleeping state check
Attacks fix: 100 AP system for HitRate calculation
EstimatePath fix: ignore person at destination if we are estimating path cost
FindFlankingSpot: use full search range

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8265 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-07-03 09:53:56 +00:00
Sevenfm f8d9a538cd Taunts update:
- TAUNT_INFORM_ABOUT (check that this opponent is really new)
- TAUNT_ALERT (say taunt only when red alert raised, if it's no initial alert, use TAUNT_INFORM_ABOUT instead)
- TAUNT_SUSPICIOUS (only when yellow alert is raised)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8262 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-25 10:41:13 +00:00
Flugente 503523a9fa New feature: localized weather adds more weather types, different weather can happen in different sectors at the same time.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23094&#msg_345949

Requires GameDir >= r2325

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8253 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-18 20:57:03 +00:00
silversurfer 196a1eb84d AI and tactics improvements (by Sevenfm):
New options:
 AI_YELLOW_FLANKING - yellow flanking is disabled by default
 IMPROVED_TACTICAL_UI - use name color to show soldier's status (disguised, drunk)

Removed obsolete options:
 SHOW_COVER_INDICATOR
 SHOW_ENEMY_RANK_ICON
 SHOW_ENEMY_AWARENESS

Fixes and improvements:
 - collapsed enemies should not taunt
 - if soldier is unconscious, he can't see anything or anybody
 - ClosestReachableDisturbance - performance improvement
 - allow InternalGoAsFarAsPossibleTowards to jump over fences

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8226 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-20 18:25:33 +00:00
Flugente d0dc6c3230 - Tweaked tunnel vision penalty calculation
- If both body items and weapon have tunnel vision penalties, use their maximum, not their sum

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8134 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-04-03 16:53:17 +00:00