I don't know how familiar you are with Decorate since you're new to modding, but here's how the Berserk item is defined in Decorate:
https://zdoom.org/wiki/Classes:Berserk
As you might be able to see, the problematic line here is this:
That line makes the item heal the player. So we need to create a new Berserk item that behaves exactly the same as Berserk but has that line removed. And we also have to make that new berserk actually replace the old berserk items in the map. Here's how you define a new berserk item that does this.
Code: Select all
ACTOR NewBerserk : Berserk replaces Berserk
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("PowerStrength")
TNT1 A 0 A_SelectWeapon("Fist")
Stop
}
}
The ": Berserk" part of the first line is called
inheritance and it makes our new berserk inherit (copy-paste) all the properties and states of the old "Berserk" item/class. Then we write a new Pickup state for the new berserk which effectively replaces the Pickup state inherited from the old berserk.
The "replaces Berserk" part of the first line makes the game replace all "Berserk" actors/items in the map with "NewBerserk" actors/items.
To make this finally work, if your mod is a .wad, then put that code I gave you inside the DECORATE lump, and if you're making a .pk3, put it inside decorate.txt
We could also have defined the new berserk item just by copypasting the native berserk definition and removing the line which heals the user (and adding the "replaces Berserk" at the end of the first line):
Code: Select all
ACTOR NewBerserk : CustomInventory replaces Berserk
{
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
Inventory.PickupMessage "$GOTBERSERK" // "Berserk!"
Inventory.PickupSound "misc/p_pkup"
States
{
Spawn:
PSTR A -1
Stop
Pickup:
TNT1 A 0 A_GiveInventory("PowerStrength")
TNT1 A 0 A_SelectWeapon("Fist")
Stop
}
}
But the method using inheritance is generally preferred over this. If you inherit from a user-made class, then when you change the user-made class, the changes also get reflected on the classes which inherit from that class as well, so that's an advantage of using inheritance.