F2: new change to the damage calculation - hopefully a fix

Status
Not open for further replies.
Does everyone agree?
Hmmm... Nope! :D

This formula should apply to HtH combat:
raw_damage = random(min_damage_of_weapon, max_damage_of_weapon + melee_damage + heavy_handed_bonus) + special_unarmed_bonus + (2*rank_of_HtH_dam_perk)
where min_damage_of_weapon=1 and max_damage_of_weapon=2 if the critter in question has no weapons. There is no reason not to allow HtH bonuses for weapons such as Power Fist.

And I suggest that 'heavy_handed_bonus' should apply to Weapon Melee Damage. These things are related, aren't they?

Because Heavy Handed trait is so unattractive, I would further suggest to treat it like 2 levels of HtH_dam_perk, but I'll leave this for others to decide.
 
Nevill said:
Does everyone agree?
Hmmm... Nope! :D

This formula should apply to HtH combat:
raw_damage = random(min_damage_of_weapon, max_damage_of_weapon + melee_damage + heavy_handed_bonus) + special_unarmed_bonus + (2*rank_of_HtH_dam_perk)
where min_damage_of_weapon=1 and max_damage_of_weapon=2 if the critter in question has no weapons. There is no reason not to allow HtH bonuses for weapons such as Power Fist.

And I suggest that 'heavy_handed_bonus' should apply to Weapon Melee Damage. These things are related, aren't they?

Because Heavy Handed trait is so unattractive, I would further suggest to treat it like 2 levels of HtH_dam_perk, but I'll leave this for others to decide.
I disagree with this, but there could be a case made for adding Heavy Handed to the Weapon Melee damage given how it is treated. The new formula would be:
Glovz said:
Weapon Melee Damage
Code:
raw_damage = random(min_damage_of_melee_weapon, max_damage_of_melee_weapon + melee_damage + heavy_handed_bonus)
This would allow Weapon Melee to gain a bit of a bonus, while still having enough distinction from Unarmed Melee.

EDIT:
Considering two things; one Heavy Handed needs more impact , and two the highest minimum damage value should not be too great. I think this final change should accomplish both those things, not deviate too greatly from the original results, and offer a difference between unarmed and weapon melee.

Melee Damage Scale
Code:
melee_damage = max(player_strength - 5, 1)

Weapon Melee Damage
Code:
raw_damage = random(min_damage_of_melee_weapon, max_damage_of_melee_weapon + melee_damage) + heavy_handed_bonus

Unarmed Melee Damage (equivalent to Haen's formula)
Code:
raw_damage = random(1, 2 + melee_damage + (2*rank_of_HtH_dam_perk)) + special_unarmed_bonus + heavy_handed_bonus
 
I disagree with this
What exactly are you disagreeing with?

I think we have already established that HtH_dam_perk should also apply to minimum damage, it's written in the description.

And is there a reason to disallow perk and trait bonuses while wearing Knuckles and similar HtH weapons? I think not.
 
Nevill said:
I disagree with this
What exactly are you disagreeing with?

I think we have already established that HtH_dam_perk should also apply to minimum damage, it's written in the description.

And is there a reason to disallow perk and trait bosuses while wearing Knuckles and similar HtH weapons? I think not.
The issue for me is that weapon melee will have much more advantage over unarmed if all bonuses are applied. Remember weapons already come with a greater hit range than being unarmed and while I understand the thought towards the brass/spiked knuckles, power fists, and gloves, can you consider the same of knifes and sledges?

Have you run the numbers? Without Heavy Handed applying to minimum hit level, it's a pathetic trait. I am simply trying to add value to it.

As for HtH perk, keeping it with maximum hit level only allows for it to be useful and allows the minimum hit level to not get to close to the maximum. I thought as discussed earlier this point was important.

All this could be moot anyway given I have not been able to figure out how to have these changes applied. I'm hoping Haen will have an idea. I know Timeslip suggests using hookscripts but for myself I am not sure how to do this and second the script(s) provided earlier seem to be missing some of the checks that exist in the assembly, again though I am not 100% sure. :?
 
The issue for me is that weapon melee will have much more advantage over unarmed if all bonuses are applied.
No, they don't.

First, they cost more AP than unarmed attacks. It's only natural they deal greater damage (and logical, too). The ones that cost less AP are either powerless or come with some sort of unwanted effect (Super Sledge and Knockback, duhhh). There are no perks to improve one's performance with melee weapons, but there are some really nice choices for HtH combat (HtH evade, for example). Overall, Unarmed skill is completely superior to Melee.

The only field Melee excel at is damage, but just barely.

Have you run the numbers? Without Heavy Handed applying to minimum hit level, it's a pathetic trait. I am simply trying to add value to it.
I never said anything against Heavy Handed, did I? In fact, I thought we might let it increase minimum damage on the very first page. :) The only thing that was weighting on my mind was damage randomisation, but if I absolutely had to choose between what should increase min_damage - Heavy Handed or Bonus HtH damage, I'd go for the latter. Not only because it explicitly says so in it's description, but also because it could be picked 3 times, and, frankly, who would do that if it only gave 1 extra pt. of damage on average? Hmm, I wonder if a multiplier can be changed from 2 to 4.

