mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added setting about Night Vision perk to perks.ini
Updated version number.
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
; be used to remove their hardcoded effects, and add new stat/skill effects
|
; be used to remove their hardcoded effects, and add new stat/skill effects
|
||||||
|
|
||||||
[PerksTweak]
|
[PerksTweak]
|
||||||
|
;Changes the light level bonus for 'Night Vision' perk (ID 9)
|
||||||
|
;valid range: 0..100, 20 - default bonus
|
||||||
|
NightVisionBonus=20
|
||||||
|
|
||||||
;Changes the Outdoorsman skill bonus for 'Survivalist' perk (ID 16)
|
;Changes the Outdoorsman skill bonus for 'Survivalist' perk (ID 16)
|
||||||
;125 - maximum bonus, 25 - default bonus
|
;125 - maximum bonus, 25 - default bonus
|
||||||
SurvivalistBonus=25
|
SurvivalistBonus=25
|
||||||
@@ -77,8 +81,9 @@ GamblerBonus=20
|
|||||||
HarmlessBonus=20
|
HarmlessBonus=20
|
||||||
|
|
||||||
;Changes the damage bonus and the Doctor skill bonus for 'Living Anatomy' perk (ID 97)
|
;Changes the damage bonus and the Doctor skill bonus for 'Living Anatomy' perk (ID 97)
|
||||||
;125 - maximum bonus, 5 - default bonus, 10 - default skill bonus
|
;125 - maximum bonus, 5 - default damage bonus
|
||||||
LivingAnatomyBonus=5
|
LivingAnatomyBonus=5
|
||||||
|
;125 - maximum bonus, 10 - default skill bonus
|
||||||
LivingAnatomyDoctorBonus=10
|
LivingAnatomyDoctorBonus=10
|
||||||
|
|
||||||
;Changes the Speech and Barter skill bonus for 'Negotiator' perk (ID 99)
|
;Changes the Speech and Barter skill bonus for 'Negotiator' perk (ID 99)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace perk
|
|||||||
|
|
||||||
static long SalesmanBonus = 20;
|
static long SalesmanBonus = 20;
|
||||||
static long DemolitionExpertBonus = 10;
|
static long DemolitionExpertBonus = 10;
|
||||||
|
static long NightVisionBonus = 13107; // 20% of max light
|
||||||
|
|
||||||
static bool TryGetModifiedInt(const char* key, int defaultValue, int& outValue, const char* perksFile) {
|
static bool TryGetModifiedInt(const char* key, int defaultValue, int& outValue, const char* perksFile) {
|
||||||
outValue = IniReader::GetInt("PerksTweak", key, defaultValue, perksFile);
|
outValue = IniReader::GetInt("PerksTweak", key, defaultValue, perksFile);
|
||||||
@@ -75,10 +76,21 @@ static __declspec(naked) void queue_explode_exit_hack_demolition_expert() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __declspec(naked) void light_set_ambient_hack_night_vision() {
|
||||||
|
__asm {
|
||||||
|
imul eax, [NightVisionBonus];
|
||||||
|
pop edx;
|
||||||
|
add edx, 16; // skip code (to 0x47A932)
|
||||||
|
jmp edx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EnginePerkBonusInit() {
|
void EnginePerkBonusInit() {
|
||||||
// Allows the current perk level to affect the calculation of its bonus value
|
// Allows the current perk level to affect the calculation of its bonus value
|
||||||
MakeCall(0x496F5E, perk_adjust_skill_hack_salesman);
|
MakeCall(0x496F5E, perk_adjust_skill_hack_salesman);
|
||||||
MakeCall(0x4A289C, queue_explode_exit_hack_demolition_expert, 1);
|
MakeCall(0x4A289C, queue_explode_exit_hack_demolition_expert, 1);
|
||||||
|
// Allows customizable light level bonus
|
||||||
|
MakeCall(0x47A91D, light_set_ambient_hack_night_vision);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadPerksBonuses(const char* perksFile) {
|
void ReadPerksBonuses(const char* perksFile) {
|
||||||
@@ -96,6 +108,10 @@ void ReadPerksBonuses(const char* perksFile) {
|
|||||||
float floatValue = static_cast<float>(value);
|
float floatValue = static_cast<float>(value);
|
||||||
SafeWrite32(0x474BB3, *(DWORD*)&floatValue); // write float data
|
SafeWrite32(0x474BB3, *(DWORD*)&floatValue); // write float data
|
||||||
}
|
}
|
||||||
|
if (TryGetModifiedInt("NightVisionBonus", 20, value, perksFile) && value >= 0) {
|
||||||
|
if (value > 100) value = 100;
|
||||||
|
NightVisionBonus = (65536 * value) / 100;
|
||||||
|
}
|
||||||
if (TryGetModifiedInt("SalesmanBonus", SalesmanBonus, value, perksFile) && value >= 0) {
|
if (TryGetModifiedInt("SalesmanBonus", SalesmanBonus, value, perksFile) && value >= 0) {
|
||||||
SalesmanBonus = min(value, 999);
|
SalesmanBonus = min(value, 999);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -25,6 +25,6 @@
|
|||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 4
|
#define VERSION_MINOR 4
|
||||||
#define VERSION_BUILD 5
|
#define VERSION_BUILD 5
|
||||||
#define VERSION_REV 1
|
#define VERSION_REV 2
|
||||||
|
|
||||||
#define VERSION_STRING "4.4.5.1"
|
#define VERSION_STRING "4.4.5.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user