A_CustomPower

From SRB2 Wiki
Jump to: navigation, search

A_CustomPower is an action that gives the target (must be a player) a power-up, and plays SeeSound. The power-up is determined by Var1. Var2 sets the value of the power-up (how much of the power-up the player gets, or the duration). If any of the shield powers are selected using this action, the shield orb for the power given will be automatically spawned if it doesn't already exist on the player.

In SRB2, this action is internally used by linedef type 434, using a dummy MT_NULL Object to call A_CustomPower with the player who triggered it set as the target. The Not Climbable flag checked on this linedef special will make any timer powers infinite in duration – this is achieved in SOCs or Lua scripts using A_CustomPower by setting Var2 to UINT16_MAX (65535), a special value that prevents timer powers from reducing their values.

The custom powers are as follows:

0 pw_invulnerability Sets the Invincibility timer.
1 pw_sneakers Sets the Super Sneakers timer.
2 pw_flashing Sets the temporary invincibility timer (as if the player has just been hit).
3 pw_shield Sets which shield(s) the player currently has. 1
4 pw_tailsfly Sets the amount of time left in the player's flight timer.
5 pw_underwater Sets the player's drowning timer.
6 pw_spacetime Sets the player's space timer.
7 pw_extralife Sets how long the extra life music lasts.
8 pw_super Sets whether the player is Super. The player must still meet the criteria for becoming Super. (Note that this is used internally as a timer for how long the player has been super, in tics.)
9 pw_gravityboots Gives the player Gravity Boots for the given duration.
10 pw_infinityring Sets the Infinity Ring ammo.
11 pw_automaticring Sets the Automatic Ring ammo.
12 pw_bouncering Sets the Bounce Ring ammo.
13 pw_scatterring Sets the Scatter Ring ammo.
14 pw_grenadering Sets the Grenade Ring ammo.
15 pw_explosionring Sets the Explosion Ring ammo.
16 pw_railring Sets the Rail Ring ammo.
17 pw_emeralds Gives the player a specified number of multiplayer Chaos Emeralds. 2
18 pw_nights_superloop Sets the Super Paraloop power-up timer (NiGHTS only).
19 pw_nights_helper Sets the Nightopian Helper power-up timer (NiGHTS only).
20 pw_nights_linkfreeze Sets the Link Freeze power-up timer (NiGHTS only).
21 pw_nocontrol Takes control away from the player. Adding 32768 to Var2's value will allow the player to jump while affected.
22 pw_ingoop Sets whether the player is in Brak Eggman's goop.

1 The values for the shields are as follows:

Name Value Description
SH_NONE 0 No shield
SH_JUMP 1 Whirlwind Shield
SH_ATTRACT 2 Attraction Shield
SH_ELEMENTAL 3 Elemental Shield
SH_BOMB 4 Armageddon Shield
SH_BUBBLEWRAP 5 S3&K Bubble Shield (unimplemented)
SH_THUNDERCOIN 6 S3&K Thunder Shield (unimplemented)
SH_FLAMEAURA 7 S3&K Flame Shield (unimplemented)
SH_PITY 8 Pity Shield
SH_FIREFLOWER 0x100 (256) Fire Flower power-up. Note: This can be combined with any of the other shields.
SH_FORCE 0x200 (512) Force Shield. On its own this flag only gives one health point to the shield – the lower 8 bits can be used as extra health points (max extra health is 0xFF, or 255), e.g. SH_FORCE|1 gives a force shield with 2 health points. Note: This cannot be combined with any of the values SH_JUMP to SH_PITY

2 Var2 defines which multiplayer emeralds are given to the player according to the table below. If you wish to award multiple emeralds at once, add the corresponding values. For example, to award all seven Chaos Emeralds, Var2 should be 127.

1 EMERALD1 Green Emerald
2 EMERALD2 Purple Emerald
4 EMERALD3 Blue Emerald
8 EMERALD4 Light Blue Emerald
16 EMERALD5 Orange Emerald
32 EMERALD6 Red Emerald
64 EMERALD7 Gray Emerald

  Actions – Powers and monitors [view]
A_1upThinkerA_AwardScoreA_BombShieldA_CustomPowerA_EggmanBoxA_ExtraLifeA_ForceShieldA_GiveWeaponA_GravityBoxA_InvincibilityA_JumpShieldA_MixUpA_MonitorPopA_PityShieldA_RecyclePowersA_RingBoxA_RingShieldA_SuperSneakersA_WaterShield