Strength bonus (melee_damage) might be enough to avoid min_damage getting too close to max_damage.

I insist on this formula for HtH combat:
raw_damage = random(1, 2 + melee_damage) + special_unarmed_bonus + 2*rank_of_HtH_dam_perk
---------------------------------------------------------
+ heavy_handed_bonus goes either inside or outside the brackets, I don't care that much
 
As you can all tell by my lack of replies, RL stuff has been tearing into me pretty heavily lately. So for now, I'll stick with the following observations/responses:

1) Should damage formula for melee and unarmed attacks be different? My opinion is no. Firstly, this is how the Fallout engine handles it currently (special_unarmed_bonus is set to 0 in the event of a melee attack, but the engine still adds the zero). Secondly, damage formula not withstanding, unarmed and melee attacks are pretty well balanced already. As Nevill pointed out, Melee attacks deal more damage in a single attack generally speaking, while Unarmed attacks deal out less damage but more strikes per round. The Unarmed Special Attack Bonus is balanced out by the fact that the higher level melee weapons have Weapon Perks, though some (i.e. Weapon Penetrate) are more useful/less annoying than others.

2) Yes, for whatever it's worth, I can make the engine changes to do any of the suggestions that has been tossed about in this thread. Assuming we've decided on a final algorithm, it should take me about half hour to an hour. Nonetheless, it's time I really don't have currently.

3) I think we are all agreed that Bonus HtH Damage should be added to both minimum and maximum, just like how Bonus Ranged Damage effectively works. The real question is whether or not Heavy Handed Trait should be dealt with in the same way. Like I said before, I'm of a split opinion on this. If we want to go for realism, then I'd leave Heavy Handed Trait to be added only to the maximum. If we want to go for balance, then add it to both maximum and minimum. I'll try to find some time to analyze damage figures with both settings.

-- The Haen.
 
