129 Commits
Author SHA1 Message Date
KittyandGitHub 9ff8476c15 Fixes to npc-actions Pacos
Fixes to npc-actions Pacos
2025-08-07 23:33:35 +02:00
kitty624 6a9df9f22c Fixes to npc-actions Pacos 2025-08-07 23:30:09 +02:00
Asdow c3a34a660d Check squads are on the same level 2025-08-07 22:02:49 +03:00
Asdow 1074e9c408 Fix save game compability for MERCPROFILESTRUCT 2025-08-07 21:34:54 +03:00
KittyandGitHub 4537f5d4dc IniOption Food items can show without using Food (#475)
IniOption: Food items can show without using Food

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
2025-08-03 08:23:34 +02:00
kitty624 4ae331c19e IniOption Food items can show without using Food
- 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
2025-08-03 08:12:48 +02:00
KittyandGitHub b85380c958 Reverting Commit 9122d7a (#474) from kitty624
Reverting Commit 9122d7a

 it made: CAN_FAN_THE_HAMMER = FALSE now disables the burst mode on pistols

 which effectivly resulted in pistols burst mode only being avaialbale with can fan the hammer active

 which further resulted in being required to fire from hip mode when using burst with pistols

 that's not a desired behaviour for burst on pistols, their burst should not depend on fan the hammer

 therefore reverted
2025-08-01 21:10:57 +02:00
kitty624 eb3f62c3d5 Reverting Commit 9122d7a
it made: CAN_FAN_THE_HAMMER = FALSE now disables the burst mode on pistols
which effectivly resulted in pistols burst mode only being avaialbale with can fan the hammer active
which further resulted in being required to fire from hip mode when using burst with pistols
that's not a desired behaviour for burst on pistols, their burst should not depend on fan the hammer
therefore reverted
2025-08-01 20:52:22 +02:00
CptMoore 8644e5f8b9 Update build.yml 2025-07-25 10:25:46 +02:00
Asdow 872a356e82 Correct column size check 2025-07-23 15:11:03 +03:00
AsdowandGitHub 7bb7c54317 Guard against integer underflow (#462) 2025-07-20 17:30:22 -07:00
Asdow 49a56d01ac Load correct militia icons for 720p resolution 2025-07-08 20:21:54 +03:00
Asdow 09ce332721 Allow 10 size squads for 720p resolution in UB 2025-06-27 16:00:10 +03:00
Asdow 5e2c61ef12 Externalized UB bloodcat quest sector 2025-06-25 22:54:53 +03:00
Asdow 4d948fda06 Fix powergen fan stopping in UB
Sector Y & Z coordinates were mixed up in code, which would then always fail the check for correct sector.
2025-06-24 22:54:44 +03:00
Asdow 2ae110971b spelling fixes 2025-06-24 22:54:44 +03:00
Asdow 9a78e7dfa0 Formatting changes 2025-06-24 22:54:44 +03:00
Asdow d95bae2bf6 Re-enable power generator fan sound effect for UB 2025-06-24 22:54:44 +03:00
Asdow a1bb85ca95 Externalize fan exitgrid location in the source sector 2025-06-24 22:54:44 +03:00
Asdow d9391de58a Fix laptop crush popup text
Due to additional dialogue flag having the value 8, and UB not having a specific flag for mercs standing up after heli crash, the FindSoldierByProfileID would always find Steroid if he was on the team, and then display the crunched laptop popup text.

Adding a new flag that is checked before we go into that branch in HandleDialogue fixes the issue.
2025-06-22 12:43:33 +03:00
Asdow c02bbc90cb Fix helicopter for UB
No need to force an assert error here. We can simply ignore the meanwhile scene just like all the others.
2025-06-18 22:58:17 +03:00
Asdow efb54202ea Fix Mercprofile usStrategicInsertionData for bigmaps
NPCs would not appear in the map if their gridno was over 65535 in large maps
2025-06-15 14:42:34 +03:00
zwwoooooandmajcosta 11caa6529c Fix the issue of garbled UTF-8 text in the szTileSetDisplayName field of the StructureMove.xml file in the game's "Drag" menu.(Method provided by @Learner) 2025-05-10 14:28:14 -03:00
Asdow e2f296c42c Remove #pragma optimize("", off)
Managed to slip in in commit f21cb38. Bad Asdow, bad!
2025-05-01 10:39:19 +03:00
Asdow ee2807ae64 Default to 1st kit if deciding not to buy gear in UB
1st one is included in the hiring fee
2025-04-26 00:37:38 +03:00
Asdow b23c9ac8b1 Do not prompt for buying inventory for 1st kit in UB 2025-04-26 00:37:38 +03:00
Asdow fa0c5a2862 Prevent hiring MERC in UB if not enough funds 2025-04-26 00:37:38 +03:00
Asdow db6da100e1 Reset selected gear kit when browsing mercs 2025-04-26 00:37:38 +03:00
Asdow a3e7ce5794 Display special offer for 1st M.E.R.C. inv kit in UB
* Use weekly instead of daily salary for total cost calculation
2025-04-26 00:37:38 +03:00
Asdow 5062ae74f2 Display correct salary info for MERCs in UB campaign 2025-04-26 00:37:38 +03:00
Asdow dd58f904f4 Do not offer surrender for multiplayer 2025-04-24 21:52:11 +03:00
Asdow 8dcb431ef2 Use (0,0) sector coordinates as unused cache
Makes the comment in Mod_Settings.ini valid advice
2025-04-17 23:51:44 +03:00
Asdow 5f45d06852 Fix possible integer overflow 2025-04-16 20:10:11 +03:00
Asdow 92103e36a6 Fix formatting 2025-04-16 01:28:07 +03:00
Asdow 8f98a9b985 Move UpdateAirspaceControl() out of #ifdef
Fixes UB not updating samsite airspace correctly after battle
2025-04-16 01:28:07 +03:00
Asdow c2e78d0461 Use correct macro to index StrategicMap 2025-04-16 01:28:07 +03:00
AsdowandGitHub 3e45217a9a Add compilationFlags to {exe} (#428)
* Add compilationFlags to {exe}

sgp.cpp is not recognizing JA2EDITOR preprocessor definition otherwise and therefore does not read EDITOR_SCREEN_RESOLUTION when starting map editor

* Add debugFlags too
2025-04-12 17:48:12 -03:00
CptMoore 9df885a264 Fixed tagged releases #2 2025-04-09 20:33:32 +02:00
CptMooreandGitHub 5ed70befb4 Fixed tagged releases (#429)
Fixed tagged releases
2025-04-09 19:52:23 +02:00
Asdow f21cb38647 Increase TileNo to UINT32
Bigmap grid number values go over uint16 max
2025-04-05 16:20:37 +03:00
Asdow 4823ef4929 Add check for vest position attachments 2025-03-06 17:39:35 +02:00
Asdow 586a46bb78 Remove last reference to gbPixelDepth 2025-02-24 23:08:52 +02:00
Asdow fffb3a45fb Remove 8bit mode
Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
2025-02-24 21:42:36 +02:00
Asdow 9c951adfea Read correct variable from CTHconstants.ini 2025-02-24 16:11:58 +02:00
Asdow e3a542bf5d Exclude robots from trying to activate panic triggers 2025-02-14 16:47:03 +02:00
Asdow 222daead0e Remove unused ItemFlags
Detonator and Remote Detonator are specified by AttachmentClass
No items in items.xml actually even contained these flags.
2025-01-27 18:30:11 +02:00
Marco Antonio J. Costaandmajcosta ebd2e25e0f Fix a wrong #ifdef to runtime check conversion
I didn't get this right the first time, non-Chinese text was looking
funny in dialog boxes
2025-01-09 21:37:19 -03:00
Marco Antonio J. Costaandmajcosta ff8376d625 Keep UB specific enum value for all builds
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
2025-01-09 21:34:07 -03:00
Marco Antonio J. Costaandmajcosta 7aa0e18352 Revert "make sure these steps run"
This reverts commit 1976dee738.

Revert "yet another fix for the github actions"

This reverts commit 552951795c.

Revert "make sure CI to assemble release on 'v*' tag push or manually"

This reverts commit 8897769f0d.
2025-01-07 16:51:30 -03:00
Marco Antonio J. Costaandmajcosta 1976dee738 make sure these steps run
otherwise there is no 'source' working directory for the final step
2025-01-07 14:13:46 -03:00
Marco Antonio J. Costaandmajcosta 552951795c yet another fix for the github actions
github.ref_name isn't 'master' when a tag is pushed, but the tag name,
so it won't trigger a release build when a 'v*' tag is pushed
2025-01-07 13:19:03 -03:00
Marco Antonio J. Costaandmajcosta 8897769f0d make sure CI to assemble release on 'v*' tag push or manually
also put bash script through shellcheck to be more posix compliant
2025-01-07 13:09:23 -03:00
Asdow dcf202990f Remove duplicate header includes 2025-01-05 17:08:02 +02:00
Asdow db40cd433e Move mapscreen bottom coordinates' initialization
Fixes radar map's initial  position in strategic screen being in the top right corner.
2025-01-05 17:08:02 +02:00
Marco Antonio J. Costaandmajcosta ac6a1504df add a space to string to prevent compilation errors in GB2312 2025-01-05 10:04:04 -03:00
Marco Antonio J. Costaandmajcosta 22e67f66fa Move wine.cpp into its own library
avoid extra compilations that way
2025-01-05 07:57:57 -03:00
FunkyFr3shandmajcosta fd6ffd8d69 automatically add needed dll override for Linux/macOS/Android (WINE) 2025-01-05 07:06:01 -03:00
Marco Antonio J. Costaandmajcosta f471b74f5b fix inconsistent case for a few files
you can now build in a case-sensitive filesystem
2025-01-04 13:14:22 -03:00
majcostaandGitHub 4a16698cdb CHINESE: actually display BobbyR amount purchased correctly at runtime (#398)
* Revert "Move CHINESE BOBBYR_ITEMS_BOUGHT_X conditional definition to i18n"

This reverts commit ecdc8916f2.

* actually display the amount purchased correctly at runtime
2025-01-03 21:03:09 -03:00
Marco Antonio J. Costaandmajcosta 846abf5f1c Convert Text.h to utf-8-sig and move ChineseSpecString* there
This time without mangling the characters
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costaandmajcosta ed73bd07ae Revert "Make Chinese specific strings compile-time instead of conditional"
When these lines were edited, I likely opened _ChineseText.cpp in the
wrong encoding, and therefore saved it in the wrong encoding, mangling
the characters

This reverts commit cd69f5f3ae.
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costaandmajcosta b908bcecb9 fix missing icon in executable
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
2025-01-02 08:02:52 -03:00
Marco Antonio J. Costaandmajcosta a7b0091a27 use link-time optimization when creating a release
it's a lot slower, but we don't release often
2025-01-01 18:10:47 -03:00
Marco Antonio J. Costaandmajcosta 7aafa7aada fix the GitHub actions for VS2022's quirk too
missed this change in 98cdffe5, fix it now
2025-01-01 18:10:47 -03:00
majcostaandGitHub 3e76e9525e Merge pull request #378 from majcosta/pr_remove_language_from_preprocessor
Get every language preprocessor conditional into one library
2024-12-31 18:32:50 -03:00
Marco Antonio J. Costa 959c29434e Adjust the build system
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
2024-12-31 18:24:36 -03:00
Marco Antonio J. Costa e9686c0dca reformat CMakeLists.txt 2024-12-31 16:28:45 -03:00
Marco Antonio J. Costa 10037291f3 remove preprocessor from i18n Multi Language Graphic Utils.cpp 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 9ed713f952 move Utils/Multi Language Graphic Utils.* to i18n
has language preprocessor silliness, straight to jail
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cccec0ef11 straggler in Utils/Font Control.cpp 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4a7625cef0 Slightly clunky RUSSIAN conversion 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 70f09471c2 just cast g_lang into lua's language code
because magically I got the enum order right first try
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa b15c4ef96c the really gnarly CHINESE #ifdef conversions
these seem to be right, chinese text appears to be flowing correctly
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa ecdc8916f2 Move CHINESE BOBBYR_ITEMS_BOUGHT_X conditional definition to i18n
Just awful
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4b563fefc8 Slightly clunkier fix for RUSSIAN conditional 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cf0b4dfc40 Manual unrolling preprocessor stuff and added function
This function is just for GERMAN but it has a unique name so it's no
problem.

Had to slightly change how MercID gets populated
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5fb989a1fc Move Text.h over to i18n too
Never use relative paths for #includes. Didn't touch the rest because
out of scope.
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 33e8c1dc39 Move all the translated strings over to i18n
It's where all conditional language preprocessor goes
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 73f7812165 Slightly less straightforward CHINESE conversion in Interface Items.cpp
A bit clunkier, had to repeat function calls because of how
preprocessor tricks don't map 1:1 with actual C++.
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
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
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cd69f5f3ae Make Chinese specific strings compile-time instead of conditional
eventually we'll switch between CHINESE and other languages during
runtime, so even if language is not chinese, these symbols must still
be there

these symbol names aren't used so this is fine
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa bf6de9f342 Move GetLanguagePrefix function into i18n 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5d19c1fe25 make conditional CHINESE preprocessor def into global constant 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4624fe92f0 leave CHINESE struct member UINT8 Width[0x80]
this might cause a horrifying alignment bug, but I doubt it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 3acd2cea97 move Ja 2 Libs.* to i18n
it has preprocessor silliness in it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4d4e039da7 add an internationalization constant
gather all ENGLISH|GERMAN|CHINESE etc preprocessor hell into a single
library, so to restrict the number of targets that need to be built 8x

this still has UB/EDITOR definitions so that still needs to be dealt
with before we can build it only 8 times
2024-12-31 16:28:44 -03:00
Asdow 3cfde817ba Set table mouse_region priorities lower than bookmark bar 2024-12-30 21:21:30 +02:00
Marco Antonio J. Costaandmajcosta dd5cabc6ba actually make link-time optimization default to OFF
sorry, I lied in the last commit. didn't mean to
2024-12-29 07:29:13 -03:00
Marco Antonio J. Costaandmajcosta a83dfbefb0 add option to enable link time optimization
a bit slower to compile for developing so defaults to 'false', but
might be a good idea for the releases.
2024-12-27 18:17:20 -03:00
Marco Antonio J. Costaandmajcosta dc72a43a19 silence narrowing conversions in MSVC
we all know they're there, whenever someone fixes it (lol), this
should be removed
2024-12-27 03:08:36 -03:00
Marco Antonio J. Costaandmajcosta 897f684705 remove all #include's for Language Defines
scripted diff:

find . -type f -iname "*.h" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
find . -type f -iname "*.cpp" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costaandmajcosta 0993789430 remove Language Defines file
we don't do it like that anymore, the build system takes care of it
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costaandmajcosta 6b9997b9c5 we don't use USE_CODE_PAGE anymore 2024-12-26 11:51:31 -03:00
Asdow 4ed7b1fb98 Increase selection window size 2024-12-25 22:03:03 +02:00
Asdow 5499d1fba2 Whitespace formatting 2024-12-25 22:03:03 +02:00
Asdow 22af6e8ec8 Implement mousewheel scroll for selection window 2024-12-25 22:03:03 +02:00
Asdow a9ab60e5e5 Fix road tiles for big maps 2024-12-25 17:35:11 +02:00
Asdow c30b1c1b25 Reimplement UB pricing for AIM 2024-12-24 22:48:41 +02:00
Marco Antonio Jaguaribe Costaandmajcosta f4f48f23c7 cmake: favor vertical layout and absolute paths for include_directories
just the way git works should tilt us towards tall code rather than very
long lines, easier for merging/conflicts
2024-12-24 08:28:02 -03:00
Asdow 5b966b4df9 Provide MAX_TACTICAL_ENEMIES to lua 2024-12-24 00:16:09 +02:00
Asdow eb7837bc3e Increase filename buffer length
The mapeditor filedialog is big enough to show longer filenames than 20 characters.
2024-12-23 20:45:48 +02:00
Asdow c88fbbe749 Fix assertion error due to too long filenames 2024-12-23 20:45:48 +02:00
Asdow a580052e40 Read new tags
Maybe *this* time it'll finally be fixed. Sigh...
2024-12-23 19:26:37 +02:00
Asdow 7fa8ff930b Remove unused tag
PercentCounterForceFrequency is never read from items.xml and INVTYPE doesn't have a field for it either
2024-12-22 00:08:45 +02:00
Asdow c7d021f5f3 Read updated items.xml format
Requires accompanying GameDir change.

Removed ItemFlag as an xml tag and added  bitmask flags as their own individual tags. Makes modding easier when the flags can be modified without math in the xml files
2024-12-22 00:08:45 +02:00
KittyandGitHub bfc78e2ef8 Simplified rework foodsystem allowed items (#357)
Simplified rework foodsystem allowed items
now no more need for a tag when checking IsItemLegal for Food System
ontop of checking for foodpoints, now also check if is drug
as a result, as previously, all eatable food will be excluded without food system,
but now only if it isn't a drug at the same time
and no more tag to check for that in items.xml needed
2024-12-17 13:23:58 +01:00
kitty624 0bd932f20f Simplified rework foodsystem allowed items
simplified the previous commit, now no more need for a tag
when checking IsItemLegal for Food System, ontop of checking for foodpoints, now also check if is drug
as a result, as previously, all eatable food will be excluded without food system, but now only if it isn't a drug at the same time
and no more tag to check for that in items.xml needed
2024-12-17 13:13:37 +01:00
KittyandGitHub 28a51e0e7b Reworked foodsystem exclusive items
no food items if the food system is off
whether the item is exclusive is defined by tag in items.xml
replaced previous way of decision, which used Item[usItemIndex].foodtype > 0 as criteria
that also restricted dual use items (i.e. drugs that also have a foodtype, like coffee, etc.)
2024-12-16 10:07:20 +01:00
kitty624 2fcba8b9f7 Reworked foodsystem exclusive items:
no food items if the food system is off
whether the item is exclusive is defined by tag in items.xml
replaced previous way of decision, which used Item[usItemIndex].foodtype > 0 as criteria
that also restricted dual use items (i.e. drugs that also have a foodtype, like coffee, etc.)
2024-12-16 09:54:54 +01:00
Marco Antonio Jaguaribe Costaandmajcosta 184b44c386 a couple consistency extension changes
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.
2024-12-15 15:25:28 -03:00
Marco Antonio J. Costaandmajcosta 86ad401186 add newline at end of file where it's lacking
.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
```
2024-12-14 19:05:48 -03:00
Marco Antonio J. Costaandmajcosta 1d58bda82d cross-compilation scaffolding WIP
requires clang/lld or mingw, obviously

just make sure the MSVC_DIRECTORY env variable points to valid Visual Studio Build Tools directory
and do: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=clang_or_mingw_toolchain_file`
2024-12-13 19:24:59 -03:00
momoko-handGitHub 87f51f0f6e Fix warning C4715 in Music Control.cpp (#351) 2024-12-10 17:15:21 +02:00
Marco Antonio Jaguaribe Costaandmajcosta 98cdffe5fd (actually) fix broken MS2022 behavior
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, completely blowing up the previous
setup.

after this commit, you should either delete the CMakeUserPresets.json
file from your root or add it to your system - NOT repo! - excludesFile:
https://stackoverflow.com/questions/7335420/global-git-ignore
2024-12-09 14:19:25 -03:00
Marco Antonio Jaguaribe Costaandmajcosta 2424066aab Revert "fix broken MS2022 behavior"
This reverts commit b89c63058f.
2024-12-09 13:45:08 -03:00
Marco Antonio Jaguaribe Costaandmajcosta b89c63058f fix broken MS2022 behavior
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, this patches it over for now and makes
note to remove it once this is fixed
2024-12-09 13:38:40 -03:00
Marco Antonio Jaguaribe Costaandmajcosta 0b21d1d798 add a TODO file
put your TODOs here so you won't forget, or in case you do, maybe
someone can pick it up in the decades to come
2024-12-09 12:58:43 -03:00
AsdowandGitHub dcde413b7b Initialize AI morale to normal instead of hopeless (#345) 2024-12-05 23:05:50 +02:00
Asdow febb283c3a Allow bloodcats in RED state to roam farther
Bloodcat lair had a few cats with CLOSE PATROL orders, resulting them to move only 15 tiles from their starting point, allowing them to be picked off from afar with scoped rifles.
2024-12-05 22:56:57 +02:00
Asdow 678ef822ca Fix passive bloodcats 2024-12-05 22:56:57 +02:00
AsdowandGitHub 1eff9f6aaa Fix bloodcat ambush endless loop (#343)
Some bloodcats during ambushes could have ubInsertionDirection with values > 100, which then causes endless looping in pathfinding algorithms as valid direction values range from 0 to 7
2024-12-05 16:13:09 +02:00
AsdowandGitHub 11bb0f741f Fix music playing when crepitus is present (#341)
UseCreatureMusic( HostileZombiesPresent() ); was overriding the music mode set in PrepareCreaturesForBattle() when encountering crepitus or being in the creature caves, resulting in regular tense and battle music being played.
2024-12-02 01:10:58 +02:00
AsdowandGitHub 1cd94cda23 Fix inventory cloning bug (#338)
- If we have a sector already loaded (eg. Drassen airport)
- Squad in a different sector encounters enemies and goes to autoresolve
- After pressing DONE in autoresolve screen -> we miss calling the TrashWorld() function in CheckAndHandleUnloadingOfCurrentWorld() due to battle sector not being the same as loaded sector.
- Selected sector gets reset from Drassen airport to invalid values by same function
- Now we have the loaded sector's whole inventory existing in gWorldItems
 - Enter any other sector in tactical mode and the gWorldItems gets added into its sector inventory in EnterSector()

Because the TrashItems() work in a way where it only sets gWorldItems elements to not existing if it finds them in a loaded map's structure data, we will pretty much always have that original bugged out set of items present in gWorlItems and they will constantly be added to sector inventories from then on once the bug has been triggered.
2024-11-16 16:05:14 +02:00
AsdowandGitHub f48fadb802 Improve AbstractXMLParser error reporting (#330)
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
2024-11-08 23:50:52 +02:00
KittyandGitHub 6497a35af9 Text EDB Pop-up Disease Protection adjusted ( #329)
- face protection had a misleading text, stating item should be worn at face
- that's no longer true, so adjusted text to avoid player confusion
- adjusted text to distinguish between both disease protections variations
2024-11-08 09:37:53 +01:00
kitty624 85ad2e5e72 Text EDB Pop-up Disease Protection adjusted
- face protection had a misleading text, stating item should be worn at face
- that's no longer true, so adjusted text to avoid player confusion
- adjusted text to distinguish between both disease protections variations
2024-11-08 09:08:38 +01:00
AsdowandGitHub 8040c5d826 Use functions for logging load & save game times (#328)
Less copy and paste. Allows these very simple timings to be logged from elsewhere as well.
2024-10-04 17:29:47 +03:00
AsdowandGitHub 93e89798ec Merc can be assigned to patient in well-fed state (#327)
Previously merc had to be in overfed state for both food and water
2024-10-02 21:24:02 +03:00
AsdowandGitHub 49a119e6b9 Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
2024-08-22 08:48:29 +03:00
419 changed files with 4777 additions and 9953 deletions
+1 -2
View File
@@ -186,7 +186,6 @@ jobs:
merge-multiple: true merge-multiple: true
- name: Checkout Repo - name: Checkout Repo
if: github.ref == 'refs/heads/master'
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: source path: source
@@ -201,6 +200,7 @@ jobs:
git push --delete origin refs/tags/latest || true git push --delete origin refs/tags/latest || true
git tag latest git tag latest
git push --force origin refs/tags/latest git push --force origin refs/tags/latest
sleep 15 # make sure github can find the tag for gh release
gh release create latest ../dist/* \ gh release create latest ../dist/* \
--generate-notes \ --generate-notes \
--title "Latest (unstable)" \ --title "Latest (unstable)" \
@@ -213,7 +213,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
working-directory: source working-directory: source
run: | run: |
exit 0
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+12 -2
View File
@@ -54,12 +54,22 @@ jobs:
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
cat Ja2/GameVersion.cpp cat Ja2/GameVersion.cpp
- name: Turn on link-time optimization?
if: fromJSON(inputs.assemble)
shell: bash
run: |
set -eux
echo "
LTO=ON
" >> $GITHUB_ENV
- name: Prepare build properties - name: Prepare build properties
shell: bash shell: bash
run: | run: |
set -eux set -eux
touch CMakeUserPresets.json touch CMakePresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]') JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]') JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
@@ -77,7 +87,7 @@ jobs:
arch: x86 arch: x86
- name: Prepare build - name: Prepare build
run: | run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO"
- name: Build - name: Build
run: | run: |
cmake --build build/ -- -v cmake --build build/ -- -v
+1 -1
View File
@@ -6,6 +6,6 @@
/.vs/ /.vs/
/build/ /build/
/out/ /out/
/CMakePresets.json
/CMakeSettings.json /CMakeSettings.json
/CMakeUserPresets.json
/lib/ /lib/
+109 -60
View File
@@ -9,10 +9,25 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
include(CheckIPOSupported)
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
if(LinkTimeOptimization AND LTO_OPTION)
message(STATUS "Configuring WITH link-time optimization")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
endif()
option(ADDRESS_SANITIZER OFF) option(ADDRESS_SANITIZER OFF)
if(ADDRESS_SANITIZER) if(ADDRESS_SANITIZER)
message(STATUS "AddressSanitizer ENABLED for non-Release builds") message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>) add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
endif()
if(MSVC)
add_compile_options("/wd4838")
endif() endif()
# whether we are using MSBuild as a generator # whether we are using MSBuild as a generator
@@ -23,7 +38,24 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE) add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
include_directories(Ja2 "ext/VFS/include" Utils TileEngine TacticalAI "ModularizedTacticalAI/include" Tactical Strategic sgp "Ja2/Res" Lua Laptop Multiplayer Editor Console) include_directories(
"${CMAKE_SOURCE_DIR}/Ja2"
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
"${CMAKE_SOURCE_DIR}/Utils"
"${CMAKE_SOURCE_DIR}/TileEngine"
"${CMAKE_SOURCE_DIR}/TacticalAI"
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
"${CMAKE_SOURCE_DIR}/Tactical"
"${CMAKE_SOURCE_DIR}/Strategic"
"${CMAKE_SOURCE_DIR}/sgp"
"${CMAKE_SOURCE_DIR}/Ja2/Res"
"${CMAKE_SOURCE_DIR}/Lua"
"${CMAKE_SOURCE_DIR}/Laptop"
"${CMAKE_SOURCE_DIR}/Multiplayer"
"${CMAKE_SOURCE_DIR}/Editor"
"${CMAKE_SOURCE_DIR}/Console"
"${CMAKE_SOURCE_DIR}/i18n/include"
)
# external libraries # external libraries
add_subdirectory("ext/libpng") add_subdirectory("ext/libpng")
@@ -34,32 +66,46 @@ target_link_libraries(bfVFS PRIVATE 7z)
# ja2export utility # ja2export utility
add_subdirectory("ext/export/src") add_subdirectory("ext/export/src")
# static libraries whose source files, header files or header files included # static libraries whose translation units don't rely on Application preprocessor definitions.
# by header files do not rely on Applications or Languages preprocessor definitions, add_subdirectory(lua)
# and therefore only need to be compiled once. Good.
add_subdirectory(Lua)
add_subdirectory(Multiplayer) add_subdirectory(Multiplayer)
add_subdirectory(wine)
# static libraries whose source files, header files or header files included set(Ja2_Libraries
# by header files rely on Application and Language preprocessor definitions, and "${CMAKE_SOURCE_DIR}/binkw32.lib"
# therefore need to be compiled multiple times. Very Bad. "${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"Dbghelp.lib"
"Winmm.lib"
"ws2_32.lib"
bfVFS
Lua
Multiplayer
wine
)
# static libraries whose translation units rely on Application preprocessor definitions.
set(Ja2_Libs set(Ja2_Libs
TileEngine Console
TacticalAI Editor
Utils Ja2
Strategic Laptop
sgp ModularizedTacticalAI
Laptop sgp
Editor Strategic
Console Tactical
Tactical TacticalAI
ModularizedTacticalAI TileEngine
Utils
) )
foreach(lib IN LISTS Ja2_Libs) foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib}) add_subdirectory(${lib})
endforeach() endforeach()
add_subdirectory(Ja2) # language library relies on Application _and_ Language preprocessor definition. very bad.
add_subdirectory(i18n)
# simple function to validate Languages and Application choices # simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake) include(cmake/ValidateOptions.cmake)
@@ -74,47 +120,50 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
# preprocessor definitions for Debug build, per the legacy MSBuild # preprocessor definitions for Debug build, per the legacy MSBuild
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>) set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
# Due to widespread preprocessor definition abuse in the codebase, practically foreach(app IN LISTS ApplicationTargets)
# every library-language-executable combination is its own compilation target set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>)
# TODO: refactor preprocessor usage onto, ideally, a single translation unit set(isUb $<STREQUAL:${app},JA2UB>)
foreach(lang IN LISTS LangTargets) set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>)
foreach(exe IN LISTS ApplicationTargets) set(compilationFlags
set(Executable ${exe}_${lang}) $<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
$<IF:${isUb},JA2UB;JA2UBMAPS,>
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
)
# executable for an application/language combination, e.g. JA2_ENGLISH.exe foreach(lib IN LISTS Ja2_Libs)
add_executable(${Executable} WIN32) # library for an application, e.g. JA2UB_sgp
target_sources(${Executable} PRIVATE ${Ja2Src}) set(game_library ${app}_${lib})
add_library(${game_library})
target_sources(${game_library} PRIVATE ${${lib}Src})
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
endforeach()
# Good libraries have already been built, can be simply linked here foreach(lang IN LISTS LangTargets)
target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>) # executable for an application/language combination, e.g. JA2_ENGLISH.exe
target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>) set(exe ${app}_${lang})
add_executable(${exe} WIN32
sgp/sgp.cpp
Ja2/Res/ja2.rc
)
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
# for each app/lang combination, the Very Bad libraries need to be built, # language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
# with the appropriate preprocessor definitions set(language_library ${exe}_i18n)
foreach(lib IN LISTS Ja2_Libs) add_library(${language_library})
# syntactic sugar to hopefully make this more readable target_sources(${language_library} PRIVATE ${i18nSrc})
set(VeryBadLib ${Executable}_${lib}) target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang})
set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>) target_link_libraries(${exe} PRIVATE ${language_library})
set(isUb $<STREQUAL:${exe},JA2UB>)
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
# static library for an app/lang combination, e.g. JA2_ENGLISH_sgp.lib # go through all game libraries again and link them to the app/language executable
add_library(${VeryBadLib}) foreach(lib IN LISTS Ja2_Libs)
target_sources(${VeryBadLib} PRIVATE ${${lib}Src}) target_link_libraries(${exe} PRIVATE ${app}_${lib})
endforeach()
endforeach()
target_compile_definitions(${VeryBadLib} PUBLIC # for SGP only
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,> target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
$<IF:${isUb},JA2UB;JA2UBMAPS,> target_link_libraries(${app}_sgp PRIVATE libpng)
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,> target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION)
${debugFlags}
${lang}
)
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
endforeach()
# for sgp only
target_link_libraries(${Executable}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${Executable}_sgp PUBLIC libpng)
target_compile_definitions(${Executable}_sgp PRIVATE NO_ZLIB_COMPRESSION)
endforeach()
endforeach() endforeach()
+2 -2
View File
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i]; item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR ) //if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue; // continue;
if(item->notineditor) if(ItemIsNotInEditor(i))
continue; continue;
if( i == SWITCH || i == ACTION_ITEM ) if( i == SWITCH || i == ACTION_ITEM )
{ {
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue; continue;
} }
item = &Item[usCounter]; item = &Item[usCounter];
if(item->notineditor) if(ItemIsNotInEditor(usCounter))
{ {
usCounter++; usCounter++;
continue; continue;
+9 -1
View File
@@ -173,7 +173,15 @@ void LoadSaveScreenEntry()
vfs::CVirtualProfile* prof = it.value(); vfs::CVirtualProfile* prof = it.value();
memset(&FileInfo, 0, sizeof(GETFILESTRUCT)); memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
strcpy(FileInfo.zFileName, "< "); strcpy(FileInfo.zFileName, "< ");
strcat(FileInfo.zFileName, prof->cName.utf8().c_str()); // Cut filename off if it's too long for the buffer
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
{
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
}
else
{
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
}
strcat(FileInfo.zFileName, " >"); strcat(FileInfo.zFileName, " >");
FileInfo.zFileName[FILENAME_BUFLEN] = 0; FileInfo.zFileName[FILENAME_BUFLEN] = 0;
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY; FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "BuildDefines.h" #include "BuildDefines.h"
#include "Fileman.h" #include "Fileman.h"
#define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213 #define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
#ifdef JA2EDITOR #ifdef JA2EDITOR
+34 -6
View File
@@ -403,14 +403,42 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
while( gRoadMacros[ i ].sMacroID == iMacroID ) while( gRoadMacros[ i ].sMacroID == iMacroID )
{ {
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size // need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS; INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS);
INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS; INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS);
INT32 sOffset = sdY*WORLD_COLS + sdX;
// Take into account the dfference between old and new row size for tiles that are shifted
// by one row due to X offset
// For example:
// {RBR, 159},
//{ RBR, -159 },
// //
AddToUndoList( iMapIndex + sOffset ); // Offsets for 160x160 map
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES ); // [] [] [-159]
// [] [0] []
// [159] [] []
//
// Converted to 200x200 map
// [] [] [-199]
// [] [0] []
// [199] [] []
//
// Without this the original conversion would output 159 and -159 for X coordinate
if (sdX < -OLD_WORLD_COLS/2)
{
sdX -= WORLD_COLS - OLD_WORLD_COLS;
}
else if (sdX > OLD_WORLD_COLS / 2)
{
sdX += WORLD_COLS - OLD_WORLD_COLS;
}
INT32 sOffset = sdY*WORLD_COLS + sdX;
INT32 newGridNo = iMapIndex + sOffset;
AddToUndoList( newGridNo );
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex ); GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( iMapIndex + sOffset, usTileIndex ); AddObjectToHead( newGridNo, usTileIndex );
i++; i++;
} }
} }
+19 -5
View File
@@ -1,4 +1,4 @@
#include "builddefines.h" #include "builddefines.h"
#ifdef JA2EDITOR #ifdef JA2EDITOR
@@ -1069,10 +1069,7 @@ void ShowCurrentDrawingMode( void )
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on // Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
usFillColor = GenericButtonFillColors[0]; usFillColor = GenericButtonFillColors[0];
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES ); pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
if(gbPixelDepth==16) RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
else if(gbPixelDepth==8)
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
UnLockVideoSurface( FRAME_BUFFER ); UnLockVideoSurface( FRAME_BUFFER );
@@ -2954,6 +2951,23 @@ UINT32 WaitForSelectionWindowResponse( void )
} }
} }
// Mousewheel scroll
if (_WheelValue > 0)
{
while (_WheelValue--)
{
ScrollSelWinUp();
}
}
else
{
while (_WheelValue++)
{
ScrollSelWinDown();
}
}
_WheelValue = 0;
if ( DoWindowSelection( ) ) if ( DoWindowSelection( ) )
{ {
fSelectionWindow = FALSE; fSelectionWindow = FALSE;
+60 -36
View File
@@ -29,6 +29,16 @@ extern BOOLEAN fDontUseRandom;
extern UINT16 GenericButtonFillColors[40]; extern UINT16 GenericButtonFillColors[40];
struct SelectionWindow
{
SGPRect window;
SGPPoint displayAreaStart; // Area where selectable items are drawn
SGPPoint displayAreaEnd;
SGPPoint spacing; // For displayed items
};
SelectionWindow gSelection;
BOOLEAN gfRenderSquareArea = FALSE; BOOLEAN gfRenderSquareArea = FALSE;
INT16 iStartClickX,iStartClickY; INT16 iStartClickX,iStartClickY;
INT16 iEndClickX,iEndClickY; INT16 iEndClickX,iEndClickY;
@@ -40,7 +50,6 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
BOOLEAN fAllDone=FALSE; BOOLEAN fAllDone=FALSE;
BOOLEAN fButtonsPresent=FALSE; BOOLEAN fButtonsPresent=FALSE;
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
//These definitions help define the start and end of the various wall indices. //These definitions help define the start and end of the various wall indices.
//This needs to be maintained if the walls change. //This needs to be maintained if the walls change.
@@ -172,6 +181,30 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
// //
void CreateJA2SelectionWindow( INT16 sWhat ) void CreateJA2SelectionWindow( INT16 sWhat )
{ {
auto selectWinWidth = 600;
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
if (iResolution > _800x600)
{
selectWinWidth = 900;
}
auto tlX = 0;
auto tlY = 0;
auto brX = tlX + selectWinWidth;
auto brY = tlY + selectWinHeight;
gSelection.window.iLeft = tlX;
gSelection.window.iTop = tlY;
gSelection.window.iRight = brX;
gSelection.window.iBottom = brY;
gSelection.displayAreaStart.iX = tlX + 1;
gSelection.displayAreaStart.iY = tlY + 15;
gSelection.displayAreaEnd.iX = brX - 1;
gSelection.displayAreaEnd.iY= brY - 1;
gSelection.spacing.iX = 2;
gSelection.spacing.iY = 2;
iTopWinCutOff = gSelection.displayAreaStart.iY;
iBotWinCutOff = gSelection.displayAreaEnd.iY;
DisplaySpec *pDSpec; DisplaySpec *pDSpec;
UINT16 usNSpecs; UINT16 usNSpecs;
@@ -185,32 +218,33 @@ void CreateJA2SelectionWindow( INT16 sWhat )
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" ); iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" ); iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, SelWinClkCallback); DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0, iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
BUTTON_USE_DEFAULT, 600, 0, BUTTON_USE_DEFAULT, selectWinWidth, 0,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, OkClkCallback); DEFAULT_MOVE_CALLBACK, OkClkCallback);
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]); SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0, iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
BUTTON_USE_DEFAULT, 600, 40, BUTTON_USE_DEFAULT, selectWinWidth, 40,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, CnclClkCallback); DEFAULT_MOVE_CALLBACK, CnclClkCallback);
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]); SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0, iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
BUTTON_USE_DEFAULT, 600, 80, BUTTON_USE_DEFAULT, selectWinWidth, 80,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, UpClkCallback); DEFAULT_MOVE_CALLBACK, UpClkCallback);
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]); SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0, iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
BUTTON_USE_DEFAULT, 600, 240, BUTTON_USE_DEFAULT, selectWinWidth, 240,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DwnClkCallback); DEFAULT_MOVE_CALLBACK, DwnClkCallback);
@@ -218,18 +252,6 @@ void CreateJA2SelectionWindow( INT16 sWhat )
fButtonsPresent = TRUE; fButtonsPresent = TRUE;
SelWinSpacing.iX = 2;
SelWinSpacing.iY = 2;
SelWinStartPoint.iX = 1;
SelWinStartPoint.iY = 15;
iTopWinCutOff = 15;
SelWinEndPoint.iX = 599;
SelWinEndPoint.iY = 359;
iBotWinCutOff = 359;
switch( sWhat ) switch( sWhat )
{ {
@@ -347,8 +369,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
return; return;
} }
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint, BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd,
&SelWinSpacing, CLEAR_BACKGROUND); &gSelection.spacing, CLEAR_BACKGROUND);
} }
@@ -849,12 +871,14 @@ void RenderSelectionWindow( void )
return; return;
ColorFillVideoSurfaceArea(FRAME_BUFFER, ColorFillVideoSurfaceArea(FRAME_BUFFER,
0, 0, 600, 400, gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom,
GenericButtonFillColors[0]); GenericButtonFillColors[0]
);
DrawSelections( ); DrawSelections( );
MarkButtonsDirty(); MarkButtonsDirty();
RenderButtons( ); RenderButtons( );
// Draw selection rectangle
if ( gfRenderSquareArea ) if ( gfRenderSquareArea )
{ {
button = ButtonList[iSelectWin]; button = ButtonList[iSelectWin];
@@ -862,7 +886,7 @@ void RenderSelectionWindow( void )
return; return;
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) || if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) ) (abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) )
{ {
// iSX = (INT32)iStartClickX; // iSX = (INT32)iStartClickX;
// iEX = (INT32)button->Area.MouseXPos; // iEX = (INT32)button->Area.MouseXPos;
@@ -870,7 +894,7 @@ void RenderSelectionWindow( void )
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY); // iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
iSX = iStartClickX; iSX = iStartClickX;
iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY; iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY;
iEX = gusMouseXPos; iEX = gusMouseXPos;
iEY = gusMouseYPos; iEY = gusMouseYPos;
@@ -889,10 +913,10 @@ void RenderSelectionWindow( void )
iEY ^= iSY; iEY ^= iSY;
} }
iEX = min( iEX, 600 ); iEX = min( gSelection.displayAreaEnd.iX, iEX);
iSY = max( SelWinStartPoint.iY, iSY ); iSY = max( gSelection.displayAreaStart.iY, iSY );
iEY = min( 359, iEY ); iEY = min( gSelection.displayAreaEnd.iY, iEY );
iEY = max( SelWinStartPoint.iY, iEY ); iEY = max( gSelection.displayAreaStart.iY, iEY );
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0)); usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
usFillGreen += usDir; usFillGreen += usDir;
@@ -928,7 +952,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
return; return;
iClickX = button->Area.MouseXPos; iClickX = button->Area.MouseXPos;
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY; iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN) if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
{ {
@@ -1035,9 +1059,9 @@ void DisplaySelectionWindowGraphicalInformation()
UINT16 y; UINT16 y;
//Determine if there is a valid picture at cursor position. //Determine if there is a valid picture at cursor position.
//iRelX = gusMouseXPos; //iRelX = gusMouseXPos;
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY; //iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY; y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY;
pNode = pDispList; pNode = pDispList;
fDone = FALSE; fDone = FALSE;
while( (pNode != NULL) && !fDone ) while( (pNode != NULL) && !fDone )
@@ -1470,10 +1494,10 @@ void DrawSelections( void )
{ {
SGPRect ClipRect, NewRect; SGPRect ClipRect, NewRect;
NewRect.iLeft = SelWinStartPoint.iX; NewRect.iLeft = gSelection.displayAreaStart.iX;
NewRect.iTop = SelWinStartPoint.iY; NewRect.iTop = gSelection.displayAreaStart.iY;
NewRect.iRight = SelWinEndPoint.iX; NewRect.iRight = gSelection.displayAreaEnd.iX;
NewRect.iBottom = SelWinEndPoint.iY; NewRect.iBottom = gSelection.displayAreaEnd.iY;
GetClippingRect(&ClipRect); GetClippingRect(&ClipRect);
SetClippingRect(&NewRect); SetClippingRect(&NewRect);
@@ -1483,7 +1507,7 @@ void DrawSelections( void )
SetObjectShade( gvoLargeFontType1, 0 ); SetObjectShade( gvoLargeFontType1, 0 );
// SetObjectShade( gvoLargeFont, 0 ); // SetObjectShade( gvoLargeFont, 0 );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND ); DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND );
SetObjectShade( gvoLargeFontType1, 4 ); SetObjectShade( gvoLargeFontType1, 4 );
+2 -17
View File
@@ -14,7 +14,6 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Language Defines.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
@@ -28,25 +27,11 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SCREENS.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Screens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
${CMAKE_CURRENT_SOURCE_DIR}/Res/ja2.rc
PARENT_SCOPE)
set(Ja2_Libraries
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"Dbghelp.lib"
Lua
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"Winmm.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"${CMAKE_SOURCE_DIR}/binkw32.lib"
bfVFS
"ws2_32.lib"
Multiplayer
PARENT_SCOPE) PARENT_SCOPE)
-1
View File
@@ -1,7 +1,6 @@
#ifndef _CHEATS__H_ #ifndef _CHEATS__H_
#define _CHEATS__H_ #define _CHEATS__H_
#include "Language Defines.h"
extern UINT8 gubCheatLevel; extern UINT8 gubCheatLevel;
-1
View File
@@ -1,6 +1,5 @@
#include "Types.h" #include "Types.h"
#include "Credits.h" #include "Credits.h"
#include "Language Defines.h"
#include "vsurface.h" #include "vsurface.h"
#include "mousesystem.h" #include "mousesystem.h"
#include "Text.h" #include "Text.h"
+3 -7
View File
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES); pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES); pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth==16) Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
{ (UINT16 *)pSrcBuf, uiSrcPitchBYTES,
// BLIT HERE 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
UnLockVideoSurface(FRAME_BUFFER); UnLockVideoSurface(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER); UnLockVideoSurface(guiSAVEBUFFER);
-1
View File
@@ -26,7 +26,6 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "Sys Globals.h" #include "Sys Globals.h"
+2 -2
View File
@@ -1830,7 +1830,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{ {
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768) if (iResolution >= _800x600 && iResolution < _1280x720)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
@@ -1850,7 +1850,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON); btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768) if (iResolution >= _800x600 && iResolution < _1280x720 )
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
+3 -3
View File
@@ -10,7 +10,6 @@
#include "GameVersion.h" #include "GameVersion.h"
#include "LibraryDataBase.h" #include "LibraryDataBase.h"
#include "Debug.h" #include "Debug.h"
#include "Language Defines.h"
#include "HelpScreen.h" #include "HelpScreen.h"
#include "INIReader.h" #include "INIReader.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
@@ -45,7 +44,7 @@
#include <vfs/Core/vfs_file_raii.h> #include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#define GAME_SETTINGS_FILE "Ja2_Settings.INI" #define GAME_SETTINGS_FILE "Ja2_Settings.ini"
#define FEATURE_FLAGS_FILE "Ja2_Features.ini" #define FEATURE_FLAGS_FILE "Ja2_Features.ini"
@@ -1999,6 +1998,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE); gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f); gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE); gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
//################# Disease Settings ################## //################# Disease Settings ##################
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE ); gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
@@ -3794,7 +3794,7 @@ void LoadCTHConstants()
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
+1
View File
@@ -506,6 +506,7 @@ typedef struct
FLOAT sFoodDecayModificator; FLOAT sFoodDecayModificator;
BOOLEAN fFoodEatingSounds; BOOLEAN fFoodEatingSounds;
BOOLEAN fAlwaysFood;
// Flugente: disease settings // Flugente: disease settings
BOOLEAN fDisease; BOOLEAN fDisease;
+2 -2
View File
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
// //
// Keeps track of the saved game version. Increment the saved game version whenever // Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file // you will invalidate the saved game file
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184 #define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183 #define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us #define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION GROWTH_MODIFIERS #define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA
//#define RUSSIANGOLD //#define RUSSIANGOLD
#ifdef __cplusplus #ifdef __cplusplus
+88 -109
View File
@@ -35,7 +35,6 @@
#include "tile cache.h" #include "tile cache.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "Map Information.h" #include "Map Information.h"
#include "laptop.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
#include "Exit Grids.h" #include "Exit Grids.h"
#include "Summary Info.h" #include "Summary Info.h"
@@ -51,6 +50,7 @@
#include "Multilingual Text Code Generator.h" #include "Multilingual Text Code Generator.h"
#include "editscreen.h" #include "editscreen.h"
#include "Arms Dealer Init.h" #include "Arms Dealer Init.h"
#include "Map Screen Interface Bottom.h"
#include "MPXmlTeams.hpp" #include "MPXmlTeams.hpp"
#include "Strategic Mines LUA.h" #include "Strategic Mines LUA.h"
#include "UndergroundInit.h" #include "UndergroundInit.h"
@@ -76,7 +76,8 @@
#include "AimArchives.h" #include "AimArchives.h"
#include "connect.h" #include "connect.h"
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes() #include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
#include "Animation Data.h" // added by Flugente
#include <language.hpp>
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0}; extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08 extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -134,34 +135,6 @@ static void AddLanguagePrefix(STR fileName, const STR language)
memmove( fileComponent, language, strlen( language) ); memmove( fileComponent, language, strlen( language) );
} }
static const STR GetLanguagePrefix()
{
#ifdef ENGLISH
return "";
#endif
#ifdef GERMAN
return GERMAN_PREFIX;
#endif
#ifdef RUSSIAN
return RUSSIAN_PREFIX;
#endif
#ifdef DUTCH
return DUTCH_PREFIX;
#endif
#ifdef POLISH
return POLISH_PREFIX;
#endif
#ifdef FRENCH
return FRENCH_PREFIX;
#endif
#ifdef ITALIAN
return ITALIAN_PREFIX;
#endif
#ifdef CHINESE
return CHINESE_PREFIX;
#endif
}
static void AddLanguagePrefix(STR fileName) static void AddLanguagePrefix(STR fileName)
{ {
AddLanguagePrefix( fileName, GetLanguagePrefix()); AddLanguagePrefix( fileName, GetLanguagePrefix());
@@ -254,7 +227,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
@@ -268,9 +241,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} }
#else } else {
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
#endif }
// Lesh: added this, begin // Lesh: added this, begin
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -294,14 +267,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags // the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
} }
#endif }
//if(!WriteItemStats()) //if(!WriteItemStats())
// return FALSE; // return FALSE;
@@ -366,14 +339,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat( fileName, DISEASEFILENAME ); strcat( fileName, DISEASEFILENAME );
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME ); SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME); SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME); strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
@@ -411,14 +384,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LOADSCREENHINTSFILENAME); strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, ARMOURSFILENAME); strcat(fileName, ARMOURSFILENAME);
@@ -438,22 +411,24 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if (isMultiplayer == false) if (isMultiplayer == false)
{ {
using namespace LogicalBodyTypes; using namespace LogicalBodyTypes;
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME); CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"};
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME); SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME); SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME); SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
} }
} }
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
} }
#endif }
// THE_BOB : added for pocket popup definitions // THE_BOB : added for pocket popup definitions
LBEPocketPopup.clear(); LBEPocketPopup.clear();
@@ -461,7 +436,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if (FileExists(fileName)) if (FileExists(fileName))
@@ -476,10 +451,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} }
#else } else {
// WANNE: Load english file // WANNE: Load english file
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#endif }
#ifdef JA2UB #ifdef JA2UB
@@ -495,14 +470,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, MERCSTARTINGGEARFILENAME); strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
} }
#endif }
#endif #endif
@@ -519,14 +494,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, ATTACHMENTSLOTSFILENAME); strcat(fileName, ATTACHMENTSLOTSFILENAME);
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
} }
#endif }
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls // Flugente: created separate gun and item choices for different soldier classes - read in different xmls
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -700,14 +675,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, CITYTABLEFILENAME); strcat(fileName, CITYTABLEFILENAME);
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME); SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
} }
#endif }
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp, // Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
// function BOOLEAN InitStrategicMovementCosts(); // function BOOLEAN InitStrategicMovementCosts();
@@ -758,14 +733,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, DELIVERYMETHODSFILENAME); strcat(fileName, DELIVERYMETHODSFILENAME);
@@ -778,14 +753,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
} }
#endif }
// HEADROCK HAM 3.4: Read in facility locations // HEADROCK HAM 3.4: Read in facility locations
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -799,14 +774,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
} }
#endif }
// HEADROCK HAM 5: Read in Coolness by Sector // HEADROCK HAM 5: Read in Coolness by Sector
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -828,7 +803,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -836,7 +811,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInMercProfiles(fileName,TRUE)) if(!ReadInMercProfiles(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
} }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -854,14 +829,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
} }
#endif }
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data // HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -924,14 +899,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
} }
#endif }
} }
@@ -943,14 +918,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
} }
#endif }
} }
@@ -960,14 +935,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
} }
#endif }
if (gGameExternalOptions.fEnemyRank == TRUE) if (gGameExternalOptions.fEnemyRank == TRUE)
{ {
@@ -977,14 +952,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
} }
#endif }
} }
// Flugente: backgrounds // Flugente: backgrounds
@@ -993,14 +968,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
} }
#endif }
// Flugente: individual militia // Flugente: individual militia
strcpy( fileName, directoryName ); strcpy( fileName, directoryName );
@@ -1014,14 +989,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
} }
#endif }
// WANNE: Only in a singleplayer game... // WANNE: Only in a singleplayer game...
// Externalised taunts // Externalised taunts
@@ -1042,14 +1017,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
#endif }
while( GetFileNext(&FileInfo) ) while( GetFileNext(&FileInfo) )
{ {
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1057,14 +1032,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
#endif }
} }
GetFileClose(&FileInfo); GetFileClose(&FileInfo);
} }
@@ -1076,14 +1051,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME); SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
} }
#endif }
// IMP Portraits List by Jazz // IMP Portraits List by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1091,14 +1066,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
} }
#endif }
LoadIMPPortraitsTEMP( ); LoadIMPPortraitsTEMP( );
@@ -1183,14 +1158,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME); SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
//WriteFaceGear(); //WriteFaceGear();
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
} }
#endif }
UINT32 i; UINT32 i;
for(i=0; i<NUM_PROFILES; i++) for(i=0; i<NUM_PROFILES; i++)
{ {
@@ -1204,14 +1179,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
} }
#endif }
//Main Menu by Jazz //Main Menu by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1224,7 +1199,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME); SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1232,7 +1207,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInActionItems(fileName,TRUE)) if(!ReadInActionItems(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
if ( ReadXMLEmail == TRUE ) if ( ReadXMLEmail == TRUE )
{ {
@@ -1242,7 +1217,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE); SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1250,7 +1225,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailMercAvailable(fileName,TRUE)) if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
// EMAIL MERC LEVEL UP by Jazz // EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1258,7 +1233,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP); SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1266,7 +1241,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailMercLevelUp(fileName,TRUE)) if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
} }
/* /*
// EMAIL OTHER by Jazz // EMAIL OTHER by Jazz
@@ -1275,7 +1250,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER); SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1283,7 +1258,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailOther(fileName,TRUE)) if(!ReadInEmailOther(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
*/ */
//new vehicles by Jazz //new vehicles by Jazz
@@ -1294,7 +1269,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME); SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1302,9 +1277,9 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInNewVehicles(fileName,TRUE)) if(!ReadInNewVehicles(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1312,7 +1287,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0)) if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
return FALSE; return FALSE;
} }
#endif }
#ifdef ENABLE_BRIEFINGROOM #ifdef ENABLE_BRIEFINGROOM
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1320,14 +1295,14 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
} }
#endif }
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0); BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
@@ -1339,14 +1314,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME); SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
} }
#endif }
// Old AIM Archive // Old AIM Archive
UINT8 p; UINT8 p;
@@ -1360,14 +1335,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
} }
#endif }
UINT8 emptyslotsinarchives = 0; UINT8 emptyslotsinarchives = 0;
for (p=0;p<NUM_PROFILES;p++) for (p=0;p<NUM_PROFILES;p++)
{ {
@@ -1417,14 +1392,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
} }
#endif }
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true); LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix()); g_luaUnderground.LoadScript(GetLanguagePrefix());
@@ -1498,6 +1473,10 @@ UINT32 InitializeJA2(void)
return( ERROR_SCREEN ); return( ERROR_SCREEN );
} }
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
// before calling InitTacticalEngine()
InitMapScreenInterfaceBottomCoords();
// Init tactical engine // Init tactical engine
if ( !InitTacticalEngine( ) ) if ( !InitTacticalEngine( ) )
{ {
+4 -3
View File
@@ -36,6 +36,7 @@
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "XML.h" #include "XML.h"
#include <language.hpp>
BOOLEAN Style_JA = TRUE; BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0; extern INT8 Test = 0;
@@ -726,11 +727,11 @@ void DisplaySirtechSplashScreen()
* (2006-10-10, Sergeant_Kolja) * (2006-10-10, Sergeant_Kolja)
*/ */
#ifdef _DEBUG #ifdef _DEBUG
# if defined(ENGLISH) if( g_lang == i18n::Lang::en ) {
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) ); AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
# elif defined(GERMAN) } else if( g_lang == i18n::Lang::de ) {
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) ); AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
# endif }
#endif #endif
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) ); AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
return; return;
+2 -4
View File
@@ -12,13 +12,11 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode' //enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType enum EIntroType
{ {
#ifdef JA2UB
INTRO_HELI_CRASH,
#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video. INTRO_ENDING, //set when viewing the end game video.
INTRO_SPLASH, INTRO_SPLASH,
// Unfinished Business
INTRO_HELI_CRASH
}; };
+4 -3
View File
@@ -5,6 +5,7 @@
#include "Timer Control.h" #include "Timer Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <stdio.h> #include <stdio.h>
#include <language.hpp>
UINT32 guiSplashFrameFade = 10; UINT32 guiSplashFrameFade = 10;
UINT32 guiSplashStartTime = 0; UINT32 guiSplashStartTime = 0;
@@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer;
//Simply create videosurface, load image, and draw it to the screen. //Simply create videosurface, load image, and draw it to the screen.
void InitJA2SplashScreen() void InitJA2SplashScreen()
{ {
#ifdef ENGLISH if( g_lang == i18n::Lang::en ) {
ClearMainMenu(); ClearMainMenu();
#else } else {
UINT32 uiLogoID = 0; UINT32 uiLogoID = 0;
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
@@ -69,7 +70,7 @@ void InitJA2SplashScreen()
GetVideoSurface( &hVSurface, uiLogoID ); GetVideoSurface( &hVSurface, uiLogoID );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
DeleteVideoSurfaceFromIndex( uiLogoID ); DeleteVideoSurfaceFromIndex( uiLogoID );
#endif // ENGLISH } // ENGLISH
InvalidateScreen(); InvalidateScreen();
RefreshScreen( NULL ); RefreshScreen( NULL );
-21
View File
@@ -1,21 +0,0 @@
#include "Language Defines.h"
#if defined(ENGLISH)
# pragma message(" (Language set to ENGLISH, You'll need english CDs)")
#elif defined(GERMAN)
# pragma message(" (Language set to GERMAN, You'll need Topware/german CDs)")
#elif defined(RUSSIAN)
# pragma message(" (Language set to RUSSIAN, You'll need russian CDs)")
#elif defined(DUTCH)
# pragma message(" (Language set to DUTCH, You'll need dutch CDs)")
#elif defined(POLISH)
# pragma message(" (Language set to POLISH, You'll need polish CDs)")
#elif defined(FRENCH)
# pragma message(" (Language set to FRENCH, You'll need french CDs)")
#elif defined(ITALIAN)
# pragma message(" (Language set to ITALIAN, You'll need italian CDs)")
#elif defined(CHINESE)
# pragma message(" (Language set to CHINESE, You'll need chinese CDs)")
#else
# error "At least You have to specify a Language somewhere. See comments above."
#endif
-119
View File
@@ -1,119 +0,0 @@
#ifndef __LANGUAGE_DEFINES_H
#define __LANGUAGE_DEFINES_H
#pragma once
/* ============================================================================
* ONLY ONE OF THESE LANGUAGES CAN BE DEFINED AT A TIME!
* BUT now You can define it _here_ by uncommenting one _or_ (better):
* You can comment them all out and then set it _global_ in "Preprocessor
* options" (do it for ALL projects in the workspace and both debug & release)
* _or_
* give it do Your MAKEFILE, f.i. make ENGLISH, but keep in mind that some
* weird make tools will require 'make ENGLISH=1' instead
*
* using one of the two later methods will keep this SVN file unchanged for the
* future, only Your private project files (workspace/solution) will differ
* from the SVN stuff.
* (2006-10-10, Sergeant_Kolja)
*/
/* The recommend approach for VS2010 multi-language builds is to use the command line or the ja2.props file.
By default the language is ENGLISH and the Language Prefix is EN.
There are 3 ways you can build the JA2 1.13 executable file:
// -------------------------------------------------------
// 1. Using the command line
// -------------------------------------------------------
For example, where msbuild is located in %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ if not on your path
msbuild.exe /p:Configuration=Release ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=PL /p:JA2Language=POLISH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=RU /p:JA2Language=RUSSIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=NL /p:JA2Language=DUTCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=FR /p:JA2Language=FRENCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=IT /p:JA2Language=ITALIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=CN /p:JA2Language=CHINESE ja2_VS2010.sln
Note: If you want to build "Unfinished Business" version, just append the /p:JA2Config=JA2UB in the command line
msbuild.exe /p:Configuration=Release /p:JA2Config=JA2UB ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB ja2_VS2010.sln
Note2: You can also specify the target output name with the parameter /p:TargetName
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB /p:TargetName="JA2UB_113" ja2_VS2010.sln
// --------------------------------------------------------
// 2. Editing the ja2.props file and then build in VS 2010
// -------------------------------------------------------
1. Open the "ja2.props" file in a text editor and set the <BuildMacro> tags to your likeing.
For example: If you want to build Russian Version (normal JA2, not UB) then set the following:
<BuildMacro Include="JA2Config">
<Value></Value>
</BuildMacro>
<BuildMacro Include="JA2LangPrefix">
<Value>RU</Value>
</BuildMacro>
<BuildMacro Include="JA2Language">
<Value>RUSSIAN</Value>
</BuildMacro>
2. Save the file
3. Build the project in Visual Studio 2010
// --------------------------------------------------------
// 3. The "old" way for building the executable
// -------------------------------------------------------
1. Enable the "#undef ENGLISH" define below, so English will not be used anymore
2. Set the desired language below
3. If you want to build "Unfinished Business" version, enable "#define JA2UB" and "#define JA2UBMAPS" in builddefines.h"
4. Build the executable in VS 2005 / 2008 / 2010
5. The output will be placed in the "Build\bin\" folder
*/
// Only enable this "undef", if you use the 3. way of building the executable!
#undef ENGLISH
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
/* please set one manually here (by uncommenting) if not willingly to set Workspace wide */
#define ENGLISH
//#define GERMAN
//#define RUSSIAN
//#define DUTCH
//#define FRENCH
//#define ITALIAN
//#define POLISH
// INFO: For Chinese 1.13 version, you also have to set USE_WINFONTS = 1 in ja2.ini inside your JA2 installation directory!
//#define CHINESE
#endif
//**ddd direct link libraries
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "gdi32.lib")
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "shell32.lib")
/* ====================================================================
* Regardless of if we did it Workspace wide or by uncommenting above,
* HERE we must see, what language was selected. If one, we
*/
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
# error "At least You have to specify a Language somewhere. See comments above."
#endif
//if the language represents words as single chars
/*#ifdef TAIWAN
#define SINGLE_CHAR_WORDS
#endif*/
#endif
-1
View File
@@ -29,7 +29,6 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "SmokeEffects.h" #include "SmokeEffects.h"
+57 -179
View File
@@ -138,7 +138,6 @@
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009 #include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
#include "Sys Globals.h"//dnl ch74 201013 #include "Sys Globals.h"//dnl ch74 201013
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...) #include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// //
// Local Defines // Local Defines
@@ -153,6 +152,7 @@
#endif #endif
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
@@ -177,7 +177,11 @@ extern void initMapViewAndBorderCoordinates(void);
UINT32 guiNumberOfMapTempFiles; //Test purposes UINT32 guiNumberOfMapTempFiles; //Test purposes
UINT32 guiSizeOfTempFiles; UINT32 guiSizeOfTempFiles;
CHAR gzNameOfMapTempFile[128]; CHAR gzNameOfMapTempFile[128];
#endif
//#define LOADSAVEGAME_LOGTIME 1 //#define LOADSAVEGAME_LOGTIME 1
#ifdef LOADSAVEGAME_LOGTIME
#include "TimeLogging.h"
#endif #endif
extern SOLDIERTYPE *gpSMCurrentMerc; extern SOLDIERTYPE *gpSMCurrentMerc;
@@ -1463,7 +1467,17 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
if ( guiCurrentSaveGameVersion >= MERC_PROFILE_INSERTION_DATA )
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof( this->usStrategicInsertionData ), sizeof( UINT32 ), numBytesRead );
}
else
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(UINT16), sizeof(UINT16), numBytesRead);
buffer += 4; // To make numBytesRead check match the struct size. 2 bytes from uint32 - uint16 and 2 bytes due to struct memory layout change when usStrategicInsertionData was increased to uint32
}
numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
@@ -3588,14 +3602,8 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = true; alreadySaving = true;
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
// Flugente: log how long this takes TimingLogInitialize("TimeLog_LoadSavedGame.txt");
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE* fp_timelog = fopen("LoadSavedGame_TimeLog.txt", "a");
#endif #endif
//clear out the save game header //clear out the save game header
memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) ); memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) );
@@ -3775,14 +3783,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
//Create the name of the file //Create the name of the file
CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLogWrite("Save ");
{ TimingLogWrite(zSaveGameName);
fprintf(fp_timelog, "Save savegame: %s\n", zSaveGameName); TimingLog("\nShutdown stuff", 10);
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//if the file already exists, delete it //if the file already exists, delete it
@@ -3919,12 +3922,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveTacticalStatusToSavedGame", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -3966,12 +3964,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" ); SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveLaptopInfoToSavedGame", 7);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
// //
@@ -4003,12 +3996,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" ); SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveSoldierStructure", 8);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4071,12 +4059,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveStrategicInfoToSavedFile", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
/*// Flugente: Save the strategic supply /*// Flugente: Save the strategic supply
@@ -4126,12 +4109,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveStrategicMovementGroupsToSaveGameFile", 3);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4148,12 +4126,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" ); SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveMapTempFilesToSavedGameFile", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveQuestInfoToSavedGameFile( hFile ) ) if( !SaveQuestInfoToSavedGameFile( hFile ) )
@@ -4319,12 +4292,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" ); SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveMilitiaMovementInformationToSaveGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveBulletStructureToSaveGameFile( hFile ) ) if( !SaveBulletStructureToSaveGameFile( hFile ) )
@@ -4564,12 +4532,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" ); SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveLuaGlobalToSaveGameFile", 7);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveDataSaveToSaveGameFile( hFile ) ) if( !SaveDataSaveToSaveGameFile( hFile ) )
@@ -4669,12 +4632,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
goto FAILED_TO_SAVE; goto FAILED_TO_SAVE;
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("File read done", 10);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//Close the saved game file //Close the saved game file
@@ -4755,22 +4713,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = false; alreadySaving = false;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("Update functions", 9);
{ TimingLogTotalTime("SaveSavedGame total", 9);
t0 = t1; TimingLogStop();
t1 = clock();
fprintf(fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
{
t0 = starttime;
t1 = clock();
fprintf(fp_timelog, "SaveSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
fclose(fp_timelog);
#endif #endif
return( TRUE ); return( TRUE );
@@ -4780,6 +4725,9 @@ FAILED_TO_SAVE:
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" ); SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLogStop();
#endif
FileClose( hFile ); FileClose( hFile );
@@ -4825,8 +4773,6 @@ extern int gEnemyPreservedTempFileVersion[256];
extern int gCivPreservedTempFileVersion[256]; extern int gCivPreservedTempFileVersion[256];
#include "time.h"
BOOLEAN LoadSavedGame( int ubSavedGameID ) BOOLEAN LoadSavedGame( int ubSavedGameID )
{ {
HWFILE hFile; HWFILE hFile;
@@ -4845,12 +4791,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
// Flugente: log how long this takes TimingLogInitialize("TimeLog_LoadSavedGame.txt");
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE *fp_timelog = fopen( "LoadSavedGame_TimeLog.txt", "a" );
#endif #endif
uiRelStartPerc = uiRelEndPerc =0; uiRelStartPerc = uiRelEndPerc =0;
@@ -4933,14 +4874,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLogWrite("Load ");
{ TimingLogWrite(zSaveGameName);
fprintf( fp_timelog, "Load savegame: %s\n", zSaveGameName ); TimingLog("\nShutdown stuff", 10);
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// open the save game file // open the save game file
@@ -5061,19 +4997,14 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLog("LoadTacticalStatusFromSavedGame", 6);
#endif
//This gets reset by the above function //This gets reset by the above function
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME; gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
#if LOADSAVEGAME_LOGTIME
if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif
//Load the game clock ingo //Load the game clock ingo
if( !LoadGameClock( hFile ) ) if( !LoadGameClock( hFile ) )
@@ -5194,12 +5125,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadLaptopInfoFromSavedGame", 7);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 0; uiRelEndPerc += 0;
@@ -5242,12 +5168,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadSoldierStructure", 8);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5376,12 +5297,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadStrategicInfoFromSavedFile", 6);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5442,12 +5358,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
ValidateStrategicGroups(); ValidateStrategicGroups();
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadStrategicMovementGroupsFromSavedGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 30; uiRelEndPerc += 30;
@@ -5467,12 +5378,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadMapTempFilesFromSavedGameFile", 5);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5771,12 +5677,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadMilitiaMovementInformationFromSavedGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -6336,12 +6237,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadLuaGlobalFromLoadGameFile", 6);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE) if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
@@ -6573,12 +6469,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("File read done", 10);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// //
@@ -7023,22 +6914,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements; gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("Update functions", 9);
{ TimingLogTotalTime("LoadSavedGame total", 9);
t0 = t1; TimingLogStop();
t1 = clock();
fprintf( fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
{
t0 = starttime;
t1 = clock();
fprintf( fp_timelog, "LoadSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
fclose( fp_timelog );
#endif #endif
DebugQuestInfo("\n--------- Game loaded ---------"); DebugQuestInfo("\n--------- Game loaded ---------");
@@ -7338,7 +7216,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
} }
} }
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
// Fix neutral flags // Fix neutral flags
if ( guiCurrentSaveGameVersion < 94 ) if ( guiCurrentSaveGameVersion < 94 )
{ {
@@ -7348,7 +7226,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
Menptr[ cnt].aiData.bNeutral = FALSE; Menptr[ cnt].aiData.bNeutral = FALSE;
} }
} }
#endif }
//#ifdef JA2UB //#ifdef JA2UB
//if the soldier has the NON weapon version of the merc knofe or merc umbrella //if the soldier has the NON weapon version of the merc knofe or merc umbrella
//ConvertWeapons( &Menptr[ cnt ] ); //ConvertWeapons( &Menptr[ cnt ] );
@@ -10029,9 +9907,9 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader )
} }
} }
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
uiEncryptionSet *= 11; uiEncryptionSet *= 11;
#endif }
uiEncryptionSet = uiEncryptionSet % 10; uiEncryptionSet = uiEncryptionSet % 10;
+72
View File
@@ -0,0 +1,72 @@
#include "TimeLogging.h"
#include "time.h"
#include <stdio.h>
clock_t starttime;
clock_t t0;
clock_t t1;
FILE* fp_timelog = nullptr;
static void indent(int n)
{
for (int i = 0; i < n; i++)
fputc('\t', fp_timelog);
}
void TimingLogInitialize(const CHAR8* filename)
{
starttime = clock();
t1 = starttime;
if (!fp_timelog)
{
fp_timelog = fopen(filename, "a");
}
}
void TimingLog(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
}
void TimingLogTotalTime(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - starttime) / CLOCKS_PER_SEC));
}
}
void TimingLogWrite(const CHAR8* text)
{
if (fp_timelog)
{
fprintf(fp_timelog, text);
}
}
void TimingLogStop()
{
if (fp_timelog)
{
fprintf(fp_timelog, "\n");
fclose(fp_timelog);
fp_timelog = nullptr;
}
}
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include "Types.h"
void TimingLogInitialize(const CHAR8* filename);
void TimingLog(const CHAR8* logEvent, int n);
void TimingLogTotalTime(const CHAR8* logEvent, int n);
void TimingLogWrite(const CHAR8* text);
void TimingLogStop();
-2
View File
@@ -1,8 +1,6 @@
#ifndef _BUILDDEFINES_H #ifndef _BUILDDEFINES_H
#define _BUILDDEFINES_H #define _BUILDDEFINES_H
#include "Language Defines.h"
//----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz ----- //----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz -----
// Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM), // Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM),
// you can access the briefing room feature from the laptop // you can access the briefing room feature from the laptop
+6 -8
View File
@@ -45,10 +45,10 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "WordWrap.h" #include "WordWrap.h"
#include "text.h" #include "text.h"
#include "Language Defines.h"
#include "IniReader.h" #include "IniReader.h"
#include "sgp_logger.h" #include "sgp_logger.h"
#include <language.hpp>
#define _UNICODE #define _UNICODE
// Networking Stuff // Networking Stuff
@@ -332,7 +332,7 @@ UINT32 InitScreenHandle(void)
if ( ubCurrentScreen == 255 ) if ( ubCurrentScreen == 255 )
{ {
#ifdef ENGLISH if( g_lang == i18n::Lang::en ) {
if( gfDoneWithSplashScreen ) if( gfDoneWithSplashScreen )
{ {
ubCurrentScreen = 0; ubCurrentScreen = 0;
@@ -342,9 +342,9 @@ UINT32 InitScreenHandle(void)
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
return( INTRO_SCREEN ); return( INTRO_SCREEN );
} }
#else } else {
ubCurrentScreen = 0; ubCurrentScreen = 0;
#endif }
} }
if ( ubCurrentScreen == 0 ) if ( ubCurrentScreen == 0 )
@@ -397,7 +397,7 @@ UINT32 InitScreenHandle(void)
// Handle queued .ini file error messages // Handle queued .ini file error messages
int y = 40; int y = 40;
sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger(); sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger();
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.txt", false, sgp::Logger::FLUSH_ON_DELETE); sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.log", false, sgp::Logger::FLUSH_ON_DELETE);
sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id); sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id);
while (! iniErrorMessages.empty()) { while (! iniErrorMessages.empty()) {
static BOOL iniErrorMessage_create_out_file = TRUE; static BOOL iniErrorMessage_create_out_file = TRUE;
@@ -407,7 +407,7 @@ UINT32 InitScreenHandle(void)
if (iniErrorMessage_create_out_file) if (iniErrorMessage_create_out_file)
{ {
y += 25; y += 25;
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.txt has been created." ); swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.log has been created." );
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED ); DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
iniErrorMessage_create_out_file = FALSE; iniErrorMessage_create_out_file = FALSE;
} }
@@ -959,7 +959,6 @@ void DoneFadeOutForDemoExitScreen( void )
// unused // unused
//extern INT8 gbFadeSpeed; //extern INT8 gbFadeSpeed;
#ifdef GERMAN
void DisplayTopwareGermanyAddress() void DisplayTopwareGermanyAddress()
{ {
VOBJECT_DESC vo_desc; VOBJECT_DESC vo_desc;
@@ -994,7 +993,6 @@ void DisplayTopwareGermanyAddress()
ExecuteBaseDirtyRectQueue(); ExecuteBaseDirtyRectQueue();
EndFrameBufferRender(); EndFrameBufferRender();
} }
#endif
UINT32 DemoExitScreenHandle(void) UINT32 DemoExitScreenHandle(void)
{ {
+7 -1
View File
@@ -238,7 +238,8 @@ void LoadGameUBOptions()
gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155); gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980); gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749); gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger( "Unfinished Business Settings", "POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749 );
gGameUBOptions.PowergenSectorExitgridSrcGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_SRC_GRIDNO", 10979 );
gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979); gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749); gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980); gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
@@ -356,6 +357,11 @@ void LoadGameUBOptions()
gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0); gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0);
gGameUBOptions.BettyBloodCatSectorX = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_X", 10 );
gGameUBOptions.BettyBloodCatSectorY = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Y", 9 );
gGameUBOptions.BettyBloodCatSectorZ = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Z", 0 );
if ( gGameUBOptions.InGameHeli == TRUE ) if ( gGameUBOptions.InGameHeli == TRUE )
gGameUBOptions.InGameHeliCrash = FALSE; gGameUBOptions.InGameHeliCrash = FALSE;
+4
View File
@@ -67,6 +67,7 @@ typedef struct
UINT32 PowergenSectorGridNo3; UINT32 PowergenSectorGridNo3;
UINT32 PowergenSectorGridNo4; UINT32 PowergenSectorGridNo4;
UINT32 PowergenSectorExitgridGridNo; UINT32 PowergenSectorExitgridGridNo;
UINT32 PowergenSectorExitgridSrcGridNo;
UINT32 PowergenFanSoundGridNo1; UINT32 PowergenFanSoundGridNo1;
UINT32 PowergenFanSoundGridNo2; UINT32 PowergenFanSoundGridNo2;
UINT32 StartFanbackupAgainGridNo; UINT32 StartFanbackupAgainGridNo;
@@ -220,6 +221,9 @@ typedef struct
UINT8 MaxNumberOfMercs; UINT8 MaxNumberOfMercs;
INT16 BettyBloodCatSectorX;
INT16 BettyBloodCatSectorY;
INT8 BettyBloodCatSectorZ;
} GAME_UB_OPTIONS; } GAME_UB_OPTIONS;
extern GAME_UB_OPTIONS gGameUBOptions; extern GAME_UB_OPTIONS gGameUBOptions;
+98 -22
View File
@@ -36,7 +36,6 @@
#include "Strategic Status.h" #include "Strategic Status.h"
#include "Merc Contract.h" #include "Merc Contract.h"
#include "Strategic Merc Handler.h" #include "Strategic Merc Handler.h"
#include "Language Defines.h"
#include "Assignments.h" #include "Assignments.h"
#include "Sound Control.h" #include "Sound Control.h"
#include "Quests.h" #include "Quests.h"
@@ -50,6 +49,7 @@
#include "Encrypted File.h" #include "Encrypted File.h"
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include <sstream> #include <sstream>
#include <language.hpp>
// //
//****** Defines ****** //****** Defines ******
@@ -148,10 +148,16 @@
#define FEE_X PRICE_X + 7 #define FEE_X PRICE_X + 7
#define FEE_Y NAME_Y #define FEE_Y NAME_Y
#define FEE_WIDTH 37 #define FEE_WIDTH 37
#define FEE_X_UB PRICE_X + 40
#define FEE_Y_UB STATS_Y + 28
#define FEE_Y_UB_NSGI STATS_Y
#define AIM_CONTRACT_X PRICE_X + 51 #define AIM_CONTRACT_X PRICE_X + 51
#define AIM_CONTRACT_Y FEE_Y #define AIM_CONTRACT_Y FEE_Y
#define AIM_CONTRACT_WIDTH 59 #define AIM_CONTRACT_WIDTH 59
#define AIM_CONTRACT_X_UB PRICE_X + 19
#define AIM_OFFER_X PRICE_X + 3
#define AIM_OFFER_WIDTH 110
#define ONEDAY_X AIM_CONTRACT_X #define ONEDAY_X AIM_CONTRACT_X
#define ONEWEEK_X AIM_CONTRACT_X #define ONEWEEK_X AIM_CONTRACT_X
@@ -1120,7 +1126,13 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Draw fee & contract //Draw fee & contract
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1129,9 +1141,6 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1140,6 +1149,7 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
#endif // JA2UB
} }
else else
{ {
@@ -1163,6 +1173,12 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
//Draw fee & contract //Draw fee & contract
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1172,9 +1188,6 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
@@ -1183,6 +1196,7 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
#endif
} }
DisableAimButton(); DisableAimButton();
@@ -1309,6 +1323,10 @@ BOOLEAN UpdateMercInfo(void)
if(gGameExternalOptions.gfUseNewStartingGearInterface) if(gGameExternalOptions.gfUseNewStartingGearInterface)
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1335,6 +1353,8 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif // JA2UB
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -1363,6 +1383,10 @@ BOOLEAN UpdateMercInfo(void)
} }
else else
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1389,6 +1413,7 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -2528,6 +2553,21 @@ BOOLEAN DisplayVideoConferencingDisplay()
DisplayMercChargeAmount(); DisplayMercChargeAmount();
#ifdef JA2UB
if (gubVideoConferencingMode == AIM_VIDEO_HIRE_MERC_MODE)
{
CHAR16 offerText[190];
swprintf(offerText, zNewTacticalMessages[TACT_MSG__AIMMEMBER_ONE_TIME_FEE], gMercProfiles[gbCurrentSoldier].zNickname);
const auto xCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_X + 115;
const auto yCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_Y + 45;
const auto textAreaWidth = 245;
SetFontShadow(AIM_M_VIDEO_NAME_SHADOWCOLOR);
DisplayWrappedString(xCoord, yCoord, textAreaWidth, 2, AIM_M_FONT_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, offerText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
SetFontShadow(DEFAULT_SHADOW);
}
#endif // JA2UB
// if( gfMercIsTalking && !gfIsAnsweringMachineActive) // if( gfMercIsTalking && !gfIsAnsweringMachineActive)
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] ) if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
{ {
@@ -2577,6 +2617,9 @@ BOOLEAN DisplayMercsVideoFace()
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown) void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
{ {
#ifdef JA2UB
return;
#else
UINT16 i, usPosY, usPosX; UINT16 i, usPosY, usPosX;
//First draw the select light for the contract length buttons //First draw the select light for the contract length buttons
@@ -2630,6 +2673,8 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP; usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
} }
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
#endif // JA2UB
} }
@@ -2653,7 +2698,10 @@ UINT32 DisplayMercChargeAmount()
giContractAmount = 0; giContractAmount = 0;
//the contract charge amount //the contract charge amount
#ifdef JA2UB
// Special offer for a limited time! Act fast!
giContractAmount = gMercProfiles[gbCurrentSoldier].uiWeeklySalary;
#else
// Get the salary rate // Get the salary rate
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY) if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary; giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
@@ -2675,6 +2723,7 @@ UINT32 DisplayMercChargeAmount()
{ {
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost; giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
} }
#endif
} }
@@ -2685,10 +2734,15 @@ UINT32 DisplayMercChargeAmount()
//if the merc hasnt just been hired //if the merc hasnt just been hired
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL ) // if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
{ {
#ifdef JA2UB
// Don't even have to pay for medical insurance! What a DEAL!
swprintf(wTemp, L"%s", wDollarTemp);
#else
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit ) if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] ); swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
else else
swprintf(wTemp, L"%s", wDollarTemp ); swprintf(wTemp, L"%s", wDollarTemp );
#endif // JA2UB
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -3887,14 +3941,14 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
MSYS_DisableRegion(&gSelectedShutUpMercRegion); MSYS_DisableRegion(&gSelectedShutUpMercRegion);
//Enable the ability to click on the BIG face to go to different screen //Enable the ability to click on the BIG face to go to different screen
MSYS_EnableRegion(&gSelectedFaceRegion); MSYS_EnableRegion(&gSelectedFaceRegion);
// EnableDisableCurrentVideoConferenceButtons(FALSE); // EnableDisableCurrentVideoConferenceButtons(FALSE);
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE ) if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
{ {
// Enable the current video conference buttons // Enable the current video conference buttons
EnableDisableCurrentVideoConferenceButtons(FALSE); EnableDisableCurrentVideoConferenceButtons(FALSE);
} }
fVideoConferenceCreated = FALSE; fVideoConferenceCreated = FALSE;
@@ -4085,6 +4139,22 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT); // InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE ); DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
#ifdef JA2UB
// Disable and hide contract length & gear purchase buttons
gfBuyEquipment = TRUE;
for (size_t i = 0; i < 3; i++)
{
DisableButton(giContractLengthButton[i]);
HideButton(giContractLengthButton[i]);
if (i < 2)
{
DisableButton(giBuyEquipmentButton[i]);
HideButton(giBuyEquipmentButton[i]);
}
}
#endif // JA2UB
} }
@@ -5297,11 +5367,17 @@ BOOLEAN DisplayShadedStretchedMercFace( UINT8 ubMercID, UINT16 usPosX, UINT16 us
void DemoHiringOfMercs( ) void DemoHiringOfMercs( )
{ {
INT16 i; INT16 i;
#ifdef GERMAN UINT8 MercID[5];
UINT8 MercID[]={ 7, 10, 4, 14, 50 }; MercID[0] = 7;
#else MercID[1] = 10;
UINT8 MercID[]={ 7, 10, 4, 42, 33 }; MercID[2] = 4;
#endif if( g_lang == i18n::Lang::de ) {
MercID[3] = 14;
MercID[4] = 50;
} else {
MercID[3] = 42;
MercID[4] = 33;
}
MERC_HIRE_STRUCT HireMercStruct; MERC_HIRE_STRUCT HireMercStruct;
static BOOLEAN fHaveCalledBefore=FALSE; static BOOLEAN fHaveCalledBefore=FALSE;
@@ -5392,20 +5468,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
//create the string to display to the user, looks like.... //create the string to display to the user, looks like....
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival // L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
//Germans version has a different argument order //Germans version has a different argument order
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString, zTimeString,
zSectorIDString ); zSectorIDString );
#else } else {
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
zSectorIDString, zSectorIDString,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString ); zTimeString );
#endif }
+1 -1
View File
@@ -627,7 +627,7 @@ TestTable::Display( )
{ {
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown], MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow, usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
MSYS_PRIORITY_HIGHEST, CURSOR_WWW, MSYS_PRIORITY_HIGHEST-3, CURSOR_WWW,
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack ); MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] ); MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
+21 -20
View File
@@ -20,6 +20,7 @@
// HEADROCK HAM 4 // HEADROCK HAM 4
#include "input.h" #include "input.h"
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item #include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
#include <language.hpp>
#define BOBBYR_DEFAULT_MENU_COLOR 255 #define BOBBYR_DEFAULT_MENU_COLOR 255
@@ -115,11 +116,7 @@
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1 #define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40 #define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
#ifdef CHINESE #define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH - 10 //BOBBYR_ITEM_QTY_NUM_X
#else
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#endif
#define BOBBY_RAY_NOT_PURCHASED 255 #define BOBBY_RAY_NOT_PURCHASED 255
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200 #define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
@@ -1765,11 +1762,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
{ {
if ( iSubFilter > -1 ) // Madd: new BR filters if ( iSubFilter > -1 ) // Madd: new BR filters
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter ) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter )
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bAddItem = TRUE; bAddItem = TRUE;
} }
else else
@@ -2506,7 +2503,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED) if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
{ {
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased); swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
DrawTextToScreen(sTemp, BOBBYR_ITEMS_BOUGHT_X, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); auto bobbyRItemsBoughtX{ BOBBYR_ITEMS_BOUGHT_X };
if (g_lang == i18n::Lang::zh) {
bobbyRItemsBoughtX -= 10;
}
DrawTextToScreen(sTemp, bobbyRItemsBoughtX, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
} }
@@ -2516,11 +2517,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
//if it's a used item, display how damaged the item is //if it's a used item, display how damaged the item is
if( fUsed ) if( fUsed )
{ {
#ifdef CHINESE if ( g_lang == i18n::Lang::zh ) {
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
#else } else {
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality ); swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
#endif }
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -2653,11 +2654,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
{ {
if (iSubFilter > -1 ) if (iSubFilter > -1 )
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment ) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE; bCntNumItems = TRUE;
} }
else else
@@ -3641,11 +3642,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
{ {
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntItem = TRUE; bCntItem = TRUE;
} }
else else
@@ -4181,7 +4182,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (it = range.first; it != range.second; it++) for (it = range.first; it != range.second; it++)
{ {
UINT16 attachmentId = it->second.attachmentIndex; UINT16 attachmentId = it->second.attachmentIndex;
if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE)) if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE) if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
@@ -4194,7 +4195,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++) for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
{ {
// If the attachment is not hidden and attachable to the gun (usItemNumber) // If the attachment is not hidden and attachable to the gun (usItemNumber)
if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment && if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) &&
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId)) ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
+7 -6
View File
@@ -30,6 +30,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#include <vfs/Core/vfs.h> #include <vfs/Core/vfs.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#include <language.hpp>
/* /*
typedef struct typedef struct
@@ -488,11 +489,11 @@ BOOLEAN EnterBobbyRMailOrder()
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE ); SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
#ifdef FRENCH if(g_lang == i18n::Lang::fr) {
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
#else } else {
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
#endif }
// Accept Order button // Accept Order button
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 ); guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
@@ -504,11 +505,11 @@ BOOLEAN EnterBobbyRMailOrder()
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback); DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
#ifdef FRENCH if(g_lang == i18n::Lang::fr) {
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
#else } else {
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
#endif }
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED ); SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
if( gbSelectedCity == -1 ) if( gbSelectedCity == -1 )
+9 -13
View File
@@ -24,6 +24,7 @@
#include "text.h" #include "text.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
#define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138 #define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138
#define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195 #define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195
@@ -552,14 +553,14 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
//Heinz (18.01.2009): Russian layout //Heinz (18.01.2009): Russian layout
// ViSoR (07.01.2012) : Russian and Belarussian layouts // ViSoR (07.01.2012) : Russian and Belarussian layouts
// //
#if defined(RUSSIAN) || defined(BELARUSSIAN) if(g_lang == i18n::Lang::ru) {
// ViSoR (02.02.2013): Fix for Cyrillic layouts // ViSoR (02.02.2013): Fix for Cyrillic layouts
DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 ); DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 );
DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF; DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF;
if( layout == 0x419 ) // Russian if( layout == 0x419 ) // Russian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨"; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨ ";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
@@ -567,28 +568,23 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
else if( layout == 0x423 ) // Belarussian else if( layout == 0x423 ) // Belarussian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨"; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨ ";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
} }
else if( !CheckIsKeyValid( uiKey ) ) else if( !CheckIsKeyValid( uiKey ) )
uiKey = '#'; uiKey = '#';
}
if( uiKey != '#') if( (g_lang != i18n::Lang::ru &&
#else uiKey >= 'A' && uiKey <= 'Z' ||
#ifndef USE_CODE_PAGE
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' || uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' || uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey == '_' || uiKey == '.' ||
uiKey == ' ' || uiKey == '"' || uiKey == ' ' || uiKey == '"' ||
uiKey == 39 // This is ' which cannot be written explicitly here of course uiKey == 39 // This is ' which cannot be written explicitly here of course
) ) ||
#else uiKey != '#')
if( charSet::IsFromSet( uiKey, charSet::CS_SPACE|charSet::CS_ALPHA_NUM|charSet::CS_SPECIAL_ALPHA ) )
#endif
#endif
{ {
// if the current string position is at max or great, do nothing // if the current string position is at max or great, do nothing
switch( ubTextEnterMode ) switch( ubTextEnterMode )
+5 -5
View File
@@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
if(iOrder[i]!=-1) if(iOrder[i]!=-1)
{ {
// skip if this item is an attachment // skip if this item is an attachment
if(Item[tInv[iOrder[i]].inv].attachment) if(ItemIsAttachment(tInv[iOrder[i]].inv))
continue; continue;
iSet = FALSE; iSet = FALSE;
number = tInv[iOrder[i]].iNumber; number = tInv[iOrder[i]].iNumber;
@@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
return HELMETPOS; return HELMETPOS;
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST ) if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
return VESTPOS; return VESTPOS;
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment)) if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) )
return LEGPOS; return LEGPOS;
break; break;
case IC_BLADE: case IC_BLADE:
@@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
case IC_GUN: case IC_GUN:
if ( pProfile->inv[HANDPOS] == NONE ) if ( pProfile->inv[HANDPOS] == NONE )
return HANDPOS; return HANDPOS;
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded)) if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS])))
return SECONDHANDPOS; return SECONDHANDPOS;
if((UsingNewInventorySystem() == true)) if((UsingNewInventorySystem() == true))
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0) if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
@@ -1681,7 +1681,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
// give ammo for guns // give ammo for guns
Assert( usItem < gMAXITEMS_READ ); Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher ) if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
@@ -1726,7 +1726,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
MakeProfileInvItemAnySlot(pProfile,usItem,100,1); MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
// give ammo for guns // give ammo for guns
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher ) if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
+1 -1
View File
@@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
{ {
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
if (Item[usItem].twohanded) { if (ItemIsTwoHanded(usItem)) {
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
} }
else { else {
+4 -3
View File
@@ -38,6 +38,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#endif #endif
#include <language.hpp>
#define IMP_SEEK_AMOUNT 5 * 80 * 2 #define IMP_SEEK_AMOUNT 5 * 80 * 2
@@ -204,18 +205,18 @@ void PrintImpText( void )
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0);
//inshy (18.01.2009): fix position for russian text //inshy (18.01.2009): fix position for russian text
#ifdef RUSSIAN if( g_lang == i18n::Lang::ru ) {
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
#else } else {
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
#endif }
break; break;
case ( IMP_PERSONALITY ): case ( IMP_PERSONALITY ):
+116 -40
View File
@@ -418,6 +418,34 @@ BOOLEAN EnterMercsFiles()
return( TRUE ); return( TRUE );
} }
static void TryToHireMERC()
{
if ( (gMercProfiles[GetAvailableMercIDFromMERCArray( gubCurMercIndex )].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
{
#ifdef JA2UB
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
{
fMercBuyEquipment = 1;
MercProcessHireAfterGear();
}
else
{
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
}
#else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
#endif // JA2UB
}
}
void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{ {
if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP) if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
@@ -442,15 +470,7 @@ void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
//else try to hire the merc //else try to hire the merc
else else
{ {
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable ) TryToHireMERC();
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
} }
} }
@@ -701,15 +721,7 @@ void BtnMercHireButtonCallback(GUI_BUTTON *btn,INT32 reason)
//else try to hire the merc //else try to hire the merc
else else
{ {
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable ) TryToHireMERC();
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY); InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
@@ -1040,14 +1052,25 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawNumeralsToScreen(gMercProfiles[ ubMercID ].bMedical, 3, MERC_STATS_SECOND_NUM_COL_X, usPosY, MERC_STATS_FONT, ubColor); DrawNumeralsToScreen(gMercProfiles[ ubMercID ].bMedical, 3, MERC_STATS_SECOND_NUM_COL_X, usPosY, MERC_STATS_FONT, ubColor);
usPosY += MERC_SPACE_BN_LINES; usPosY += MERC_SPACE_BN_LINES;
//Daily Salary //Merc Salary
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); #ifdef JA2UB
// One time "Fee" instead of "Salary" per day
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT); usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
swprintf(sString, L"%d", gMercProfiles[ ubMercID ].sSalary); swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary );
InsertCommasForDollarFigure( sString ); InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString ); InsertDollarSignInToString( sString );
swprintf(sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY]); #else
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary );
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
#endif // JA2UB
wcscat( sString, sTemp ); wcscat( sString, sTemp );
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
@@ -1059,14 +1082,27 @@ void DisplayMercsStats( UINT8 ubMercID )
if (gubCurMercFilesTogglePage == MERC_FILES_INV_PAGE) if (gubCurMercFilesTogglePage == MERC_FILES_INV_PAGE)
{ {
//Gear Cost //Gear Cost
usPosY = usPosY + 145; usPosY = usPosY + 148;
DrawTextToScreen( MercInfo[MERC_FILES_GEAR], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen( MercInfo[MERC_FILES_GEAR], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if ( (gMercProfiles[ ubMercID ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS ) if ( (gMercProfiles[ubMercID].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS)
&& ( !(gMercProfiles[ ubMercID ].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable ) ) && (!(gMercProfiles[ubMercID].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable) )
{
gMercProfiles[ ubMercID ].usOptionalGearCost = 0; gMercProfiles[ ubMercID ].usOptionalGearCost = 0;
}
#ifdef JA2UB
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
{
gMercProfiles[ubMercID].usOptionalGearCost = 0;
swprintf(NsString, L"+ "); // Special offer text above the gear cost
const auto y = usPosY - MERC_SPACE_BN_LINES + 2;
swprintf( NsString, MercInfo[MERC_FILES_SPECIAL_OFFER] );
DrawTextToScreen( NsString, usPosX, y, 95, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
}
#endif // JA2UB
swprintf( NsString, L"+ " );
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost); swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost);
InsertCommasForDollarFigure( sTemp ); InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp ); InsertDollarSignInToString( sTemp );
@@ -1078,7 +1114,11 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawTextToScreen( MercInfo[MERC_FILES_TOTAL], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_NAME_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen( MercInfo[MERC_FILES_TOTAL], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_NAME_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
swprintf(N2sString, L"= "); swprintf(N2sString, L"= ");
#ifdef JA2UB
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary );
#else
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary); swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
#endif
InsertCommasForDollarFigure( sTemp ); InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp ); InsertDollarSignInToString( sTemp );
wcscat( N2sString, sTemp ); wcscat( N2sString, sTemp );
@@ -1175,6 +1215,22 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
return(FALSE);//not enough big ones $$$sATMText return(FALSE);//not enough big ones $$$sATMText
} }
#ifdef JA2UB
Namount = 0;
Namount += gMercProfiles[ubMercID].uiWeeklySalary;
if ( gSelectedMercKit > 0 )
{
Namount += gMercProfiles[ubMercID].usOptionalGearCost;
}
if ( Namount > LaptopSaveInfo.iCurrentBalance )
{
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[4], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
return(FALSE);//not enough big ones $$$sATMText
}
#endif // JA2UB
bReturnCode = HireMerc( &HireMercStruct ); bReturnCode = HireMerc( &HireMercStruct );
//already have limit of mercs on the team //already have limit of mercs on the team
@@ -1196,16 +1252,25 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount ); AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount );
} }
#ifdef JA2UB #ifdef JA2UB
//add an entry in the finacial page for the hiring of the merc //add an entry in the finacial page for the hiring of the merc
AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -(INT32)( gMercProfiles[ubMercID].uiWeeklySalary ) ); INT32 totalCost = gMercProfiles[ubMercID].uiWeeklySalary;
#endif if ( gSelectedMercKit > 0 ) // First kit is included in the initial fee
{
totalCost += gMercProfiles[ubMercID].usOptionalGearCost;
}
AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -totalCost );
#endif
//JMich_MMG: Setting the flag that we bought the gear and still haven't paid for it if we succesfully hired the merc //JMich_MMG: Setting the flag that we bought the gear and still haven't paid for it if we succesfully hired the merc
if ( fMercBuyEquipment ) if ( fMercBuyEquipment )
{ {
gMercProfiles[ ubMercID ].ubMiscFlags |= PROFILE_MISC_FLAG_ALREADY_USED_ITEMS; gMercProfiles[ ubMercID ].ubMiscFlags |= PROFILE_MISC_FLAG_ALREADY_USED_ITEMS;
#ifdef JA2UB
// Gear cost gets added to initial hiring fee in UB
#else
gMercProfiles[ ubMercID ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID; gMercProfiles[ ubMercID ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID;
#endif // JA2UB
} }
return(TRUE); return(TRUE);
@@ -1305,15 +1370,7 @@ void HandleMercsFilesKeyBoardInput( )
//else try to hire the merc //else try to hire the merc
else else
{ {
//bought gear before TryToHireMERC();
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
//prompt to buy gear
else
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
} }
break; break;
@@ -1783,11 +1840,22 @@ void MercWeaponKitSelectionUpdate(UINT8 selectedInventory)
void MercHireButtonGearYesNoCallback (UINT8 bExitValue) void MercHireButtonGearYesNoCallback (UINT8 bExitValue)
{ {
//yes, buy gear //yes, buy gear
if( bExitValue == MSG_BOX_RETURN_YES ) if ( bExitValue == MSG_BOX_RETURN_YES )
{
fMercBuyEquipment = 1; fMercBuyEquipment = 1;
}
//no, no gear //no, no gear
else else
{
#ifdef JA2UB
// Switch to the free, first kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
fMercBuyEquipment = 1;
#else
fMercBuyEquipment = 0; fMercBuyEquipment = 0;
#endif // JA2UB
}
MercProcessHireAfterGear(); MercProcessHireAfterGear();
} }
@@ -1810,6 +1878,10 @@ void MercProcessHireAfterGear()
void NextMercMember() void NextMercMember()
{ {
// Reset selected kit, cannot assume next merc has more than 1 kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
if (gfKeyState [ CTRL ]) if (gfKeyState [ CTRL ])
gubCurMercIndex = LaptopSaveInfo.gubLastMercIndex; gubCurMercIndex = LaptopSaveInfo.gubLastMercIndex;
else if (gfKeyState [ SHIFT ]) else if (gfKeyState [ SHIFT ])
@@ -1840,6 +1912,10 @@ void NextMercMember()
void PrevMercMember() void PrevMercMember()
{ {
// Reset selected kit, cannot assume next merc has more than 1 kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
if (gfKeyState [ CTRL ]) if (gfKeyState [ CTRL ])
gubCurMercIndex = 0; gubCurMercIndex = 0;
else if (gfKeyState [ SHIFT ]) else if (gfKeyState [ SHIFT ])
+1 -1
View File
@@ -15,7 +15,7 @@
#include "../../TileEngine/Isometric Utils.h" // defines NOWHERE #include "../../TileEngine/Isometric Utils.h" // defines NOWHERE
#include "../../Utils/Debug Control.h" // LiveMessage #include "../../Utils/Debug Control.h" // LiveMessage
#include "../../Utils/Font Control.h" // ScreenMsg about deadlock #include "../../Utils/Font Control.h" // ScreenMsg about deadlock
#include "../../Utils/Text.h" // Sniper warning #include <Text.h> // Sniper warning
#include "../../Utils/message.h" // ditto #include "../../Utils/message.h" // ditto
+2 -2
View File
@@ -1198,7 +1198,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
if ( pObj ) if ( pObj )
{ {
// abort if this is a launcher without ammo // abort if this is a launcher without ammo
if ( Item[pObj->usItem].rocketlauncher && !Item[pObj->usItem].singleshotrocketlauncher ) if (ItemIsRocketLauncher(pObj->usItem) && !ItemIsSingleShotRocketLauncher(pObj->usItem))
{ {
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE ); OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
if ( !pAttachment->exists( ) ) if ( !pAttachment->exists( ) )
@@ -1227,7 +1227,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName ); MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName );
// 'fire' (remove shot) // 'fire' (remove shot)
if ( Item[pObj->usItem].singleshotrocketlauncher ) if (ItemIsSingleShotRocketLauncher(pObj->usItem))
{ {
CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj ); CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj );
+12 -12
View File
@@ -1562,7 +1562,7 @@ BOOLEAN CanCharacterPatient( SOLDIERTYPE *pSoldier )
return ( TRUE ); return ( TRUE );
// Flugente: stats can also be damaged // Flugente: stats can also be damaged
if ( !UsingFoodSystem() || ( pSoldier->bFoodLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold && pSoldier->bDrinkLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold ) ) if ( !UsingFoodSystem() || ( pSoldier->bFoodLevel >= FoodMoraleMods[FOOD_NORMAL].bThreshold && pSoldier->bDrinkLevel >= FoodMoraleMods[FOOD_NORMAL].bThreshold ) )
{ {
if ( pSoldier->usStarveDamageHealth > 0 || pSoldier->usStarveDamageStrength > 0 ) if ( pSoldier->usStarveDamageHealth > 0 || pSoldier->usStarveDamageStrength > 0 )
return ( TRUE ); return ( TRUE );
@@ -3349,7 +3349,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
} }
// can't repair at all without a toolkit // can't repair at all without a toolkit
if (!Item[pSoldier->inv[HANDPOS].usItem].toolkit ) if (!ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
{ {
*pusMaxPts = 0; *pusMaxPts = 0;
return(0); return(0);
@@ -4063,7 +4063,7 @@ UINT16 ToolKitPoints(SOLDIERTYPE *pSoldier)
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket) for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket)
{ {
if( Item[pSoldier->inv[ ubPocket ].usItem].toolkit ) if(ItemIsToolkit(pSoldier->inv[ ubPocket ].usItem))
{ {
usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) ); usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) );
} }
@@ -5138,7 +5138,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, IN
// repairs on electronic items take twice as long if the guy doesn't have the skill // repairs on electronic items take twice as long if the guy doesn't have the skill
// Technician/Electronic traits - repairing electronic items - SANDRO // Technician/Electronic traits - repairing electronic items - SANDRO
if ( Item[ usItem ].electronic ) if (ItemIsElectronic(usItem))
{ {
if (gGameOptions.fNewTraitSystem) if (gGameOptions.fNewTraitSystem)
{ {
@@ -5745,7 +5745,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold ) BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )
{ {
// check to see if item can/needs to be repaired // check to see if item can/needs to be repaired
if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) ) if ( ( bStatus < 100) && ItemIsRepairable(usItem) )
{ {
if ( gGameExternalOptions.fAdvRepairSystem ) if ( gGameExternalOptions.fAdvRepairSystem )
{ {
@@ -10459,7 +10459,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT; INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT;
// if there isn't a toolkit in his hand // if there isn't a toolkit in his hand
if( Item[pSoldier->inv[ HANDPOS].usItem].toolkit ) if(ItemIsToolkit(pSoldier->inv[ HANDPOS].usItem))
{ {
bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier; bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier;
bToolkitPocket = HANDPOS; bToolkitPocket = HANDPOS;
@@ -10469,7 +10469,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if( Item[pSoldier->inv[ bPocket ].usItem].toolkit && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus) if(ItemIsToolkit(pSoldier->inv[ bPocket ].usItem) && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
{ {
bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier; bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier;
bToolkitPocket = bPocket; bToolkitPocket = bPocket;
@@ -10503,7 +10503,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
fTeamPanelDirty = TRUE; fTeamPanelDirty = TRUE;
// if there is a MEDICAL BAG in his hand, we're set // if there is a MEDICAL BAG in his hand, we're set
if ( Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit ) if (ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem))
{ {
return(TRUE); return(TRUE);
} }
@@ -10511,7 +10511,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
// run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found // run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if ( Item[pSoldier->inv[ bPocket ].usItem].medicalkit ) if (ItemIsMedicalKit(pSoldier->inv[ bPocket ].usItem))
{ {
medkit_found = true; medkit_found = true;
can_swap = true; can_swap = true;
@@ -10579,7 +10579,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
return FALSE; return FALSE;
// we didn't find a medical bag, so settle for a FIRST AID KIT // we didn't find a medical bag, so settle for a FIRST AID KIT
if ( Item[pSoldier->inv[ HANDPOS ].usItem].firstaidkit ) if (ItemIsFirstAidKit(pSoldier->inv[ HANDPOS ].usItem))
{ {
return(TRUE); return(TRUE);
} }
@@ -10588,10 +10588,10 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if ( Item[pSoldier->inv[ bPocket ].usItem].firstaidkit ) if (ItemIsFirstAidKit(pSoldier->inv[ bPocket ].usItem))
{ {
// CHRISL: This needs to start with the first "non-big" pocket. // CHRISL: This needs to start with the first "non-big" pocket.
if( ( Item[ pSoldier -> inv[ HANDPOS ].usItem ].twohanded ) && ( bPocket >= SMALLPOCKSTART ) ) if( (ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && (bPocket >= SMALLPOCKSTART)))
{ {
// first move from hand to second hand // first move from hand to second hand
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE ); SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
+2 -2
View File
@@ -4257,7 +4257,7 @@ BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
{ {
pItem = &pSoldier->inv[i]; pItem = &pSoldier->inv[i];
if ( Item[pItem->usItem].cannon ) if (ItemIsCannon(pItem->usItem))
{ {
PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN ); PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN );
@@ -4291,7 +4291,7 @@ BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
{ {
pItem = &pSoldier->inv[i]; pItem = &pSoldier->inv[i];
if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || Item[pItem->usItem].cannon ) if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || ItemIsCannon(pItem->usItem))
{ {
pAttacker->bWeaponSlot = (INT8)i; pAttacker->bWeaponSlot = (INT8)i;
if ( gpAR->fUnlimitedAmmo ) if ( gpAR->fUnlimitedAmmo )
+1 -1
View File
@@ -627,7 +627,7 @@ void HourlySmokerUpdate( )
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
{ {
if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].cigarette ) if ( pSoldier->inv[bLoop].exists( ) && ItemIsCigarette(pSoldier->inv[bLoop].usItem) )
{ {
pObj = &(pSoldier->inv[bLoop]); pObj = &(pSoldier->inv[bLoop]);
+2 -20
View File
@@ -96,6 +96,7 @@ extern "C" {
#include "Merc Contract.h" #include "Merc Contract.h"
#include "message.h" #include "message.h"
#include "Town Militia.h" #include "Town Militia.h"
#include <language.hpp>
extern UINT8 gubWaitingForAllMercsToExitCode; extern UINT8 gubWaitingForAllMercsToExitCode;
@@ -13208,26 +13209,7 @@ static int l_GetUsedLanguage( lua_State *L )
{ {
if ( lua_gettop( L ) ) if ( lua_gettop( L ) )
{ {
INT32 val = 0; INT32 val = static_cast<INT32>(g_lang);
#if defined(ENGLISH)
val = 0;
#elif defined(GERMAN)
val = 1;
#elif defined(RUSSIAN)
val = 2;
#elif defined(DUTCH)
val = 3;
#elif defined(POLISH)
val = 4;
#elif defined(FRENCH)
val = 5;
#elif defined(ITALIAN)
val = 6;
#elif defined(CHINESE)
val = 7;
#endif
lua_pushinteger( L, val ); lua_pushinteger( L, val );
} }
+1 -2
View File
@@ -1278,8 +1278,7 @@ void LandHelicopter( void )
else else
{ {
#ifdef JA2UB #ifdef JA2UB
Assert( 0 ); //No meanwhiles in UB
//No meanwhiles
#else #else
// play meanwhile scene if it hasn't been used yet // play meanwhile scene if it hasn't been used yet
HandleKillChopperMeanwhileScene(); HandleKillChopperMeanwhileScene();
+1 -1
View File
@@ -50,11 +50,11 @@
#include "Ja25 Strategic Ai.h" #include "Ja25 Strategic Ai.h"
#include "MapScreen Quotes.h" #include "MapScreen Quotes.h"
#include "SaveLoadGame.h" #include "SaveLoadGame.h"
#include "strategicmap.h"
#endif #endif
#include "connect.h" #include "connect.h"
#include <language.hpp>
struct UILayout_BottomButtons struct UILayout_BottomButtons
{ {
-6
View File
@@ -4,12 +4,6 @@
#include "types.h" #include "types.h"
#include "Soldier Control.h" #include "Soldier Control.h"
#ifdef CHINESE //zwwoooooo: Chinese fonts relatively high , so to reduce the number of rows
#define MAX_MESSAGES_ON_MAP_BOTTOM 6
#else
#define MAX_MESSAGES_ON_MAP_BOTTOM 9
#endif
#ifdef JA2UB #ifdef JA2UB
extern INT8 gbExitingMapScreenToWhere; extern INT8 gbExitingMapScreenToWhere;
#endif #endif
@@ -1481,7 +1481,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !(Item[twItem->object.usItem].singleshotrocketlauncher)) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem))
{ {
EmptyWeaponMagazine( &twItem->object, &gItemPointer ); EmptyWeaponMagazine( &twItem->object, &gItemPointer );
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
@@ -6009,7 +6009,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
//original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary. //original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary.
// ... if we use overheating and item is a gun, a launcher or a barrel ... // ... if we use overheating and item is a gun, a launcher or a barrel ...
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[itemStack->usItem].barrel == TRUE ) ) if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel(itemStack->usItem) ) )
{ {
for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ... for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
{ {
@@ -6017,7 +6017,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ... FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ...
if ( Item[itemStack->usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ... if (ItemIsBarrel(itemStack->usItem)) // ... a barrel lying around cools down a bit faster ...
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel; cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ... FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
+11 -10
View File
@@ -56,6 +56,7 @@
#include "MilitiaSquads.h" #include "MilitiaSquads.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
// added by Flugente // added by Flugente
extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH]; extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH];
@@ -1199,11 +1200,11 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen1");
// don't show loyalty string until loyalty tracking for that town has been started // don't show loyalty string until loyalty tracking for that town has been started
if( gTownLoyalty[ bTown ].fStarted && gfTownUsesLoyalty[ bTown ]) if( gTownLoyalty[ bTown ].fStarted && gfTownUsesLoyalty[ bTown ])
{ {
#ifdef CHINESE if ( g_lang == i18n::Lang::zh ) {
swprintf( sStringA, L"%d%£¥%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); swprintf( sStringA, L"%d%£¥%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]);
#else } else {
swprintf( sStringA, L"%d%%%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); swprintf( sStringA, L"%d%%%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]);
#endif }
// if loyalty is too low to train militia, and militia training is allowed here // if loyalty is too low to train militia, and militia training is allowed here
if ( ( gTownLoyalty[ bTown ].ubRating < iMinLoyaltyToTrain ) && MilitiaTrainingAllowedInTown( bTown ) ) if ( ( gTownLoyalty[ bTown ].ubRating < iMinLoyaltyToTrain ) && MilitiaTrainingAllowedInTown( bTown ) )
@@ -4873,11 +4874,11 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
// if potential is not nil, show percentage of the two // if potential is not nil, show percentage of the two
if (GetMaxPeriodicRemovalFromMine(ubMineIndex) > 0) if (GetMaxPeriodicRemovalFromMine(ubMineIndex) > 0)
{ {
#ifdef CHINESE if ( g_lang == i18n::Lang::zh ) {
swprintf( wSubString, L" (%d%£¥%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); swprintf( wSubString, L" (%d%£¥%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) );
#else } else {
swprintf( wSubString, L" (%d%%%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); swprintf( wSubString, L" (%d%%%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) );
#endif }
wcscat( wString, wSubString ); wcscat( wString, wSubString );
} }
@@ -5282,12 +5283,12 @@ BOOLEAN LoadMilitiaPopUpBox( void )
// load the militia pop up box // load the militia pop up box
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if (iResolution >= _640x480 && iResolution < _800x600) if ( isWidescreenUI() || iResolution >= _1024x768)
FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile);
else if (iResolution < _1024x768) else if (iResolution >= _800x600)
FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile);
else else
FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia)); CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia));
+1 -1
View File
@@ -864,7 +864,7 @@ void EndMeanwhile( )
{ {
// We leave this sector open for our POWs to escape! // We leave this sector open for our POWs to escape!
// Set music mode to enemy present! // Set music mode to enemy present!
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT ); SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
+1 -1
View File
@@ -342,8 +342,8 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
// Ja25: no loyalty // Ja25: no loyalty
#else #else
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ ); HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ );
UpdateAirspaceControl( );
#endif #endif
UpdateAirspaceControl( );
// if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet // if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet
if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) ) if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) )
{ {
+1 -1
View File
@@ -1071,7 +1071,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
//Disable the options button when the auto resolve screen comes up //Disable the options button when the auto resolve screen comes up
EnableDisAbleMapScreenOptionsButton( FALSE ); EnableDisAbleMapScreenOptionsButton( FALSE );
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ];
+1 -1
View File
@@ -3171,7 +3171,7 @@ BOOLEAN CheckPendingNonPlayerTeam( UINT8 usTeam )
void HandleBloodCatDeaths( SECTORINFO *pSector ) void HandleBloodCatDeaths( SECTORINFO *pSector )
{ {
//if the current sector is the first part of the town //if the current sector is the first part of the town
if( gWorldSectorX == 10 && gWorldSectorY == 9 && gbWorldSectorZ == 0 ) if( gWorldSectorX == BETTY_BLOODCAT_SECTOR_X && gWorldSectorY == BETTY_BLOODCAT_SECTOR_Y && gbWorldSectorZ == BETTY_BLOODCAT_SECTOR_Z )
{ {
//if ALL the bloodcats are killed //if ALL the bloodcats are killed
if( pSector->bBloodCats == 0 ) if( pSector->bBloodCats == 0 )
+6 -6
View File
@@ -4417,16 +4417,16 @@ void SetupInfo()
// (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?) // (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?)
for (UINT16 i = 0; i < MAXITEMS; ++i) for (UINT16 i = 0; i < MAXITEMS; ++i)
{ {
if (Item[i].gascan) ItemIdCache::gasCans.push_back(i); if (ItemIsGascan(i)) ItemIdCache::gasCans.push_back(i);
else if (Item[i].firstaidkit) ItemIdCache::firstAidKits.push_back(i); else if (ItemIsFirstAidKit(i)) ItemIdCache::firstAidKits.push_back(i);
else if (Item[i].medicalkit) ItemIdCache::medKits.push_back(i); else if (ItemIsMedicalKit(i)) ItemIdCache::medKits.push_back(i);
else if (Item[i].toolkit) ItemIdCache::toolKits.push_back(i); else if (ItemIsToolkit(i)) ItemIdCache::toolKits.push_back(i);
else if (Item[i].usItemClass & IC_AMMO) else if (Item[i].usItemClass & IC_AMMO)
{ {
if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX) if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX)
{ {
if ((gGameOptions.fGunNut || !Item[i].biggunlist) if ((gGameOptions.fGunNut || !ItemIsOnlyInTonsOfGuns(i))
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !Item[i].scifi)) && (gGameOptions.ubGameStyle == STYLE_SCIFI || !ItemIsOnlyInScifi(i)))
{ {
// coolness runs from 1-10, so apply offset // coolness runs from 1-10, so apply offset
const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10); const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10);
+55 -18
View File
@@ -1610,6 +1610,11 @@ void InitStrategicAI()
case 1: case 1:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
// (0,0) coordinates signify a not used cache sector
if ( gModSettings.ubWeaponCache1X == 0 || gModSettings.ubWeaponCache1Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
@@ -1628,6 +1633,10 @@ void InitStrategicAI()
case 2: case 2:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache2X == 0 || gModSettings.ubWeaponCache2Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
@@ -1646,6 +1655,10 @@ void InitStrategicAI()
case 3: case 3:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache3X == 0 || gModSettings.ubWeaponCache3Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
@@ -1664,6 +1677,10 @@ void InitStrategicAI()
case 4: case 4:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache4X == 0 || gModSettings.ubWeaponCache4Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
@@ -1682,6 +1699,10 @@ void InitStrategicAI()
case 5: case 5:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache5X == 0 || gModSettings.ubWeaponCache5Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
@@ -1706,25 +1727,40 @@ void InitStrategicAI()
} }
else else
{ {
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11 if ( gModSettings.ubWeaponCache1X != 0 && gModSettings.ubWeaponCache1Y != 0 )
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; {
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2); pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y )]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5 if ( gModSettings.ubWeaponCache2X != 0 && gModSettings.ubWeaponCache2Y != 0 )
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; {
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2); pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y )]; //SEC_H5
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10 if ( gModSettings.ubWeaponCache3X != 0 && gModSettings.ubWeaponCache3Y != 0 )
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; {
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2); pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y )]; //SEC_H10
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12 if ( gModSettings.ubWeaponCache4X != 0 && gModSettings.ubWeaponCache4Y != 0 )
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; {
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2); pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y )]; //SEC_J12
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9 if ( gModSettings.ubWeaponCache5X != 0 && gModSettings.ubWeaponCache5Y != 0 )
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; {
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2); pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y )]; //SEC_M9
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
}
/* /*
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
@@ -7115,15 +7151,16 @@ void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &
tankCount++; tankCount++;
} }
if ( gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) ) if ( troopCount > 0 && gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) )
{ {
troopCount--; troopCount--;
jeepCount++; jeepCount++;
} }
if ( gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() ) if ( troopCount > 0 && gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() )
{ {
const int numRobots = 1 + Random(difficultyMod); // Limit amount of robots, if randomized difficulty bonus would cause us to go over the troopCount amount
const int numRobots = min( (1 + Random(difficultyMod)), troopCount);
troopCount -= numRobots; troopCount -= numRobots;
robotCount += numRobots; robotCount += numRobots;
} }
+1 -1
View File
@@ -1334,7 +1334,7 @@ void CheckForMissingHospitalSupplies( void )
} }
} }
#endif//obsoleteCode #endif//obsoleteCode
if ( Item[pObj->usItem].firstaidkit || Item[pObj->usItem].medicalkit || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER ) if (ItemIsFirstAidKit(pObj->usItem) || ItemIsMedicalKit(pObj->usItem) || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
{ {
for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) { for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) {
if ( iter->data.objectStatus > 60 ) if ( iter->data.objectStatus > 60 )
+3 -2
View File
@@ -1085,7 +1085,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
} }
//Set music //Set music
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
@@ -2644,6 +2644,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
{ {
if ( pGroup != pFirstGroup && (pGroup->usGroupTeam == OUR_TEAM || pGroup->usGroupTeam == MILITIA_TEAM) && pGroup->fBetweenSectors && if ( pGroup != pFirstGroup && (pGroup->usGroupTeam == OUR_TEAM || pGroup->usGroupTeam == MILITIA_TEAM) && pGroup->fBetweenSectors &&
pGroup->ubNextX == pFirstGroup->ubSectorX && pGroup->ubNextY == pFirstGroup->ubSectorY && pGroup->ubNextX == pFirstGroup->ubSectorX && pGroup->ubNextY == pFirstGroup->ubSectorY &&
pFirstGroup->ubSectorZ == pGroup->ubSectorZ &&
!(pGroup->uiFlags & GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED) && !(pGroup->uiFlags & GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED) &&
!IsGroupTheHelicopterGroup( pGroup ) ) !IsGroupTheHelicopterGroup( pGroup ) )
{ {
@@ -5137,7 +5138,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle )
OBJECTTYPE *pItem; OBJECTTYPE *pItem;
INT16 sFuelNeeded, sFuelAvailable, sFuelAdded; INT16 sFuelNeeded, sFuelAvailable, sFuelAdded;
pItem = &pSoldier->inv[ HANDPOS ]; pItem = &pSoldier->inv[ HANDPOS ];
if( !Item[pItem->usItem].gascan ) if( !ItemIsGascan(pItem->usItem))
{ {
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
CHAR16 str[ 100 ]; CHAR16 str[ 100 ];
+4 -3
View File
@@ -40,6 +40,7 @@
#include "Luaglobal.h" #include "Luaglobal.h"
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "Interface.h" #include "Interface.h"
#include <language.hpp>
#include "GameInitOptionsScreen.h" #include "GameInitOptionsScreen.h"
extern WorldItems gAllWorldItems; extern WorldItems gAllWorldItems;
@@ -1631,12 +1632,12 @@ void AdjustLoyaltyForCivsEatenByMonsters( INT16 sSectorX, INT16 sSectorY, UINT8
swprintf( str, gpStrategicString[STR_PB_BANDIT_KILLCIVS_IN_SECTOR], ubHowMany, pSectorString ); swprintf( str, gpStrategicString[STR_PB_BANDIT_KILLCIVS_IN_SECTOR], ubHowMany, pSectorString );
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
//diffrent order of words in Chinese //diffrent order of words in Chinese
swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], pSectorString, ubHowMany ); swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], pSectorString, ubHowMany );
#else } else {
swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], ubHowMany, pSectorString ); swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], ubHowMany, pSectorString );
#endif }
} }
DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
+12 -12
View File
@@ -500,18 +500,18 @@ void UpdateTransportGroupInventory()
if (!ItemIsLegal(i, TRUE)) continue; if (!ItemIsLegal(i, TRUE)) continue;
if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue; if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue;
if (Item[i].medical) if (ItemIsMedical(i))
{ {
if (Item[i].firstaidkit) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i); if (ItemIsFirstAidKit(i)) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i);
else if (Item[i].medicalkit) itemMap[MEDICAL_MEDKITS].push_back(i); else if (ItemIsMedicalKit(i)) itemMap[MEDICAL_MEDKITS].push_back(i);
else itemMap[MEDICAL_OTHER].push_back(i); else itemMap[MEDICAL_OTHER].push_back(i);
} }
else if (Item[i].gascan) itemMap[GAS_CANS].push_back(i); else if (ItemIsGascan(i)) itemMap[GAS_CANS].push_back(i);
else if (Item[i].toolkit) itemMap[TOOL_KITS].push_back(i); else if (ItemIsToolkit(i)) itemMap[TOOL_KITS].push_back(i);
else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i); else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i);
else if (Item[i].usItemClass & IC_GRENADE) else if (Item[i].usItemClass & IC_GRENADE)
{ {
if (Item[i].glgrenade == 0 if (!ItemIsGLgrenade(i)
&& Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher && Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher
&& Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher && Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher
itemMap[GRENADE_THROWN].push_back(i); itemMap[GRENADE_THROWN].push_back(i);
@@ -523,7 +523,7 @@ void UpdateTransportGroupInventory()
itemMap[BACKPACKS].push_back(i); itemMap[BACKPACKS].push_back(i);
} }
} }
else if (Item[i].camouflagekit) itemMap[CAMO_KITS].push_back(i); else if (ItemIsCamoKit(i)) itemMap[CAMO_KITS].push_back(i);
else if (Item[i].usItemClass & IC_MISC) else if (Item[i].usItemClass & IC_MISC)
{ {
switch (Item[i].attachmentclass) switch (Item[i].attachmentclass)
@@ -555,11 +555,11 @@ void UpdateTransportGroupInventory()
{ {
itemMap[GUNS].push_back(i); itemMap[GUNS].push_back(i);
} }
else if (Item[i].grenadelauncher) else if (ItemIsGrenadeLauncher(i))
{ {
itemMap[GRENADELAUNCHERS].push_back(i); itemMap[GRENADELAUNCHERS].push_back(i);
} }
else if (Item[i].rocketlauncher) else if (ItemIsRocketLauncher(i))
{ {
itemMap[ROCKETLAUNCHERS].push_back(i); itemMap[ROCKETLAUNCHERS].push_back(i);
} }
@@ -713,7 +713,7 @@ void UpdateTransportGroupInventory()
case ROCKETLAUNCHERS: case ROCKETLAUNCHERS:
{ {
addItemToInventory(pSoldier, id, Item[id].singleshotrocketlauncher ? 3 : 1); addItemToInventory(pSoldier, id, ItemIsSingleShotRocketLauncher(id) ? 3 : 1);
const UINT16 launchableId = PickARandomLaunchable(id); const UINT16 launchableId = PickARandomLaunchable(id);
if (launchableId == 0) continue; // no launchable matches, skip if (launchableId == 0) continue; // no launchable matches, skip
@@ -773,7 +773,7 @@ void UpdateTransportGroupInventory()
for (int i = 0; i < pSoldier->inv.size(); ++i) for (int i = 0; i < pSoldier->inv.size(); ++i)
{ {
OBJECTTYPE* item = &pSoldier->inv[i]; OBJECTTYPE* item = &pSoldier->inv[i];
if (item->exists() && Item[item->usItem].defaultundroppable == FALSE) if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE)
{ {
item->fFlags &= ~OBJECT_UNDROPPABLE; item->fFlags &= ~OBJECT_UNDROPPABLE;
} }
@@ -861,7 +861,7 @@ void UpdateTransportGroupInventory()
for (int i = 0; i < pSoldier->inv.size(); ++i) for (int i = 0; i < pSoldier->inv.size(); ++i)
{ {
OBJECTTYPE* item = &pSoldier->inv[i]; OBJECTTYPE* item = &pSoldier->inv[i];
if (item->exists() && Item[item->usItem].defaultundroppable == FALSE) if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE)
{ {
item->fFlags &= ~OBJECT_UNDROPPABLE; item->fFlags &= ~OBJECT_UNDROPPABLE;
} }
+1
View File
@@ -64,6 +64,7 @@ BOOLEAN LuaUnderground::InitializeSectorList()
.TableOpen() .TableOpen()
.TParam("difficultyLevel", int(gGameOptions.ubDifficultyLevel)) .TParam("difficultyLevel", int(gGameOptions.ubDifficultyLevel))
.TParam("gameStyle", int(gGameOptions.ubGameStyle)) .TParam("gameStyle", int(gGameOptions.ubGameStyle))
.TParam("maxTacticalEnemies", int(gGameExternalOptions.ubGameMaximumNumberOfEnemies))
.TableClose(); .TableClose();
SGP_THROW_IFFALSE(initsectorlist_func.Call(1), "call to lua function BuildUndergroundSectorList failed"); SGP_THROW_IFFALSE(initsectorlist_func.Call(1), "call to lua function BuildUndergroundSectorList failed");
+18 -30
View File
@@ -11,10 +11,8 @@
#include "font.h" #include "font.h"
#include "screenids.h" #include "screenids.h"
#include "screens.h" #include "screens.h"
#include "gameloop.h"
#include "overhead.h" #include "overhead.h"
#include "sysutil.h" #include "sysutil.h"
#include "input.h"
#include "Event Pump.h" #include "Event Pump.h"
#include "Font Control.h" #include "Font Control.h"
#include "Timer Control.h" #include "Timer Control.h"
@@ -44,18 +42,15 @@
#include "PopUpBox.h" #include "PopUpBox.h"
#include "Game Clock.h" #include "Game Clock.h"
#include "items.h" #include "items.h"
#include "vobject.h"
#include "Cursor Control.h" #include "Cursor Control.h"
#include "text.h" #include "text.h"
#include "strategic.h" #include "strategic.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "interface.h"
#include "strategic pathing.h" #include "strategic pathing.h"
#include "Map Screen Interface Bottom.h" #include "Map Screen Interface Bottom.h"
#include "Map Screen Interface Border.h" #include "Map Screen Interface Border.h"
#include "Map Screen Interface Map.h" #include "Map Screen Interface Map.h"
#include "Map Screen Interface.h" #include "Map Screen Interface.h"
#include "Strategic Pathing.h"
#include "Assignments.h" #include "Assignments.h"
#include "points.h" #include "points.h"
#include "Squads.h" #include "Squads.h"
@@ -114,7 +109,7 @@
#include "connect.h" //hayden #include "connect.h" //hayden
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include "vobject.h" #include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
#include "laptop.h" #include "laptop.h"
@@ -4792,9 +4787,6 @@ UINT32 MapScreenHandle(void)
InitPreviousPaths(); InitPreviousPaths();
// HEADROCK HAM 3.6: Init coordinates for new variable-sized message window
InitMapScreenInterfaceBottomCoords();
// if arrival sector is invalid, reset to A9 // if arrival sector is invalid, reset to A9
if ( ( gsMercArriveSectorX < 1 ) || ( gsMercArriveSectorY < 1 ) || if ( ( gsMercArriveSectorX < 1 ) || ( gsMercArriveSectorY < 1 ) ||
( gsMercArriveSectorX > 16 ) || ( gsMercArriveSectorY > 16 ) ) ( gsMercArriveSectorX > 16 ) || ( gsMercArriveSectorY > 16 ) )
@@ -9056,12 +9048,8 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
// clip to view region // clip to view region
ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES ); ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES );
if(gbPixelDepth==16) RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf );
{ InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 );
// DB Need to add a radar color for 8-bit
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf );
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 );
}
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES ); RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
UnLockVideoSurface( FRAME_BUFFER ); UnLockVideoSurface( FRAME_BUFFER );
@@ -9664,27 +9652,27 @@ void BltCharInvPanel()
// print armor/weight/camo labels // print armor/weight/camo labels
mprintf(UI_CHARINV.Text.ArmorLabel.iX, UI_CHARINV.Text.ArmorLabel.iY, pInvPanelTitleStrings[ 0 ] ); mprintf(UI_CHARINV.Text.ArmorLabel.iX, UI_CHARINV.Text.ArmorLabel.iY, pInvPanelTitleStrings[ 0 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, ChineseSpecString1 );
#else } else {
mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, L"%%" );
#endif }
mprintf(UI_CHARINV.Text.WeightLabel.iX, UI_CHARINV.Text.WeightLabel.iY, pInvPanelTitleStrings[ 1 ] ); mprintf(UI_CHARINV.Text.WeightLabel.iX, UI_CHARINV.Text.WeightLabel.iY, pInvPanelTitleStrings[ 1 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, ChineseSpecString1 );
#else } else {
mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, L"%%" );
#endif }
mprintf(UI_CHARINV.Text.CamoLabel.iX, UI_CHARINV.Text.CamoLabel.iY, pInvPanelTitleStrings[ 2 ] ); mprintf(UI_CHARINV.Text.CamoLabel.iX, UI_CHARINV.Text.CamoLabel.iY, pInvPanelTitleStrings[ 2 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, ChineseSpecString1 );
#else } else {
mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, L"%%" );
#endif }
const auto width = UI_CHARINV.Text.PercentWidth; const auto width = UI_CHARINV.Text.PercentWidth;
const auto height = UI_CHARINV.Text.PercentHeight; const auto height = UI_CHARINV.Text.PercentHeight;
@@ -9797,12 +9785,12 @@ void BltCharInvPanel()
UINT32 fontColour = FONT_MCOLOR_RED; UINT32 fontColour = FONT_MCOLOR_RED;
// robot targeting bonus // robot targeting bonus
if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus) if (ItemProvidesRobotLaserBonus(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
{ {
swprintf(text, szRobotText[ROBOT_TEXT_LASER]); swprintf(text, szRobotText[ROBOT_TEXT_LASER]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotNightVision) else if (ItemProvidesRobotNightvision(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
{ {
swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]); swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -9825,7 +9813,7 @@ void BltCharInvPanel()
swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]); swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (Item[pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem].fProvidesRobotCamo) else if (ItemProvidesRobotCamo(pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem))
{ {
swprintf(text, szRobotText[ROBOT_TEXT_CAMO]); swprintf(text, szRobotText[ROBOT_TEXT_CAMO]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -9858,12 +9846,12 @@ void BltCharInvPanel()
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].metaldetector == 1) else if (ItemIsMetalDetector(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem))
{ {
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].xray == 1) else if (ItemHasXRay(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem))
{ {
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -10442,7 +10430,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
{ {
if ( !InItemDescriptionBox( ) ) if ( !InItemDescriptionBox( ) )
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[pSoldier->inv[ uiHandPos ].usItem].singleshotrocketlauncher) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(pSoldier->inv[ uiHandPos ].usItem) )
{ {
EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos ); EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
InternalMAPBeginItemPointer( pSoldier ); InternalMAPBeginItemPointer( pSoldier );
+12 -13
View File
@@ -6665,18 +6665,16 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
if ( guiCurrentScreen == AUTORESOLVE_SCREEN ) if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
{ {
if ( gWorldSectorX == sBattleSectorX && gWorldSectorY == sBattleSectorY && gbWorldSectorZ == sBattleSectorZ ) //Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside
{ //Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside //TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because
//TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because //we are in the autoresolve screen, soldiers are internally created different (from pointers instead of
//we are in the autoresolve screen, soldiers are internally created different (from pointers instead of //the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the
//the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the //screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is
//screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is //complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions
//complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions //don't change throughout this whole process which makes it necessary to do it this way.
//don't change throughout this whole process which makes it necessary to do it this way. guiCurrentScreen = MAP_SCREEN;
guiCurrentScreen = MAP_SCREEN; TrashWorld( );
TrashWorld( ); guiCurrentScreen = AUTORESOLVE_SCREEN;
guiCurrentScreen = AUTORESOLVE_SCREEN;
}
} }
else else
{ {
@@ -7780,6 +7778,7 @@ void HandleMovingEnemiesCloseToEntranceInSecondTunnelMap( )
void HandlePowerGenFanSoundModification( ) void HandlePowerGenFanSoundModification( )
{ {
extern UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO;
SetTileAnimCounter( TILE_ANIM__FAST_SPEED ); SetTileAnimCounter( TILE_ANIM__FAST_SPEED );
switch ( gJa25SaveStruct.ubStateOfFanInPowerGenSector ) switch ( gJa25SaveStruct.ubStateOfFanInPowerGenSector )
@@ -7788,7 +7787,7 @@ void HandlePowerGenFanSoundModification( )
HandleAddingPowerGenFanSound( ); HandleAddingPowerGenFanSound( );
//MAKE SURE the fan does not have an exit grid //MAKE SURE the fan does not have an exit grid
RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO ); RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO );
break; break;
case PGF__STOPPED: case PGF__STOPPED:
+5
View File
@@ -0,0 +1,5 @@
# stuff that needs doing
# priority (LOW,HIGH) and description
LOW readd the C4838 (https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4838) warning to CMakeLists.txt once they're all fixed in the code
HIGH get rid of ENGLISH, GERMAN, etc preprocessor definitions completely. that way i18n can be built just once and language can be changed in the options screen pending game restart (hotloading will likely require more work)
+5 -5
View File
@@ -4297,10 +4297,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND.... // ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem; usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher) if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
{ {
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) ) // if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( (Item[ usItem ].twohanded ) ) if (ItemIsTwoHanded(usItem))
{ {
ubWaterHandIndex = 0; ubWaterHandIndex = 0;
} }
@@ -4321,7 +4321,7 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND.... // ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem; usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || Item[usItem].rocketlauncher ) if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || ItemIsRocketLauncher(usItem) )
{ {
if ( usAnimState == STANDING ) if ( usAnimState == STANDING )
{ {
@@ -4342,10 +4342,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
else else
{ {
// CHECK FOR HANDGUN // CHECK FOR HANDGUN
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher ) if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
{ {
// if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) ) // if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( !(Item[ usItem ].twohanded ) ) if ( !ItemIsTwoHanded(usItem) )
{ {
// SANDRO - new anim for running with pistol by PasHancock // SANDRO - new anim for running with pistol by PasHancock
if ( usAnimState == RUNNING ) if ( usAnimState == RUNNING )
+19 -50
View File
@@ -71,7 +71,6 @@ void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemIndex, UIN
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems ); void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems ); void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex );
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex ); UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer ); BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
@@ -85,8 +84,6 @@ BOOLEAN CanThisItemBeSoldToSimulatedCustomer( UINT8 ubArmsDealerID, UINT16 usIte
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer ); void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime ); BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status) ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status)
@@ -961,7 +958,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_HANDGUNCLASS ); return( ARMS_DEALER_HANDGUNCLASS );
break; break;
case RIFLECLASS: case RIFLECLASS:
if ( ItemIsARocketRifle( usItem ) ) if (ItemHasFingerPrintID( usItem ) )
return( ARMS_DEALER_ROCKET_RIFLE ); return( ARMS_DEALER_ROCKET_RIFLE );
else else
return( ARMS_DEALER_RIFLECLASS ); return( ARMS_DEALER_RIFLECLASS );
@@ -1010,15 +1007,15 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
{ {
if ( Item [usItem].alcohol > 0.0f ) if ( Item [usItem].alcohol > 0.0f )
return( ARMS_DEALER_ALCOHOL ); return( ARMS_DEALER_ALCOHOL );
else if ( Item [usItem].electronic ) else if (ItemIsElectronic(usItem))
return( ARMS_DEALER_ELECTRONICS ); return( ARMS_DEALER_ELECTRONICS );
else if ( Item [usItem].hardware ) else if (ItemIsHardware(usItem))
return( ARMS_DEALER_HARDWARE ); return( ARMS_DEALER_HARDWARE );
else if ( Item [usItem].medical ) else if (ItemIsMedical(usItem))
return( ARMS_DEALER_MEDICAL ); return( ARMS_DEALER_MEDICAL );
else if ( Item [usItem].attachment ) else if (ItemIsAttachment(usItem))
return( ARMS_DEALER_ATTACHMENTS ); return( ARMS_DEALER_ATTACHMENTS );
else if ( Item [usItem].detonator || Item [usItem].remotedetonator || Item [usItem].remotetrigger ) else if ( IsAttachmentClass( usItem, (AC_DETONATOR | AC_REMOTEDET) ) || ItemIsRemoteTrigger(usItem))
return( ARMS_DEALER_DETONATORS ); return( ARMS_DEALER_DETONATORS );
else else
return( ARMS_DEALER_MISC ); return( ARMS_DEALER_MISC );
@@ -1076,7 +1073,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_AMMO ); return( ARMS_DEALER_AMMO );
break; break;
case IC_FACE: case IC_FACE:
if (Item[usItem].electronic ) if (ItemIsElectronic(usItem))
return ARMS_DEALER_ELECTRONICS; return ARMS_DEALER_ELECTRONICS;
else else
return ARMS_DEALER_FACE; return ARMS_DEALER_FACE;
@@ -1278,8 +1275,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// uiFlags = Item[ usItemIndex ].fFlags; // uiFlags = Item[ usItemIndex ].fFlags;
// can't repair anything that's not repairable! // can't repair anything that's not repairable!
// if ( !( uiFlags & ITEM_REPAIRABLE ) ) if ( !ItemIsRepairable(usItemIndex) )
if ( !( Item[ usItemIndex ].repairable ) )
{ {
return(FALSE); return(FALSE);
} }
@@ -1297,8 +1293,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_PERKO: case ARMS_DEALER_PERKO:
#endif #endif
// repairs ANYTHING non-electronic // repairs ANYTHING non-electronic
// if ( !( uiFlags & ITEM_ELECTRONIC ) ) if ( !ItemIsElectronic(usItemIndex) )
if ( !( Item[ usItemIndex ].electronic ) )
{ {
return(TRUE); return(TRUE);
} }
@@ -1306,8 +1301,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_FREDO: case ARMS_DEALER_FREDO:
// repairs ONLY electronics // repairs ONLY electronics
// if ( uiFlags & ITEM_ELECTRONIC ) if (ItemIsElectronic(usItemIndex))
if ( Item[ usItemIndex ].electronic )
{ {
return(TRUE); return(TRUE);
} }
@@ -1318,7 +1312,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can // Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can
if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS ) if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
{ {
if ( !( Item[ usItemIndex ].electronic ) ) if ( !ItemIsElectronic(usItemIndex) )
return(TRUE); return(TRUE);
else else
return(FALSE); return(FALSE);
@@ -1369,7 +1363,7 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
// if it's a damagable item, and not a liquid (those are always sold full) // if it's a damagable item, and not a liquid (those are always sold full)
// if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) ) // if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) )
if ( ( Item[ usItemIndex ].damageable ) && !ItemContainsLiquid( usItemIndex ) ) if (ItemIsDamageable(usItemIndex) && !ItemContainsLiquid(usItemIndex))
{ {
// if he ONLY has used items, or 50% of the time if he carries both used & new items // if he ONLY has used items, or 50% of the time if he carries both used & new items
if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) || if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) ||
@@ -1383,25 +1377,6 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
return( ubCondition); return( ubCondition);
} }
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex )
{
return Item[usItemIndex].containsliquid;
//switch ( usItemIndex )
//{
// case CANTEEN:
// case BEER:
// case ALCOHOL:
// case JAR_HUMAN_BLOOD:
// case JAR_CREATURE_BLOOD:
// case JAR_QUEEN_CREATURE_BLOOD:
// case JAR_ELIXIR:
// case GAS_CAN:
// return( TRUE );
//}
//return( FALSE );
}
bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item) bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item)
{ {
@@ -1839,7 +1814,7 @@ void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this // they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets. // ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
//CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1 //CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1
if(Item[pObject->usItem].singleshotrocketlauncher == TRUE) if(ItemIsSingleShotRocketLauncher(pObject->usItem))
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1; (*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
else else
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0; (*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
@@ -1863,7 +1838,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) ); Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
// c) Actually damaged, or a rocket rifle (being reset) // c) Actually damaged, or a rocket rifle (being reset)
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) ); Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
/* ARM: Can now repair with removeable attachments still attached... /* ARM: Can now repair with removeable attachments still attached...
// d) Already stripped of all *detachable* attachments // d) Already stripped of all *detachable* attachments
@@ -1898,7 +1873,7 @@ void GiveItemToArmsDealerforRepair( UINT8 ubArmsDealer, OBJECTTYPE* pObject, UIN
Assert( DoesDealerDoRepairs( ubArmsDealer ) ); Assert( DoesDealerDoRepairs( ubArmsDealer ) );
Assert( (*pObject)[0]->data.objectStatus > 0 ); Assert( (*pObject)[0]->data.objectStatus > 0 );
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) ); Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
// figure out the earliest the repairman will be free to start repairing this item // figure out the earliest the repairman will be free to start repairing this item
uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer ); uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer );
@@ -1995,8 +1970,7 @@ UINT32 CalculateSimpleItemRepairTime( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
// repairs on electronic items take twice as long if the guy doesn't have the skill // repairs on electronic items take twice as long if the guy doesn't have the skill
// for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double) // for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double)
// (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.) // (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.)
// if( ( Item[ usItemIndex ].fFlags & ITEM_ELECTRONIC ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) ) if( ItemIsElectronic(usItemIndex) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
if( ( Item[ usItemIndex ].electronic ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
{ {
uiTimeToRepair *= 2; uiTimeToRepair *= 2;
} }
@@ -2065,7 +2039,7 @@ UINT32 CalculateSimpleItemRepairCost( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
} }
*/ */
if ( ItemIsARocketRifle( usItemIndex ) ) if (ItemHasFingerPrintID( usItemIndex ) )
{ {
// resetting imprinting for a rocket rifle costs something extra even if rifle is at 100% // resetting imprinting for a rocket rifle costs something extra even if rifle is at 100%
uiRepairCost += 100; uiRepairCost += 100;
@@ -2167,7 +2141,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
// the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz ) // the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz )
// Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars) // Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars)
if ( ( !Item[usItemIndex].jar ) && if ( ( !ItemIsJar(usItemIndex)) &&
( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) || ( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) ||
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) ) DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
{ {
@@ -2214,7 +2188,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
{ {
// exception: Gas (Jake's) // exception: Gas (Jake's)
// if ( usItemIndex != GAS_CAN ) // if ( usItemIndex != GAS_CAN )
if ( !Item[usItemIndex].gascan ) if ( !ItemIsGascan(usItemIndex))
{ {
// they pay only 1/3 of true value! // they pay only 1/3 of true value!
usValueToThisDealer /= 3; usValueToThisDealer /= 3;
@@ -2244,11 +2218,6 @@ void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer )
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) ); GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
} }
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex )
{
return( Item[sItemIndex].fingerprintid );
}
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime ) BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
{ {
SOLDIERTYPE *pSoldier; SOLDIERTYPE *pSoldier;
+3 -5
View File
@@ -944,8 +944,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
} }
// items normally not sold at shops are unsuitable // items normally not sold at shops are unsuitable
// if ( Item[ usItemIndex ].fFlags & ITEM_NOT_BUYABLE ) if (ItemIsNotBuyable(usItemIndex))
if ( Item[ usItemIndex ].notbuyable )
{ {
return(ITEM_SUITABILITY_NONE); return(ITEM_SUITABILITY_NONE);
} }
@@ -971,7 +970,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
// case JAR: // case JAR:
// case JAR_ELIXIR: // case JAR_ELIXIR:
// case JAR_CREATURE_BLOOD: // case JAR_CREATURE_BLOOD:
if ( Item[usItemIndex].medical || Item[usItemIndex].canteen || Item[usItemIndex].medicalkit || Item[usItemIndex].locksmithkit || Item[usItemIndex].toolkit || Item[usItemIndex].crowbar || Item[usItemIndex].jar ) if (ItemIsMedical(usItemIndex) || ItemIsCanteen(usItemIndex) || ItemIsMedicalKit(usItemIndex) || ItemIsLocksmithKit(usItemIndex) || ItemIsToolkit(usItemIndex) || ItemIsCrowbar(usItemIndex) || ItemIsJar(usItemIndex) )
return(ITEM_SUITABILITY_ALWAYS); return(ITEM_SUITABILITY_ALWAYS);
//} //}
@@ -1455,8 +1454,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex ) BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
{ {
// if ( !( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) ) if ( !ItemIsDamageable(usItemIndex) )
if ( !( Item[ usItemIndex ].damageable ) )
return(FALSE); return(FALSE);
// certain items, although they're damagable, shouldn't be sold in a used condition // certain items, although they're damagable, shouldn't be sold in a used condition
+6 -5
View File
@@ -67,6 +67,7 @@
#include "ub_config.h" #include "ub_config.h"
#include "history.h" #include "history.h"
#include <language.hpp>
//forward declarations of common classes to eliminate includes //forward declarations of common classes to eliminate includes
class OBJECTTYPE; class OBJECTTYPE;
@@ -1344,10 +1345,10 @@ void HandleDialogue( )
{ {
HandleEveryoneDoneTheirEndGameQuotes(); HandleEveryoneDoneTheirEndGameQuotes();
} }
else else if ( QItem.uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH )
{ {
// grab soldier ptr from profile ID // grab soldier ptr from profile ID
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData, FALSE ); pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData2, FALSE );
// FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that. // FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that.
if (pSoldier != nullptr) if (pSoldier != nullptr)
@@ -2407,8 +2408,8 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
{ {
if ( fWavFile ) if ( fWavFile )
{ {
#ifdef RUSSIAN if ( g_lang == i18n::Lang::ru &&
if ( ( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC || ( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC ||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_NPC || gMercProfiles[ubCharacterNum].Type == PROFILETYPE_NPC ||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_VEHICLE ) && gMercProfiles[ ubCharacterNum ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) gMercProfiles[ubCharacterNum].Type == PROFILETYPE_VEHICLE ) && gMercProfiles[ ubCharacterNum ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED )
{ {
@@ -2426,7 +2427,7 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
#endif #endif
} }
else else
#endif
{ {
// build name of wav file (characternum + quotenum) // build name of wav file (characternum + quotenum)
sprintf( zFileNameHelper, "SPEECH\\%03d_%03d", usVoiceSet, usQuoteNum ); sprintf( zFileNameHelper, "SPEECH\\%03d_%03d", usVoiceSet, usQuoteNum );
+1
View File
@@ -262,6 +262,7 @@ enum DialogQuoteIDs
#ifdef JA2UB #ifdef JA2UB
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000 #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000 #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000
#define MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH 0x08000000
#else #else
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001 #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002 #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002
+3 -3
View File
@@ -1274,7 +1274,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
{ {
case MINES_DRAW_PLAYERTEAM_NETWORKS: case MINES_DRAW_PLAYERTEAM_NETWORKS:
{ {
if ( Item[pObj->usItem].tripwire == 1 ) if (ItemIsTripwire(pObj->usItem))
{ {
// if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE // if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE
if ( bOverlayType == MINE_BOMB ) if ( bOverlayType == MINE_BOMB )
@@ -1314,7 +1314,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NETWORKCOLOURING: case MINES_DRAW_NETWORKCOLOURING:
{ {
if ( Item[pObj->usItem].tripwire == 1 ) if (ItemIsTripwire(pObj->usItem))
{ {
// determine if wire is of the network we're searching for // determine if wire is of the network we're searching for
// determine this tripwire's flag // determine this tripwire's flag
@@ -1342,7 +1342,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NET_C: case MINES_DRAW_NET_C:
case MINES_DRAW_NET_D: case MINES_DRAW_NET_D:
{ {
if ( Item[pObj->usItem].tripwire == 1 ) if (ItemIsTripwire(pObj->usItem))
{ {
UINT32 specificnet = 0; UINT32 specificnet = 0;
switch ( gubDrawMode ) switch ( gubDrawMode )
+1 -1
View File
@@ -205,7 +205,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed
gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++; gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++;
} }
if ( Item[usItem].cigarette ) if (ItemIsCigarette(usItem))
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] );
} }
+3 -3
View File
@@ -1950,7 +1950,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check first face slot // check first face slot
if (uiFaceItemOne != NONE) if (uiFaceItemOne != NONE)
{ {
if (Item[uiFaceItemOne].gasmask) if (ItemIsGasmask(uiFaceItemOne))
uiFaceItemOne = 1; uiFaceItemOne = 1;
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0) else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
uiFaceItemOne = 2; uiFaceItemOne = 2;
@@ -1965,7 +1965,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check second face slot // check second face slot
if (uiFaceItemTwo != NONE) if (uiFaceItemTwo != NONE)
{ {
if (Item[uiFaceItemTwo].gasmask) if (ItemIsGasmask(uiFaceItemTwo))
uiFaceItemTwo = 21; uiFaceItemTwo = 21;
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0) else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
uiFaceItemTwo = 42; uiFaceItemTwo = 42;
@@ -2250,7 +2250,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
sIconIndex_Assignment = 0; sIconIndex_Assignment = 0;
fDoIcon_Assignment = TRUE; fDoIcon_Assignment = TRUE;
// Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points. // Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points.
if (Item[pSoldier->inv[HANDPOS].usItem].toolkit) if (ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE); sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
else else
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts); sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
+12 -12
View File
@@ -174,7 +174,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, UINT16 usPointsTo
return( FALSE); return( FALSE);
// workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled // workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled
if ( Item[pObject->usItem].canteen == TRUE && (*pObject)[0]->data.objectStatus == 1 ) if (ItemIsCanteen(pObject->usItem) && (*pObject)[0]->data.objectStatus == 1 )
return( FALSE); return( FALSE);
// do we eat or drink this stuff? // do we eat or drink this stuff?
@@ -693,7 +693,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen // if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly ) if ( fcanteensonly )
{ {
if ( Item[pObj->usItem].canteen == FALSE ) if ( !ItemIsCanteen(pObj->usItem))
continue; continue;
} }
else else
@@ -707,7 +707,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
if ( foodcondition < FOOD_BAD_THRESHOLD ) if ( foodcondition < FOOD_BAD_THRESHOLD )
continue; continue;
if ( Item[pObj->usItem].canteen == TRUE ) if (ItemIsCanteen(pObj->usItem))
continue; continue;
} }
@@ -741,7 +741,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen // if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly ) if ( fcanteensonly )
{ {
if ( Item[pObj->usItem].canteen == FALSE ) if (!ItemIsCanteen(pObj->usItem))
continue; continue;
} }
@@ -846,7 +846,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -878,7 +878,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0) if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem) && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -920,7 +920,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen and is NOT a water drum... // ... if Item exists and is canteen and is NOT a water drum...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM))) if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -973,7 +973,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen ) if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1031,7 +1031,7 @@ OBJECTTYPE* GetUsableWaterDrumInSector( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen ) if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1077,7 +1077,7 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier)
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -1118,7 +1118,7 @@ BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN f
if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints ) if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints )
{ {
if ( Item[pSoldier->inv[bLoop].usItem].canteen ) if (ItemIsCanteen(pSoldier->inv[bLoop].usItem))
{ {
// empty canteens retain 1% status, so check ether something is in them // empty canteens retain 1% status, so check ether something is in them
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 ) if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
@@ -1170,7 +1170,7 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
+4 -3
View File
@@ -33,6 +33,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#include "fresh_header.h" #include "fresh_header.h"
#include "connect.h" #include "connect.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
#include "Explosion Control.h" #include "Explosion Control.h"
@@ -1492,7 +1493,7 @@ void SetDoorString( INT32 sGridNo )
// ATE: If here, we try to say, opened or closed... // ATE: If here, we try to say, opened or closed...
if ( gfUIIntTileLocation2 == FALSE ) if ( gfUIIntTileLocation2 == FALSE )
{ {
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] ); wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] );
gfUIIntTileLocation2 = TRUE; gfUIIntTileLocation2 = TRUE;
@@ -1535,7 +1536,7 @@ void SetDoorString( INT32 sGridNo )
gfUIIntTileLocation = TRUE; gfUIIntTileLocation = TRUE;
} }
} }
#else } else {
// Try to get doors status here... // Try to get doors status here...
pDoorStatus = GetDoorStatus( sGridNo ); pDoorStatus = GetDoorStatus( sGridNo );
@@ -1576,7 +1577,7 @@ void SetDoorString( INT32 sGridNo )
} }
} }
#endif }
} }
} }
+33 -34
View File
@@ -319,7 +319,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
pSoldier->ubProfile != NO_PROFILE && pSoldier->ubProfile != NO_PROFILE &&
pTargetSoldier && pTargetSoldier &&
Item[usHandItem].usItemClass != IC_MEDKIT && Item[usHandItem].usItemClass != IC_MEDKIT &&
!Item[usHandItem].gascan && !ItemIsGascan(usHandItem) &&
!ItemCanBeAppliedToOthers(usHandItem) && !ItemCanBeAppliedToOthers(usHandItem) &&
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) && !HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
!HasItemFlag( usHandItem, MEDICAL_SPLINT ) ) !HasItemFlag( usHandItem, MEDICAL_SPLINT ) )
@@ -473,8 +473,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE ) if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
{ {
// WEAPONS // WEAPONS
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem,Item[usHandItem].fingerprintid,pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile)); DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem, ItemHasFingerPrintID(usHandItem), pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
if ( Item[usHandItem].fingerprintid ) if (ItemHasFingerPrintID(usHandItem))
{ {
// check imprint ID // check imprint ID
// NB not-imprinted value is NO_PROFILE // NB not-imprinted value is NO_PROFILE
@@ -807,7 +807,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
// ATE: Here to make cursor go back to move after LAW shot... // ATE: Here to make cursor go back to move after LAW shot...
if ( fFromUI && Item[usHandItem].singleshotrocketlauncher) if ( fFromUI && ItemIsSingleShotRocketLauncher(usHandItem) )
{ {
guiPendingOverrideEvent = A_CHANGE_TO_MOVE; guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
} }
@@ -969,7 +969,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
BOOLEAN fCorpse = FALSE; BOOLEAN fCorpse = FALSE;
if(pCorpse != NULL) if(pCorpse != NULL)
fCorpse = IsValidDecapitationCorpse( pCorpse ); fCorpse = IsValidDecapitationCorpse( pCorpse );
if ( Item[usHandItem].wirecutters && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives if (ItemIsWirecutters(usHandItem) && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
{ {
// See if we can get there to stab // See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE ); sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1025,7 +1025,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if ( Item[usHandItem].toolkit ) if (ItemIsToolkit(usHandItem))
{ {
UINT8 ubMercID; UINT8 ubMercID;
BOOLEAN fVehicle = FALSE; BOOLEAN fVehicle = FALSE;
@@ -1098,7 +1098,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if ( Item[usHandItem].gascan ) if (ItemIsGascan(usHandItem))
{ {
UINT8 ubMercID; UINT8 ubMercID;
INT32 sVehicleGridNo=-1; INT32 sVehicleGridNo=-1;
@@ -1170,7 +1170,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
if ( Item[usHandItem].jar ) if (ItemIsJar(usHandItem))
{ {
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE ); sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1614,7 +1614,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if ( Item[usHandItem].canandstring ) if (ItemIsCanAndString(usHandItem))
{ {
STRUCTURE *pStructure; STRUCTURE *pStructure;
LEVELNODE *pIntTile; LEVELNODE *pIntTile;
@@ -1686,7 +1686,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) ) if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
{ {
DeductPoints( pSoldier, sAPCost, 0 ); DeductPoints( pSoldier, sAPCost, 0 );
if ( Item[usHandItem].xray ) if (ItemHasXRay(usHandItem))
{ {
PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) ); PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
@@ -1867,7 +1867,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 ); sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 );
// Check if these is room to place mortar! // Check if these is room to place mortar!
if ( Item[usHandItem].mortar ) if (ItemIsMortar(usHandItem))
{ {
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier ); ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
@@ -1881,7 +1881,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
//pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change //pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change
} }
else if ( Item[usHandItem].grenadelauncher )//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER ) else if (ItemIsGrenadeLauncher(usHandItem))//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
{ {
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime ); GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime );
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost); usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
@@ -1960,7 +1960,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].ubCursor == INVALIDCURS ) if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
{ {
// Found detonator... // Found detonator...
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[usHandItem].tripwire ) if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire(usHandItem))
{ {
StartBombMessageBox( pSoldier, sGridNo ); StartBombMessageBox( pSoldier, sGridNo );
@@ -1980,7 +1980,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo ) void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
{ {
// Does this have detonator that needs info? // Does this have detonator that needs info?
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[ (&(pSoldier->inv[ HANDPOS ] ))->usItem ].tripwire == 1) if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire((&(pSoldier->inv[ HANDPOS ] ))->usItem) )
{ {
StartBombMessageBox( pSoldier, sGridNo ); StartBombMessageBox( pSoldier, sGridNo );
} }
@@ -2003,7 +2003,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
if ( iResult >= 0 ) if ( iResult >= 0 )
{ {
// Less explosives gain for placing tripwire // Less explosives gain for placing tripwire
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire ) if (ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
StatChange( pSoldier, EXPLODEAMT, 1, FALSE ); StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) ) else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( pSoldier, MECHANAMT, 10, FALSE ); StatChange( pSoldier, MECHANAMT, 10, FALSE );
@@ -2027,7 +2027,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
pSoldier->inv[ HANDPOS ][0]->data.bTrap++; pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
// anv: additional tile properties - modify trap level depending on its placement // anv: additional tile properties - modify trap level depending on its placement
if(gGameExternalOptions.fAdditionalTileProperties && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 ) if(gGameExternalOptions.fAdditionalTileProperties && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
{ {
ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel ); ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel );
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus; pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
@@ -2072,7 +2072,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE ); StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
// oops! How badly did we screw up? // oops! How badly did we screw up?
if ( iResult < -20 && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 ) if ( iResult < -20 && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem) )
{ {
// OOPS! ... BOOM! // OOPS! ... BOOM!
IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] ); IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] );
@@ -2576,7 +2576,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) ) if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) )
{ {
// Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already... // Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already...
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && Item[gWorldItems[ iItemIndex ].object.usItem].tripwireactivation == 1 ) if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && ItemHasTripwireActivation(gWorldItems[ iItemIndex ].object.usItem) )
{ {
gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel ); gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
gpBoobyTrapSoldier = pSoldier; gpBoobyTrapSoldier = pSoldier;
@@ -2998,8 +2998,7 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
if ( TERRAIN_IS_WATER( bTerrainID) ) if ( TERRAIN_IS_WATER( bTerrainID) )
{ {
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS ) if (ItemSinks(pObject->usItem))
if ( Item[ pObject->usItem ].sinks )
{ {
return( NULL ); return( NULL );
} }
@@ -3340,7 +3339,7 @@ BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemInde
pItemPoolTemp = pItemPool; pItemPoolTemp = pItemPool;
while( pItemPoolTemp != NULL ) while( pItemPoolTemp != NULL )
{ {
if ( Item[gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem].marbles ) if (ItemIsMarbles(gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem))
{ {
if ( piItemIndex ) if ( piItemIndex )
{ {
@@ -5154,7 +5153,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
gpTempSoldier = pSoldier; gpTempSoldier = pSoldier;
gsTempGridNo = sGridNo; gsTempGridNo = sGridNo;
if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger ) if (ItemIsRemoteTrigger(pSoldier->inv[HANDPOS].usItem))
{ {
wcscpy( gzUserDefinedButton[0], L"1" ); wcscpy( gzUserDefinedButton[0], L"1" );
wcscpy( gzUserDefinedButton[1], L"2" ); wcscpy( gzUserDefinedButton[1], L"2" );
@@ -5249,7 +5248,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
{ {
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL );
} }
else if ( Item[ (&(pSoldier->inv[HANDPOS]))->usItem ].tripwire == 1 ) else if (ItemIsTripwire((&(pSoldier->inv[HANDPOS]))->usItem))
{ {
wcscpy( gzUserDefinedButton[0], L"1-A" ); wcscpy( gzUserDefinedButton[0], L"1-A" );
wcscpy( gzUserDefinedButton[1], L"1-B" ); wcscpy( gzUserDefinedButton[1], L"1-B" );
@@ -5573,10 +5572,10 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if (gpTempSoldier) if (gpTempSoldier)
{ {
// sevenfm: remember last tripwire network settings // sevenfm: remember last tripwire network settings
if(Item[ gpTempSoldier->inv[HANDPOS].usItem ].tripwire ) if(ItemIsTripwire(gpTempSoldier->inv[HANDPOS].usItem))
gubLastTripwire = ubExitValue; gubLastTripwire = ubExitValue;
if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger ) if (ItemIsRemoteTrigger(gpTempSoldier->inv[HANDPOS].usItem))
{ {
// Flugente: jamming can prevent bomb activation // Flugente: jamming can prevent bomb activation
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() ) if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
@@ -5602,7 +5601,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if ( iResult >= 0 ) if ( iResult >= 0 )
{ {
// Less explosives gain for placing tripwire // Less explosives gain for placing tripwire
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 ) if (ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE ); StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE );
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) ) else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE ); StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
@@ -5643,7 +5642,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
else else
{ {
// we can't blow up tripwire, no matter how bad we fail // we can't blow up tripwire, no matter how bad we fail
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 ) if ( !ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
{ {
// OOPS! ... BOOM! // OOPS! ... BOOM!
IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] ); IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] );
@@ -5699,7 +5698,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier
// Flugente: tripwire was called through a messagebox, but has to be buried nevertheless // Flugente: tripwire was called through a messagebox, but has to be buried nevertheless
if ( Item[ (&gTempObject)->usItem ].tripwire == 1 ) if (ItemIsTripwire((&gTempObject)->usItem))
{ {
AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 ); AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
// sevenfm: set flag only if planting tripwire // sevenfm: set flag only if planting tripwire
@@ -5839,7 +5838,7 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
// shape to be usable, and doesn't break during use. // shape to be usable, and doesn't break during use.
// Exception: land mines. You can bury them broken, they just won't blow! // Exception: land mines. You can bury them broken, they just won't blow!
// if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN ) // if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN )
if ( Item[pObj->usItem].damageable && !Item[pObj->usItem].mine && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) ) if (ItemIsDamageable(pObj->usItem) && !ItemIsMine(pObj->usItem) && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !ItemIsGascan(pObj->usItem) && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
{ {
// if it's still usable, check whether it breaks // if it's still usable, check whether it breaks
if ( (*pObj)[0]->data.objectStatus >= USABLE) if ( (*pObj)[0]->data.objectStatus >= USABLE)
@@ -6103,7 +6102,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject); CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject);
// also spawn attached guns/explosives // also spawn attached guns/explosives
if (gTempObject.usItem != ACTION_ITEM && (Item[gTempObject.usItem].tripwire || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV)) if (gTempObject.usItem != ACTION_ITEM && (ItemIsTripwire(gTempObject.usItem) || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
{ {
// search for attached items // search for attached items
OBJECTTYPE* pAttItem = NULL; OBJECTTYPE* pAttItem = NULL;
@@ -6990,7 +6989,7 @@ INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay ) BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
{ {
if ( Item[pSoldier->inv[ pSoldier->ubAttackingHand ].usItem].fingerprintid ) if (ItemHasFingerPrintID(pSoldier->inv[ pSoldier->ubAttackingHand ].usItem))
{ {
// check imprint ID // check imprint ID
// NB not-imprinted value is NO_PROFILE // NB not-imprinted value is NO_PROFILE
@@ -7042,7 +7041,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
fStealItem = FALSE; fStealItem = FALSE;
pObject=&pOpponent->inv[i]; pObject=&pOpponent->inv[i];
if ((pObject->exists() == true) && !(Item[pObject->usItem].defaultundroppable )) // CHECK! Undroppable items cannot be stolen - SANDRO if ((pObject->exists() == true) && !ItemIsUndroppableByDefault(pObject->usItem)) // CHECK! Undroppable items cannot be stolen - SANDRO
{ {
// Is the enemy collapsed // Is the enemy collapsed
if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed ) if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed )
@@ -9855,7 +9854,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
} }
} }
// if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand // if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand
else if ( node.slot == HANDPOS && Item[node.item].twohanded && pSoldier->inv[SECONDHANDPOS].exists( ) ) else if ( node.slot == HANDPOS && ItemIsTwoHanded(node.item) && pSoldier->inv[SECONDHANDPOS].exists( ) )
{ {
AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel ); AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel );
DeleteObj( &pSoldier->inv[SECONDHANDPOS] ); DeleteObj( &pSoldier->inv[SECONDHANDPOS] );
@@ -10268,7 +10267,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
} }
// if there is water in this sector, refill canteens // if there is water in this sector, refill canteens
if ( refillwaterfromsector && Item[(pSoldier->inv[slot]).usItem].canteen && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 ) if ( refillwaterfromsector && ItemIsCanteen(pSoldier->inv[slot].usItem) && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[slot]); OBJECTTYPE* pObj = &(pSoldier->inv[slot]);
+10 -9
View File
@@ -2988,11 +2988,12 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
if ( pTSoldier != NULL ) if ( pTSoldier != NULL )
{ {
// If this is one of our own guys.....pop up requiester... // If this is one of our own guys.....pop up requiester...
UINT16 usItem = pSoldier->inv[HANDPOS].usItem;
if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM ) if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM )
&& Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass != IC_MEDKIT && Item[ usItem ].usItemClass != IC_MEDKIT
&& !Item[pSoldier->inv[ HANDPOS ].usItem].gascan && !ItemIsGascan(usItem)
&& !Item[pSoldier->inv[HANDPOS].usItem].toolkit && !ItemIsToolkit(usItem)
&& !ItemCanBeAppliedToOthers( pSoldier->inv[ HANDPOS ].usItem ) && !ItemCanBeAppliedToOthers( usItem )
&& gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile && gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile
&& ( pTSoldier->ubID != pSoldier->ubID ) ) && ( pTSoldier->ubID != pSoldier->ubID ) )
{ {
@@ -3010,7 +3011,7 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - Should we ask if we really want to do the surgery? // SANDRO - Should we ask if we really want to do the surgery?
else if (Item[ pSoldier->inv[ HANDPOS ].usItem ].medicalkit && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) else if (ItemIsMedicalKit(usItem) && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery)
&& (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM) && (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM)
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier )) && (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
&& gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100 && gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100
@@ -3894,7 +3895,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding && gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() && pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
bNewStance == ANIM_STAND) bNewStance == ANIM_STAND)
{ {
ChangeScopeMode(pSoldier, NOWHERE); ChangeScopeMode(pSoldier, NOWHERE);
@@ -3937,7 +3938,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding && gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() && pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
bNewStance == ANIM_STAND) bNewStance == ANIM_STAND)
{ {
ChangeScopeMode(pSoldier, NOWHERE); ChangeScopeMode(pSoldier, NOWHERE);
@@ -4628,7 +4629,7 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, INT32 usMapPos, UINT32 uiFlags )
} }
else if ( uiFlags == MOVEUI_TARGET_BOMB ) else if ( uiFlags == MOVEUI_TARGET_BOMB )
{ {
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1) if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
sAPCost += GetAPsToPlantMine( pSoldier ); sAPCost += GetAPsToPlantMine( pSoldier );
else else
sAPCost += GetAPsToDropBomb( pSoldier ); sAPCost += GetAPsToDropBomb( pSoldier );
@@ -5014,7 +5015,7 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
} }
// SANDRO - doctor with medical bag trying to do the surgery // SANDRO - doctor with medical bag trying to do the surgery
if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit && gGameOptions.fNewTraitSystem if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem) && gGameOptions.fNewTraitSystem
&& (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100)) && (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100))
{ {
// should come a question first if you really want to do the surgery // should come a question first if you really want to do the surgery
+3 -2
View File
@@ -2353,7 +2353,8 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
break; break;
case NPC_ACTION_HAVE_PACOS_FOLLOW: case NPC_ACTION_HAVE_PACOS_FOLLOW:
pSoldier = FindSoldierByProfileID( 114, FALSE ); pSoldier = FindSoldierByProfileID( 114, FALSE );
sGridNo = 18193; //dnl!!! sGridNo = 8537; //dnl!!!
//kitty: changed gridno from 18193 to 8537, that's at entrance door to rebel basement, where Fatima and Dimitri dialogue happens
if (pSoldier) if (pSoldier)
{ {
if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) ) if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) )
@@ -4331,7 +4332,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
case NPC_ACTION_PUT_PACOS_IN_BASEMENT: case NPC_ACTION_PUT_PACOS_IN_BASEMENT:
gMercProfiles[ PACOS ].sSectorX = 10; gMercProfiles[ PACOS ].sSectorX = 10;
gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A; gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A;
gMercProfiles[ PACOS ].bSectorZ = 0; gMercProfiles[ PACOS ].bSectorZ = 1; //kitty: fixed - first level underground is 1, not 0
break; break;
case NPC_ACTION_HISTORY_ASSASSIN: case NPC_ACTION_HISTORY_ASSASSIN:
AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY ); AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY );
File diff suppressed because it is too large Load Diff
+224 -104
View File
@@ -57,7 +57,6 @@
#include "game clock.h" #include "game clock.h"
#include "squads.h" #include "squads.h"
#include "MessageBoxScreen.h" #include "MessageBoxScreen.h"
#include "Language Defines.h"
#include "GameSettings.h" #include "GameSettings.h"
#include "Map Screen Interface Map Inventory.h" #include "Map Screen Interface Map Inventory.h"
#include "Quests.h" #include "Quests.h"
@@ -83,6 +82,7 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
#include "Ja25_Tactical.h" #include "Ja25_Tactical.h"
@@ -168,7 +168,7 @@ INT16 ITEMDESC_DONE_Y;
#define DOTDOTDOT L"..." #define DOTDOTDOT L"..."
#define COMMA_AND_SPACE L", " #define COMMA_AND_SPACE L", "
#define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !Item[ usItem ].rocketlauncher ) ) #define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !ItemIsRocketLauncher(usItem) ) )
#define ITEMDESC_ITEM_STATUS_WIDTH 2 #define ITEMDESC_ITEM_STATUS_WIDTH 2
#define ITEMDESC_ITEM_WIDTH 117 #define ITEMDESC_ITEM_WIDTH 117
@@ -2666,7 +2666,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
} }
// IF it's the second hand and this hand cannot contain anything, remove the second hand position graphic // IF it's the second hand and this hand cannot contain anything, remove the second hand position graphic
if (sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded ) if (sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem))
{ {
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon // CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
if( guiCurrentItemDescriptionScreen != MAP_SCREEN ) if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
@@ -2710,7 +2710,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
fHatchItOut = TRUE; fHatchItOut = TRUE;
} }
// CHRISL: Don't hatch second hand position if we're holding a two handed item // CHRISL: Don't hatch second hand position if we're holding a two handed item
else if ( sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded ) else if ( sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) )
{ {
fHatchItOut = FALSE; fHatchItOut = FALSE;
} }
@@ -2832,8 +2832,8 @@ BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject)
//Shadooow: rewritten to use new item flags and check canteen not empty //Shadooow: rewritten to use new item flags and check canteen not empty
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || Item[usItem].camouflagekit || usItem == JAR_ELIXIR || if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || ItemIsCamoKit(usItem) || usItem == JAR_ELIXIR ||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1)) Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!ItemIsCanteen(usItem) || (*pTestObject)[0]->data.objectStatus > 1))
{ {
return( TRUE ); return( TRUE );
} }
@@ -3010,14 +3010,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos
UINT32 invsize = pSoldier->inv.size(); UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if ( !(Item[ pTestObject->usItem ].hiddenaddon ) ) if ( !(ItemIsHiddenAddon(pTestObject->usItem)) )
{ {
for ( cnt = 0; cnt < invsize; ++cnt ) for ( cnt = 0; cnt < invsize; ++cnt )
{ {
pObject = &(pSoldier->inv[ cnt ]); pObject = &(pSoldier->inv[ cnt ]);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment && if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3116,14 +3116,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapInventory(SOLDIERTYPE *pSoldier, INT32 bInvP
} }
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if (!(Item[pTestObject->usItem].hiddenaddon)) if (!(ItemIsHiddenAddon(pTestObject->usItem)))
{ {
for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt) for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt)
{ {
pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object); pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment && if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3270,14 +3270,14 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
UINT32 invsize = pSoldier->inv.size(); UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if (!(Item[pTestObject->usItem].hiddenaddon)) if (!(ItemIsHiddenAddon(pTestObject->usItem)))
{ {
for (cnt = 0; cnt < invsize; ++cnt) for (cnt = 0; cnt < invsize; ++cnt)
{ {
pObject = &(pSoldier->inv[cnt]); pObject = &(pSoldier->inv[cnt]);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment && if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3302,7 +3302,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
} }
} }
//if the test object is hidden addon or attachment, it won't be ammunition or gun so skip this //if the test object is hidden addon or attachment, it won't be ammunition or gun so skip this
if (!Item[pTestObject->usItem].hiddenaddon && !Item[pTestObject->usItem].attachment) if (!ItemIsHiddenAddon(pTestObject->usItem) && !ItemIsAttachment(pTestObject->usItem))
{ {
if( ( Item [ pTestObject->usItem ].usItemClass & IC_GUN ) ) if( ( Item [ pTestObject->usItem ].usItemClass & IC_GUN ) )
{ {
@@ -3816,7 +3816,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
} }
if ( pItem->usItemClass == IC_GUN && !Item[pObject->usItem].rocketlauncher ) if ( pItem->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObject->usItem) )
{ {
sNewY = sY + sHeight - 10; sNewY = sY + sHeight - 10;
sNewX = sX + 1; sNewX = sX + 1;
@@ -3872,7 +3872,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
} }
if ( pItemShown->usItemClass == IC_GUN && !Item[pObjShown->usItem].rocketlauncher ) if ( pItemShown->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObjShown->usItem) )
{ {
SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red, SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red,
AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green, AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green,
@@ -3950,7 +3950,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
// Flugente: overheating // Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel ) ) if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || ItemIsBarrel(pObject->usItem)) )
{ {
OBJECTTYPE* pObjShown = pObject; OBJECTTYPE* pObjShown = pObject;
@@ -4201,7 +4201,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
if ( ( ( pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO ) || if ( ( ( pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO ) ||
( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher ) ) && ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem)) ) &&
pSoldier->usGLDelayMode ) pSoldier->usGLDelayMode )
{ {
wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] ); wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] );
@@ -4231,7 +4231,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) && if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) &&
(pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) && (pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) &&
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN &&
!(Item[ pSoldier->inv[HANDPOS ].usItem ].twohanded ) && !ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
pSoldier->IsValidSecondHandBurst() ) pSoldier->IsValidSecondHandBurst() )
{ {
sNewY = sY + 13; // rather arbitrary sNewY = sY + 13; // rather arbitrary
@@ -4565,7 +4565,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
} }
//////////////////// GUN DATA ////////////////// //////////////////// GUN DATA //////////////////
if ( pItem->usItemClass & IC_GUN && !Item[pObject->usItem].rocketlauncher ) if ( pItem->usItemClass & IC_GUN && !ItemIsRocketLauncher(pObject->usItem) )
{ {
//////////////// AMMO REMAINING //////////////// AMMO REMAINING
@@ -4804,7 +4804,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
} }
iCurAsterisk = ATTACHMENT_GENERAL; iCurAsterisk = ATTACHMENT_GENERAL;
if (Item[iter->usItem].grenadelauncher ) if (ItemIsGrenadeLauncher(iter->usItem))
{ {
//iCurAsterisk = ATTACHMENT_GL; //iCurAsterisk = ATTACHMENT_GL;
uiNumAttachmentsGL++; uiNumAttachmentsGL++;
@@ -5233,7 +5233,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
} }
// Add ammo eject button for GUN type objects. // Add ammo eject button for GUN type objects.
if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !Item[pObject->usItem].rocketlauncher ) if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !ItemIsRocketLauncher(pObject->usItem) )
{ {
if ( GetMagSize(gpItemDescObject) <= 99 ) if ( GetMagSize(gpItemDescObject) <= 99 )
{ {
@@ -5610,7 +5610,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
} }
// if ( !(Item[ pObject->usItem ].fFlags & ITEM_HIDDEN_ADDON) && ( ValidAttachment( gpItemPointer->usItem, pObject->usItem ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) ) // if ( !(Item[ pObject->usItem ].fFlags & ITEM_HIDDEN_ADDON) && ( ValidAttachment( gpItemPointer->usItem, pObject->usItem ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
if ( !(Item[ pObject->usItem ].hiddenaddon ) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) ) if ( !(ItemIsHiddenAddon(pObject->usItem)) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
{ {
SetUpFastHelpListRegions( SetUpFastHelpListRegions(
gItemDescHelpText.iXPosition, gItemDescHelpText.iXPosition,
@@ -5750,7 +5750,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE)) if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE))
{ {
usAttachment = usLoop; usAttachment = usLoop;
if (!Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment)) if (!ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5786,7 +5786,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
} }
} }
if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment)) if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5822,7 +5822,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
} }
} }
if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment)) if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5895,7 +5895,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
for(UINT16 loop = 0; loop < attachList.size(); loop++){ for(UINT16 loop = 0; loop < attachList.size(); loop++){
usAttachment = attachList[loop]; usAttachment = attachList[loop];
// If the attachment is not hidden // If the attachment is not hidden
if (usAttachment > 0 && !Item[ usAttachment ].hiddenaddon && !Item[ usAttachment ].hiddenattachment) if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment))
{ {
if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3600) if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3600)
{ {
@@ -7021,8 +7021,7 @@ void RenderItemDescriptionBox( )
//WarmSteel - This hatches out attachment slots one by one, instead of all of em. //WarmSteel - This hatches out attachment slots one by one, instead of all of em.
for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++) for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++)
{ {
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) || if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) && ( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) ) !ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7038,8 +7037,7 @@ void RenderItemDescriptionBox( )
} else { } else {
for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++) for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++)
{ {
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) || if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) && ( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) ) !ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7071,7 +7069,7 @@ void RenderItemDescriptionBox( )
DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex ); DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex );
// Flugente: overheating // Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[ (iter)->usItem ].barrel == TRUE) ) // Flugente if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel((iter)->usItem)) ) // Flugente
{ {
FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter)); FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter));
@@ -7219,7 +7217,7 @@ void RenderItemDescriptionBox( )
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
SetFontShadow( ITEMDESC_FONTSHADOW2 ); SetFontShadow( ITEMDESC_FONTSHADOW2 );
// Caliber // Caliber
if ( (Item[gpItemDescObject->usItem].fingerprintid ) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE ) if ( ItemHasFingerPrintID(gpItemDescObject->usItem) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
{ {
// Fingerprint ID // Fingerprint ID
swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname ); swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname );
@@ -7284,7 +7282,7 @@ void RenderItemDescriptionBox( )
} }
// Flugente: display temperature string // Flugente: display temperature string
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) ) if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || ItemIsBarrel(gpItemDescObject->usItem) ) )
{ {
// UDB system displays a string with colored condition text. // UDB system displays a string with colored condition text.
int regionindex = 8; int regionindex = 8;
@@ -7412,11 +7410,11 @@ void RenderItemDescriptionBox( )
FindFontRightCoordinates( gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sTop, gODBItemDescRegions[0][0].sRight - gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sBottom - gODBItemDescRegions[0][0].sTop ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sTop, gODBItemDescRegions[0][0].sRight - gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sBottom - gODBItemDescRegions[0][0].sTop ,pStr, BLOCKFONT2, &usX, &usY);
} }
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
wcscat( pStr, ChineseSpecString1 ); wcscat( pStr, ChineseSpecString1 );
#else } else {
wcscat( pStr, L"%%" ); wcscat( pStr, L"%%" );
#endif }
mprintf( usX, usY, pStr ); mprintf( usX, usY, pStr );
} }
@@ -7612,7 +7610,7 @@ void RenderItemDescriptionBox( )
FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY, pStr ); mprintf( usX, usY, pStr );
} }
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{ {
// DAMAGE // DAMAGE
SetFontForeground( 6 ); SetFontForeground( 6 );
@@ -8365,7 +8363,7 @@ void DeleteItemDescriptionBox( )
} }
if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) || if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) ||
Item[gpItemDescObject->usItem].cannon) ItemIsCannon(gpItemDescObject->usItem))
{ {
//lalien: changed to charge AP's for reloading a GL/RL //lalien: changed to charge AP's for reloading a GL/RL
ubAPCost = GetAPsToReload(gpItemDescObject); ubAPCost = GetAPsToReload(gpItemDescObject);
@@ -10712,7 +10710,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) )
{ {
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos ); EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
InternalMAPBeginItemPointer( gpItemPopupSoldier ); InternalMAPBeginItemPointer( gpItemPopupSoldier );
@@ -10723,7 +10721,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{ {
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos ); EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
gpItemPointer = &gItemPointer; gpItemPointer = &gItemPointer;
@@ -11181,11 +11179,11 @@ void SetupPickupPage( INT8 bPage )
} }
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString3, sValue ); swprintf( pStr, ChineseSpecString3, sValue );
#else } else {
swprintf( pStr, L"%d%%", sValue ); swprintf( pStr, L"%d%%", sValue );
#endif }
} }
SetRegionFastHelpText( &(gItemPickupMenu.Regions[ cnt - iStart ]), pStr ); SetRegionFastHelpText( &(gItemPickupMenu.Regions[ cnt - iStart ]), pStr );
@@ -12283,12 +12281,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString11, swprintf( pStr, ChineseSpecString11,
#else
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue, sValue,
@@ -12307,16 +12301,32 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue,
sThreshold,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString4, swprintf( pStr, ChineseSpecString4,
#else
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue, sValue,
@@ -12334,6 +12344,28 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
} }
break; break;
@@ -12382,12 +12414,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#else
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
sValue, sValue,
sThreshold, sThreshold,
@@ -12405,15 +12433,31 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ],
sValue,
sThreshold,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#else
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String gWeaponStatsDesc[ 9 ], //Accuracy String
@@ -12430,6 +12474,25 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ],
sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
} }
break; break;
@@ -12440,13 +12503,9 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
{ {
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString9, swprintf( pStr, ChineseSpecString9,
#else ItemNames[ usItem ],
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
#endif
ItemNames[ usItem ],
sValue, sValue,
sThreshold, sThreshold,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
@@ -12457,16 +12516,26 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ],
sValue,
sThreshold,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage
gWeaponStatsDesc[ 6 ], //AP String
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString5, swprintf( pStr, ChineseSpecString5,
#else ItemNames[ usItem ],
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
#endif
ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage GetDamage(pObject), //Melee damage
@@ -12476,6 +12545,19 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ],
sValue,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage
gWeaponStatsDesc[ 6 ], //AP String
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
} }
break; break;
@@ -12515,13 +12597,9 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage, 0 ); UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage, 0 );
UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage, 1 ); UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage, 1 );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString5, swprintf( pStr, ChineseSpecString5,
#else ItemNames[ usItem ],
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
#endif
ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
explDamage, explDamage,
@@ -12531,6 +12609,19 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ],
sValue,
gWeaponStatsDesc[ 11 ], //Damage String
explDamage,
gWeaponStatsDesc[ 13 ], //Stun Damage String
explStunDamage, //Stun Damage
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
break; break;
@@ -12560,12 +12651,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString10, swprintf( pStr, ChineseSpecString10,
#else
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
sThreshold, //repair threshold sThreshold, //repair threshold
@@ -12579,15 +12666,27 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
ItemNames[ usItem ], //Item long name
sValue, //Item condition
sThreshold, //repair threshold
pInvPanelTitleStrings[ 4 ], //Protection string
iProtection, //Protection rating in % based on best armor
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
pInvPanelTitleStrings[ 3 ], //Camo string
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
gWeaponStatsDesc[ 12 ], //Weight string
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
else else
{ {
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString6, swprintf( pStr, ChineseSpecString6,
#else
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
pInvPanelTitleStrings[ 4 ], //Protection string pInvPanelTitleStrings[ 4 ], //Protection string
@@ -12600,6 +12699,21 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
ItemNames[ usItem ], //Item long name
sValue, //Item condition
pInvPanelTitleStrings[ 4 ], //Protection string
iProtection, //Protection rating in % based on best armor
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
pInvPanelTitleStrings[ 3 ], //Camo string
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
gWeaponStatsDesc[ 12 ], //Weight string
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
} }
break; break;
@@ -12612,24 +12726,30 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
default: default:
{ {
// The final, and typical case, is that of an item with a percent status // The final, and typical case, is that of an item with a percent status
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
swprintf( pStr, ChineseSpecString7, swprintf( pStr, ChineseSpecString7,
#else
swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
gWeaponStatsDesc[ 12 ], //Weight String gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
} else {
swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s",
ItemNames[ usItem ], //Item long name
sValue, //Item condition
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
}
} }
break; break;
} }
// Fingerprint ID (Soldier Name) // Fingerprint ID (Soldier Name)
if ( ( Item[pObject->usItem].fingerprintid ) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE ) if ( ItemHasFingerPrintID(pObject->usItem) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE )
{ {
CHAR16 pStr2[20]; CHAR16 pStr2[20];
swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname ); swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname );
@@ -13816,7 +13936,7 @@ void BombInventoryMessageBoxCallBack( UINT8 ubExitValue )
if (gpItemDescSoldier) if (gpItemDescSoldier)
{ {
// no planting tripwire in our inventory... // no planting tripwire in our inventory...
if ( Item[ gpItemDescObject->usItem ].tripwire == 1 ) if (ItemIsTripwire(gpItemDescObject->usItem))
return; return;
INT32 iResult; INT32 iResult;
@@ -13965,14 +14085,14 @@ void BombInventoryDisArmMessageBoxCallBack( UINT8 ubExitValue )
if ( (*gpItemDescObject)[0]->data.misc.ubBombOwner > 1 && ( (INT32)(*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && (*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) ) if ( (*gpItemDescObject)[0]->data.misc.ubBombOwner > 1 && ( (INT32)(*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && (*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) )
{ {
// Flugente: get a tripwire-related bonus if we have a wire cutter in our hands // Flugente: get a tripwire-related bonus if we have a wire cutter in our hands
if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && Item[ gpItemDescSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpItemDescSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) ) if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[HANDPOS].usItem) ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[SECONDHANDPOS].usItem) ) )
{ {
// + 10 if item gets activated by tripwire // + 10 if item gets activated by tripwire
if ( Item[gpItemDescObject->usItem].tripwireactivation == 1 ) if (ItemHasTripwireActivation(gpItemDescObject->usItem))
diff += 10; diff += 10;
// + 10 if item is tripwire // + 10 if item is tripwire
if ( Item[gpItemDescObject->usItem].tripwire == 1 ) if (ItemIsTripwire(gpItemDescObject->usItem))
diff += 10; diff += 10;
} }
+20 -17
View File
@@ -73,6 +73,8 @@
//legion by Jazz //legion by Jazz
#include "Interface Utils.h" #include "Interface Utils.h"
#include <language.hpp>
//forward declarations of common classes to eliminate includes //forward declarations of common classes to eliminate includes
class OBJECTTYPE; class OBJECTTYPE;
class SOLDIERTYPE; class SOLDIERTYPE;
@@ -2747,27 +2749,27 @@ void RenderSMPanel( BOOLEAN *pfDirty )
mprintf( SM_ARMOR_LABEL_X - StringPixLength( pInvPanelTitleStrings[0], BLOCKFONT2 ) / 2, SM_ARMOR_LABEL_Y, pInvPanelTitleStrings[ 0 ] ); mprintf( SM_ARMOR_LABEL_X - StringPixLength( pInvPanelTitleStrings[0], BLOCKFONT2 ) / 2, SM_ARMOR_LABEL_Y, pInvPanelTitleStrings[ 0 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, ChineseSpecString1 );
#else } else {
mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, L"%%" ); mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, L"%%" );
#endif }
mprintf( SM_WEIGHT_LABEL_X - StringPixLength( pInvPanelTitleStrings[1], BLOCKFONT2 ), SM_WEIGHT_LABEL_Y, pInvPanelTitleStrings[ 1 ] ); mprintf( SM_WEIGHT_LABEL_X - StringPixLength( pInvPanelTitleStrings[1], BLOCKFONT2 ), SM_WEIGHT_LABEL_Y, pInvPanelTitleStrings[ 1 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, ChineseSpecString1 );
#else } else {
mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, L"%%" ); mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, L"%%" );
#endif }
mprintf( SM_CAMMO_LABEL_X - StringPixLength( pInvPanelTitleStrings[2], BLOCKFONT2 ), SM_CAMMO_LABEL_Y, pInvPanelTitleStrings[ 2 ] ); mprintf( SM_CAMMO_LABEL_X - StringPixLength( pInvPanelTitleStrings[2], BLOCKFONT2 ), SM_CAMMO_LABEL_Y, pInvPanelTitleStrings[ 2 ] );
#ifdef CHINESE if( g_lang == i18n::Lang::zh ) {
mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, ChineseSpecString1 );
#else } else {
mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" ); mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" );
#endif }
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, (BOOLEAN)(gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE ? TRUE : FALSE), (BOOLEAN)((gGameOptions.fNewTraitSystem && (gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0)) ? TRUE : FALSE), gpSMCurrentMerc->bExtraAgility != 0 ); // SANDRO UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, (BOOLEAN)(gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE ? TRUE : FALSE), (BOOLEAN)((gGameOptions.fNewTraitSystem && (gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0)) ? TRUE : FALSE), gpSMCurrentMerc->bExtraAgility != 0 ); // SANDRO
@@ -3373,7 +3375,7 @@ BOOLEAN HandleNailsVestFetish( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, UINT16 u
else else
{ {
// Do we have nothing or the leather vest or kevlar leather vest? // Do we have nothing or the leather vest or kevlar leather vest?
if ( Item[usReplaceItem].leatherjacket || if (ItemIsLeatherJacket(usReplaceItem) ||
usReplaceItem == COMPOUND18 || usReplaceItem == COMPOUND18 ||
usReplaceItem == JAR_QUEEN_CREATURE_BLOOD ) usReplaceItem == JAR_QUEEN_CREATURE_BLOOD )
{ {
@@ -4044,7 +4046,7 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
{ {
if ( !InItemDescriptionBox( ) ) if ( !InItemDescriptionBox( ) )
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpSMCurrentMerc->inv[ uiHandPos ].usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{ {
EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos ); EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
gpItemPointer = &gItemPointer; gpItemPointer = &gItemPointer;
@@ -7096,22 +7098,23 @@ void CheckForAndAddMercToTeamPanel( SOLDIERTYPE *pSoldier )
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj ) void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
{ {
INT16 bMaxPoints; INT16 bMaxPoints;
UINT16 usItem = pObj->usItem;
if ( !(Item[pObj->usItem].usItemClass & IC_AMMO || Item[pObj->usItem].usItemClass & IC_KIT || Item[pObj->usItem].usItemClass & IC_MEDKIT || Item[pObj->usItem].canteen || Item[pObj->usItem].gascan || Item[pObj->usItem].alcohol > 0.0f) ) if ( !(Item[usItem].usItemClass & IC_AMMO || Item[usItem].usItemClass & IC_KIT || Item[usItem].usItemClass & IC_MEDKIT || ItemIsCanteen(usItem) || ItemIsGascan(usItem) || Item[usItem].alcohol > 0.0f) )
{ {
return; return;
} }
if ( Item[ pObj->usItem ].usItemClass & IC_AMMO ) if ( Item[ usItem ].usItemClass & IC_AMMO )
{ {
bMaxPoints = Magazine[ Item[ pObj->usItem ].ubClassIndex ].ubMagSize; bMaxPoints = Magazine[ Item[ usItem ].ubClassIndex ].ubMagSize;
} }
else else
{ {
bMaxPoints = 100; bMaxPoints = 100;
} }
if ( pCursorObj && pCursorObj->usItem == pObj->usItem ) if ( pCursorObj && pCursorObj->usItem == usItem )
{ {
DistributeStatus(pCursorObj, pObj, bMaxPoints); DistributeStatus(pCursorObj, pObj, bMaxPoints);
} }
@@ -7120,13 +7123,13 @@ void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
// Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance // Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance
if ( pObj->ubNumberOfObjects > 1 ) if ( pObj->ubNumberOfObjects > 1 )
{ {
if ( Item[pObj->usItem].usItemClass & IC_AMMO ) if ( Item[usItem].usItemClass & IC_AMMO )
{ {
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft; UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft; (*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
(*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first; (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first;
} }
else if ( Item[pObj->usItem].usItemClass & IC_MAPFILTER_KIT ) else if ( Item[usItem].usItemClass & IC_MAPFILTER_KIT )
{ {
INT16 status_first = (*pObj)[0]->data.objectStatus; INT16 status_first = (*pObj)[0]->data.objectStatus;
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus; (*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
+7 -20
View File
@@ -461,14 +461,7 @@ BOOLEAN InitializeTacticalInterface( )
// failing the CHECKF after this will cause you to lose your mouse // failing the CHECKF after this will cause you to lose your mouse
if ( GETPIXELDEPTH() == 8 ) strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT_8.pcx" );
}
else if ( GETPIXELDEPTH() == 16 )
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
}
if( !AddVideoSurface( &vs_desc, &guiINTEXT ) ) if( !AddVideoSurface( &vs_desc, &guiINTEXT ) )
AssertMsg( 0, "Missing INTERFACE\\In_text.sti"); AssertMsg( 0, "Missing INTERFACE\\In_text.sti");
@@ -978,12 +971,12 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
} }
else else
{ {
if ( Item[pSoldier->inv[ HANDPOS ].usItem].toolkit ) if (ItemIsToolkit(pSoldier->inv[ HANDPOS ].usItem))
{ {
uiActionImages = TOOLKITACTIONC_IMAGES; uiActionImages = TOOLKITACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] ); swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
} }
else if ( Item[pSoldier->inv[ HANDPOS ].usItem].wirecutters ) else if (ItemIsWirecutters(pSoldier->inv[ HANDPOS ].usItem))
{ {
uiActionImages = WIRECUTACTIONC_IMAGES; uiActionImages = WIRECUTACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] ); swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
@@ -3562,10 +3555,7 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
} }
if ( pSoldier->ubID == gusSelectedSoldier ) if ( pSoldier->ubID == gusSelectedSoldier )
{ {
if(gbPixelDepth==16) RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
else
RectangleDraw8( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color8, pDestBuf);
} }
} }
@@ -5812,10 +5802,7 @@ void DrawBar( INT32 x, INT32 y, INT32 width, INT32 height, UINT16 color8, UINT16
{ {
for( INT32 i=0; i < height; i++ ) for( INT32 i=0; i < height; i++ )
{ {
if(gbPixelDepth==16) LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
else if(gbPixelDepth==8)
LineDraw8( TRUE, x, y+i, x+width-1, y+i, color8, pDestBuf );
} }
} }
} }
@@ -6043,7 +6030,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
} }
else else
{ // show general name { // show general name
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask ) if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus ) else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
@@ -6059,7 +6046,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
} }
else else
{ // show general name { // show general name
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask ) if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus ) else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
+7 -7
View File
@@ -738,7 +738,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
switch( Item[ pItem->usItem ].usItemClass ) switch( Item[ pItem->usItem ].usItemClass )
{ {
case IC_GUN: case IC_GUN:
if ( !Item[pItem->usItem].rocketlauncher ) if ( !ItemIsRocketLauncher(pItem->usItem) )
{ {
bWeaponClass *= -1; bWeaponClass *= -1;
} }
@@ -873,7 +873,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType; pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType;
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex; pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
if ( Item[usGunIndex].fingerprintid ) if (ItemHasFingerPrintID(usGunIndex))
{ {
pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1); pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1);
} }
@@ -951,7 +951,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE; pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE;
// Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off // Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off
if ( Item[usGunIndex].fingerprintid ) if (ItemHasFingerPrintID(usGunIndex))
{ {
pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1); pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1);
} }
@@ -3144,7 +3144,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
{ {
usItem = pp->Inv[ uiLoop ].usItem; usItem = pp->Inv[ uiLoop ].usItem;
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ExtendedGunListGun( usItem ) ) if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ItemIsOnlyInTonsOfGuns( usItem ) )
{ {
if ( bSoldierClass == SOLDIER_CLASS_NONE ) if ( bSoldierClass == SOLDIER_CLASS_NONE )
{ {
@@ -3528,7 +3528,7 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
} }
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE ) else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
{ {
if ( Item[ pObj->usItem ].gasmask ) if (ItemIsGasmask(pObj->usItem))
value = (*pObj)[idx]->data.objectStatus; value = (*pObj)[idx]->data.objectStatus;
else if ( Item[ pObj->usItem ].hearingrangebonus ) else if ( Item[ pObj->usItem ].hearingrangebonus )
{ {
@@ -4186,7 +4186,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) ) else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) )
{ {
// gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2 // gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2
if ( Item[ pWorldItem[ uiCount ].object.usItem ].gasmask ) if (ItemIsGasmask(pWorldItem[ uiCount ].object.usItem))
EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] ); EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] );
else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 ) else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 )
{ {
@@ -4265,7 +4265,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
if ( fnd == launcherhelpmap.end() ) if ( fnd == launcherhelpmap.end() )
{ {
LauncherHelpStruct tmp; LauncherHelpStruct tmp;
tmp.fNeedsAmmo = !Item[pWorldItem[ uiCount ].object.usItem].singleshotrocketlauncher; tmp.fNeedsAmmo = !ItemIsSingleShotRocketLauncher(pWorldItem[ uiCount ].object.usItem);
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp; launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
} }
} }
+1 -1
View File
@@ -1595,7 +1595,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
} }
else if ( EXPLOSIVE_GUN( this->usItem ) ) else if ( EXPLOSIVE_GUN( this->usItem ) )
{ {
if ( Item[this->usItem].singleshotrocketlauncher ) if (ItemIsSingleShotRocketLauncher(this->usItem))
{ {
(*this)[0]->data.gun.ubGunShotsLeft = 1; (*this)[0]->data.gun.ubGunShotsLeft = 1;
} }
+222 -259
View File
@@ -738,18 +738,18 @@ extern OBJECTTYPE gTempObject;
// note that these should not be used to determine what kind of an attachment an item is, that is determined by attachmentclass and the AC_xxx flags above // note that these should not be used to determine what kind of an attachment an item is, that is determined by attachmentclass and the AC_xxx flags above
#define BLOOD_BAG 0x00000001 //1 // this item is a blood bag can can be used to boost surgery #define BLOOD_BAG 0x00000001 //1 // this item is a blood bag can can be used to boost surgery
#define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System #define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System
#define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it #define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it
#define CAMERA 0x00000008 //8 #define CAMERA 0x00000008 //8
#define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in #define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in
#define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat #define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat
#define MEAT_COW 0x00000040 //64 // retrieve this by gutting a cow #define MEAT_COW 0x00000040 //64 // retrieve this by gutting a cow
#define BELT_FED 0x00000080 //128 // item can be fed externally #define BELT_FED 0x00000080 //128 // item can be fed externally
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally #define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots #define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo #define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit #define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
#define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up #define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up
#define GAROTTE 0x00002000 //8192 // this item is a garotte #define GAROTTE 0x00002000 //8192 // this item is a garotte
@@ -758,18 +758,18 @@ extern OBJECTTYPE gTempObject;
#define SKIN_BLOODCAT 0x00010000 //65536 // retrieve this by skinning (=decapitating) a bloodcat #define SKIN_BLOODCAT 0x00010000 //65536 // retrieve this by skinning (=decapitating) a bloodcat
#define NO_METAL_DETECTION 0x00020000 //131072 // a planted bomb with this flag can NOT be detected via metal detector. Use sparingly! #define NO_METAL_DETECTION 0x00020000 //131072 // a planted bomb with this flag can NOT be detected via metal detector. Use sparingly!
#define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines #define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines
#define HANDCUFFS 0x00080000 //524288 // item can be used to capture soldiers #define HANDCUFFS 0x00080000 //524288 // item can be used to capture soldiers
#define TASER 0x00100000 //1048576 // item is a taser, melee hits with this will drain breath (if batteries are supplied) #define TASER 0x00100000 //1048576 // item is a taser, melee hits with this will drain breath (if batteries are supplied)
#define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle #define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle
#define SCUBA_MASK 0x00400000 //4194304 // item is a scuba gear breathing mask #define SCUBA_MASK 0x00400000 //4194304 // item is a scuba gear breathing mask
#define SCUBA_FINS 0x00800000 //8388608 // this item speed up swimming, but slows walking and running #define SCUBA_FINS 0x00800000 //8388608 // this item speed up swimming, but slows walking and running
#define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll #define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll
#define RADIO_SET 0x02000000 //33554432 // item can be used to radio militia/squads in other sectors #define RADIO_SET 0x02000000 //33554432 // item can be used to radio militia/squads in other sectors
#define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages #define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages
#define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines #define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines
#define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player #define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player
#define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory #define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory
@@ -779,6 +779,98 @@ extern OBJECTTYPE gTempObject;
// extended flagmask to UINT64 // extended flagmask to UINT64
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag #define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
#define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases #define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases
#define ITEM_damageable 0x0000000400000000
#define ITEM_repairable 0x0000000800000000
#define ITEM_waterdamages 0x0000001000000000
#define ITEM_metal 0x0000002000000000
#define ITEM_sinks 0x0000004000000000
#define ITEM_showstatus 0x0000008000000000
#define ITEM_hiddenaddon 0x0000010000000000
#define ITEM_twohanded 0x0000020000000000
#define ITEM_notbuyable 0x0000040000000000
#define ITEM_attachment 0x0000080000000000
#define ITEM_hiddenattachment 0x0000100000000000
#define ITEM_biggunlist 0x0000200000000000
#define ITEM_notineditor 0x0000400000000000
#define ITEM_defaultundroppable 0x0000800000000000
#define ITEM_unaerodynamic 0x0001000000000000
#define ITEM_electronic 0x0002000000000000
#define ITEM_cannon 0x0004000000000000
#define ITEM_rocketrifle 0x0008000000000000
#define ITEM_fingerprintid 0x0010000000000000
#define ITEM_metaldetector 0x0020000000000000
#define ITEM_gasmask 0x0040000000000000
#define ITEM_lockbomb 0x0080000000000000
#define ITEM_flare 0x0100000000000000
#define ITEM_grenadelauncher 0x0200000000000000
#define ITEM_mortar 0x0400000000000000
#define ITEM_duckbill 0x0800000000000000
//UNUSED #define ITEM_detonator 0x1000000000000000
//UNUSED #define ITEM_remotedetonator 0x2000000000000000
#define ITEM_hidemuzzleflash 0x4000000000000000
#define ITEM_rocketlauncher 0x8000000000000000
// New UINT64 Item Flag => usItemFlag2
#define ITEM_singleshotrocketlauncher 0x00000001
#define ITEM_brassknuckles 0x00000002
#define ITEM_crowbar 0x00000004
#define ITEM_glgrenade 0x00000008
#define ITEM_flakjacket 0x00000010
#define ITEM_leatherjacket 0x00000020
#define ITEM_batteries 0x00000040
#define ITEM_needsbatteries 0x00000080
#define ITEM_xray 0x00000100
#define ITEM_wirecutters 0x00000200
#define ITEM_toolkit 0x00000400
#define ITEM_firstaidkit 0x00000800
#define ITEM_medicalkit 0x00001000
#define ITEM_canteen 0x00002000
#define ITEM_jar 0x00004000
#define ITEM_canandstring 0x00008000
#define ITEM_marbles 0x00010000
#define ITEM_walkman 0x00020000
#define ITEM_remotetrigger 0x00040000
#define ITEM_robotremotecontrol 0x00080000
#define ITEM_camouflagekit 0x00100000
#define ITEM_locksmithkit 0x00200000
#define ITEM_mine 0x00400000
#define ITEM_antitankmine 0x00800000
#define ITEM_hardware 0x01000000
#define ITEM_medical 0x02000000
#define ITEM_gascan 0x04000000
#define ITEM_containsliquid 0x08000000
#define ITEM_rock 0x10000000
#define ITEM_thermaloptics 0x20000000
#define ITEM_scifi 0x40000000
#define ITEM_newinv 0x80000000
#define ITEM_DiseaseSystemExclusive 0x0000000100000000 // kitty: item exclusively available with disease feature
#define ITEM_barrel 0x0000000200000000 // item can be used on some guns as an exchange barrel
#define ITEM_tripwireactivation 0x0000000400000000 // item (mine) can be activated by nearby tripwire
#define ITEM_tripwire 0x0000000800000000 // item is tripwire
#define ITEM_directional 0x0000001000000000 // item is a directional mine/bomb (actual direction is set upon planting)
#define ITEM_blockironsight 0x0000002000000000 // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
#define ITEM_fAllowClimbing 0x0000004000000000 // JMich: BackpackClimb does item allow climbing while wearing it
#define ITEM_cigarette 0x0000008000000000 // Flugente: this item can be smoked
#define ITEM_fProvidesRobotCamo 0x0000010000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotNightVision 0x0000020000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotLaserBonus 0x0000040000000000 // rftr: robot attachments
// ---------------------------------------------------------------- // ----------------------------------------------------------------
@@ -947,160 +1039,48 @@ extern OBJECTTYPE gTempObject;
// autofiretohitbonus, // autofiretohitbonus,
// bursttohitbonus // bursttohitbonus
typedef struct typedef struct
{ {
UINT32 usItemClass;
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
UINT16 ubClassIndex;
UINT8 ubCursor;
INT8 bSoundType;
UINT8 ubGraphicType;
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT8 ubPerPocket;
UINT16 ItemSize;
UINT16 usPrice;
UINT8 ubCoolness;
INT8 bReliability;
INT8 bRepairEase;
UINT16 fFlags;
UINT32 uiIndex; // added
CHAR16 szItemName[80]; //+1 for the null terminator //added
BOOLEAN damageable;
BOOLEAN repairable;
BOOLEAN waterdamages;
BOOLEAN metal;
BOOLEAN sinks;
BOOLEAN showstatus;
BOOLEAN hiddenaddon;
BOOLEAN twohanded;
BOOLEAN notbuyable;
BOOLEAN attachment;
BOOLEAN hiddenattachment;
BOOLEAN biggunlist;
BOOLEAN notineditor;
BOOLEAN defaultundroppable;
BOOLEAN unaerodynamic;
BOOLEAN electronic;
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
CHAR16 szLongItemName[80];
CHAR16 szItemDesc[400]; CHAR16 szItemDesc[400];
CHAR16 szBRName[80];
CHAR16 szBRDesc[400]; CHAR16 szBRDesc[400];
CHAR16 szItemName[80]; //+1 for the null terminator //added
//TODO: quest items, boosters, money CHAR16 szLongItemName[80];
CHAR16 szBRName[80];
// special item/attachment functions:
BOOLEAN cannon;
BOOLEAN rocketrifle;
BOOLEAN fingerprintid;
BOOLEAN metaldetector;
BOOLEAN gasmask;
BOOLEAN lockbomb;
BOOLEAN flare;
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
BOOLEAN grenadelauncher;
BOOLEAN mortar;
BOOLEAN duckbill;
BOOLEAN detonator;
BOOLEAN remotedetonator;
BOOLEAN hidemuzzleflash;
BOOLEAN rocketlauncher;
BOOLEAN singleshotrocketlauncher;
UINT16 discardedlauncheritem;
BOOLEAN brassknuckles;
//*** ddd UINT16 bloodieditem;
INT16 bloodieditem;
BOOLEAN crowbar;
BOOLEAN glgrenade;
BOOLEAN flakjacket;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
BOOLEAN leatherjacket;
BOOLEAN batteries;
BOOLEAN needsbatteries;
BOOLEAN xray;
BOOLEAN wirecutters;
BOOLEAN toolkit;
BOOLEAN firstaidkit;
BOOLEAN medicalkit;
BOOLEAN canteen;
BOOLEAN jar;
BOOLEAN canandstring;
BOOLEAN marbles;
BOOLEAN walkman;
BOOLEAN remotetrigger;
BOOLEAN robotremotecontrol;
BOOLEAN camouflagekit;
BOOLEAN locksmithkit;
BOOLEAN mine;
BOOLEAN antitankmine;
FLOAT alcohol;
BOOLEAN hardware;
BOOLEAN medical;
BOOLEAN gascan;
BOOLEAN containsliquid;
BOOLEAN rock;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
BOOLEAN thermaloptics;
UINT8 percenttunnelvision;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
BOOLEAN scifi; // item only available in scifi mode
BOOLEAN newinv; // item only available in new inventory mode
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data) UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data)
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 64 BOOLEAN values). If I only had thought of this earlier....
UINT64 usItemFlag2; // bitflags to store various item properties
UINT32 uiIndex;
UINT32 usItemClass;
UINT32 attachmentclass; // attachmentclass used
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
UINT32 foodtype;
UINT32 usActionItemFlag; // Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 clothestype; // Flugente: clothes type that 'links' to an entry in Clothes.xml
//zilpin: pellet spread patterns externalized in XML //zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern; INT32 spreadPattern;
FLOAT alcohol;
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
// subjectively.
FLOAT RecoilModifierX;
FLOAT RecoilModifierY;
FLOAT scopemagfactor;
FLOAT projectionfactor;
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
FLOAT dirtIncreaseFactor; // Flugente: advanced repair/dirt system. One shot causes this much dirt on a gun
FLOAT fRobotDamageReductionModifier; // rftr: robot attachments
// HEADROCK HAM 4: New variable arrays for the New CTH system. // HEADROCK HAM 4: New variable arrays for the New CTH system.
INT16 flatbasemodifier[3]; INT16 flatbasemodifier[3];
INT16 percentbasemodifier[3]; INT16 percentbasemodifier[3];
@@ -1113,115 +1093,98 @@ typedef struct
INT16 counterforceaccuracymodifier[3]; INT16 counterforceaccuracymodifier[3];
INT16 targettrackingmodifier[3]; INT16 targettrackingmodifier[3];
INT16 aimlevelsmodifier[3]; INT16 aimlevelsmodifier[3];
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
// subjectively. //Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
FLOAT RecoilModifierX; UINT16 ubClassIndex;
FLOAT RecoilModifierY; UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT16 ItemSize;
UINT16 usPrice;
UINT16 discardedlauncheritem;
UINT16 randomitem; // Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 usBuddyItem; // Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usRiotShieldStrength; // Flugente: riot shields. strength of shield
UINT16 usRiotShieldGraphic; // Flugente: riot shields. graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
INT16 bloodieditem;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
INT16 PercentRecoilModifier; INT16 PercentRecoilModifier;
INT16 percentaccuracymodifier; INT16 percentaccuracymodifier;
FLOAT scopemagfactor; INT16 usSpotting; // Flugente: spotting effectiveness
FLOAT projectionfactor; INT16 sBackpackWeightModifier; // JMich: BackpackClimb modifier to weight calculation to climb.
BOOLEAN speeddot; INT16 sFireResistance;
// Flugente UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
BOOLEAN barrel; // item can be used on some guns as an exchange barrel UINT8 ubCursor;
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount UINT8 ubGraphicType;
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments) UINT8 ubPerPocket;
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels) UINT8 ubCoolness;
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments) UINT8 percenttunnelvision;
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments) UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
UINT8 usHackingModifier;
UINT8 usBurialModifier; // Flugente: a modifier for burial effectiveness
UINT8 usDamageChance; // Flugente: advanced repair/dirt system. Chance that damage to the status will also damage the repair threshold
UINT8 usFlashLightRange; // Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usItemChoiceTimeSetting; // Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 ubSleepModifier; // silversurfer: item provides breath regeneration bonus while resting
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
UINT8 usAdministrationModifier; // Flugente: a modifier for administration effectiveness
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
UINT32 attachmentclass; // attachmentclass used INT8 bSoundType;
INT8 bReliability;
BOOLEAN tripwireactivation; // item (mine) can be activated by nearby tripwire INT8 bRepairEase;
BOOLEAN tripwire; // item is tripwire INT8 LockPickModifier;
BOOLEAN directional; // item is a directional mine/bomb (actual direction is set upon planting) INT8 RepairModifier;
INT8 randomitemcoolnessmodificator; // Flugente: a link to RandomItemsClass.xml. alters the allowed maximum coolness a random item can have
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects INT8 bRobotStrBonus; // rftr: robot attachments
INT8 bRobotAgiBonus; // rftr: robot attachments
BOOLEAN blockironsight; // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight) INT8 bRobotDexBonus; // rftr: robot attachments
INT8 bRobotTargetingSkillGrant; // rftr: robot attachments
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier.... INT8 bRobotChassisSkillGrant; // rftr: robot attachments
INT8 bRobotUtilitySkillGrant; // rftr: robot attachments
// Flugente: food type INT8 iTransportGroupMinProgress; // rftr: the progress bounds that allow a transport group to drop an item
UINT32 foodtype; INT8 iTransportGroupMaxProgress; // rftr: the progress bounds that allow a transport group to drop an item
//JMich_SkillModifiers: Adding new skill modifiers
INT8 LockPickModifier;
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
INT8 RepairModifier;
// Flugente: a modifier to hacking
UINT8 usHackingModifier;
// Flugente: a modifier for burial effectiveness
UINT8 usBurialModifier;
// Flugente: advanced repair/dirt system
UINT8 usDamageChance; // chance that damage to the status will also damage the repair threshold
FLOAT dirtIncreaseFactor; // one shot causes this much dirt on a gun
// Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 usActionItemFlag;
// Flugente: clothes type that 'links' to an entry in Clothes.xml
UINT32 clothestype;
// Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 randomitem;
INT8 randomitemcoolnessmodificator; // alters the allowed maximum coolness a random item can have
// Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usFlashLightRange;
// Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 usItemChoiceTimeSetting;
// Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usBuddyItem;
// silversurfer: item provides breath regeneration bonus while resting
UINT8 ubSleepModifier;
// Flugente: spotting effectiveness
INT16 usSpotting;
//JMich.BackpackClimb
INT16 sBackpackWeightModifier; //modifier to weight calculation to climb.
BOOLEAN fAllowClimbing; //does item allow climbing while wearing it
BOOLEAN cigarette; // Flugente: this item can be smoked
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
// Flugente: riot shields
UINT16 usRiotShieldStrength; // strength of shield
UINT16 usRiotShieldGraphic; // graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
// Flugente: fire resistance
INT16 sFireResistance;
// Flugente: a modifier for administration effectiveness
UINT8 usAdministrationModifier;
// rftr: robot attachments
FLOAT fRobotDamageReductionModifier;
INT8 bRobotStrBonus;
INT8 bRobotAgiBonus;
INT8 bRobotDexBonus;
INT8 bRobotTargetingSkillGrant;
INT8 bRobotChassisSkillGrant;
INT8 bRobotUtilitySkillGrant;
BOOLEAN fProvidesRobotCamo;
BOOLEAN fProvidesRobotNightVision;
BOOLEAN fProvidesRobotLaserBonus;
// kitty: item exclusively available with disease feature
BOOLEAN DiseaseSystemExclusive;
// rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMinProgress;
INT8 iTransportGroupMaxProgress;
} INVTYPE; } INVTYPE;
+240 -170
View File
File diff suppressed because it is too large Load Diff
+72 -4
View File
@@ -179,8 +179,76 @@ BOOLEAN ValidAttachmentClass( UINT16 usAttachment, UINT16 usItem );
//Determines if it is possible to equip this weapon with this ammo. //Determines if it is possible to equip this weapon with this ammo.
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType ); BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
//Determines if this item is a two handed item. BOOLEAN ItemIsDamageable(UINT16 usItem);
BOOLEAN TwoHandedItem( UINT16 usItem ); BOOLEAN ItemIsRepairable(UINT16 usItem);
BOOLEAN ItemIsDamagedByWater(UINT16 usItem);
BOOLEAN ItemIsMetal(UINT16 usItem);
BOOLEAN ItemSinks(UINT16 usItem);
BOOLEAN ItemIsTwoHanded(UINT16 usItem);
BOOLEAN ItemIsHiddenAddon(UINT16 usItem);
BOOLEAN ItemIsNotBuyable(UINT16 usItem);
BOOLEAN ItemIsAttachment(UINT16 usItem);
BOOLEAN ItemIsHiddenAttachment(UINT16 usItem);
BOOLEAN ItemIsOnlyInTonsOfGuns(UINT16 usItem);
BOOLEAN ItemIsNotInEditor(UINT16 usItem);
BOOLEAN ItemIsUndroppableByDefault(UINT16 usItem);
BOOLEAN ItemIsUnaerodynamic(UINT16 usItem);
BOOLEAN ItemIsElectronic(UINT16 usItem);
BOOLEAN ItemIsCannon(UINT16 usItem);
BOOLEAN ItemIsRocketRifle(UINT16 usItem);
BOOLEAN ItemHasFingerPrintID(UINT16 usItem);
BOOLEAN ItemIsMetalDetector(UINT16 usItem);
BOOLEAN ItemIsGasmask(UINT16 usItem);
BOOLEAN ItemIsLockBomb(UINT16 usItem);
BOOLEAN ItemIsFlare(UINT16 usItem);
BOOLEAN ItemIsGrenadeLauncher(UINT16 usItem);
BOOLEAN ItemIsMortar(UINT16 usItem);
BOOLEAN ItemIsDuckbill(UINT16 usItem);
BOOLEAN ItemHasHiddenMuzzleFlash(UINT16 usItem);
BOOLEAN ItemIsRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsSingleShotRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsBrassKnuckles(UINT16 usItem);
BOOLEAN ItemIsCrowbar(UINT16 usItem);
BOOLEAN ItemIsGLgrenade(UINT16 usItem);
BOOLEAN ItemIsFlakJacket(UINT16 usItem);
BOOLEAN ItemIsLeatherJacket(UINT16 usItem);
BOOLEAN ItemIsBatteries(UINT16 usItem);
BOOLEAN ItemNeedsBatteries(UINT16 usItem);
BOOLEAN ItemHasXRay(UINT16 usItem);
BOOLEAN ItemIsWirecutters(UINT16 usItem);
BOOLEAN ItemIsToolkit(UINT16 usItem);
BOOLEAN ItemIsFirstAidKit(UINT16 usItem);
BOOLEAN ItemIsMedicalKit(UINT16 usItem);
BOOLEAN ItemIsCanteen(UINT16 usItem);
BOOLEAN ItemIsJar(UINT16 usItem);
BOOLEAN ItemIsCanAndString(UINT16 usItem);
BOOLEAN ItemIsMarbles(UINT16 usItem);
BOOLEAN ItemIsWalkman(UINT16 usItem);
BOOLEAN ItemIsRemoteTrigger(UINT16 usItem);
BOOLEAN ItemIsRobotRemote(UINT16 usItem);
BOOLEAN ItemIsCamoKit(UINT16 usItem);
BOOLEAN ItemIsLocksmithKit(UINT16 usItem);
BOOLEAN ItemIsMine(UINT16 usItem);
BOOLEAN ItemIsATMine(UINT16 usItem);
BOOLEAN ItemIsHardware(UINT16 usItem);
BOOLEAN ItemIsMedical(UINT16 usItem);
BOOLEAN ItemIsGascan(UINT16 usItem);
BOOLEAN ItemContainsLiquid(UINT16 usItem);
BOOLEAN ItemIsRock(UINT16 usItem);
BOOLEAN ItemIsThermalOptics(UINT16 usItem);
BOOLEAN ItemIsOnlyInScifi(UINT16 usItem);
BOOLEAN ItemIsOnlyInNIV(UINT16 usItem);
BOOLEAN ItemIsBarrel(UINT16 usItem);
BOOLEAN ItemHasTripwireActivation(UINT16 usItem);
BOOLEAN ItemIsTripwire(UINT16 usItem);
BOOLEAN ItemIsDirectional(UINT16 usItem);
BOOLEAN ItemBlocksIronsight(UINT16 usItem);
BOOLEAN ItemAllowsClimbing(UINT16 usItem);
BOOLEAN ItemIsCigarette(UINT16 usItem);
BOOLEAN ItemIsOnlyInDisease(UINT16 usItem);
BOOLEAN ItemProvidesRobotCamo(UINT16 usItem);
BOOLEAN ItemProvidesRobotNightvision(UINT16 usItem);
BOOLEAN ItemProvidesRobotLaserBonus(UINT16 usItem);
//Existing functions without header def's, added them here, just incase I'll need to call //Existing functions without header def's, added them here, just incase I'll need to call
//them from the editor. //them from the editor.
@@ -222,7 +290,6 @@ UINT8 ConvertObjectTypeMoneyValueToProfileMoneyValue( UINT32 uiMoneyAmount );
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround ); BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE ); BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
BOOLEAN ExtendedGunListGun( UINT16 usGun );
UINT16 StandardGunListReplacement( UINT16 usGun ); UINT16 StandardGunListReplacement( UINT16 usGun );
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType); UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun ); UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun );
@@ -497,7 +564,8 @@ UINT64 GetAvailableAttachmentPoint ( OBJECTTYPE * pObject, UINT8 subObject );
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency ); void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency );
// Flugente: check for specific flags // Flugente: check for specific flags
BOOLEAN HasItemFlag( UINT16 usItem, UINT64 aFlag ); BOOLEAN HasItemFlag(UINT16 usItem, UINT64 aFlag);
BOOLEAN HasItemFlag2(UINT16 usItem, UINT64 aFlag);
// Flugente: get first item number that has this flag. Use with caution, as we search in all items // Flugente: get first item number that has this flag. Use with caution, as we search in all items
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag ); BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
+29 -17
View File
@@ -293,7 +293,8 @@ UINT32 POWERGENSECTOR_GRIDNO1 = 15100;
UINT32 POWERGENSECTOR_GRIDNO2 = 12220; UINT32 POWERGENSECTOR_GRIDNO2 = 12220;
UINT32 POWERGENSECTOR_GRIDNO3 = 14155; UINT32 POWERGENSECTOR_GRIDNO3 = 14155;
UINT32 POWERGENSECTOR_GRIDNO4 = 13980; UINT32 POWERGENSECTOR_GRIDNO4 = 13980;
UINT32 POWERGENSECTOREXITGRID_GRIDNO1 = 19749; UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO = 10979;
UINT32 POWERGENSECTOREXITGRID_DST_GRIDNO = 19749;
UINT32 POWERGENFANSOUND_GRIDNO1 = 10979; UINT32 POWERGENFANSOUND_GRIDNO1 = 10979;
UINT32 POWERGENFANSOUND_GRIDNO2 = 19749; UINT32 POWERGENFANSOUND_GRIDNO2 = 19749;
UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980; UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980;
@@ -304,17 +305,22 @@ UINT32 SECTOR_LAUNCH_MISSLES_Y = 12;
UINT32 SECTOR_LAUNCH_MISSLES_Z = 3; UINT32 SECTOR_LAUNCH_MISSLES_Z = 3;
//J13-0 //J13-0
UINT32 SECTOR_FAN_X = 13; UINT32 SECTOR_FAN_X = 13;
UINT32 SECTOR_FAN_Z = 10; UINT32 SECTOR_FAN_Y = 10;
UINT32 SECTOR_FAN_Y = 0; UINT32 SECTOR_FAN_Z = 0;
//K14-1 //K14-1
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14;
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11;
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1;
// Destination sector for fan exitgrid
//J14-1 //J14-1
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14;
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10;
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1;
INT16 BETTY_BLOODCAT_SECTOR_X = 10;
INT16 BETTY_BLOODCAT_SECTOR_Y = 9;
INT8 BETTY_BLOODCAT_SECTOR_Z = 0;
void InitGridNoUB() void InitGridNoUB()
{ {
SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231; SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231;
@@ -326,7 +332,8 @@ void InitGridNoUB()
POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220; POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220;
POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155; POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155;
POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980; POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980;
POWERGENSECTOREXITGRID_GRIDNO1 = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749; POWERGENSECTOREXITGRID_SRC_GRIDNO = gGameUBOptions.PowergenSectorExitgridSrcGridNo; //= 10979; // Exitgrid location in the sector it is created in
POWERGENSECTOREXITGRID_DST_GRIDNO = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749; // Exitgrid location in the destination sector
POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979; POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979;
POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749; POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749;
STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980; STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980;
@@ -338,8 +345,8 @@ void InitGridNoUB()
SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3; SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3;
//J13-0 //J13-0
SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13; SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13;
SECTOR_FAN_Z = gGameUBOptions.SectorFanY; //10; SECTOR_FAN_Y = gGameUBOptions.SectorFanY; //10;
SECTOR_FAN_Y = gGameUBOptions.SectorFanZ; //0; SECTOR_FAN_Z = gGameUBOptions.SectorFanZ; //0;
//K14-1 //K14-1
SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14; SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14;
SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11; SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11;
@@ -349,6 +356,11 @@ void InitGridNoUB()
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10; EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10;
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1; EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1;
BETTY_BLOODCAT_SECTOR_X = gGameUBOptions.BettyBloodCatSectorX;
BETTY_BLOODCAT_SECTOR_Y = gGameUBOptions.BettyBloodCatSectorY;
BETTY_BLOODCAT_SECTOR_Z = gGameUBOptions.BettyBloodCatSectorZ;
MANUEL_UB = gGameUBOptions.ubMANUEL_UB; MANUEL_UB = gGameUBOptions.ubMANUEL_UB;
BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB; BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB;
JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB; JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB;
@@ -646,7 +658,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
UINT32 uiPercentEnemiesKilled; UINT32 uiPercentEnemiesKilled;
UINT8 ubSectorID; UINT8 ubSectorID;
//if there isnt enemies in the sector //if there isn't enemies in the sector
if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 ) if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 )
{ {
//get out //get out
@@ -663,7 +675,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
switch( ubSectorID ) switch( ubSectorID )
{ {
case SEC_K15: case SEC_K15:
//all enemies are dead and if the quote hasnt been said yet //all enemies are dead and if the quote hasn't been said yet
if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) ) if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) )
{ {
INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam(); INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam();
@@ -703,7 +715,7 @@ void StopPowerGenFan()
return; return;
} }
//Remeber how the player got through //Remember how the player got through
SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED ); SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED );
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED; gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED;
@@ -721,7 +733,7 @@ void StopPowerGenFan()
//Turn off the power gen fan sound //Turn off the power gen fan sound
HandleRemovingPowerGenFanSound(); HandleRemovingPowerGenFanSound();
//remeber which turn the fan stopped on //remember which turn the fan stopped on
gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter; gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter;
@@ -729,7 +741,7 @@ void StopPowerGenFan()
// Replace the Fan graphic // Replace the Fan graphic
// //
// Turn on permenant changes.... // Turn on permanent changes....
ApplyMapChangesToMapTempFile( TRUE ); ApplyMapChangesToMapTempFile( TRUE );
//Add the exit grid to the power gen fan //Add the exit grid to the power gen fan
@@ -784,7 +796,7 @@ void StartFanBackUpAgain()
return; return;
} }
//Remeber how the player got through //Remember how the player got through
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY; gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY;
@@ -796,7 +808,7 @@ void StartFanBackUpAgain()
// Replace the Fan graphic // Replace the Fan graphic
// //
// Turn on permenant changes.... // Turn on permanent changes....
ApplyMapChangesToMapTempFile( TRUE ); ApplyMapChangesToMapTempFile( TRUE );
// Remove it! // Remove it!
@@ -821,7 +833,7 @@ void StartFanBackUpAgain()
gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY; gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY;
//Remove the exit grid //Remove the exit grid
RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO ); RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO );
// FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES // FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES
SetRenderFlags(RENDER_FLAG_FULL); SetRenderFlags(RENDER_FLAG_FULL);
@@ -914,7 +926,7 @@ void HandleAddingPowerGenFanSound()
sGridNo = POWERGENFANSOUND_GRIDNO2; sGridNo = POWERGENFANSOUND_GRIDNO2;
//Create the new ambient fan sound //Create the new ambient fan sound
//gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND ); gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND, 30 );
SetPositionSndsInActive( ); SetPositionSndsInActive( );
SetPositionSndsActive( ); SetPositionSndsActive( );
@@ -942,10 +954,10 @@ void AddExitGridForFanToPowerGenSector()
ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14; ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14;
ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J; ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J;
ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1; ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1;
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_GRIDNO1; ExitGrid.usGridNo = POWERGENSECTOREXITGRID_DST_GRIDNO;
//Add the exit grid when the fan is either stopped or blown up //Add the exit grid when the fan is either stopped or blown up
AddExitGridToWorld( PGF__FAN_EXIT_GRID_GRIDNO, &ExitGrid ); AddExitGridToWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO, &ExitGrid );
} }
BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce ) BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce )
+4 -1
View File
@@ -5,7 +5,6 @@
#include "MapScreen Quotes.h" #include "MapScreen Quotes.h"
#define PGF__FAN_EXIT_GRID_GRIDNO 10979
#define NUM_MERCS_WITH_NEW_QUOTES 20//7 #define NUM_MERCS_WITH_NEW_QUOTES 20//7
@@ -144,6 +143,10 @@ extern UINT8 RAUL_UB;
extern UINT8 MORRIS_UB; extern UINT8 MORRIS_UB;
extern UINT8 RUDY_UB; extern UINT8 RUDY_UB;
extern INT16 BETTY_BLOODCAT_SECTOR_X;
extern INT16 BETTY_BLOODCAT_SECTOR_Y;
extern INT8 BETTY_BLOODCAT_SECTOR_Z;
extern void Old_UB_Inventory (); extern void Old_UB_Inventory ();
extern void New_UB_Inventory (); extern void New_UB_Inventory ();
+16 -16
View File
@@ -4840,15 +4840,15 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if ( Item[usHandItem].rocketlauncher ) else if (ItemIsRocketLauncher(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if ( Item[usHandItem].cannon ) else if (ItemIsCannon(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if ( Item[usHandItem].rocketrifle ) else if (ItemIsRocketRifle(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -5237,7 +5237,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) ) if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{ {
// another shot fired // another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar) if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++; gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE ) else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++; gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -5335,15 +5335,15 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if ( Item[usHandItem].rocketlauncher ) else if (ItemIsRocketLauncher(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if ( Item[usHandItem].cannon ) else if (ItemIsCannon(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if ( Item[usHandItem].rocketrifle ) else if (ItemIsRocketRifle(usHandItem))
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -5753,7 +5753,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) ) if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{ {
// another shot fired // another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar) if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++; gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE ) else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++; gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -6007,15 +6007,15 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if ( Item[usItem].rocketlauncher ) else if (ItemIsRocketLauncher(usItem))
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if ( Item[usItem].cannon ) else if (ItemIsCannon(usItem))
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if ( Item[usItem].rocketrifle ) else if (ItemIsRocketRifle(usItem))
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -6594,15 +6594,15 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if ( Item[usItem].rocketlauncher ) else if (ItemIsRocketLauncher(usItem))
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if ( Item[usItem].cannon ) else if (ItemIsCannon(usItem))
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if ( Item[usItem].rocketrifle ) else if (ItemIsRocketRifle(usItem))
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -6923,7 +6923,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
// sevenfm: check that weapon exists! // sevenfm: check that weapon exists!
if (pObjHand->exists() && if (pObjHand->exists() &&
pObjHand->usItem == pFirer->usAttackingWeapon && pObjHand->usItem == pFirer->usAttackingWeapon &&
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || Item[pFirer->usAttackingWeapon].rocketlauncher)) (Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || ItemIsRocketLauncher(pFirer->usAttackingWeapon)))
{ {
BOOLEAN fBuckShot = FALSE; BOOLEAN fBuckShot = FALSE;
@@ -8643,7 +8643,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand])); //INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
INT16 sLaserRange = GetBestLaserRange(pWeapon); INT16 sLaserRange = GetBestLaserRange(pWeapon);
if (AM_A_ROBOT(pShooter) && Item[pShooter->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus) if (AM_A_ROBOT(pShooter) && ItemProvidesRobotLaserBonus(pShooter->inv[ROBOT_TARGETING_SLOT].usItem))
{ {
sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT])); sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT]));
} }
@@ -24,14 +24,15 @@ AbstractXMLLoader::ParseData* AbstractXMLLoader::MakeParseData(XML_Parser* parse
return new ParseData(parser); return new ParseData(parser);
} }
bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName) { bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf) {
HWFILE hFile; HWFILE hFile;
UINT32 uiBytesRead; UINT32 uiBytesRead;
UINT32 uiFSize; UINT32 uiFSize;
CHAR8* lpcBuffer; CHAR8* lpcBuffer;
char fileNameFull[MAX_PATH + 1]; char fileNameFull[MAX_PATH + 1];
if (strlen(fileName) + strlen(directoryName) >= MAX_PATH) { if (strlen(fileName) + strlen(directoryName) >= MAX_PATH) {
LiveMessage("Can't load file. Concatinated filename too long for buffer!"); sprintf(errorBuf, "Can't load file %s%s, Concatenated filename too long for buffer!", directoryName, fileName);
LiveMessage(errorBuf);
return false; return false;
} }
SetDirectoryName(directoryName); SetDirectoryName(directoryName);
@@ -46,12 +47,14 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, msg.c_str()); DebugMsg(TOPIC_JA2, DBG_LEVEL_3, msg.c_str());
hFile = FileOpen(fileNameFull, FILE_ACCESS_READ, FALSE); hFile = FileOpen(fileNameFull, FILE_ACCESS_READ, FALSE);
if (!hFile) { if (!hFile) {
sprintf(errorBuf, "Can't open %s", fileNameFull);
delete data; delete data;
return false; return false;
} }
uiFSize = FileGetSize(hFile); uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1); lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1);
if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead)) { if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead)) {
sprintf(errorBuf, "Error reading %s to buffer", fileNameFull);
MemFree(lpcBuffer); MemFree(lpcBuffer);
delete data; delete data;
return false; return false;
@@ -72,7 +75,6 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
try { try {
if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE)) { if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE)) {
CHAR8 errorBuf[512];
sprintf(errorBuf, "XML Parser Error in %s[%d]: %s", fileNameFull, XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); sprintf(errorBuf, "XML Parser Error in %s[%d]: %s", fileNameFull, XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser)));
LiveMessage(errorBuf); LiveMessage(errorBuf);
MemFree(lpcBuffer); MemFree(lpcBuffer);
@@ -80,7 +82,6 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
return false; return false;
} }
} catch (XMLParseException e) { } catch (XMLParseException e) {
CHAR8 errorBuf[512];
sprintf(errorBuf, "XML Parser Exception in %s[%d]: %s", fileNameFull, e._LINE, e.what()); sprintf(errorBuf, "XML Parser Exception in %s[%d]: %s", fileNameFull, e._LINE, e.what());
LiveMessage(errorBuf); LiveMessage(errorBuf);
MemFree(lpcBuffer); MemFree(lpcBuffer);
@@ -55,7 +55,7 @@ private:
public: public:
AbstractXMLLoader(XML_StartElementHandler startHandler, XML_EndElementHandler endHandler, XML_CharacterDataHandler charHandler, ParseDataFactoryFunc parseDataFactF = MakeParseData); AbstractXMLLoader(XML_StartElementHandler startHandler, XML_EndElementHandler endHandler, XML_CharacterDataHandler charHandler, ParseDataFactoryFunc parseDataFactF = MakeParseData);
~AbstractXMLLoader(void); ~AbstractXMLLoader(void);
bool LoadFromFile(const char* directoryName, const char* fileName); bool LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf);
const char* GetFileName(); const char* GetFileName();
const char* GetDirectoryName(); const char* GetDirectoryName();
void SetFileName(const char* fileName); void SetFileName(const char* fileName);
+14 -2
View File
@@ -214,10 +214,10 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre; cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
break; break;
case REQ_WEAPON_TWOHANDED: case REQ_WEAPON_TWOHANDED:
cmp_val = TwoHandedItem(pSoldier->inv[HANDPOS].usItem); cmp_val = ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem);
break; break;
case REQ_LEFT_WEAPON_TWOHANDED: case REQ_LEFT_WEAPON_TWOHANDED:
cmp_val = TwoHandedItem(pSoldier->inv[SECONDHANDPOS].usItem); cmp_val = ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem);
break; break;
case REQ_VEST_AMOR_PROTECTION: case REQ_VEST_AMOR_PROTECTION:
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection; cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
@@ -258,6 +258,18 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
case REQ_LEGPOSATTACHMENT3: case REQ_LEGPOSATTACHMENT3:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 3); cmp_val = CompareAttachment(pSoldier, LEGPOS, 3);
break; break;
case REQ_VESTPOSATTACHMENT0:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 0 );
break;
case REQ_VESTPOSATTACHMENT1:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 1 );
break;
case REQ_VESTPOSATTACHMENT2:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 2 );
break;
case REQ_VESTPOSATTACHMENT3:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 3 );
break;
default: default:
if (q < NUM_REQTYPESINV) { if (q < NUM_REQTYPESINV) {
cmp_val = pSoldier->inv[q].usItem; cmp_val = pSoldier->inv[q].usItem;
+4
View File
@@ -75,6 +75,10 @@ public:
REQ_LEGPOSATTACHMENT1, REQ_LEGPOSATTACHMENT1,
REQ_LEGPOSATTACHMENT2, REQ_LEGPOSATTACHMENT2,
REQ_LEGPOSATTACHMENT3, REQ_LEGPOSATTACHMENT3,
REQ_VESTPOSATTACHMENT0,
REQ_VESTPOSATTACHMENT1,
REQ_VESTPOSATTACHMENT2,
REQ_VESTPOSATTACHMENT3,
NUM_REQTYPES, NUM_REQTYPES,
// 3rd byte is for operator flags // 3rd byte is for operator flags
_REQ_BTWN = 0x20000, _REQ_BTWN = 0x20000,
+6 -2
View File
@@ -270,7 +270,7 @@ namespace LogicalBodyTypes {
/***************************************** /*****************************************
Filter enum criterion types Filter enum criterion types
******************************************/ ******************************************/
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 43, LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 47,
Filter::REQ_HELMETPOS, Filter::REQ_HELMETPOS,
Filter::REQ_VESTPOS, Filter::REQ_VESTPOS,
Filter::REQ_LEGPOS, Filter::REQ_LEGPOS,
@@ -313,7 +313,11 @@ namespace LogicalBodyTypes {
Filter::REQ_LEGPOSATTACHMENT0, Filter::REQ_LEGPOSATTACHMENT0,
Filter::REQ_LEGPOSATTACHMENT1, Filter::REQ_LEGPOSATTACHMENT1,
Filter::REQ_LEGPOSATTACHMENT2, Filter::REQ_LEGPOSATTACHMENT2,
Filter::REQ_LEGPOSATTACHMENT3 Filter::REQ_LEGPOSATTACHMENT3,
Filter::REQ_VESTPOSATTACHMENT0,
Filter::REQ_VESTPOSATTACHMENT1,
Filter::REQ_VESTPOSATTACHMENT2,
Filter::REQ_VESTPOSATTACHMENT3
); );
/***************************************** /*****************************************
+1 -1
View File
@@ -991,7 +991,7 @@ void HandleFirstHeliDropOfGame( )
SayQuoteFromAnyBodyInSector( QUOTE_ENEMY_PRESENCE ); SayQuoteFromAnyBodyInSector( QUOTE_ENEMY_PRESENCE );
// Start music // Start music
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
+60 -60
View File
@@ -1036,78 +1036,78 @@ if ( gGameUBOptions.InGameHeliCrash == TRUE )
void UpdateJerryMiloInInitialSector() void UpdateJerryMiloInInitialSector()
{ {
SOLDIERTYPE *pSoldier = NULL; SOLDIERTYPE *pSoldier = NULL;
SOLDIERTYPE *pJerrySoldier=NULL; SOLDIERTYPE *pJerrySoldier = NULL;
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE;
//SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE;
if ( gGameUBOptions.InGameHeli == TRUE )
return; //AA
if ( gGameUBOptions.InGameHeliCrash == TRUE )
{
//if it is the first sector we are loading up, place Jerry in the map
if( !gfFirstTimeInGameHeliCrash )
return;
if ( gGameUBOptions.InJerry == TRUE )
{
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
if( pSoldier == NULL )
{
Assert( 0 );
}
}
//the internet part of the laptop isnt working. It gets broken in the heli crash.
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
//Record the initial sector as ours
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE; //SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE; SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE; //SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
if ( gGameUBOptions.InJerry == TRUE ) if ( gGameUBOptions.InGameHeli == TRUE )
return; //AA
if ( gGameUBOptions.InGameHeliCrash == TRUE )
{ {
//Set some variable so Jerry will be on the ground //if it is the first sector we are loading up, place Jerry in the map
pSoldier->fWaitingToGetupFromJA25Start = TRUE; if ( !gfFirstTimeInGameHeliCrash )
pSoldier->fIgnoreGetupFromCollapseCheck = TRUE; return;
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone if ( gGameUBOptions.InJerry == TRUE )
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone {
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
if ( pSoldier == NULL )
{
Assert( 0 );
}
RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[ 6 ] + 800 + Random( 400 ) ); }
//should we be on our back or tummy //the internet part of the laptop isnt working. It gets broken in the heli crash.
if( Random( 100 ) < 50 ) if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE ); StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
else
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
}
//Wont work cause it gets reset every frame //Record the initial sector as ours
//make sure we can see Jerry //SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
if ( gGameUBOptions.InJerry == TRUE ) if ( gGameUBOptions.InJerry == TRUE )
{ {
pJerrySoldier = FindSoldierByProfileID(JERRY_MILO_UB, FALSE );//JERRY //Set some variable so Jerry will be on the ground
if( pJerrySoldier != NULL ) pSoldier->fWaitingToGetupFromJA25Start = TRUE;
{ pSoldier->fIgnoreGetupFromCollapseCheck = TRUE;
//Make sure we can see the pilot
gbPublicOpplist[OUR_TEAM][ pJerrySoldier->ubID ] = SEEN_CURRENTLY;
pJerrySoldier->bVisible = TRUE;
}
} //pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone
//Lock the interface RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[6] + 800 + Random( 400 ) );
guiPendingOverrideEvent = LU_BEGINUILOCK;
//should we be on our back or tummy
if ( Random( 100 ) < 50 )
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE );
else
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
}
//Wont work cause it gets reset every frame
//make sure we can see Jerry
if ( gGameUBOptions.InJerry == TRUE )
{
pJerrySoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE );//JERRY
if ( pJerrySoldier != NULL )
{
//Make sure we can see the pilot
gbPublicOpplist[OUR_TEAM][pJerrySoldier->ubID] = SEEN_CURRENTLY;
pJerrySoldier->bVisible = TRUE;
}
}
//Lock the interface
guiPendingOverrideEvent = LU_BEGINUILOCK;
} }
} }
+48 -49
View File
@@ -1077,7 +1077,7 @@ BOOLEAN ExecuteOverhead( )
pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 ); pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 );
} }
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, pSoldier->ubProfile, 0, 0, pSoldier->iFaceIndex, 0 ); SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH, pSoldier->ubProfile, 0, pSoldier->iFaceIndex, 0 );
} }
} }
else else
@@ -6664,7 +6664,7 @@ void ExitCombatMode( )
// unused // unused
//gfForceMusicToTense = TRUE; //gfForceMusicToTense = TRUE;
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
@@ -6706,63 +6706,62 @@ void ExitCombatMode( )
} }
void SetEnemyPresence( ) void SetEnemyPresence()
{ {
// We have an ememy present.... // We have an ememy present....
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("SetEnemyPresence")); DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "SetEnemyPresence" ) );
// Check if we previously had no enemys present and we are in a virgin secotr ( no enemys spotted yet ) // Check if we previously had no enemys present and we are in a virgin secotr ( no enemys spotted yet )
if ( !gTacticalStatus.fEnemyInSector && gTacticalStatus.fVirginSector ) if ( !gTacticalStatus.fEnemyInSector && gTacticalStatus.fVirginSector )
{ {
// If we have a guy selected, say quote! // If we have a guy selected, say quote!
// For now, display ono status message // For now, display ono status message
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[ ENEMY_IN_SECTOR_STR ] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[ENEMY_IN_SECTOR_STR] );
// Change music modes.. // Change music modes..
// If we are just starting game, don't do this! // If we are just starting game, don't do this!
#ifdef JA2UB #ifdef JA2UB
//Ja25: no meanwhiles //Ja25: no meanwhiles
if ( !DidGameJustStart() ) if ( !DidGameJustStart() )
#else #else
if ( !DidGameJustStart() && !AreInMeanwhile( ) ) if ( !DidGameJustStart() && !AreInMeanwhile() )
#endif #endif
{ {
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[SECTOR( gWorldSectorX, gWorldSectorY )].SoundTacticalTensor[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] != -1 ) if ( MusicSoundValues[SECTOR( gWorldSectorX, gWorldSectorY )].SoundTacticalTensor[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] ); SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[SECTOR( gWorldSectorX, gWorldSectorY )].SoundTacticalTensor[gbWorldSectorZ] );
else else
#endif #endif
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT ); SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("SetEnemyPresence: warnings = false")); DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "SetEnemyPresence: warnings = false" ) );
sniperwarning = FALSE; sniperwarning = FALSE;
biggunwarning = FALSE; biggunwarning = FALSE;
gogglewarning = FALSE; gogglewarning = FALSE;
checkBonusMilitia = TRUE; checkBonusMilitia = TRUE;
// airstrikeavailable = TRUE; // airstrikeavailable = TRUE;
} }
else else
{ {
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("SetEnemyPresence: warnings = true")); DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "SetEnemyPresence: warnings = true" ) );
sniperwarning = TRUE; sniperwarning = TRUE;
biggunwarning = TRUE; biggunwarning = TRUE;
//gogglewarning = TRUE; //gogglewarning = TRUE;
// airstrikeavailable = FALSE; // airstrikeavailable = FALSE;
} }
// Say quote... // Say quote...
//SayQuoteFromAnyBodyInSector( QUOTE_ENEMY_PRESENCE ); //SayQuoteFromAnyBodyInSector( QUOTE_ENEMY_PRESENCE );
gTacticalStatus.fEnemyInSector = TRUE; gTacticalStatus.fEnemyInSector = TRUE;
} }
} }
@@ -7078,7 +7077,7 @@ BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen )
// Begin tense music.... // Begin tense music....
// unused // unused
//gfForceMusicToTense = TRUE; //gfForceMusicToTense = TRUE;
UseCreatureMusic(HostileZombiesPresent()); CheckForZombieMusic();
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
@@ -7287,7 +7286,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
// Check if it's supposed to be dropped // Check if it's supposed to be dropped
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) || pTeamSoldier->bTeam == gbPlayerNum ) if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) || pTeamSoldier->bTeam == gbPlayerNum )
{ {
if ( !(Item[pObj->usItem].defaultundroppable) ) if ( !ItemIsUndroppableByDefault(pObj->usItem) )
{ {
//ReduceAmmoDroppedByNonPlayerSoldiers( pTeamSoldier, cnt ); //ReduceAmmoDroppedByNonPlayerSoldiers( pTeamSoldier, cnt );
@@ -7301,7 +7300,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
//add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items //add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items
usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY; usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY;
if ( Item[pObj->usItem].damageable && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives if (ItemIsDamageable(pObj->usItem) && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives
{ {
// silversurfer: externalized this // silversurfer: externalized this
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 ); //(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 );
@@ -7916,7 +7915,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
if ( CheckFact( FACT_FIRST_BATTLE_BEING_FOUGHT, 0 ) ) if ( CheckFact( FACT_FIRST_BATTLE_BEING_FOUGHT, 0 ) )
{ {
// ATE: Need to trigger record for this event .... for NPC scripting // ATE: Need to trigger record for this event .... for NPC scripting
TriggerNPCRecord( PACOS, 18 ); TriggerNPCRecord( PACOS, 20 );
// this is our first battle... and we won! // this is our first battle... and we won!
SetFactTrue( FACT_FIRST_BATTLE_FOUGHT ); SetFactTrue( FACT_FIRST_BATTLE_FOUGHT );
@@ -9320,7 +9319,7 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
if ( gTacticalStatus.bBoxingState == BOXING ) if ( gTacticalStatus.bBoxingState == BOXING )
{ {
// should have a check for "in boxing ring", no? // should have a check for "in boxing ring", no?
if ( ( pSoldier->usAttackingWeapon != NOTHING && !Item[pSoldier->usAttackingWeapon].brassknuckles ) || !( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) || pSoldier->IsRiotShieldEquipped() ) if ( ( pSoldier->usAttackingWeapon != NOTHING && !ItemIsBrassKnuckles(pSoldier->usAttackingWeapon)) || !( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) || pSoldier->IsRiotShieldEquipped() )
{ {
// someone's cheating! // someone's cheating!
if ( (Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_BLADE || Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_PUNCH) && (pTarget->flags.uiStatusFlags & SOLDIER_BOXER) ) if ( (Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_BLADE || Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_PUNCH) && (pTarget->flags.uiStatusFlags & SOLDIER_BOXER) )
@@ -9921,7 +9920,7 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
pSoldier->bDoAutofire = 1; pSoldier->bDoAutofire = 1;
pSoldier->bDoBurst = TRUE; pSoldier->bDoBurst = TRUE;
} }
if ( Item[pSoldier->inv[ HANDPOS ].usItem].twohanded && Weapon[pSoldier->inv[ HANDPOS ].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 ) if (ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) && Weapon[pSoldier->inv[ HANDPOS ].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD; pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
else else
pSoldier->bScopeMode = USE_BEST_SCOPE; pSoldier->bScopeMode = USE_BEST_SCOPE;

Some files were not shown because too many files have changed in this diff Show More