Weapon virtual functions
Jump to navigation
Jump to search
- int, int CheckAddToSlots()
- Called when the level is first loaded if the weapon has neither a defined slot number property nor is assigned to a slot in a player class. Returns the slot number of the weapon and its slot priority multiplied by 65536.
- State GetReadyState()
- Returns the weapon's Ready state. Called by multiple functions when setting a weapon to its Ready state (e.g. A_Raise).
- State GetUpState()
- Returns the weapon's Select state. Called when a pending weapon becomes the player's current weapon.
- State GetDownState()
- Returns the weapon's Deselect state. Called when a pending weapon has been queued up and the current weapon needs to be lowered.
- State GetAtkState(bool hold)
- Returns the weapon's Fire state. Called by PlayerPawn's fire function.
- hold - If true, returns the Hold state instead if one is found, otherwise returning Fire.
- State GetAltAtkState(bool hold)
- Returns the weapon's Altfire state. Called by PlayerPawn's alt fire function
- hold - If true, returns the AltHold state instead if one is found, otherwise returning Altfire.
- void PlayUpSound(Actor origin)
- Plays the weapon's UpSound. Called when a pending weapon becomes the player's current weapon.
- origin - The actor to play the sound from.
- void EndPowerup()
- Called when a Tome of Power expires and the weapon is currently powered up.
- bool CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo = false, int ammocount = -1)
- Called when the game checks to see if a weapon has enough ammo either for firing or for switching to. Returns true if the weapon has enough ammo.
- bool DepleteAmmo(bool altFire, bool checkEnough = true, int ammouse = -1)
- Called to consume ammo when attacking.
- ui Vector2 ModifyBobLayer(Vector2 Bob, int layer, double ticfrac)
- Allows modifying the weapon bob values after they have been calculated by the
BobWeapon()call on the PlayerPawn.- bob - the bob value received from
BobWeapon(). - layer - the number of the layer that is bobbing.
- ticfrac - current tic fraction.
- bob - the bob value received from
- By default the function returns
bobunmodified.
- ui Vector3, Vector3 ModifyBobLayer3D(Vector3 Translation, Vector3 Rotation, int layer, double ticfrac)
- Allows modifying the weapon bob values for 3D-model-based weapons after they have been calculated by the
BobWeapon3D()call on the PlayerPawn.- Translation - the 3D position value received from
BobWeapon3D(). - Rotation - the 3D rotation value received from
BobWeapon3D(). - layer - the number of the layer that is bobbing.
- ticfrac - current tic fraction.
- Translation - the 3D position value received from
- By default the function returns
Translation, Rotationunmodified.
- ui Vector3 ModifyBobPivotLayer3D(int layer, double ticfrac)
- (Need more info)