I'm for balance, so we might as well go with:
Melee Damage Scale
Code:
melee_damage = max(player_strength - 5, 1)
Weapon Melee Damage
Code:
raw_damage = random(min_damage_of_melee_weapon, max_damage_of_melee_weapon + melee_damage) + special_unarmed_bonus + heavy_handed_bonus + (2*rank_of_HtH_dam_perk)
Unarmed Melee Damage (equivalent to Haen's formula)
Code:
raw_damage = random(1, 2 + melee_damage) + special_unarmed_bonus + heavy_handed_bonus + (2*rank_of_HtH_dam_perk)
 
Ok, Glovz. Thanks for the clarification.

The way these formulas are presented means that functionally speaking, no change was made to the max damage of unarmed or melee attacks. What was being added to the max damage under the original formula is still being added under the new formula.

Therefore, the only thing that really needs to be done functionally speaking is to tack on the Heavy Handed Bonus and Bonus HtH Damage Perk bonus to the min damage, assuming that they exist.

With the above in mind, here's my first stab at the code. Since the goal is integration into sfall, I've placed them into a file named "BonusHtHDamageTweak.cpp", using "AmmoMod.cpp" as a template.

Code:
/*
*    sfall
*    Copyright (C) 2008, 2009, 2010  The sfall team
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http>.
*/

#define WIN32_LEAN_AND_MEAN
#include <windows>
#include "main.h"
#include "safewrite.h"

static const DWORD get_critter_stat = 0x004AEF48;
static const DWORD has_trait = 0x004B3BC8;
static const DWORD has_perk = 0x00496B78;
static const DWORD Tweak1End = 0x004784B0;
static const DWORD Tweak2End = 0x0047855C;

static _declspec(naked) void HtHDamageTweak1() {
	_asm {
		mov eax,ecx;				// get_critter_stat argument: pointer to critter
		mov edx,0xb;				// get_critter_stat argument: STAT_melee_dmg
		call get_critter_stat;			// Get Total_Melee_Damage
		add eax,2;				// Total_Melee_Damage += 2
		mov dword ptr ss:[esp],eax;		// Max_Damage = Total_Melee_Damage
		xor edx,edx;
		mov eax,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,eax;				// Is the critter == PC?
		jnz ajmp;				// Skip to ajmp if no
		mov eax,0x6;				// has_trait argument: TRAIT_heavy_handed
		call has_trait;				// Heavy_Handed_Bonus = 1 if PC has trait, 0 otherwise
		shl eax,0x2;				// Heavy_Handed_Bonus *= 4
		mov dword ptr ss:[esp+0x4],eax;		// Min_Damage = Heavy_Handed_Bonus
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		mov edx,dword ptr ss:[esp+0x4];		// Retrieve Min_Damage
		add edx,eax;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
ajmp:
		add edx,1;				// Min_Damage += 1
		mov dword ptr ss:[esp+0x4],edx;		// Store Min_Damage
		sub esi,0x8;				// Set up for switch statement beyond jump
		jmp Tweak1End;
	}
}

static _declspec(naked) void HtHDamageTweak2() {
	_asm {
		add edx,ebp;				// Max_Damage += Total_Melee_Damage
		mov ebp,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,ebp;				// Is the critter == PC?
		jnz exit;				// Exit tweak if no
		mov ebp,eax;				// Otherwise, store Min_Damage and Max_Damage...
		mov esi,edx;				// ...in temp variables (no longer used by rest of function)
		mov eax,0x6;				// has_trait argument: TRAIT_heavy_handed
		call has_trait;				// Heavy_Handed_Bonus = 1 if PC has trait, 0 otherwise
		shl eax,0x2;				// Heavy_Handed_Bonus *= 4
		add ebp,eax;				// Min_Damage += Heavy_Handed_Bonus
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		add eax,ebp;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
		mov edx,esi;				// Restore Max_Damage from temp variable
exit:
		jmp Tweak2End;
	}
}

void BonusHtHDamageTweakInit() {
	MakeCall(0x478492, &HtHDamageTweak1, true);
	MakeCall(0x47855a, &HtHDamageTweak2, true);
}

I'm not certain if I've used the MakeCall procedures in procedure BonusHtHDamageTweakInit() properly, or even if it's valid to call it twice in the same procedure without the use of a switch statement. Moreover, I'm half-asleep, so chances are pretty good there's something that I've overlooked. Comments are more than welcomed.

Cheers,

-- The Haen.
 
Haenlomal said:
I'm not certain if I've used the MakeCall procedures in procedure BonusHtHDamageTweakInit() properly, or even if it's valid to call it twice in the same procedure without the use of a switch statement. Moreover, I'm half-asleep, so chances are pretty good there's something that I've overlooked. Comments are more than welcomed.
I don't have time to read through the asm right now, but the mechanics of it look fine. MakeCall just injects a jmp to the function you specify, (or a call if the third argument is false,) so you can call it as often as you like.

btw, I've created the hookscript I said I would. (I got a little distracted because my test script turned out a wrong code bug in my script compiler...) I haven't committed it to svn yet, so I can scrap it in favour of your hardcoded version if you think that's better, but personally, for something like this that other people might want to change in their own damage mods, I'd prefer to keep it flexible.
 
Following the same method, here is the HtH Evade tweak created by crazycc.

Code:
/*
*    sfall
*    Copyright (C) 2008, 2009, 2010  The sfall team
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http>.
*/

#define WIN32_LEAN_AND_MEAN
#include <windows>
#include "main.h"
#include "safewrite.h"

static const DWORD has_perk = 0x00496B78;
static const DWORD item_ptr_right_slot = 0x00471B70;
static const DWORD item_ptr_left_slot = 0x00471BBC;
static const DWORD item_type = 0x00477AFC;
static const DWORD weapon_type = 0x00478DA8;
static const DWORD skill_level = 0x004AA558;
static const DWORD Tweak1End = 0x004AF09C;

// HtH Evade tweak by crazycc
static _declspec(naked) void HtHEvadeTweak1() {
   _asm { 
          mov edx,0x5d; // h2h evade
          call has_perk; //
          test eax,eax; //
          je Tweak1End; //
          mov eax,dword ptr ds:[6610B8]; //
          call item_ptr_right_slot; // get item ptr on right slot
          mov edx,eax; //
          test eax,eax; //
          je aJmp; //
          call item_type; // get item type
          cmp eax,0x3; //
          jnz aJmp; //
          mov eax,edx; //
          call weapon_type; // get weapon type
          cmp eax,0x4; //
          jg Tweak1End; // branch if gun type
   aJmp:
          mov eax,dword ptr ds:[6610B8]; //
          call item_ptr_left_slot; // get item ptr on left slot
          mov edx,eax; //
          test eax,eax; //
          je bJmp; //
          call item_type; // get item type
          cmp eax,0x3; //
          jnz bJmp; //
          mov eax,edx; //
          call weapon_type; // get weapon type
          cmp eax,0x4; //
          jg Tweak1End; // branch if gun type
   bJmp:
          mov edx,dword ptr ss:[esp+4]; //
          add edx,edx; //
          mov eax,dword ptr ds:[6610B8]; //
          mov dword ptr ss:[esp+4],edx; //
          mov edx,0x3; // unarmed
          call skill_level; // get skill level
          mov edi,eax; //
          mov eax,dword ptr ds:[6610B8]; //
          mov edx,0x4; // melee
          call skill_level; // get skill level
          add eax,edi; // unarmed + melee
          sar eax,0x4; // skill divided by 16
          mov ebp,eax; //
          jmp Tweak1End; //
   }
} 

void HtHEvadeTweakInit() {
   MakeCall(0x004AF007, &HtHEvadeTweak1, true);
}
 
Glovz said:
Following the same method, here is the HtH Evade tweak created by crazycc.

Let's work on one thing at a time, shall we? :) Personally speaking, I have no problems with HtH Evade the way it is, but I suppose it could be mod option for others to have them made HtH Evade effective for both Melee and Unarmed attacks.

Timeslip said:
btw, I've created the hookscript I said I would. (I got a little distracted because my test script turned out a wrong code bug in my script compiler...) I haven't committed it to svn yet, so I can scrap it in favour of your hardcoded version if you think that's better, but personally, for something like this that other people might want to change in their own damage mods, I'd prefer to keep it flexible.

I see where you're coming from. To me, however, the thing with the Bonus HtH Damage Perk is not a tweak, but a bugfix. By their descriptions, Bonus HtH Damage Perk and Bonus Ranged Damage Perk would work in the exact same way. Currently, this isn't being done, but is erroneously being applied before the roll instead of after the roll. By bumping the min_damage value by the bonus given by Bonus HtH Damage, we've effectively made it equivalent to Bonus Ranged Damage. I feel that this is a bug fix that everyone should get, though I'm aware that others may feel differently.

That said, I can see the point about the Heavy Handed Trait. Unlike Bonus HtH Damage, the Heavy Handed Trait is working as designed, though that design is admittedly poor. The tweak in this case is to make Heavy Handed is bit more powerful, but it is ultimately still a tweak.

So how about the following proposal:

1) Create a new setting in ddraw.ini, maybe something like "BonusHtHDamageFix". Make this entry under the category of "Removed from ddraw.ini, but which will still be recognised if they're readded", but keep it enabled by default (i.e. BonusHtHDamageFix=1).

