Commit Graph
244 Commits
Author SHA1 Message Date
rftrdevandGitHub b5ec955324 Disable backpack climb check for non-player soldiers (#117) 2023-01-27 17:56:46 -08:00
AsdowandGitHub ae1fd0a2ee Prisoner feature bugfix (#110)
* Allow game to continue after offering to surrender to enemies

* Fix issues related to surrender and POW quests

- Quests were ended prematurely if one had prisoners in both alma and tixa
- Strategic status flags for rescue/escape were not set properly
- Only the maximum amount a prison can hold will be taken as POWs, rest of the mercs will either escape or have to fight to the death, to prevent a player having unrescuable POWs
- Capturing a mercenary had a lot of functions called that should not have been, IF the merc is not going to be captured after all

* Switch all tactical surrender calls to use one unified function

* Only mercs that are capable can escape

Incapacitated mercs left behind will die.
Should probably prioritize incapacitated mercs to be captured by the enemy to prevent needless deaths

* Combine pow quest state changes into one function

* Add JumpIntoEscapedSector to header file

* Allow enemy to demand surrender even if they already have POWs in Tixa and Alma

* Remove surrender from UB

* Address review feedback
2023-01-22 23:35: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
Asdow 6dbbfa227a Change shift + B to also pick up back packs in tactical
Instead of always dropping backpacks, it will now either pick up or drop backpacks depending on if any have been dropped
2022-11-10 18:40:00 +02: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
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
Sevenfm 0782dec389 ESC: unready weapon for all selected mercs.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9357 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-04-02 15:28:41 +00:00
Sevenfm 9acaa41e95 Added Autobandage option to Skill Menu.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9344 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-25 10:50:18 +00:00
Shadooow 06599477a0 changed ctrl + shift + T to be gated behind cheat activation, and it is now labelled "Auto save # cheat"
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9314 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-01 23:14:09 +00:00
Sevenfm 81f493aa5a Quick keys Alt + 0..9 and Alt + [~] now work consistently in normal and cheat mode.
Moved Alt + 1..5 cheat hotkeys to Ctrl + Alt + 1..5

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9309 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-20 13:42:59 +00:00
Shadooow a8fec72f2e ALT+g cheat changed from "semi-random" merc to merc of your choosing.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9308 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-19 14:13:00 +00:00
Sevenfm aa5e2dc4c3 PlaceObject: don't show incompatible face item message when doing autoplacement.
SwapGoggles: swap face item to helmet if possible.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9301 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-15 12:03:54 +00:00
Sevenfm 878447af9f Improved code for flashlight/stock transformation hotkeys.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9300 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-13 16:55:39 +00:00
Sevenfm 8d655ceb96 Shift+T: allow transformation into item with the same item size (for example, shovel mode transformation).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9298 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-13 07:22:12 +00:00
Sevenfm 04d14f436f New hotkey Shift+P - transform stock.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9297 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-13 06:56:23 +00:00
Sevenfm 3a9d6d65e4 Shift+T: only allow item transformation if item is corpse or resulting item is of the same item class, also check it's not transformation into same item.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9296 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-11 11:22:33 +00:00
Shadooow 6ca75431ae Disallowed to pick up items from openable structures like crates if they are currently closed. This additionally fixes bug where Bobby Ray's delivery wouldn't show up if the player had sector of the delivery currently loaded and there were any unpicked items from previous delivery in the delivery crate.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9285 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-31 03:39:50 +00:00
Sevenfm c972655886 ESC key:
- close active skill sub-menu
- stop moving merc
- stop moving group of mercs
- stop dragging
- unready weapon

Changed hotkeys:
- [A]: activate skills menu.
- [Alt]+[A]: start autobandage
- [Q]: change scope mode
- [Ctrl]+[Q]: change grenade launcher angle

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9260 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-16 13:59:59 +00:00
Sevenfm 27c0d1f8fe With ALTERNATE_MOUSE_COMMANDS = TRUE, mouse wheel allows to change active interface level.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9224 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-12-31 20:46:44 +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
Shadooow f0f558f872 fixed collapsed soldiers sometimes not being able to get up when they should have until next player round
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9200 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-28 09:36:58 +00:00
Shadooow 20335041f7 fixed autobandaging showing up during conversation which caused numerous issues
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9169 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-09-24 02:10:48 +00:00
Flugente af12b8210c Fix: opening options during Meanwhile leaves the game inoperable
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9148 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-31 14:21:27 +00: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 814bce8b56 small fix for code that is actually unused, but no harm fixing it if ever added
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9129 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-06 20:33:08 +00:00
Shadooow d6f07a7ef5 godmode reworked: reused existing mechanism in code = same functionality, less code changes, also when enabled GOD MODE text will now show up in left corner in red color, this was already there I just uncommented it
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9128 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-06 19:06:23 +00:00
Shadooow 16057eaae5 fixed endless clock issue persisting after using quickload
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9122 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-07-01 13:41:13 +00:00
Shadooow 4725ce55f1 fixed cheat command CTRL+U not refilling vehicle fuel correctly
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9121 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-30 07:16:09 +00:00
Shadooow da940db97c god mode cheat code tweaks + preventing ability damage
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9098 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-22 00:20:12 +00:00
Shadooow bdbe1ffe65 new cheat command CTRL+SHIFT+g = god mode (invulnerability) requested by Parkan, works in both tactical and strategic
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9097 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-06-21 21:15:17 +00:00
Shadooow d29b1f6467 fix: disabled inventory in meanwhile scenes
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9048 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-25 18:08:46 +00:00
Shadooow a5d13a6ebe fix for AP cost sometimes not recalculating when changing modes via right click
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9032 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-18 21:04:25 +00:00
Sevenfm 638f6d2786 New cheat command ALT+6 to turn selected soldier into bloodcat (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9028 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-05-16 18:36:00 +00:00
Sevenfm 5400775c82 Fix for randomly shooting in wrong direction because the game activates spreading code by mistake (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8992 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-30 19:16:52 +00:00
Sevenfm 23ce4caf26 Fix: CTRL+U cheat command not replenishing energy properly (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8968 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-24 12:42:53 +00:00
Sevenfm df3d71f07c Fix: erase path after switching active merc with mouse wheel (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8965 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-22 06:37:17 +00:00
Sevenfm 73070b004b Fix: path not being erased and recalculated when changing selected soldier via SPACE button (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8964 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-22 06:14:00 +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 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 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 bc3b398b63 Use MAXITEMS + 1 max limit when checking transformations.
UpdateAttachmentTooltips: 
- separate items, launchables and attachments checks as they have different max limits
- improved searching of existing item in vector

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-31 13:48:21 +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 4344c2caf8 Suppression:
- disabled ubAdjacentSoldierCnt check as it doesn't work correctly
- improved adjacent tile check to avoid out of bounds values

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8891 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-20 04:24:44 +00:00
Sevenfm 6b706f2747 Increased max possible soldiers stored for friendly fire check to 256.
Friendly fire chance code also checks for soldiers of the same side and optionally neutral civilians.
CalcCoverValue: check friendly fire chance for each position, penalize position if friendly fire chance is high (needs AI_BETTER_COVER = TRUE)

UnderFire::Add: 
- store friendly fire CTH for new added person
- use max value when replacing friendly fire CTH for existing person

CalcBestShot:
- check CTGT and friendly fire chance for every stance
- ignore possible shot if can hit friends in this stance

CalcMoraleNew: improved code to make enemy slightly more aggressive.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8873 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-31 10:26:07 +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
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
Sevenfm 3eb699c45f Walkman: bonus 20% to morale when in head slot.
Update soldier morale every turn.
Update soldier morale when changing inventory.
Improved code for 'l' hotkey.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8783 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-10 21:20:05 +00:00
Sevenfm 5b1ea7e795 Hotkeys for quick transformations:
Shift+T - transform item in hand (improved code)
Shift+O - transform scope
Shift+L - transform flashlight
Shifr+Y - transform laser

Fixed some warnings.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8779 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-03 05:14:47 +00:00