PlayerThunk

From Eternity Wiki
Revision as of 02:16, 6 May 2011 by Printz (talk | contribs) (Created.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Description

Allows the player's weapons to use a certain class of monster codepointers that are deemed safe.

Usage

PlayerThunk(function, facetarget, state, maketarget, useammo)

Parameters

The parameters are as follows:

  • function: The function (codepointer) to call
  • facetarget: Whether to change the view angle in relation to the targeted object. Possible values:
    • 0 or noface
    • 1 or face
  • state: Frame to which the player avatar is to switch just as long as the function is called, in order to make use of any potential parameterized functions applied there.
  • maketarget: Whether to define the target of the called monster-specific attack as the object in the view sight, or the last attacker.
    • 0 or attacker: last attacker (if any) of player becomes target of PlayerThunk attack.
    • 1 or aimtarget: the object in aim sight of player becomes target.
  • useammo: Whether to consume ammo.
    • 0 or nouseammo
    • 1 or useammo

Examples

Notes

Normally map object codepointers can be called directly, but PlayerThunk allows further flexibility by controlling whether to use ammo, among other features.

For state to mean "no state change", it should be set to -1. A value of 0 means S_NULL.

If useammo is set and function is valid, ammo consumption may only be canceled when maketarget is set and no object is currently in sight of player, in which case no call to the function will be made. No such check is made if maketarget is cleared and the player hasn't been attacked.

See also