2) If a user manually adds BonusHtHDamageFix=0, then disable the fix (i.e. use the original calculations).

3) If a user manually adds BonusHtHDamageFix=2, then enable the additional Heavy Handed tweak on top of the fix. Alternately, don't touch Heavy Handed Trait and leave it entirely up to hookscripts.

Assuming all of the above comments are followed, then we'll have the new "BonusHtHDamageFix.cpp" file as thus:

Code:
/*
*    sfall
*    Copyright (C) 2008, 2009, 2010  The sfall team
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http>.
*/

#define WIN32_LEAN_AND_MEAN
#include <windows>
#include "main.h"
#include "safewrite.h"

static const DWORD get_critter_stat = 0x004AEF48;
static const DWORD has_trait = 0x004B3BC8;
static const DWORD has_perk = 0x00496B78;
static const DWORD FixaEnd = 0x004784B0;
static const DWORD FixbEnd = 0x0047855C;

static _declspec(naked) void HtHDamageFix1a() {
	_asm {
		mov eax,ecx;				// get_critter_stat argument: pointer to 

critter
		mov edx,0xb;				// get_critter_stat argument: STAT_melee_dmg
		call get_critter_stat;			// Get Total_Melee_Damage
		add eax,2;				// Total_Melee_Damage += 2
		mov dword ptr ss:[esp],eax;		// Max_Damage = Total_Melee_Damage
		xor edx,edx;
		mov eax,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,eax;				// Is the critter == PC?
		jnz ajmp;				// Skip to ajmp if no
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		mov edx,dword ptr ss:[esp+0x4];		// Retrieve Min_Damage
		add edx,eax;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
ajmp:
		add edx,1;				// Min_Damage += 1
		mov dword ptr ss:[esp+0x4],edx;		// Store Min_Damage
		sub esi,0x8;				// Set up for switch statement beyond jump
		jmp FixaEnd;
	}
}

