Classes:WeaponPiece
Jump to navigation
Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
|
Weapon piece | |||
---|---|---|---|
Actor type | Internal | Game | (ZDoom) |
DoomEd Number | None | Class Name | WeaponPiece |
Classes: Inventory→WeaponPiece
→ClericWeaponPiece
→FighterWeaponPiece
→MageWeaponPiece
WeaponPieces are items that can be used to create weapons with multiple parts that have to be assembled, like the big weapons in Hexen. The base class WeaponPiece is never used directly. It is always the base class for items defined in DECORATE.
Using in DECORATE
There are a few points to observe when using weapon pieces:
- The piece's pickup sound and message are only used when the weapon is still incomplete.
- If picking up a piece that completes the weapon, the weapon's pickup sound and message are being used.
- Picking up a piece the player already owns gives some ammo. The amount is taken from the respective fields in the weapon definition.
- Any weapon used with weapon pieces must use the Health property to define the number of pieces the weapon has.
- This class is designed with the assumption that the whole weapon does not exist as a complete pickup item. It wouldn't do any harm to do it anyway but some messages would be obviously wrong.
WeaponPiece uses some of the basic Inventory properties to define their behavior as inventory items. They also define a few new properties:
- WeaponPiece.Number number
- The piece number. This can be a value between 1 and 32. To complete a weapon all available pieces as specified in the weapon must be picked up.
- WeaponPiece.Weapon weapontype
- The weapon this item helps to assemble.
DECORATE definition
ACTOR WeaponPiece : Inventory native { +WEAPONSPAWN }
Examples
ACTOR Ferkulator : Weapon { Health 3 ... } actor FerkWeaponPiece1 : WeaponPiece 10012 { Inventory.PickupSound "misc/w_pkup" Inventory.PickupMessage "A Piece of the Ferkulator" WeaponPiece.Weapon "Ferkulator" WeaponPiece.Number 1 States { Spawn: FRK1 A -1 Stop } } actor FerkWeaponPiece2 : FerkWeaponPiece1 10013 { Weaponpiece.Number 2 States { Spawn: FRK2 A -1 Stop } } actor FerkWeaponPiece3 : FerkWeaponPiece1 10016 { WeaponPiece.Number 3 States { Spawn: FRK3 A -1 Stop } }
See also
Categories:
- Chex Quest actors
- Chex Quest internal actors
- Chex Quest 3 actors
- Chex Quest 3 internal actors
- Doom actors
- Doom internal actors
- Doom II actors
- Doom II internal actors
- Heretic actors
- Heretic internal actors
- Hexen actors
- Hexen internal actors
- Strife actors
- Strife internal actors
- ZDoom actors
- ZDoom internal actors
- Internal