mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
EnginePerks: fixes
- Remove duplicate Salesman tweak
- Decoupled hacks for multi-perk-level support for Salesman and Demolition Expert from the bonus value change
- Renamed settings for consistency ("<PerkName>Bonus" when it has only one effect)
This commit is contained in:
@@ -65,41 +65,37 @@ MedicDoctorBonus=10
|
|||||||
VaultCityTrainingFirstAidBonus=5
|
VaultCityTrainingFirstAidBonus=5
|
||||||
VaultCityTrainingDoctorBonus=5
|
VaultCityTrainingDoctorBonus=5
|
||||||
|
|
||||||
;Changes the Sneak skill bonus for 'Ghost' perk (ID 38)
|
;Changes the Sneak skill bonus (when in darkness) for 'Ghost' perk (ID 38)
|
||||||
;125 - maximum bonus, 20 - default bonus
|
;125 - maximum bonus, 20 - default bonus
|
||||||
GhostSneakBonus=20
|
GhostBonus=20
|
||||||
|
|
||||||
;Changes the Lockpick, Steal and Traps skill bonus for 'Thief' perk (ID 105)
|
;Changes the Lockpick, Steal and Traps skill bonus for 'Thief' perk (ID 105)
|
||||||
;125 - maximum bonus, 10 - default bonus
|
;125 - maximum bonus, 10 - default bonus
|
||||||
ThiefSkillsBonus=10
|
ThiefBonus=10
|
||||||
|
|
||||||
;Changes the Lockpick and Steal skill bonus for 'Master Thief' perk (ID 3)
|
;Changes the Lockpick and Steal skill bonus for 'Master Thief' perk (ID 3)
|
||||||
;125 - maximum bonus, 15 - default bonus
|
;125 - maximum bonus, 15 - default bonus
|
||||||
MasterThiefSkillsBonus=15
|
MasterThiefBonus=15
|
||||||
|
|
||||||
;Changes the Steal skill bonus for 'Harmless' perk (ID 91)
|
;Changes the Steal skill bonus for 'Harmless' perk (ID 91)
|
||||||
;125 - maximum bonus, 20 - default bonus
|
;125 - maximum bonus, 20 - default bonus
|
||||||
HarmlessStealBonus=20
|
HarmlessBonus=20
|
||||||
|
|
||||||
;Changes the Speech skill bonus for 'Speaker' perk (ID 34)
|
;Changes the Speech skill bonus for 'Speaker' perk (ID 34)
|
||||||
;125 - maximum bonus, 20 - default bonus
|
;125 - maximum bonus, 20 - default bonus
|
||||||
SpeakerSpeechBonus=20
|
SpeakerBonus=20
|
||||||
|
|
||||||
;Changes the Speech skill bonus for 'Expert Excrement Expeditor' perk (ID 116)
|
;Changes the Speech skill bonus for 'Expert Excrement Expeditor' perk (ID 116)
|
||||||
;125 - maximum bonus, 5 - default bonus
|
;125 - maximum bonus, 5 - default bonus
|
||||||
ExpertExcrementExpeditorSpeechBonus=5
|
ExpertExcrementExpeditorBonus=5
|
||||||
|
|
||||||
;Changes the Speech and Barter skill bonus for 'Negotiator' perk (ID 99)
|
;Changes the Speech and Barter skill bonus for 'Negotiator' perk (ID 99)
|
||||||
;125 - maximum bonus, 10 - default bonus
|
;125 - maximum bonus, 10 - default bonus
|
||||||
NegotiatorSkillsBonus=10
|
NegotiatorBonus=10
|
||||||
|
|
||||||
;Changes the Barter skill bonus for 'Salesman' perk (ID 103)
|
|
||||||
;125 - maximum bonus, 20 - default bonus
|
|
||||||
SalesmanBarterBonus=20
|
|
||||||
|
|
||||||
;Changes the Gambling skill bonus for 'Gambler' perk (ID 83)
|
;Changes the Gambling skill bonus for 'Gambler' perk (ID 83)
|
||||||
;125 - maximum bonus, 20 - default bonus
|
;125 - maximum bonus, 20 - default bonus
|
||||||
GamblerGamblingBonus=20
|
GamblerBonus=20
|
||||||
|
|
||||||
;Changes the Outdoorsman skill bonus for 'Ranger' perk (ID 47)
|
;Changes the Outdoorsman skill bonus for 'Ranger' perk (ID 47)
|
||||||
;125 - maximum bonus, 15 - default bonus
|
;125 - maximum bonus, 15 - default bonus
|
||||||
@@ -107,11 +103,11 @@ RangerOutdoorsmanBonus=15
|
|||||||
|
|
||||||
;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
|
||||||
SurvivalistOutdoorsmanBonus=25
|
SurvivalistBonus=25
|
||||||
|
|
||||||
;Changes the Science and Repair skill bonus for 'Mr.Fixit' perk (ID 31)
|
;Changes the Science and Repair skill bonus for 'Mr.Fixit' perk (ID 31)
|
||||||
;125 - maximum bonus, 10 - default bonus
|
;125 - maximum bonus, 10 - default bonus
|
||||||
MrFixitSkillsBonus=10
|
MrFixitBonus=10
|
||||||
|
|
||||||
;##############################################################################
|
;##############################################################################
|
||||||
[Perks]
|
[Perks]
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ namespace sfall
|
|||||||
namespace perk
|
namespace perk
|
||||||
{
|
{
|
||||||
|
|
||||||
static long SalesmanBonus;
|
static long SalesmanBonus = 20;
|
||||||
static long DemolitionExpertBonus;
|
static long DemolitionExpertBonus = 10;
|
||||||
|
|
||||||
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);
|
||||||
@@ -76,8 +76,11 @@ static void __declspec(naked) queue_explode_exit_hack_demolition_expert() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EnginePerkBonusInit() {
|
void EnginePerkBonusInit() {
|
||||||
|
// Allows the current perk level to affect the calculation of its bonus value
|
||||||
|
MakeCall(0x496F5E, perk_adjust_skill_hack_salesman);
|
||||||
|
MakeCall(0x4A289C, queue_explode_exit_hack_demolition_expert, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadPerksBonuses(const char* perksFile) {
|
void ReadPerksBonuses(const char* perksFile) {
|
||||||
int value;
|
int value;
|
||||||
TryPatchValue32("WeaponScopeRangePenalty", 8, 0, 100, 0x42448E, perksFile);
|
TryPatchValue32("WeaponScopeRangePenalty", 8, 0, 100, 0x42448E, perksFile);
|
||||||
@@ -93,18 +96,15 @@ 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("SalesmanBonus", 20, value, perksFile) && value >= 0) {
|
if (TryGetModifiedInt("SalesmanBonus", SalesmanBonus, value, perksFile) && value >= 0) {
|
||||||
SalesmanBonus = min(value, 999);
|
SalesmanBonus = min(value, 999);
|
||||||
// Allows the current perk level to affect the calculation of its bonus value
|
|
||||||
MakeCall(0x496F5E, perk_adjust_skill_hack_salesman);
|
|
||||||
}
|
}
|
||||||
TryPatchSkillBonus8("LivingAnatomyBonus", 5, 0x424A91, perksFile);
|
TryPatchSkillBonus8("LivingAnatomyBonus", 5, 0x424A91, perksFile);
|
||||||
TryPatchSkillBonus8("LivingAnatomyDoctorBonus", 10, 0x496E66, perksFile);
|
TryPatchSkillBonus8("LivingAnatomyDoctorBonus", 10, 0x496E66, perksFile);
|
||||||
TryPatchSkillBonus8("PyromaniacBonus", 5, 0x424AB6, perksFile);
|
TryPatchSkillBonus8("PyromaniacBonus", 5, 0x424AB6, perksFile);
|
||||||
TryPatchValue8("StonewallPercent", 50, 0, 100, 0x424B50, perksFile);
|
TryPatchValue8("StonewallPercent", 50, 0, 100, 0x424B50, perksFile);
|
||||||
if (TryGetModifiedInt("DemolitionExpertBonus", 10, value, perksFile) && value >= 0) {
|
if (TryGetModifiedInt("DemolitionExpertBonus", DemolitionExpertBonus, value, perksFile) && value >= 0) {
|
||||||
DemolitionExpertBonus = min(value, 999);
|
DemolitionExpertBonus = min(value, 999);
|
||||||
MakeCall(0x4A289C, queue_explode_exit_hack_demolition_expert, 1);
|
|
||||||
}
|
}
|
||||||
if (TryGetModifiedInt("VaultCityInoculationsPoisonBonus", 10, value, perksFile)) {
|
if (TryGetModifiedInt("VaultCityInoculationsPoisonBonus", 10, value, perksFile)) {
|
||||||
SafeWrite8(0x4AF26A, static_cast<signed char>(clamp<long>(value, -100, 100)));
|
SafeWrite8(0x4AF26A, static_cast<signed char>(clamp<long>(value, -100, 100)));
|
||||||
@@ -117,18 +117,17 @@ void ReadPerksBonuses(const char* perksFile) {
|
|||||||
TryPatchSkillBonus32("MedicFirstAidBonus", 10, 0x496E19, perksFile);
|
TryPatchSkillBonus32("MedicFirstAidBonus", 10, 0x496E19, perksFile);
|
||||||
TryPatchSkillBonus32("MedicDoctorBonus", 10, 0x496E4E, perksFile);
|
TryPatchSkillBonus32("MedicDoctorBonus", 10, 0x496E4E, perksFile);
|
||||||
|
|
||||||
TryPatchSkillBonus32("GhostSneakBonus", 20, 0x496EA9, perksFile);
|
TryPatchSkillBonus32("GhostBonus", 20, 0x496EA9, perksFile);
|
||||||
TryPatchSkillBonus8("ThiefSkillsBonus", 10, 0x496EC1, perksFile);
|
TryPatchSkillBonus8("ThiefBonus", 10, 0x496EC1, perksFile);
|
||||||
TryPatchSkillBonus8("MasterThiefSkillsBonus", 15, 0x496EE0, perksFile);
|
TryPatchSkillBonus8("MasterThiefBonus", 15, 0x496EE0, perksFile);
|
||||||
TryPatchSkillBonus8("HarmlessStealBonus", 20, 0x496F02, perksFile);
|
TryPatchSkillBonus8("HarmlessBonus", 20, 0x496F02, perksFile);
|
||||||
TryPatchSkillBonus32("SpeakerSpeechBonus", 20, 0x496F1B, perksFile);
|
TryPatchSkillBonus32("SpeakerBonus", 20, 0x496F1B, perksFile);
|
||||||
TryPatchSkillBonus8("ExpertExcrementExpeditorSpeechBonus", 5, 0x496F33, perksFile);
|
TryPatchSkillBonus8("ExpertExcrementExpeditorBonus", 5, 0x496F33, perksFile);
|
||||||
TryPatchSkillBonus8("NegotiatorSkillsBonus", 10, 0x496F48, perksFile);
|
TryPatchSkillBonus8("NegotiatorBonus", 10, 0x496F48, perksFile);
|
||||||
TryPatchSkillBonus8("SalesmanBarterBonus", 20, 0x496F60, perksFile);
|
TryPatchSkillBonus32("GamblerBonus", 20, 0x496F79, perksFile);
|
||||||
TryPatchSkillBonus32("GamblerGamblingBonus", 20, 0x496F79, perksFile);
|
|
||||||
TryPatchSkillBonus32("RangerOutdoorsmanBonus", 15, 0x496F95, perksFile);
|
TryPatchSkillBonus32("RangerOutdoorsmanBonus", 15, 0x496F95, perksFile);
|
||||||
TryPatchSkillBonus8("SurvivalistOutdoorsmanBonus", 25, 0x496FAB, perksFile);
|
TryPatchSkillBonus8("SurvivalistBonus", 25, 0x496FAB, perksFile);
|
||||||
TryPatchSkillBonus8("MrFixitSkillsBonus", 10, 0x496E00, perksFile);
|
TryPatchSkillBonus8("MrFixitBonus", 10, 0x496E00, perksFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user