Projectile

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.


Projectiles

Projectiles, also commonly known as missiles, are special Objects in SRB2 that are generally designed to be fired, tossed, or thrown at something, for instance the players themselves. In general, projectiles will explode or be destroyed on contact with any floors, walls, and solid objects, inflicting damage on any damageable objects they hit if any. If projectiles hit the sky however, they will simply be removed from the map instead of exploding.

For projectiles themselves, their target Object is treated as the Object that fired it (whether or not it actually did), preventing them from colliding with the Object. However, this means that a number of the actions pre-existing that target an Object should not be used if the missile is meant to home in on the Object; for this reason, the projectile should set the Object as the tracer instead, and an appropriate action that homes in on the tracer used instead.

Projectiles will never have any friction applied to them whatsoever, even when they can collide with the floor. They will also be able to pass through non-solid linedefs with either Flag [0] / Impassable or Flag [1] / Block Enemies checked on them.

Projectiles in SRB2

Nearly all projectiles in SRB2 are not actually Things for placement on the map, so they are listed here by Object type instead:

Object type Name Description
MT_DETON Deton A special type of projectile that is also a type of enemy.
MT_EGGMOBILE_FIRE Egg Mobile laser fire trail Is not intended to move, but can still damage players.
MT_BLACKEGGMAN_GOOPFIRE v2.0 Brak Eggman goop Does not explode on collision with objects or the floor, instead it traps any players touching it until it disappears.
MT_BLACKEGGMAN_MISSILE v2.0 Brak Eggman missile A special type of projectile that the player can jump on and ride.
MT_CYBRAKDEMON_MISSILE v2.1 Brak Eggman missile
MT_CYBRAKDEMON_FLAMESHOT v2.1 Brak Eggman flame
MT_CYBRAKDEMON_NAPALM_BOMB_LARGE v2.1 Brak Eggman large bomb
MT_CYBRAKDEMON_NAPALM_BOMB_SMALL v2.1 Brak Eggman small bomb
MT_CYBRAKDEMON_NAPALM_FLAMES v2.1 Brak Eggman bomb flame
MT_SPINFIRE Elemental Shield's fire trail Is not intended to move, but can still damage players/enemies.
MT_ROCKET Snailer missile
MT_LASER Egg Mobile laser
MT_TORPEDO Sea Egg torpedo
MT_TORPEDO2 Fake Sea Egg torpedo
MT_MINE Jetty-Syn Bomber's/Skim's mine A type of projectile that is dropped instead of thrown.
MT_JETTBULLET Jetty-Syn Gunner's/Pop-up Turret's bullet
MT_TURRETLASER Turret laser
MT_CANNONBALL Launched Cannonball
MT_ARROW Robo-Hood arrow Can adjust its state depending on direction.
MT_DEMONFIRE Trapgoyle fireball
MT_FLAMEJETFLAME Flame Jet flame
MT_FLAMEJETFLAMEB Spinning Flame Jet flame
MT_REDRING Thrown red ring/Rail Ring
MT_THROWNBOUNCE Thrown Bounce Ring
MT_THROWNINFINITY Thrown Infinity Ring
MT_THROWNAUTOMATIC Thrown Automatic Ring
MT_THROWNSCATTER Thrown Scatter Ring
MT_THROWNEXPLOSION Thrown Explosion Ring
MT_THROWNGRENADE Thrown Grenade Ring
MT_FIREBALL Fire Flower fireball Unlike most projectiles, this bounces off floors instead of exploding on contact with them.
MT_KOOPAFLAME King Bowser's flame
MT_NAMECHECK Seenames helper Technically this is a projectile, as it is shot at players to get their names, though it should not be used outside of its intended purpose.

Several other Object types are treated by the game like projectiles, but do not have the MF_MISSILE flag unlike the Object types listed above. Typically they have the MF_PAIN flag instead, making them harmful only to the player. These are as follows:

Object type Name Description
MT_UNIBALL Unidus's spike ball These are detached from the Unidus and are destroyed on contact with Objects or walls due to the action A_UnidusBall.
MT_EGGMOBILE_BALL Egg Mobile's spike ball Same as with MT_UNIBALL, except for the Egg Mobile.
MT_GOOP Egg Slimer goop On contact with the floor, these will stop moving. These will not disappear on their own by default; this occurs because A_Boss2Chase and A_Boss2Pogo give them a fuse of 10*TICRATE when they are spawned.
MT_ENERGYBALL Metal Sonic energy ball These will not be destroyed on contact with other Objects or walls, and will pass through floors/ceilings.
MT_HAMMER King Bowser's hammer These will disappear from the map on contact with the floor.

Custom projectiles

It is possible to make custom projectiles for SRB2 with the use of SOCs. To make an Object behave like a projectile, it needs to be given the MF_MISSILE flag.

Object flags

A number of others object flags may be given for extra effects for projectiles:

  • MF_NOCLIPTHING: When a projectile has exploded once, this will be automatically set to its flags to prevent the Object from exploding again.
  • MF_GRENADEBOUNCE: Instead of exploding on collision with the floor, the projectile will bounce off it instead, playing the Object's ActiveSound for every collision until it stops bouncing.
  • MF2_BEYONDTHEGRAVE: This is automatically given to projectiles for whom the original player object that fired it has since respawned after dying.
  • MF2_DEBRIS: Projectiles with this flag will not play DeathSound when exploding.
  • MF2_SUPERFIRE: Normally projectiles will not affect super players, but when projectiles have this flag they can stun them and knock them back for a small distance.
  • Some of the weapon ring flags will also affect the knockback strength of a projectile for when it hits a player:
    • MF2_RAILRING: Increases knockback strength greatly to 45 FU/tic; combined with MF2_EXPLOSION this is reduced to 38 FU/tic.
    • MF2_EXPLOSION: Increases knockback strength greatly to 30 FU/tic; combined with MF2_RAILRING this is increased further to 38 FU/tic.
    • MF2_SCATTER: Knockback strength depends on distance the projectile is from the firer: weakest is 4 FU/tic, strongest is 128 FU/tic. Overrides MF2_RAILRING/MF2_EXPLOSION knockback.

Object properties

The following properties control some of the projectile's behavior:

  • SeeSound: Most actions and similar that are associated with firing projectiles will usually play this sound when an Object has been fired using them; however this can in fact apply for non-projectiles as well as projectiles themselves, but it is assumed that the latter particularly are to be fired by them anyway.
  • DeathState: When a projectile collides with anything other than its target, this will be used for the projectile's explosion as it should then disappear from the map afterwards normally; the projectile's DeathSound will also be played in this situation.
  • Speed: The speed at which projectiles are fired at by most actions etc; same applies to this as with SeeSound however.
  • ActiveSound: the sound played when a projectile with MF_GRENADEBOUNCE collides with the floor.

Related actions

  Object types [view]
General EnemyBossPushableSpringMonitorNiGHTS power-upProjectileAmbient sound effect
Special PlayerShieldsFlickiesOverlay
Related links List of Object types