static _declspec(naked) void HtHDamageFix1b() {
	_asm {
		add edx,ebp;				// Max_Damage += Total_Melee_Damage
		mov ebp,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,ebp;				// Is the critter == PC?
		jnz exit;				// Exit tweak if no
		mov ebp,eax;				// Otherwise, store Min_Damage and 

Max_Damage...
		mov esi,edx;				// ...in temp variables (no longer used by rest 

of function)
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		add eax,ebp;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
		mov edx,esi;				// Restore Max_Damage from temp variable
exit:
		jmp FixbEnd;
	}
}

static _declspec(naked) void HtHDamageFix2a() {
	_asm {
		mov eax,ecx;				// get_critter_stat argument: pointer to 

critter
		mov edx,0xb;				// get_critter_stat argument: STAT_melee_dmg
		call get_critter_stat;			// Get Total_Melee_Damage
		add eax,2;				// Total_Melee_Damage += 2
		mov dword ptr ss:[esp],eax;		// Max_Damage = Total_Melee_Damage
		xor edx,edx;
		mov eax,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,eax;				// Is the critter == PC?
		jnz ajmp;				// Skip to ajmp if no
		mov eax,0x6;				// has_trait argument: TRAIT_heavy_handed
		call has_trait;				// Heavy_Handed_Bonus = 1 if PC has trait, 0 

otherwise
		shl eax,0x2;				// Heavy_Handed_Bonus *= 4
		mov dword ptr ss:[esp+0x4],eax;		// Min_Damage = Heavy_Handed_Bonus
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		mov edx,dword ptr ss:[esp+0x4];		// Retrieve Min_Damage
		add edx,eax;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
ajmp:
		add edx,1;				// Min_Damage += 1
		mov dword ptr ss:[esp+0x4],edx;		// Store Min_Damage
		sub esi,0x8;				// Set up for switch statement beyond jump
		jmp FixaEnd;
	}
}

