ichxg0 wrote: ↑Sun Dec 01, 2024 12:32 pm
Does this mean to increase damage I will have to redefine each state of an attack manually?
Unfortunately, yes, because for hitscan weapons the damage usually depends on the function that gets called from the attack state sequence. And in this particular case, the damage is also hardcoded in the function itself:
ichxg0 wrote: ↑Sun Dec 01, 2024 2:45 pm
What do the two numbers (7, 14) mean
Yes, here it is. In context, which is
random[FireGoldWand](7, 14), it represents a uniformly distributed random integer value from 7 to 14 inclusive. Note that the
wiki claims the damage is "1d8+6", but it actually means the same thing: "d8" is a reference to an eight-sided die commonly used in tabletop RPGs - by rolling it, you get a random value from 1 to 8 inclusive, then you add 6... and there is your (7, 14).
ichxg0 wrote: ↑Sun Dec 01, 2024 2:45 pm
How would I write this up in decorate as a patch to load? Since this is all from the GZDoom pk3 I don't want to directly modify it..
Since
A_FireGoldWandPL1 does not accept any parameters, and you also cannot write custom functions In DECORATE, you'll have to resort to
A_FireBullets instead. The article on
A_FireGoldWandPL1 provides a reference point to start from:
ZDoom Wiki wrote:The behavior of this function can be recreated by using A_FireBullets:
Code: Select all
A_FireBullets(random(5, 6), 0, 1, random(2, 3), "GoldWandPuff1")
I have my doubts that the behavior recreated is
exact, at least in regard to damage - by default, the damage parameter passed to
A_FireBullets is multiplied by
random(1, 3); the damage value used here is
random(2, 3), which means the final damage will be from 2 to 9 inclusive, and also not uniformly distributed - definitely not the same as in the original function. Better just turn off that extra randomization with the
FBF_NORANDOM flag and pass the correct damage range directly. Also, you will need to define an
AttackSound for your weapon because
A_FireGoldWandPL1 has it hardcoded.
Here's the final code:
Code: Select all
actor MyWand : GoldWand
{
AttackSound "weapons/wandhit"
States
{
Fire:
GWND B 3
GWND C 5 A_FireBullets(random(5, 6), 0, 1, random(7, 14), "GoldWandPuff1", FBF_NORANDOM|FBF_USEAMMO)
GWND D 3
GWND D 0 A_ReFire
Goto Ready
}
}
Now you can adjust the damage to your liking by changing the fourth argument passed to
A_FireBullets - in the above example it is
random(7, 14), which corresponds to the original damage formula. You can even get rid of
random and use a fixed value instead.