Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Krispy

Applying the berserk effect to other weapons

Recommended Posts

Got a question about that. How is it done? I got the DECORATE to switch to this weapon when a berserk pack is picked up, but then the strength of the weapon is the same. I'm pretty sure it's got something to do with a class called PowerStrength, but I don't know how to change it.

Share this post


Link to post

I'm by no means a DECORATE expert, and I don't know if this is the proper way to do it, but in your weapon frames, can you use A_JumpIfInventory to check for the presence of a "PowerStrength" and go to frames with attack codepointers that have increased damage?

Share this post


Link to post

Could you spoon feed it to me? Here's the code you're talking about.
(And no laughing at any goofs you see)

actor Sword : Weapon replaces fist
{
Weapon.SelectionOrder 3700
Weapon.Kickback 100
+WEAPON.WIMPY_WEAPON
+WEAPON.MELEEWEAPON
+NOEXTREMEDEATH
Obituary "%o was cut up by %k's sword."
States
{
Spawn:
MHTE A -1
loop
Ready:
MHTG G 1 A_WeaponReady
loop
Deselect:
MHTG G 1 A_Lower
loop
Select:
MHTG G 1 A_Raise
loop
Fire:
TNT1 A 0 A_Jump(128,"Fire4")
TNT1 A 0 A_Jump(128,"Fire3")
TNT1 A 0 A_Jump(128,"Fire2")
MHTG A 2 A_PlayWeaponSound("MacheteSwing")
MHTG B 2
MHTG C 4 A_CustomPunch (30,0,0,"MachetePuff")
MHTG D 2
MHTG E 2
MHTG F 2
MHTG G 2
MHTG H 2
MHTG I 2
goto Ready
Fire2:
MHT2 A 2 A_PlayWeaponSound("MacheteSwing")
MHT2 B 2
MHT2 C 4 A_CustomPunch (20,0,0,"MachetePuff")
MHT2 D 2
MHT2 E 2
MHT2 F 2
MHT2 G 2
MHT2 H 2
goto Ready
Fire3:
MHT3 A 2 A_PlayWeaponSound("MacheteSwing")
MHT3 B 2
MHT3 C 4 A_CustomPunch (10,0,0,"MachetePuff")
MHT3 D 2
MHT3 E 2
MHT3 F 2
MHT3 G 2
TNT1 A 0 A_ReFire
goto Ready
Fire4:
MHT4 A 2 A_PlayWeaponSound("MacheteSwing")
MHT4 B 2
MHT4 C 4 A_CustomPunch (10,0,0,"MachetePuff")
MHT4 D 2
MHT4 E 2
MHT4 F 2
MHT4 G 2
TNT1 A 0 A_ReFire
goto Ready
}
}

ACTOR MachetePuff
{
+NOBLOCKMAP
+NOGRAVITY
+NOEXTREMEDEATH
+PUFFONACTORS
RenderStyle Translucent
Alpha 0.6
SeeSound "MacheteHitThing"
AttackSound "MacheteHitWall"
ActiveSound "MacheteSwing"
VSpeed 1
States
{
Spawn:
PUFF ABCD 4
Stop
}
}

Share this post


Link to post

Again, I am not sure I can give you accurate information. That last time I used DECORATE for anything was back in 2004 when DECORATE was only used for ... yep, decorations.

I do see somethings you can improve on though. First, some frames can be combined, so your code doesn't have to be so long. For example, the Fire states where consecutive frames all have the same delay and action (or lack thereof).

Like:

MHT4 DEFG 2

Instead of...

MHT4 D 2
MHT4 E 2
MHT4 F 2
MHT4 G 2

Anyways, seeing as you already have a bunch of different Fire states, I'm not sure how to best go about it. It seems obvious to me the first thing you need to check under "Fire" if whether a player has picked up the berserk by using A_JumpIfInventory("PowerStrength", 1, "<state>").

At the most here, you'd need yet another 3 states for the increased berserk damage, one more for each variation of your normal attack.

Share this post


Link to post

So then why doesn't the fist have that? And like I said, I'm certainly less knowledgeable than you at this, so if you could type it out for me that would be just awesome.

Share this post


Link to post

Probably because the A_Punch function checks for a "PowerStrength" item.

And no, I have no desire to mess around and write DECORATE for you. That's something you need to figure out for yourself. I'm just steering you in some random direction because no one else seems interested. I don't even know if it's the right one.

Share this post


Link to post

That's fine, I'm not demanding anything. "Figuring it out" on my own hasn't worked, so that's why I came here.

Share this post


Link to post

Add something like this into the Fire state of the weapon, before the attack actually occurs:

Fire:
TNT1 A 0 A_JumpIfInventory("PowerMeleeDamageUp",1,"PoweredUp")
(normal attack stuff goes here)
Goto Ready
PoweredUp:
(stronger attack stuff goes here)
Goto Ready

You could also add the check for the Strength item in the Fire1,2,3,4 states and have it jump from there.

Oh, and:

Spawn:
MHTE A -1
loop

If you're going to use a frame duration of -1 (infinite), the "Loop" is redundant:

MHTE A -1
Stop

is the same engine-wise as

MHTE A 1
Loop

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×