mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
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:
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
|
||||
PartyACMsg=AC:
|
||||
PartyAddictMsg=Addict
|
||||
NPCPickupFail=%s cannot pick up the item.
|
||||
AmmoInfoGlovz=Div: DR/%d, DT/%d
|
||||
AmmoInfoYAAM=DT Mod: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Race
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=Nvl:
|
||||
PartyACMsg=CA:
|
||||
PartyAddictMsg=Viciado
|
||||
NPCPickupFail=%s não pôde pegar o item.
|
||||
AmmoInfoGlovz=Div: DR/%d, DT/%d
|
||||
AmmoInfoYAAM=DT Mod: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Raça
|
||||
|
||||
@@ -4,13 +4,15 @@ KarmaGain=
|
||||
KarmaLoss=你失去了%d点道德。
|
||||
HighlightFail1=你没有携带动态感应器。
|
||||
HighlightFail2=你的动态感应器没电了。
|
||||
SuperStimExploitMsg=你不能对没受伤的角色使用这个物品!
|
||||
SuperStimExploitMsg=你不能对未受伤的角色使用这个物品!
|
||||
BlockedCombat=你现在不能进入战斗。
|
||||
SaveSfallDataFail=储存存档延展信息时发生错误!检查是否有其他程序占用存档文件/文件夾之后再试一次。
|
||||
PartyLvlMsg=等级:
|
||||
PartyACMsg=AC:
|
||||
PartyAddictMsg=上瘾
|
||||
NPCPickupFail=%s无法将东西捡起来。
|
||||
AmmoInfoGlovz=Div: DR/%d, DT/%d
|
||||
AmmoInfoYAAM=DT Mod: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=种族
|
||||
|
||||
@@ -4,13 +4,15 @@ KarmaGain=
|
||||
KarmaLoss=你失去了%d點道德。
|
||||
HighlightFail1=你沒有攜帶動態感應器。
|
||||
HighlightFail2=你的動態感應器沒電了。
|
||||
SuperStimExploitMsg=你不能對沒受傷的角色使用這個物品!
|
||||
SuperStimExploitMsg=你不能對未受傷的角色使用這個物品!
|
||||
BlockedCombat=你現在不能進入戰鬥。
|
||||
SaveSfallDataFail=儲存存檔延伸資訊時發生錯誤!檢查是否有其他程式占用存檔檔案/資料夾之後再試一次。
|
||||
PartyLvlMsg=等級:
|
||||
PartyACMsg=AC:
|
||||
PartyAddictMsg=上癮
|
||||
NPCPickupFail=%s無法將東西撿起來。
|
||||
AmmoInfoGlovz=Div: DR/%d, DT/%d
|
||||
AmmoInfoYAAM=DT Mod: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=種族
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=Niveau:
|
||||
PartyACMsg=CA:
|
||||
PartyAddictMsg=Accroc
|
||||
NPCPickupFail=%s ne peux pas prendre cet objet.
|
||||
AmmoInfoGlovz=Div. : RD/%d, SD/%d
|
||||
AmmoInfoYAAM=Mod. SD : %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Race
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
|
||||
PartyACMsg=RÜ:
|
||||
PartyAddictMsg=Abhäng
|
||||
NPCPickupFail=%s kann das Objekt nicht nehmen.
|
||||
AmmoInfoGlovz=Div: RV/%d, SV/%d
|
||||
AmmoInfoYAAM=SV-Mod: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Geschlecht
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
|
||||
PartyACMsg=AC:
|
||||
PartyAddictMsg=Uzależniony
|
||||
NPCPickupFail=%s nie może podnieść przedmiotu.
|
||||
AmmoInfoGlovz=Dz.: OO/%d, PO/%d
|
||||
AmmoInfoYAAM=Mod. PO: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Rasa
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=
|
||||
PartyACMsg=КБ:
|
||||
PartyAddictMsg=Зависимость
|
||||
NPCPickupFail=%s не может подобрать предмет.
|
||||
AmmoInfoGlovz=Дел.: СУ/%d, ПУ/%d
|
||||
AmmoInfoYAAM=Изм. ПУ: %d
|
||||
|
||||
[AppearanceMod]
|
||||
RaceText=Раса
|
||||
|
||||
@@ -82,7 +82,6 @@ static const char* ExtraLines[] = {
|
||||
};
|
||||
|
||||
static DWORD ExtraLineCount = sizeof(ExtraLines) / 4;
|
||||
//static const char* creditsFile = "credits.txt";
|
||||
|
||||
static DWORD __fastcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
|
||||
if (!InCredits || CreditsLine >= ExtraLineCount) return 0;
|
||||
@@ -172,7 +171,6 @@ static void __declspec(naked) ShowCreditsHook() {
|
||||
pop eax;
|
||||
mov InCredits, 1;
|
||||
mov CreditsLine, 0;
|
||||
//mov eax, creditsFile;
|
||||
call fo::funcoffs::credits_;
|
||||
mov InCredits, 0;
|
||||
retn;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "..\FalloutEngine\Fallout2.h"
|
||||
#include "..\Logging.h"
|
||||
#include "..\Translate.h"
|
||||
#include "Unarmed.h"
|
||||
|
||||
#include "..\Game\stats.h"
|
||||
@@ -31,6 +32,8 @@ namespace sfall
|
||||
|
||||
static int formula;
|
||||
|
||||
static char ammoInfoFmt[32];
|
||||
|
||||
static const DWORD DamageFunctionReturn = 0x424A63;
|
||||
|
||||
// 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
|
||||
static __declspec(naked) void DamageYAAM() {
|
||||
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
|
||||
@@ -485,9 +502,13 @@ void DamageMod::init() {
|
||||
case 1:
|
||||
case 2:
|
||||
MakeJump(0x424995, DamageGlovz);
|
||||
MakeCall(0x49B54A, AmmoInfoPrintGlovz, 2); // Dmg Mod (obj_examine_func_)
|
||||
Translate::Get("sfall", "AmmoInfoGlovz", "Div: DR/%d, DT/%d", ammoInfoFmt, 32);
|
||||
break;
|
||||
case 5:
|
||||
MakeJump(0x424995, DamageYAAM);
|
||||
MakeCall(0x49B4EB, AmmoInfoPrintYAAM, 2); // DR Mod (obj_examine_func_)
|
||||
Translate::Get("sfall", "AmmoInfoYAAM", "DT Mod: %d", ammoInfoFmt, 32);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+55
-51
@@ -1213,6 +1213,57 @@ void __stdcall Graphics::ForceGraphicsRefresh(DWORD d) {
|
||||
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 /////////////////////////////////
|
||||
|
||||
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() {
|
||||
Graphics::mode = (hrpIsEnabled) // avoid mode mismatch between ddraw.ini and another ini file
|
||||
? 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);
|
||||
if (multi != 100) {
|
||||
dlogr("Applying fade patch.", DL_INIT);
|
||||
|
||||
Reference in New Issue
Block a user