Commit Graph
1086 Commits
Author SHA1 Message Date
Asdow 7546a23d0d Allow custom music to be added
Additional music can be added by placing sound files into Dataa/Music folder following this naming convention

musicmode_runningNumber.fileformat, so for example:

Mainmenu_001.mp3
Mainmenu_002.ogg
Laptop_002.ogg
Tactical_003.wav

*****************************************************************
Different musicmodes are

Mainmenu_ 		<-- Mainmenu music
Laptop_ 		<-- Laptop music
Tactical_		<-- Tactical with nothing special going on
Enemy_			<-- Tactical, enemy present
Battle_			<-- Tactical, enemy present and visible
Victory_		<-- Tactical, battle victory
Death_			<-- Tactical, battle defeat
Creepy_			<-- Tactical, creatures present
CreepyBattle_	<-- Tactical, creatures present and visible

Music files can be .mp3, .ogg or .wav formats and 100 songs in each category is supported.
The running numbering starts from 000

*****************************************************************
A few filenames are treated in a special way to facilitate easy replacement of original music.
To replace original music, insert the following named files into this folder

"menumix1"			<-- Mainmenu music
"marimbad 2"		<-- Laptop music
"nothing A"			<-- Tactical with nothing special going on
"nothing B"
"nothing C"
"nothing D"
"tensor A"			<-- Tactical, enemy present
"tensor B"
"tensor C"
"triumph"
"death"
"battle A"			<-- Tactical, enemy present and visible
"tensor B"			<-- This file is also used as battle music
"creepy"			<-- Tactical, creatures present
"creature battle"	<-- Tactical, creatures present and visible
2024-01-27 14:29:51 +02:00
AsdowandGitHub c7bd75b60d Merc arrival location fix (#263)
* User center insertion point for merc arrival

instead of initial arrival gridno that is meant only for the very first helidrop arrival at the start of a game.

* Prevent possible nullptr dereference
2024-01-24 00:35:39 +02:00
AsdowandGitHub 57bf3d9fa7 Call RemovePlayerFromGroup instead of RemoveGroup (#260)
There was a bug in a provided save where a merc's group had persistent flag set, even though the assignment was DRILL_MILITIA, which should never have a persistent group. When the code was calling RemoveGroup instead of RemovePlayerFromGroup at this point, it would crash the game with an assertion error in CancelEmptyPersistentGroupMovement() as the group in fact was not empty! Now we're removing the merc first and then checking if the group is empty and if so, attempt to delete it.
2024-01-03 00:39:44 +02:00
Asdow 4b1de56b01 Remove #ifdefs for USE_VFS 2023-10-08 16:45:06 +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
Andrzej FałkowskiandGitHub a3be3ecd7e Specific drug types and drug items for background and facilities. (#226) 2023-10-02 19:30:59 +03:00
rftrdevandGitHub 28aa73a859 Clamp coolness to valid values when generating ARC ammo cache (#220)
Fixes #217
2023-09-02 23:01:17 -07:00
Andrzej FałkowskiandGitHub d56288e313 Fixed incorrect vehicle group id after reloading the game and vehicle movement plot issues. (#207) 2023-08-28 16:26:34 +03:00
Andrzej FałkowskiandGitHub 3ddacf1a44 Fix vehicles consuming fuel after instant movement cancel (#213) 2023-08-28 16:26:02 +03:00
Andrzej FałkowskiandGitHub 2060022e94 Battle Panel Multi Resolution (#203)
* Battle panel interface with support for multiple resolutions and scrollable list

* Support for localized versions of battle panel

* Removed commented out code

* Fixed wrong copypasta in German version
2023-08-20 20:52:34 +03:00
rftrdevandGitHub aaeea9aac8 Replace evolution with growth rates (#201) 2023-08-09 18:36:44 -07:00
AsdowandGitHub 52ccc7cc3c Fix widescreen UI militia popup box y-coordinate (#196) 2023-08-04 13:45:54 +03:00
rftrdevandGitHub 1150fb5352 Update simultaneous combat check for group arrivals (#176)
The previous check didn't take group team into account, so it was possible for a simultaneous battle to be triggered by an enemy group moving into a friendly sector
2023-07-11 22:26:31 -07:00
rftrdevandGitHub 66ba2c8fbc Fix forged group not actually spawning (#173) 2023-07-04 23:18:34 -07:00
rftrdevandGitHub fb03cba2fa New feature: transport groups (#172)
https://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=365395
2023-07-04 20:58:56 -07:00
AsdowandGitHub 2571979f8a Fix message box text drawing in 720p when map inventory is up (#168)
Old 720p resolution had character inventory drawn over the message box so messages were hidden when inventory is up. New widescreen UI is similar to all the other higher resolutions where this is not the case anymore.
2023-06-12 14:47:24 +03:00
NorthFuryandmajcosta 456cfa18cf added option to scale tooltip rendering 2023-05-27 21:52:35 -03:00
Marco Antonio Jaguaribe Costaandmajcosta 760f8ab3d7 Remove all MSBuild files
now that CI is using cmake, we can be clean up the tree quite a bit

btw, cmake can still configure for the msbuild generator for those so inclined:

create the folder, cmd to it, run `cmake [project_root_dir] -G"Visual Studio 17 2022" -A Win32 -DLanguages=ENGLISH -DApplications=JA2` once, then open the solution file using Visual Studio 2022
2023-05-08 06:44:35 -03:00
rftrdevandGitHub ff360153c7 Redraw inventory panel when changing selected merc in strategic view (#127) 2023-02-21 23:22:30 -08:00
AsdowandGitHub e1f7fa7bfb Fix button glitches in widescreen UI (#125)
In widescreen strategic UI, team panel sort buttons would be hidden when transferring items to and fro merc inventory via CTRL + left click
Exit inventory panel button should always be disabled in widescreen UI
2023-02-15 16:36:57 +02: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
AsdowandGitHub a252a42ec7 Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven) (#103)
* Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven)

We would fail Assert(fSuccess) as all passengers would not fit in one squad, and the code wouldn't allow creating a new squad where they could be placed.

* Add missing if conditional to previous fix
My bad
2023-01-20 16:54:58 +02:00
AsdowandGitHub f0d0ba7307 Revert "Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven) (#101)" (#102)
This reverts commit 46c4ac2b64.
2023-01-20 16:48:27 +02:00
AsdowandGitHub 46c4ac2b64 Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven) (#101)
We would fail Assert(fSuccess) as all passengers would not fit in one squad, and the code wouldn't allow creating a new squad where they could be placed.
2023-01-20 16:24:18 +02: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
Marco Antonio Jaguaribe Costa 8609944467 Add a CMake build
Tried to stay as close as possible to ja2_2019.sln

On Visual Studio 2022 just Project -> CMake Settings for Ja2, add
the x86 configurations you want and press F7.

Below shows how the -DLanguages -DApplications switches work, If you don't
set them, the CMakeCache.txt of them will be set to ENGLISH and JA2,
respectively:

cmake [...] // nothing set, configure just JA2_ENGLISH.exe by default
cmake [...] -DApplications="JA2UB" // configures just Unfinished Business
cmake [...] build -DApplications="JA2UB;JA2UBMAPEDITOR" // Unfinished Business and UB Map Editor
cmake [...] build -DApplications="JA2UB;JA2MAPEDITOR;ALL" // ALL is in the list, configures every application
cmake [...] build -DApplications="JA2MAPEDITOR;DeathStranding" // fatal error: DeathStranding not an application

cmake [...] -DLanguages="GERMAN" // configures just German targets
cmake [...] build -DLanguages="GERMAN;ENGLISH" // German and English
cmake [...] build -DLanguages="GERMAN;ENGLISH;ALL" // ALL is in the list, configures every language
cmake [...] build -DLanguages="ENGLISH;ESPERANTO" // fatal error: ESPERANTO not supported
2023-01-14 02:08:39 -03:00
majcostaandGitHub be4f1b5e1c remove std:binary_function inheritance from comparator (#65)
deprecated since C++11, removed in C++17
2023-01-06 22:49:27 +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
AsdowandGitHub 1f567d9602 Fix CTD when displaying long names in map inventory (#52) 2022-12-25 16:01:01 +02:00
AsdowandGitHub 8f22d13fd9 Cache result of evaluating strategicmap.lua (#32) 2022-11-23 21:59:27 +02:00
rftrdev f6241feb34 Properly reduce ASD resources 2022-11-04 23:15:30 -07:00
rftrdev 76a5fa1731 Remove #pragma optimize 2022-11-04 22:55:38 -07:00
rftrdev 7c6f7d6d09 Revert "Undo unrelated Chinese text changes"
This reverts commit 75332ea219.
2022-11-04 22:42:09 -07:00
rftrdev 75332ea219 Undo unrelated Chinese text changes 2022-11-04 22:39:33 -07:00
rftrdev a554f0de17 Remove #pragma optimize 2022-11-04 22:32:23 -07:00
rftrdev 568ee070a8 Disrupt ASD now blocks upgrades 2022-11-03 00:08:03 -07:00
rftrdev 32d565eb99 Change new mission screenmsg to green 2022-11-01 01:08:17 -07:00
rftrdev 70c7c0bf96 Fix bad screen message
Stop time compression when notifying player about missions
2022-10-31 17:40:27 -07:00
rftrdev 94b846e021 Simplify merc returning from mission prep 2022-10-29 01:27:53 -07:00
rftrdev c56946f9ba Remove todo 2022-10-29 00:10:56 -07:00
rftrdev 22404480ff Fix mission randomisation 2022-10-29 00:10:13 -07:00
rftrdev 62861ab38e Add notification when new missions are available 2022-10-28 00:56:35 -07:00
rftrdev 7ad938a397 Remove debug line 2022-10-27 00:29:29 -07:00
rftrdev f89f25ab92 Split in-town and loyalty mission prep checks 2022-10-27 00:26:00 -07:00
rftrdev 02d6e48226 Use prep time setting in text
Remove debug prep time
2022-10-26 20:48:15 -07:00
rftrdev 54b0bf96b9 Ensure missions can only be started in towns that use loyalty 2022-10-26 00:18:30 -07:00
rftrdev 7d360d01ce Add mission prep time setting 2022-10-25 22:55:19 -07:00
rftrdev c1b5d1719a Add "Send Supplies" mission 2022-10-25 17:28:41 -07:00
rftrdev a35d741403 Add "Disrupt ASD" mission 2022-10-25 09:13:51 -07:00