static _declspec(naked) void HtHDamageFix2b() {
	_asm {
		add edx,ebp;				// Max_Damage += Total_Melee_Damage
		mov ebp,dword ptr ds:[0x6610b8];	// Get pointer to PC
		cmp ecx,ebp;				// Is the critter == PC?
		jnz exit;				// Exit tweak if no
		mov ebp,eax;				// Otherwise, store Min_Damage and 

Max_Damage...
		mov esi,edx;				// ...in temp variables (no longer used by rest 

of function)
		mov eax,0x6;				// has_trait argument: TRAIT_heavy_handed
		call has_trait;				// Heavy_Handed_Bonus = 1 if PC has trait, 0 

otherwise
		shl eax,0x2;				// Heavy_Handed_Bonus *= 4
		add ebp,eax;				// Min_Damage += Heavy_Handed_Bonus
		mov edx,0x2;				// has_perk argument: PERK_bonus_hth_damage
		mov eax,dword ptr ds:[0x6610b8];	// has_perk argument: pointer to PC
		call has_perk;				// Return Rank_of_Bonus_HtH_Damage_perk
		shl eax,0x1;				// Rank_of_Bonus_HtH_Damage_perk *= 2
		add eax,ebp;				// Min_Damage += Rank_of_Bonus_HtH_Damage_perk
		mov edx,esi;				// Restore Max_Damage from temp variable
exit:
		jmp FixbEnd;
	}
}

void BonusHtHDamageFixInit() {
	int formula;
	if(formula=GetPrivateProfileInt("Misc", "BonusHtHDamageFix", 1, ini)) {
		switch(formula) {
		case 1:
			MakeCall(0x478492, &HtHDamageFix1a, true);
			MakeCall(0x47855a, &HtHDamageFix1b, true);
			break;
		case 2:
			MakeCall(0x478492, &HtHDamageFix2a, true);
			MakeCall(0x47855a, &HtHDamageFix2b, true);
			break;
		default:	// Not sure if this is needed for BonusHtHDamageFix=0 setting
			break;
		}
	}
}

Cheers,

-- The Haen.
 
Haenlomal said:
I see where you're coming from. To me, however, the thing with the Bonus HtH Damage Perk is not a tweak, but a bugfix.
yes, that's a good point. OK, I'll go with your plan then.
 
Haenlomal said:
Glovz said:
Following the same method, here is the HtH Evade tweak created by crazycc.

Let's work on one thing at a time, shall we? :) Personally speaking, I have no problems with HtH Evade the way it is, but I suppose it could be mod option for others to have them made HtH Evade effective for both Melee and Unarmed attacks.
I thought we were pretty much settled given you seemed ok with going either way on Heavy Handed, but offering the choice is a perfect. :D

With regards to the HtH Evade Tweak, it has been around so long buried away in an old thread that I thought why not get it out there given it's an interesting change. :|
 
Timeslip said:
Haenlomal said:
I see where you're coming from. To me, however, the thing with the Bonus HtH Damage Perk is not a tweak, but a bugfix.
yes, that's a good point. OK, I'll go with your plan then.

