Enemy
A few of SRB2's various enemies |
---|
In SRB2, enemies (or badniks) are special Objects with artificial intelligence that appear frequently in most Single Player levels. As in most Sonic games, these are generally robots created by Dr. Eggman, the game's main villain. They will normally harm the player on direct contact, or even kill them if they have no rings. However, if the player jumps on an enemy or spins into it, the enemy is destroyed, points are awarded to the player, and a flicky trapped inside the enemy will be freed. In rare cases, enemies will take multiple hits to destroy rather than one.
Players can also destroy enemies by firing projectiles at them, exploding an Armageddon Shield within range of them, or coming into direct contact with them while invincible. Enemies can also be destroyed if they are crushed by moving floors/ceilings or solid Objects, or by coming into contact with death pits; however, no points are awarded to anyone in either case. On the other hand, they are unaffected by any sectors with damaging floors/ceilings nor Instant Kill.
Enemies also have the ability to trigger linedef executors via linedef type 313, a trigger linedef specially designed to activate linedef executors once there are no more enemies in the specified area – i.e. it will not trigger until all enemies in the area have been destroyed or have left the area.
Enemies in SRB2
Greenflower Zone
- Thing type 100: Crawla (Blue)
- Thing type 101: Crawla (Red)
- Thing type 102: Stupid Dumb Unnamed RoboFish
Techno Hill Zone
- Thing type 103: Buzz (Gold)
- Thing type 104: Buzz (Red)
- Thing type 108: Deton – A special type of enemy that is also a type of projectile, exploding on contact with the player, walls, and other Objects
- Thing type 122: Spring Shell (Green)
Deep Sea Zone
- Thing type 109: Skim
- Thing type 113: Jet Jaw
- Thing type 126: Crushstacean
Castle Eggman Zone/Forest Fortress Zone
- Thing type 117: Robo-Hood
- Thing type 118: Lance-a-Bot – A special type of enemy that takes two hits to destroy rather than one
- Thing type 119: Egg Guard – This enemy is equipped with a massive shield protecting its front and so must be attacked from behind to destroy
Arid Canyon Zone
- Thing type 115: Bird Aircraft Strike Hazard
- Thing type 120: Green Snapper – This enemy is specialised to damage players attacking from the side and so must be attacked from above to destroy
- Thing type 121: Minus
- Thing type 134: Canarivore
Red Volcano Zone
- Thing type 123: Unidus
- Thing type 135: Pterabyte
- Thing type 136: Pyre Fly
- Thing type 137: Dragonbomber
Egg Rock Zone
- Thing type 105: Jetty-Syn Bomber
- Thing type 106: Jetty-Syn Gunner
- Thing type 111: Pop-up Turret
- Thing type 112: Spincushion – This enemy is specialised to damage players attacking from above and so must be attacked from the side to destroy
- Thing type 114: Snailer
Note: The disco room in Act 2 contains numerous enemies found in prior zones.
Frozen Hillside Zone
- Thing type 129: Penguinator
- Thing type 130: Pophat
Pipe Towers Zone
- Thing type 1801: Goomba
- Thing type 1802: Goomba (Blue)
Techno Legacy Zone
- Thing type 107: Crawla Commander – Another enemy that takes two hits to destroy
Note: Techno Legacy Zone also contains both variants of the Buzz, as well as Detons.
Haunted Heights Zone
- Thing type 131: Spinbobert
- Thing type 132: Cacolantern
- Thing type 133: Hangster
Aerial Garden Zone
- Thing type 127: Hive Elemental
- Thing type 128: Bumblebore
Azure Temple Zone
- Thing type 124: Buggle
Unused
- Thing type 116: Pointy (formerly in ERZ2)
- Thing type 125: Spring Shell (Yellow) (formerly in THZ1 and THZ2)
- Thing type 138: Banpyura
Note that the Turret and King Bowser are not actual enemy Objects unlike the above, and both cannot be destroyed by normal means.
Score chains
When an enemy is destroyed, 100 points are awarded to the player who did so. If the player manages to destroy multiple enemies in one move, more points are awarded per enemy. The most typical way of doing this is through bouncing off multiple enemies after a single jump, a technique known as "Crawla bouncing". The score chain is broken if the player touches the ground or is climbing a wall (except when invincibility is in effect), resetting the points awarded to 100 each.
Number of enemies | Point value per enemy |
---|---|
1 | 100 |
2 | 200 |
3 | 500 |
4–14 | 1,000 |
15 and above | 10,000 |
Custom enemies
It is possible to make custom enemies for SRB2 with the use of SOCs and/or Lua. To make an Object behave like and be recognised as an enemy, it needs to be given the MF_ENEMY
flag. However, MF_SPECIAL
and MF_SHOOTABLE
are generally also needed as well; MF_SPECIAL
enables the player to bounce on and be harmed by the enemy Object, and MF_SHOOTABLE
allows the Object to be harmed/killed by something, whether or not it is the player. Egg Guard and Minus in particular manipulate these two flags to allow them to be untouchable temporarily.
The only Object properties that affect all enemy behavior are:
PainState
: This is used when an enemy has been hit and still has health points left; this is generally not needed as most enemies have only 1 health pointDeathState
: This is used when an enemy has been hit and has no health left; in general this is set toS_XPLD1
for the enemy explosion. For the enemy to be removed from the map after destruction, this should eventually lead toS_NULL
For multiple-hit enemies, a system to make them temporarily invincible for recovery may be needed to prevent multiple health points being lost from a single hit. This is not present by default however; the Crawla Commander's own recovery system is hardcoded to be used by itself only. Options to get around this can include removal of MF_SPECIAL
and MF_SHOOTABLE
in the pain animation for the reasons already stated above, or otherwise use of Lua if a pain animation is not wanted: for example, a combination of the Lua hooks "ShouldDamage" and "MobjDamage" (and perhaps "MobjThinker") along with a custom variable, explained here:
- "MobjDamage", for handling what happens when the enemy is damaged; a custom variable can be set to an initial value here, to prevent further damage for a set time
- "ShouldDamage", for deciding whether the enemy can be damaged or not; if the custom variable is not 0 yet, the enemy should not be harmed yet
- "MobjThinker", for handling what happens otherwise every tic; the custom variable should be decreased by 1 each time here
Object types | [view] | |
General | Enemy • Boss • Pushable • Spring • Monitor • NiGHTS power-up • Projectile • Ambient sound effect | |
Special | Player • Shields • Flickies • Overlay | |
Related links | List of Object types |