Added a tweak to the ammo info for Glovz's/YAAM

* to display correct ammo stats based on the formulas w/o editing
proto.msg manually.

Updated translation ini files.

Set the maximum number of screenshots to 10k (was 100k)

* 100k is impractical because the max files per directory on FAT32 is
65535 (only if all files are in 8.3 format) when the game came out.
This commit is contained in:
NovaRain
2023-03-01 09:18:28 +08:00
parent e090fd833b
commit 5e3e37f74c
11 changed files with 94 additions and 55 deletions
+2
View File
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
PartyACMsg=AC: PartyACMsg=AC:
PartyAddictMsg=Addict PartyAddictMsg=Addict
NPCPickupFail=%s cannot pick up the item. NPCPickupFail=%s cannot pick up the item.
AmmoInfoGlovz=Div: DR/%d, DT/%d
AmmoInfoYAAM=DT Mod: %d
[AppearanceMod] [AppearanceMod]
RaceText=Race RaceText=Race
@@ -11,6 +11,8 @@ PartyLvlMsg=Nvl:
PartyACMsg=CA: PartyACMsg=CA:
PartyAddictMsg=Viciado PartyAddictMsg=Viciado
NPCPickupFail=%s não pôde pegar o item. NPCPickupFail=%s não pôde pegar o item.
AmmoInfoGlovz=Div: DR/%d, DT/%d
AmmoInfoYAAM=DT Mod: %d
[AppearanceMod] [AppearanceMod]
RaceText=Raça RaceText=Raça
+3 -1
View File
@@ -4,13 +4,15 @@ KarmaGain=
KarmaLoss=你失去了%d点道德。 KarmaLoss=你失去了%d点道德。
HighlightFail1=你没有携带动态感应器。 HighlightFail1=你没有携带动态感应器。
HighlightFail2=你的动态感应器没电了。 HighlightFail2=你的动态感应器没电了。
SuperStimExploitMsg=你不能对受伤的角色使用这个物品! SuperStimExploitMsg=你不能对受伤的角色使用这个物品!
BlockedCombat=你现在不能进入战斗。 BlockedCombat=你现在不能进入战斗。
SaveSfallDataFail=储存存档延展信息时发生错误!检查是否有其他程序占用存档文件/文件夾之后再试一次。 SaveSfallDataFail=储存存档延展信息时发生错误!检查是否有其他程序占用存档文件/文件夾之后再试一次。
PartyLvlMsg=等级: PartyLvlMsg=等级:
PartyACMsg=AC: PartyACMsg=AC:
PartyAddictMsg=上瘾 PartyAddictMsg=上瘾
NPCPickupFail=%s无法将东西捡起来。 NPCPickupFail=%s无法将东西捡起来。
AmmoInfoGlovz=Div: DR/%d, DT/%d
AmmoInfoYAAM=DT Mod: %d
[AppearanceMod] [AppearanceMod]
RaceText=种族 RaceText=种族
+3 -1
View File
@@ -4,13 +4,15 @@ KarmaGain=
KarmaLoss=你失去了%d點道德。 KarmaLoss=你失去了%d點道德。
HighlightFail1=你沒有攜帶動態感應器。 HighlightFail1=你沒有攜帶動態感應器。
HighlightFail2=你的動態感應器沒電了。 HighlightFail2=你的動態感應器沒電了。
SuperStimExploitMsg=你不能對受傷的角色使用這個物品! SuperStimExploitMsg=你不能對受傷的角色使用這個物品!
BlockedCombat=你現在不能進入戰鬥。 BlockedCombat=你現在不能進入戰鬥。
SaveSfallDataFail=儲存存檔延伸資訊時發生錯誤!檢查是否有其他程式占用存檔檔案/資料夾之後再試一次。 SaveSfallDataFail=儲存存檔延伸資訊時發生錯誤!檢查是否有其他程式占用存檔檔案/資料夾之後再試一次。
PartyLvlMsg=等級: PartyLvlMsg=等級:
PartyACMsg=AC: PartyACMsg=AC:
PartyAddictMsg=上癮 PartyAddictMsg=上癮
NPCPickupFail=%s無法將東西撿起來。 NPCPickupFail=%s無法將東西撿起來。
AmmoInfoGlovz=Div: DR/%d, DT/%d
AmmoInfoYAAM=DT Mod: %d
[AppearanceMod] [AppearanceMod]
RaceText=種族 RaceText=種族
+2
View File
@@ -11,6 +11,8 @@ PartyLvlMsg=Niveau:
PartyACMsg=CA: PartyACMsg=CA:
PartyAddictMsg=Accroc PartyAddictMsg=Accroc
NPCPickupFail=%s ne peux pas prendre cet objet. NPCPickupFail=%s ne peux pas prendre cet objet.
AmmoInfoGlovz=Div. : RD/%d, SD/%d
AmmoInfoYAAM=Mod. SD : %d
[AppearanceMod] [AppearanceMod]
RaceText=Race RaceText=Race
+2
View File
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
PartyACMsg=RÜ: PartyACMsg=RÜ:
PartyAddictMsg=Abhäng PartyAddictMsg=Abhäng
NPCPickupFail=%s kann das Objekt nicht nehmen. NPCPickupFail=%s kann das Objekt nicht nehmen.
AmmoInfoGlovz=Div: RV/%d, SV/%d
AmmoInfoYAAM=SV-Mod: %d
[AppearanceMod] [AppearanceMod]
RaceText=Geschlecht RaceText=Geschlecht
+2
View File
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
PartyACMsg=AC: PartyACMsg=AC:
PartyAddictMsg=Uzależniony PartyAddictMsg=Uzależniony
NPCPickupFail=%s nie może podnieść przedmiotu. NPCPickupFail=%s nie może podnieść przedmiotu.
AmmoInfoGlovz=Dz.: OO/%d, PO/%d
AmmoInfoYAAM=Mod. PO: %d
[AppearanceMod] [AppearanceMod]
RaceText=Rasa RaceText=Rasa
+2
View File
@@ -11,6 +11,8 @@ PartyLvlMsg=
PartyACMsg=КБ: PartyACMsg=КБ:
PartyAddictMsg=Зависимость PartyAddictMsg=Зависимость
NPCPickupFail=%s не может подобрать предмет. NPCPickupFail=%s не может подобрать предмет.
AmmoInfoGlovz=Дел.: СУ/%d, ПУ/%d
AmmoInfoYAAM=Изм. ПУ: %d
[AppearanceMod] [AppearanceMod]
RaceText=Раса RaceText=Раса
-2
View File
@@ -82,7 +82,6 @@ static const char* ExtraLines[] = {
}; };
static DWORD ExtraLineCount = sizeof(ExtraLines) / 4; static DWORD ExtraLineCount = sizeof(ExtraLines) / 4;
//static const char* creditsFile = "credits.txt";
static DWORD __fastcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) { static DWORD __fastcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
if (!InCredits || CreditsLine >= ExtraLineCount) return 0; if (!InCredits || CreditsLine >= ExtraLineCount) return 0;
@@ -172,7 +171,6 @@ static void __declspec(naked) ShowCreditsHook() {
pop eax; pop eax;
mov InCredits, 1; mov InCredits, 1;
mov CreditsLine, 0; mov CreditsLine, 0;
//mov eax, creditsFile;
call fo::funcoffs::credits_; call fo::funcoffs::credits_;
mov InCredits, 0; mov InCredits, 0;
retn; retn;
+21
View File
@@ -20,6 +20,7 @@
#include "..\FalloutEngine\Fallout2.h" #include "..\FalloutEngine\Fallout2.h"
#include "..\Logging.h" #include "..\Logging.h"
#include "..\Translate.h"
#include "Unarmed.h" #include "Unarmed.h"
#include "..\Game\stats.h" #include "..\Game\stats.h"
@@ -31,6 +32,8 @@ namespace sfall
static int formula; static int formula;
static char ammoInfoFmt[32];
static const DWORD DamageFunctionReturn = 0x424A63; static const DWORD DamageFunctionReturn = 0x424A63;
// Damage Fix v5 (with v5.1 Damage Multiplier tweak) by Glovz 2014.04.16.xx.xx // Damage Fix v5 (with v5.1 Damage Multiplier tweak) by Glovz 2014.04.16.xx.xx
@@ -239,6 +242,13 @@ end:
} }
} }
static __declspec(naked) void AmmoInfoPrintGlovz() {
__asm {
lea edi, ammoInfoFmt;
retn;
}
}
// YAAM v1.1a by Haenlomal 2010.05.13 // YAAM v1.1a by Haenlomal 2010.05.13
static __declspec(naked) void DamageYAAM() { static __declspec(naked) void DamageYAAM() {
static long calcDT, calcDR; static long calcDT, calcDR;
@@ -327,6 +337,13 @@ end:
} }
} }
static __declspec(naked) void AmmoInfoPrintYAAM() {
__asm {
lea ecx, ammoInfoFmt;
retn;
}
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Display melee damage w/o PERK_bonus_hth_damage bonus // Display melee damage w/o PERK_bonus_hth_damage bonus
@@ -485,9 +502,13 @@ void DamageMod::init() {
case 1: case 1:
case 2: case 2:
MakeJump(0x424995, DamageGlovz); MakeJump(0x424995, DamageGlovz);
MakeCall(0x49B54A, AmmoInfoPrintGlovz, 2); // Dmg Mod (obj_examine_func_)
Translate::Get("sfall", "AmmoInfoGlovz", "Div: DR/%d, DT/%d", ammoInfoFmt, 32);
break; break;
case 5: case 5:
MakeJump(0x424995, DamageYAAM); MakeJump(0x424995, DamageYAAM);
MakeCall(0x49B4EB, AmmoInfoPrintYAAM, 2); // DR Mod (obj_examine_func_)
Translate::Get("sfall", "AmmoInfoYAAM", "DT Mod: %d", ammoInfoFmt, 32);
break; break;
} }
} }
+55 -51
View File
@@ -1213,6 +1213,57 @@ void __stdcall Graphics::ForceGraphicsRefresh(DWORD d) {
forcingGraphicsRefresh = (d == 0) ? 0 : 1; forcingGraphicsRefresh = (d == 0) ? 0 : 1;
} }
long __stdcall SaveScreen(const char* file) {
IDirect3DSurface9* surface;
d3d9Device->CreateOffscreenPlainSurface(gWidth, gHeight, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, 0);
d3d9Device->GetRenderTargetData(backBuffer, surface);
LPD3DXBUFFER buffer;
D3DXCreateBuffer(gWidth * gHeight * 2, &buffer);
D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_PNG, surface, 0, 0);
//D3DXSaveSurfaceToFileA(file, D3DXIFF_PNG, surface, 0, 0); // slow save
HANDLE hFile = CreateFileA(file, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
bool resultOK = (hFile != INVALID_HANDLE_VALUE);
if (resultOK) {
DWORD dwWritten;
WriteFile(hFile, buffer->GetBufferPointer(), buffer->GetBufferSize(), &dwWritten, 0);
CloseHandle(hFile);
}
surface->Release();
buffer->Release();
return (resultOK) ? 0 : 1;
}
long __stdcall game_screendump_hook() {
char fileName[16];
for (int i = 0; i < 10000; i++) {
std::sprintf(fileName, "scr%.5d.png", i); // scr#####.png
HANDLE hFile = CreateFileA(fileName, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if (hFile == INVALID_HANDLE_VALUE) {
return SaveScreen(fileName);
}
CloseHandle(hFile);
}
return 1;
}
static __declspec(naked) void dump_screen_hack_replacement() {
__asm {
push ecx;
push edx;
call fo::funcoffs::game_screendump_; // call ds:[FO_VAR_screendump_func];
pop edx;
pop ecx;
retn;
}
}
//////////////////////////////// WINDOW RENDER ///////////////////////////////// //////////////////////////////// WINDOW RENDER /////////////////////////////////
class OverlaySurface { class OverlaySurface {
@@ -1343,57 +1394,6 @@ static __declspec(naked) void palette_fade_to_hook() {
} }
} }
long __stdcall SaveScreen(const char* file) {
IDirect3DSurface9* surface;
d3d9Device->CreateOffscreenPlainSurface(gWidth, gHeight, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, 0);
d3d9Device->GetRenderTargetData(backBuffer, surface);
LPD3DXBUFFER buffer;
D3DXCreateBuffer(gWidth * gHeight * 2, &buffer);
D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_PNG, surface, 0, 0);
//D3DXSaveSurfaceToFileA(file, D3DXIFF_PNG, surface, 0, 0); // slow save
HANDLE hFile = CreateFileA(file, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
bool resultOK = (hFile != INVALID_HANDLE_VALUE);
if (resultOK) {
DWORD dwWritten;
WriteFile(hFile, buffer->GetBufferPointer(), buffer->GetBufferSize(), &dwWritten, 0);
CloseHandle(hFile);
}
surface->Release();
buffer->Release();
return (resultOK) ? 0 : 1;
}
long __stdcall game_screendump_hook() {
char fileName[16];
for (int i = 0; i < 10000; i++) {
std::sprintf(fileName, "scr%.5d.png", i); // scr#####.png
HANDLE hFile = CreateFileA(fileName, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if (hFile == INVALID_HANDLE_VALUE) {
return SaveScreen(fileName);
}
CloseHandle(hFile);
}
return 1;
}
static __declspec(naked) void dump_screen_hack_replacement() {
__asm {
push ecx;
push edx;
call fo::funcoffs::game_screendump_; // call ds:[FO_VAR_screendump_func];
pop edx;
pop ecx;
retn;
}
}
void Graphics::init() { void Graphics::init() {
Graphics::mode = (hrpIsEnabled) // avoid mode mismatch between ddraw.ini and another ini file Graphics::mode = (hrpIsEnabled) // avoid mode mismatch between ddraw.ini and another ini file
? IniReader::GetIntDefaultConfig("Graphics", "Mode", 0) ? IniReader::GetIntDefaultConfig("Graphics", "Mode", 0)
@@ -1464,6 +1464,10 @@ void Graphics::init() {
} }
} }
// Set the maximum number of BMP screenshots to 10k (was 100k)
const DWORD screendumpMaxAddr[] = {0x4C908B, 0x4C9093}; // default_screendump_
SafeWriteBatch<DWORD>(10000, screendumpMaxAddr);
int multi = IniReader::GetConfigInt("Graphics", "FadeMultiplier", 100); int multi = IniReader::GetConfigInt("Graphics", "FadeMultiplier", 100);
if (multi != 100) { if (multi != 100) {
dlogr("Applying fade patch.", DL_INIT); dlogr("Applying fade patch.", DL_INIT);