Hmmm...just noticed that for some odd reason, the forum messed up with the URL to GNU website in the intro header and the line "#include <windows>". Must the forum trying to interpret them as HTML tags instead of text. Oh well.

Timeslip, do you want me to e-mail you my copies of BonusHtHDamageFix.cpp and BonusHtHDamageFix.h? Alternately, I guess I can finally cave in and sign up for SVN and make the changes myself. :P

-- The Haen.

Edit: the #include line is still messed up. Must really be the forum doing its thing.
 
Haenlomal said:
Timeslip, do you want me to e-mail you my copies of BonusHtHDamageFix.cpp and BonusHtHDamageFix.h? Alternately, I guess I can finally cave in and sign up for SVN and make the changes myself. :P
I can work from what you've already posted. On the other hand, by going through me things tend to get changed quite a bit, so you might want to consider that svn anyway. :P

In this case, I've rewritten the second half of your patch, because afaict the way you had it set up would cause it to apply to all attacks, rather than just attacks carried out with melee weapons. (I did a couple of in game tests to check, but correct me if I've missed something.) I also changed the function names to match the originals, and kept it in AmmoMod.cpp. (The commit is here for you to check.)

I'll keep that as just a straight bugfix without any extra features attached, and leave any tweaks up to the hookscript side. This (untested) hook script should do for adding on heavy handed damage.

Code:
procedure start begin
  variable mindmg, maxdmg, weapon, critter, type, melee;
  mindmg:=get_sfall_arg;
  maxdmg:=get_sfall_arg;
  weapon:=get_sfall_Arg;
  critter:=get_sfall_arg;
  type:=get_sfall_arg;
  melee:=get_sfall_arg;
  
  if critter == dude_obj and (melee or not weapon) then begin
    if <player has heavy handed trait. Can't remmeber the function name from the top of my head) then begin
      set_sfall_return(mindmg + 4);
      set_sfall_return(maxdmg);
    end
  end
end
 
Timeslip said:
In this case, I've rewritten the second half of your patch, because afaict the way you had it set up would cause it to apply to all attacks, rather than just attacks carried out with melee weapons. (I did a couple of in game tests to check, but correct me if I've missed something.)

And that's what happens when you try to write asm half-asleep. You're absolutely correct: I totally forgot about the conditional check before the 2nd application of Melee damage. Um...oops? :oops: I knew there was a reason why I wrote comments were more than welcomed. :wink:

I've tried to check out your changes, but I'm getting a Python exception when I try to look it up. Maybe I'll try again later.

On a side note, as per your recommendation I've also sent a join request to the sfall project. No python exceptions there so I hope the request got through ok.

Cheers,

-- The Haen.
 
Haenlomal said:
I've tried to check out your changes, but I'm getting a Python exception when I try to look it up. Maybe I'll try again later.
Odd. The link worked for me when I posted it, and still works now. :? If it still doesn't work for you, you can try finding it manually from here.

Haenlomal said:
On a side note, as per your recommendation I've also sent a join request to the sfall project. No python exceptions there so I hope the request got through ok.
It doesn't look like it did, or at least I didn't get any notification. Is your sourceforge username the same as here? That's all I need to add you.
 
Timeslip said:
Haenlomal said:
On a side note, as per your recommendation I've also sent a join request to the sfall project. No python exceptions there so I hope the request got through ok.
It doesn't look like it did, or at least I didn't get any notification. Is your sourceforge username the same as here? That's all I need to add you.

Yup, it's the same userid as here. Thanks.

On a related note, I'm able to access your change now. I've downloaded the file and will look at it tomorrow since I'm running on fumes right now.

Cheers,

-- The Haen.
 
heh, it's giving the same python error for me now. Luckily the svn itself seems to be working, so hopefully it's just the web interface that's gone wonky.

Haenlomal said:
Yup, it's the same userid as here. Thanks
Great, added you.
 
Status
Not open for further replies.
Back
Top