* Externalize the Divisor for usBackPackWeight
A new ini value BACKPACK_WEIGHT_FACTOR is introduced to replace the hard coded 50.
The value goes from 1 to 250 and its default value is 50 as before.
* Refactor usBPPenalty into its own function GetBackbackAPPenaltyFromBackpack
The same code is also used in GetAPsCrouch as well as GetAPsProne
The intent of the change is to make sure that backpacks including their content
do not add an additional AP cost of +1. Now it checks if
the backpack weight is > ubBackPackWeightFactorForAPPenalty (default value 50).
The min exists to make sure that the AP cost does not become higher than previously.
Previously the bool fBackpackCheck was used to add +1 if there is any backpack.
But this also includes an empty tactical sling (backpack with 0.2 kg) and
therefore makes the item much less interesting to use.
- food items are usualy not shown in game without using Food
- option ALWAYS_FOOD allows them to be shown even without
- default is false, no food items without Food
but at the end, not beginning as to not make a mess
along with an intro.lua change in gamedir/Data-UB/Scripts this gets rid of a nasty preprocessor conditional in a header file
the Ja2.rc file needs to be in the add_executable target for the icon
to appear, and that one requires WinMain.
so get rid of dummy.cpp and put sgp/sgp.cpp in there
Language is now just built once per app (still some JA2UB conditionals
going on in there) but building everything should now take eight times
less work
This one is big, but unless I missed something, should be all be
trivial.
scripted-diff with the following, then manually tweaked whatever needed:
```
if [ $# -ne 3 ]; then
echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
exit 1
fi
pattern="$1"
replacement="$2"
filename="$3"
if [ ! -f "$filename" ]; then
echo "Error: File $filename does not exist."
exit 1
fi
sed -i '/'"$pattern"'/ {
:loop
$ !{
N
/'"$pattern"'.*\n.*#endif/ {
s/'"$pattern"'/'"$replacement"'/
s/#else/} else {/
s/#endif/}/
P
D
}
/'"$pattern"'/ b loop
}
}' "$filename"
echo "Replacement complete in $filename"
```
h/t to Grok2 for the sed command
iniErrorReport is a log file, all other log files have .log extension, so make it
consistent with that
make Ja2_settings.ini's extension lowercase. OCD, sorry.
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.
the script:
```
find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
isFile=$(file -0 "$file" | cut -d $'\0' -f2)
case "$isFile" in
(*text*)
echo "$file is text"
if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
echo "" >> "$file"
fi
;;
(*)
echo "file isn't text"
;;
esac
done
```
Removed from function call parameters at the same time.
It was supplied to SlideTo, SlideToLocation and SoldierLocationRelativeToScreen but was never used.
The more detailed error message that used to go only to Livelog.txt is now also displayed in the ingame error screen, providing more helpful error message to players when making bug reports/asking for help
- 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
* 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
* Move main executable files to their own directory
* Adapt the build to the new file structure
... and fix some weird #include's that were relying on the project root
being an include directory.