229 Commits
Author SHA1 Message Date
Asdow 1fc5f939bf Use new RandomGridNoUnloadedSector() for autoresolve
* Load required mapinfo for checking suitable gridnos
* Modify SOLDIERTYPE::DropSectorEquipment( ) to take an external gridno when placing items into an unloaded sector
2026-06-15 22:01:07 +03:00
Marco Antonio J. Costaandmajcosta b4176bb2d9 Fix/drag unconscious softlock
Same logic but cleaned up version of https://github.com/1dot13/source/pull/602 which Tais contributed with Claude Code's help

Most calls to SOLDIERTYPE::IsDragging() aren't supposed to have a side effect of cancelling a drag, being simple queries.
Changing the default to reflect that is right move.

Assisted-by: Claude:
2026-06-01 21:45:55 -03:00
Asdow 1a8db5d15b More conversions to SoldierID 2025-06-27 19:58:20 +03:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +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 74d752d452 More conversions to SoldierID 2024-11-17 18:15:36 +02:00
Asdow 2e147d4bd7 Convert to SoldierID 2024-11-17 16:35:26 +02:00
Asdow d28d46d974 SOLDIERTYPE::bOverrideMoveSpeed to SoldierID 2024-11-16 16:28:48 +02:00
Asdow 23af6b6f3f SoldierTakeDamage & SoldierTakeDelayedDamage to SoldierID 2024-11-16 00:47:14 +02:00
Asdow b112d39fe2 Convert SOLDIERTYPE::EVENT_SoldierGotHit to SoldierID 2024-11-16 00:34:19 +02:00
Asdow 419b0c794d SOLDIERTYPE::CreateSoldierCommon to SoldierID 2024-11-16 00:18:02 +02:00
Asdow 8ef7fb5ae4 Convert SOLDIERTYPE::usDragPersonID to SoldierID 2024-11-16 00:09:48 +02:00
Asdow 153d402065 Update Soldier Control.h 2024-11-15 23:58:28 +02:00
Asdow 75deccbc44 Convert SOLDIERTYPE::ubRobotRemoteHolderID to SoldierID 2024-11-15 23:56:26 +02:00
Asdow 566ead5815 Convert SOLDIERTYPE::ubTargetID to SoldierID 2024-11-15 23:46:15 +02:00
Asdow f823cb9718 Update Soldier Control.h 2024-11-15 23:32:13 +02:00
Asdow 5de6f77f2e Convert SOLDIERTYPE::ubOppNum to SoldierID 2024-11-15 23:26:22 +02:00
Asdow 8346d5bfa1 Convert SOLDIERTYPE->ubNextToPreviousAttackerID to SoldierID 2024-11-15 22:58:25 +02:00
Asdow 131172e41a Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID 2024-11-15 22:54:44 +02:00
Asdow ee429fd1f4 Convert SOLDIERTYPE->ubAttackerID to SoldierID 2024-11-15 22:51:48 +02:00
Asdow 9079f2e0c1 Whitespace changes to SOLDIERTYPE 2024-11-15 21:20:49 +02:00
Asdow ecb29ae9bc Convert SOLDIERTYPE->usChatPartnerID to SoldierID 2024-11-15 21:09:17 +02:00
Asdow aad6ed8297 Implemented SoldierID type to replace SOLDIERTYPE->ubID
Goal is to convert all use of SOLDIERTYPE->ubID and any other ID fields that reference the same ID to a safer type than UINT16. Same with any function that's supposed to take ubID
2024-11-13 01:29:36 +02:00
Asdow 5cf0ef4bde Correct variables from INT8 to INT16 2024-11-09 22:52:21 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +02:00
Marco Costaandmajcosta d670383f3a add const accessor to Inventory 2024-04-03 22:09:05 -03:00
kitty624 682dbaa8fc Alternative IMP Background Selection
- two new options in ja2options.ini
 ALTERNATIVE IMP CREATION
