mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added the ability to set custom names for unarmed attacks
Updated Translations.ini template. Commented out empty exit() in some modules.
This commit is contained in:
@@ -4,7 +4,7 @@ KarmaGain=You gained %d karma.
|
||||
KarmaLoss=You lost %d karma.
|
||||
HighlightFail1=You aren't carrying a motion sensor.
|
||||
HighlightFail2=Your motion sensor is out of charge.
|
||||
SuperStimExploitMsg=You cannot use a super stim on someone who is not injured!
|
||||
SuperStimExploitMsg=You cannot use this item on someone who is not injured!
|
||||
BlockedCombat=You cannot enter combat at this time.
|
||||
SaveSfallDataFail=ERROR saving extended savegame information! Check if other programs interfere with savegame files/folders and try again.
|
||||
PartyLvlMsg=Lvl:
|
||||
@@ -20,3 +20,20 @@ PartyOrderAttackRobot=::Beep::
|
||||
RaceText=Race
|
||||
StyleText=Style
|
||||
DoneBtn=Done
|
||||
|
||||
;Custom names for player's unarmed attacks (max 16 characters)
|
||||
[Unarmed]
|
||||
;Punch=Punch:
|
||||
;Kick=Kick:
|
||||
;StrongPunch=Strong Punch:
|
||||
;HammerPunch=Hammer Punch:
|
||||
;Haymaker=Haymaker:
|
||||
;Jab=Jab:
|
||||
;PalmStrike=Palm Strike:
|
||||
;PiercingStrike=Piercing Strike:
|
||||
;StrongKick=Strong Kick:
|
||||
;SnapKick=Snap Kick:
|
||||
;PowerKick=Power Kick:
|
||||
;HipKick=Hip Kick:
|
||||
;HookKick=Hook Kick:
|
||||
;PiercingKick=Piercing kick:
|
||||
|
||||
@@ -597,7 +597,7 @@ void Animations::init() {
|
||||
MakeCall(0x419A17, art_alias_fid_hack);
|
||||
}
|
||||
|
||||
void Animations::exit() {
|
||||
}
|
||||
//void Animations::exit() {
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class Animations : public Module {
|
||||
public:
|
||||
const char* name() { return "Animations"; }
|
||||
void init();
|
||||
void exit() override;
|
||||
//void exit() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -384,7 +384,8 @@ static void __declspec(naked) DisplayBonusHtHDmg1_hook() {
|
||||
jmp fo::funcoffs::sprintf_;
|
||||
}
|
||||
}
|
||||
static bool bonusHtHDamageFix = false;
|
||||
|
||||
static bool bonusHtHDamageFix = true;
|
||||
static bool displayBonusDamage = false;
|
||||
|
||||
static long __fastcall GetHtHDamage(fo::GameObject* source, long &meleeDmg, long handOffset) {
|
||||
@@ -396,13 +397,19 @@ static long __fastcall GetHtHDamage(fo::GameObject* source, long &meleeDmg, long
|
||||
|
||||
long perkBonus = game::Stats::perk_level(source, fo::Perk::PERK_bonus_hth_damage) << 1;
|
||||
if (!displayBonusDamage) meleeDmg -= perkBonus;
|
||||
if (bonusHtHDamageFix && displayBonusDamage) min += perkBonus;
|
||||
if (displayBonusDamage && bonusHtHDamageFix) min += perkBonus;
|
||||
|
||||
return min + bonus;
|
||||
}
|
||||
|
||||
static const char* __fastcall GetHtHName(long handOffset) {
|
||||
fo::AttackType hit = Unarmed::GetStoredHitMode((handOffset == 0) ? fo::HandSlot::Left : fo::HandSlot::Right);
|
||||
return Unarmed::GetName(hit);
|
||||
}
|
||||
|
||||
static void __declspec(naked) DisplayBonusHtHDmg2_hack() {
|
||||
static const DWORD DisplayBonusHtHDmg2Exit = 0x47254F;
|
||||
static const DWORD DisplayBonusHtHDmg2Exit2 = 0x472556;
|
||||
__asm {
|
||||
mov ecx, eax;
|
||||
call fo::funcoffs::stat_level_; // get STAT_melee_dmg
|
||||
@@ -411,7 +418,13 @@ static void __declspec(naked) DisplayBonusHtHDmg2_hack() {
|
||||
push edi; // handOffset
|
||||
call GetHtHDamage;
|
||||
push eax; // min dmg
|
||||
mov ecx, edi;
|
||||
call GetHtHName;
|
||||
test eax, eax;
|
||||
jnz customName;
|
||||
jmp DisplayBonusHtHDmg2Exit;
|
||||
customName:
|
||||
jmp DisplayBonusHtHDmg2Exit2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void EngineTweaks::init() {
|
||||
}
|
||||
}
|
||||
|
||||
void EngineTweaks::exit() {
|
||||
}
|
||||
//void EngineTweaks::exit() {
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class EngineTweaks : public Module {
|
||||
public:
|
||||
const char* name() { return "EngineTweaks"; }
|
||||
void init();
|
||||
void exit() override;
|
||||
//void exit() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -249,8 +249,8 @@ void Message::init() {
|
||||
LoadGameHook::OnGameReset() += ClearScriptAddedExtraGameMsg;
|
||||
}
|
||||
|
||||
void Message::exit() {
|
||||
//void Message::exit() {
|
||||
//gExtraGameMsgLists.clear();
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class Message : public Module {
|
||||
public:
|
||||
const char* name() { return "Message"; }
|
||||
void init();
|
||||
void exit() override;
|
||||
//void exit() override;
|
||||
|
||||
static const char* GameLanguage();
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ void Movies::init() {
|
||||
SkipOpeningMoviesPatch();
|
||||
}
|
||||
|
||||
void Movies::exit() {
|
||||
}
|
||||
//void Movies::exit() {
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class Movies : public Module {
|
||||
public:
|
||||
const char* name() { return "Movies"; }
|
||||
void init();
|
||||
void exit() override;
|
||||
//void exit() override;
|
||||
};
|
||||
|
||||
static constexpr int MaxMovies = 32;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "..\main.h"
|
||||
#include "..\FalloutEngine\Fallout2.h"
|
||||
#include "..\Translate.h"
|
||||
|
||||
#include "DamageMod.h"
|
||||
|
||||
@@ -34,6 +35,8 @@ static struct {
|
||||
fo::HandSlotMode mode;
|
||||
} slotHitData[2];
|
||||
|
||||
std::string hitNames[14];
|
||||
|
||||
class Hits {
|
||||
public:
|
||||
static const long count = 20;
|
||||
@@ -335,6 +338,18 @@ long Unarmed::GetDamage(fo::AttackType hit, long &minOut, long &maxOut) {
|
||||
return unarmed.Hit(hit).bonusDamage;
|
||||
}
|
||||
|
||||
const char* Unarmed::GetName(fo::AttackType hit) {
|
||||
if (hit > fo::AttackType::ATKTYPE_PIERCINGKICK) return nullptr;
|
||||
|
||||
switch (hit) {
|
||||
case fo::AttackType::ATKTYPE_PUNCH:
|
||||
case fo::AttackType::ATKTYPE_KICK:
|
||||
return (!hitNames[hit - 4].empty()) ? hitNames[hit - 4].c_str() : nullptr;
|
||||
default:
|
||||
return (hit >= fo::AttackType::ATKTYPE_STRONGPUNCH && !hitNames[hit - 6].empty()) ? hitNames[hit - 6].c_str() : nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static fo::AttackType GetPunchingHit() {
|
||||
@@ -477,6 +492,26 @@ void Unarmed::init() {
|
||||
|
||||
// Store the current values of unarmed attack modes when opening the player's inventory
|
||||
HookCall(0x46E8D4, handle_inventory_hook);
|
||||
|
||||
const char* setting[14] = {
|
||||
"Punch",
|
||||
"Kick",
|
||||
"StrongPunch",
|
||||
"HammerPunch",
|
||||
"Haymaker",
|
||||
"Jab",
|
||||
"PalmStrike",
|
||||
"PiercingStrike",
|
||||
"StrongKick",
|
||||
"SnapKick",
|
||||
"PowerKick",
|
||||
"HipKick",
|
||||
"HookKick",
|
||||
"PiercingKick"
|
||||
};
|
||||
for (size_t i = 0; i < 14; i++) {
|
||||
hitNames[i] = Translate::Get("Unarmed", setting[i], "", 17);
|
||||
}
|
||||
}
|
||||
|
||||
//void Unarmed::exit() {
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
|
||||
static long GetHitAPCost(fo::AttackType hit);
|
||||
static long GetDamage(fo::AttackType hit, long &minOut, long &maxOut);
|
||||
static const char* GetName(fo::AttackType hit);
|
||||
|
||||
static fo::AttackType GetStoredHitMode(fo::HandSlot slot);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user