A_CustomRailgun

From ZDoom Wiki
Jump to: navigation, search

A_CustomRailgun (int damage [, int spawnofs_xy [, color ringcolor [, color corecolor [, int flags [, bool aim [, float maxdiff [, str pufftype[, float spread_xy[, float spread_z [, fixed range [, int duration [, float sparsity [, float driftspeed [, str spawnclass [, float spawnofs_z]]]]]]]]]]]]]]])


A customizable railgun attack for monsters.

Parameters

  • damage: The damage to inflict; this can be a fixed value or an expression.
  • spawnofs_xy: The horizontal offset (from the actor's center) where the railgun will emerge from. Negative values shift the beam to the actor's left, positive values shift it right.
  • ringcolor: The color of the particles that form the spiral "ring" of the beam. You can use "none" to have no ring. The string can be a color defined in the X11R6RGB lump. If the string is invalid, the particles will be black.
  • corecolor: The color of the particles that form the central "core" of the beam. You can use "none" to have no core. The string can be a color defined in the X11R6RGB lump. If the string is invalid, the particles will be black.
  • flags: The following flags can be combined by using the | character between the constant names:
    • RGF_SILENT — Silent: The railgun will not play an attack sound when firing.
    • RGF_NOPIERCING — Not piercing: The railgun will stop at the first enemy hit, rather than passing through.
    • RGF_EXPLICITANGLE — Explicit angle: The spread parameters are taken as explicit angles rather than maximum random amplitude.
    • RGF_FULLBRIGHT — Full bright: Rail particles will be rendered at maximum brightness, ignoring sector lighting.
    • RGF_CENTERZ — (Need more info)
  • aim determines which aiming mode to use:
    • 0: The monster shoots in the direction it is looking.
    • 1: The monster aims at its target.
  • maxxdiff: This is used to make the rail more jagged, or lightning-like, with higher numbers. This also affects the accuracy of the shot. Default is 0 (straight).
  • pufftype: The puff actor to use. By default, the puff will only spawn in rare circumstances (e.g. when hitting a dormant monster) unless the puff actor has the ALWAYSPUFF flag set. Even if not shown, the selected puff will still be used for applying custom damagetypes and other properties.
  • spread_xy: Maximum angle of random horizontal spread. Defaults to 0.
  • spread_z: Maximum angle of random vertical spread. Defaults to 0.
  • range: Maximum distance (in map units, as fixed-point) the rail shot will travel before vanishing. Default is 8192 units, and a value of zero means "use default."
  • duration: Lifetime of spawned particles, in tics. Default is 35, and a value of zero means "use default."
  • sparsity: Distance between individial particles. Implemented as a float multiplier, with 1.0 as the default.
  • driftspeed: Speed at which particles "drift" away from their initial spawn point. Implemented as a float multiplier, with 1.0 as the default.
  • spawnclass: Actor to spawn in place of trail particles. If non-null, the specified actor will be spaced sparsity units apart instead of the usual trail. Particle-specific properties such as duration, driftspeed, and rail color are ignored in such a case.
  • spawnofs_z: The vertical offset (from the actor's center) where the railgun will emerge from. Negative values shift the beam down, positive values shift it up. Default value is 0. (New from 2.7.1)

The colors (for ringcolor and corecolor) can be specified as RRGGBB (hexadecimal) or as a color name such as Blue or Green

Examples

This arachnotron uses a rail attack which deals 65 points of damage and has a white core and a blue ring.

ACTOR RailArachnotron : Arachnotron
{
  States
  {
  Missile:
    BSPI A 17 Bright A_FaceTarget
    BSPI G 4 Bright A_CustomRailgun(65, 0, "Blue", "White") //Equivalent to A_CustomRailgun(65, 0, 0000FF, FFFFFF)
    BSPI H 4 Bright
    Goto See
  }
}