- adds new additional backgrounds, exclusive to this option
- which IMP backgrounds will be available at selection is determined by previously made choices for skills, character traits and disablities
- if a tag in background is contradicting to content of skill/character/disability, it won't be shown at selection
- what's considered contradicting is based on what's been found in code for conntent of skill/character/disability
- i.e. HeatIntolerant adds a penalty for desert and tropical sectors, so don't show backgrounds that add bonus for those sectortypes instead
- a new tag <alt_impcreation, has been added to backgrounds for this as well
- if that tag is found, it will be considered as additional IMP background exclusive to the option

REDUCED IMP CREATION
- same as above, but this time only the new additional backgrounds will be avaialable at selection
- same rules for possible restrictions to be shown

ALTERNATIVE IMP CREATION is required for REDUCED IMP CREATION to work

For ja2options.ini, a new category, "Backgrounds" was created.
This will contain the two new options and the general option to enable backgrounds

Accompanying changes in gamedir:

INIEditorJA2Options.xml
ja2options.ini
backgrounds.xml
2024-03-19 19:37:16 +01: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 a3be3ecd7e Specific drug types and drug items for background and facilities. (#226) 2023-10-02 19:30:59 +03:00
Andrzej FałkowskiandGitHub 7edecd6849 Fixed vehicle body not properly removed when destroyed during ramming (#210) 2023-08-28 16:26:46 +03:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
rftrdevandGitHub b5ec955324 Disable backpack climb check for non-player soldiers (#117) 2023-01-27 17:56:46 -08:00
CptMooreandGitHub 624c0f3bc4 Flashlight changes (#81)
* Flashlight changes:
- Fixed the lighted area being way too large in the diagonal directions.
- Added a minimum range to simulate a flashlight user not illuminating its feet.
- Added angle based calculations instead of the hardcoded one.

* Flashlight changes, MR feedback.
2023-01-18 20:52:12 +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
Sevenfm cdc605d5ab Press [\] to break window glass with crowbar or any two-handed weapon. Weapon can be damaged in the process.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9368 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-21 13:00:09 +00:00
rftr 75d98aecfd add "Disguise" menu to tactical skill menu (alt + rightclick)
add "Fill canteens" action to tactical skill menu, under "various" 

adapted from Seven's +AI

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9350 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-29 06:02:44 +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 6d14282538 NEW_SUPPRESSION_CODE:
- use effective experience level when calculating base suppression tolerance, so nearby squad leaders may raise effective level and help fight suppression
- if NEARBY_FRIENDLIES_AFFECT_TOLERANCE option is active, nearby friends can help increase suppression tolerance, up to +-3 points added depending on distance, only for merc bodytypes

CheckStatusNearbyFriendlies: minor code improvements, fixed variable names, use INT16 for calculation

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9182 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-15 08:44:57 +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
Flugente 8d112e5191 Added lua function for finding/creating/destroying items in a soldier's inventory
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9132 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-08 19:23:26 +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 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 d028282b39 Focus skill: no watched location interrupt bonus if focus is active.
Improved data initialization.
Smart tree top hiding: increased max distance to hide tree in vertical direction.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8950 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-03-05 07:01:51 +00:00
Sevenfm b157b47a34 GridNoSpotterCTHBonus: fixed bTeam type.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8949 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-03-04 21:00:28 +00:00
Sevenfm 4471b8ef97 Improved code to check if militia options are available.
Start radio animation when giving orders to militia.
FindClosestClimbPointAvailableToAI: don't check roaming range when searching climb spot for AI.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8939 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-17 15:01:57 +00:00
Sevenfm a0a6396eaa Stop cowering when merc starts to move.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8929 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-10 19:17:44 +00:00
Sevenfm 1256639fe5 AI_ACTION_STOP_MEDIC: also check START_AID, START_AID_PRN animations to prevent AI endless clock when first aid has just started and AI decides to move somewhere.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8923 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-30 23:22:59 +00:00