
Contra
Enemy Attributes
By Trax
trax@bwass.org

--------

General Notes

This is a summary of the attributes that can be modified in the Enemy Data section of any level. The variables used are located in the range 05A8-05B7 inclusively, usually noted "$05A8,X", X being the index of the enemy during gameplay, and represents a single "slot" to which an enemy can be associated.

This document is meant to be a guide when using the Contra editor Red Falcon. The "Type/Attr." row of fields is used to change enemy type and enemy attributes. Outdoor levels (1-3-5-6-7-8) use a value from 0 to 7 (3 bits). Indoor levels (Base 1 and 2) use an entire byte for enemy attributes (8 bits). Bit fields may need to be combined to properly set the right behaviors when an enemy has more than one type of attribute.

Green Guys in indoor levels 2/4 have their own specific set of values that are not related, but similar, to the $05A8 variable. They appear as part of a "cycle" or "pattern", repeated a number of times before they stop appearing in any given room. The cycles data is defined in tables at $0DD3 and $0E09 for level 2 and 4 respectively. They also have their own attributes (6 bits) that are modifiable using the Red Falcon editor.

Enemies Type 00 to 0F are "common" enemies. They can appear in more than one level. Enemies with code >= 10 change according to the level.

--------

Enemy 00 - Weapon Item

.... .xxx	Weapon Type (0-7)

0 = R		Rapid Fire
1 = M		Machine Gun
2 = F		Flame Thrower
3 = S		Spray Gun
4 = L		Laser
5 = B		Invincibility (B for Barrier ?)
6 = Eagle	Destroys Everything on Screen
7 = Undefined	Same as 6, but no graphic

----

Enemy 01 - Enemy Bullet

This enemy is generated by various enemies and should not be used alone
Bullet Type is usually stored into $05B8,X
Placing this enemy type in Enemy Data will result in an immobile bullet

----

Enemy 02 - Weapon Box

.... .xxx	Weapon Type (0-7)

Same as Weapon Item

.... x...	Tile Code after destruction

Code 0-1, index to table at $02F5, 2 bytes per level

----

Enemy 03 - Weapon Zeppelin

.... .xxx	Weapon Type (0-7)

Same as Weapon Item

----

Enemy 04 - Gray Turret

.... ..xx	Bullets per attack (0-3) (index, not actual amount)

Code 0-3, index to table at $0420
Default values : 01 02 03 03

----

Enemy 05 - Running Man

.... ...x	Initial Running Direction (0-1)

..x	Running Direction (0 = Left, 1 = Right)
.x.	?
x..	Shoots Bullets

----

Enemy 06 - Rifle Man

.... .xxx	Type of Rifle Man

0 = Standing	Shoots 3 Bullets
1 = Hides	Shoots 1 Bullet
2 = Hides	Shoots 3 Bullets (gets up when shooting)

Type 2 is used at the top of the first level's boss barricade
Other values yield unpredictable results

----

Enemy 07 - Red Turret

.... ...x	Background Type (0-1)

0 = Rocky Background
1 = Tree Trunks Background

Background type is visible when the Red Turret moves in/out of the ground

----

Enemy 08 - Triple Turret (used in Base 1/2 boss rooms)

No Attributes

----

Enemy 09 - Undefined object, invisible and indestructible

----

Enemy 0A - Wall Plating (used in Base 1/2 boss rooms)

.... ...x	Attribute to be decoded, used as 0 or 1 in original game

----

Enemy 0B - Mortar

This enemy is normally generated by the Scuba Diver (0C) during gameplay, but it can be used as a stand-alone enemy.

.... .xxx	Mortar direction and behavior

0 = Up straight, divide in 3 at top of screen
1 = Up straight, single, low
2 = Up right, single, low
3 = Up left, single, low
4 = Up left slightly, single, very high
5 = Up left, single, very high
6 = Up left more, single, very high
7 = Up left even more, single very high

All initial velocities values are taken from the table at $1F217

----

Enemy 0C - Scuba Diver

No Attributes

----

Enemy 0D - Undefined object, crashes the game if shot

----

Enemy 0E - Turret Man (used in levels 5-6-7)

.... .xxx	Delay Between Shots and Initial Delay (in frames)

Initial Delay (before the first shot) is calculated as:
Attribute Code * 10 + 1

00: 0 * 10 + 1 = 1
01: 1 * 10 + 1 = 11
02: 2 * 10 + 1 = 21
03: 3 * 10 + 1 = 31

Delay Between Shots is calculated as:
Attribute Code * 10 + 30

00: 0 * 10 + 30 = 30
01: 1 * 10 + 30 = 40
02: 2 * 10 + 30 = 50
03: 3 * 10 + 30 = 60

----

Enemy 0F - Turret Man Bullet

Generated by Enemy Type 0E and should not be used alone

--------

Level-Specific Enemies

--------

Level 1

Enemy 10 - Boss Bomb Turret

.... ...x	Background (0 = Wall, 1 = Jungle)

Enemy 11 - Boss Plated Door + Sound Effect (siren) (invisible)

No Attributes

Enemy 12 - 4 Explosions (exploding bridge)

No Attributes

----

Level 2/4

Enemy 10 - Boss Eye

This enemy appears by itself at the end of the level

Enemy 11 - Single Roller

Generated by a Roller Generator (19 or 1A) or a Running Guy (15)

Enemy 12 - Grenade

Generated by Running Guys (15) and Seeking Guys (17)

Enemy 13 - Wall Cannon

.... ..xx	Opening Delay (0-3) (index, not actual amount)

Code 0-3, index to table at $10A4
Default values : 50 80 B0 F0

Enemy 14 - Core

.... x...	Big Core (invisible)
.... .x..	Plated (0 = not plated, 1 = plated)
.... ..xx	Opening Delay (0-3, index, refer to table at $115B)

Enemy 15 - Running Guy

.....xx.	Type (0 = Shoot, 1 = Grenades, 2/3 = Drop Rollers)
.......x	Direction (0 = from right, 1 = from left)

Enemy 16 - Jumping Guy

...x xx..	Weapon Type for Red Guy
.... ..x.	Guy will be Red in second enemy cycle
.... ...x	Direction (0 = from right, 1 = from left)

Enemy 17 - Seeking Guy

.... .xx.	Number of Grenades (0-3)
.... ...x	Direction (0 = from right, 1 = from left)

Enemy 18 - Group of 4

.... ...x	Direction (0 = from right, 1 = from left)

Enemy 19 - Green Guy Generator

No Attributes

Enemy 1A - Roller Generator

.......x	Rollers Pattern (0-1)

Enemy 1B - Sphere Projectile

Generated by the Boss Eye (10)

Enemy 1C - Boss Gemini

No Attributes
This enemy is part of the Enemy Data, is generated right at the beginning of the room, but is not visible until all Wall Platings are destroyed

Enemy 1D - Spinning Bubbles

Generated by the Boss Gemini (1C)

Enemy 1E - Blue Jumping Guy

Generated by the Red/Blue Guys Generator (20)

Enemy 1F - Red Shooting Guy

Generated by the Red/Blue Guys Generator (20)

Enemy 20 - Red/Blue Guys Generator

No Attributes

----

Level 3

Enemy 10 - Rock Platform

.... ...x	Speed (0 = Slow, 1 = Fast)

Fast and Slow Velocities are taken from the table at $180C

Enemy 11 - Moving Flame

Same as Rock Platform

Enemy 12 - Falling Rock Generator

No Attributes

Enemy 13 - Falling Rock

Generated by the Falling Rock Generator

Enemy 14 - Level 3 Boss Mouth

No Attributes

Enemy 15 - Level 3 Boss Arm

.... ...x	Arm's Side (0 = Right Arm, 1 = Left Arm)

----

Level 5

Enemy 10 - Grenade Generator

No Attributes
The original game uses 02-03 but there seem to be no discernable effect

Enemy 11 - Grenade

Generated by the Grenade Generator

Enemy 12 - Tank

Attributes 02-03 used in original game, effect unknown

Enemy 13 - Pipe Joint

No Attribute. Cosmetic enemy only.
The little curved lines seen on pipes when fighting the Tanks and the Boss.

Enemy 14 - Alien Carrier

No Attributes

Enemy 15 - Flying Saucer

Generated by the Alien Carrier

Enemy 16 - Drop Bomb

Generated by the Alien Carrier

----

Level 6

Enemy 10 - Energy Beam Down

.... ..xx	Beam Length Code (0-3) (index, not actual amount)

Code 0-3, index to table at $2A0B
Default values : 05 09 0D 0F
A beam's length (in tiles) is equal to the beam's length value + 1

.... xx..	Delay Between Bursts (0-3) (index, not actual amount)

Code 0-3, index to table at $29C4
Default values : 00 20 40 60

Enemy 11 - Energy Beam Left

Same as Enemy 10

Enemy 12 - Energy Beam Right

Same as Enemy 10

Enemy 13 - Boss Robot

No Attribute

Enemy 14 - Spiked Disk Projectile

Generated by the Boss Robot

----

Level 7

Enemy 10 - Mechanical Claw

.... ..xx	Claw Length (index, not actual amount)

Code 0-3, index to table at $2F2C
Default values : 04 03 08 03

If Claw has Length Code 3, it becomes proximity activated

.... xx..	Delay before going down (index, not actual amount)

Code 0-3, index to table at $2EE1
Default values : 00 20 40 60

Enemy 11 - Raising Spiked Wall

.... ..xx	Delay between emerging steps (index, not actual amount)

Code 0-3, index to table at $3008
Default values : 0C 08 04 02

.... xx..	Code for distance of emergence and subsequent delays

Code 0-3, index to table at $3000, 2 bytes per index
Byte 0: distance of emergence
Byte 1: delay before emerging
Default values :

30 00	first wall (no delay)
50 0F	distance and delay before second wall
70 1E	distance and delay before third wall
40 00	?

Enemy 12 - Spiked Wall

.... ..xx	Index for Tile Codes after destruction

Code 0-3, index to table at $30E6, 3 bytes per index
Byte 0: Y Position of Tile
Byte 1: Tile Code
Byte 3: Y Position of Explosion

Enemy 13 - Cart Generator

No Attribute

Enemy 14 - Cart Moving

This enemy is normally generated by the Cart Generator (13) during gameplay, and using it alone yields unpredictable results.

Enemy 15 - Cart Immobile

No Attribute

Enemy 16 - Armored Door

No Attribute

Enemy 17 - Mortar Launcher

.... ...x	Type of delay before first attack

Delay 0 at $3293 (default 60)
Delay 1 at $3297 (default 10)

Enemy 18 - Enemy Generator

No Attribute

----

Level 8

To be documented...

Enemy 10 - Alien Guardian

No Attribute

Enemy 11 - Alien Foetus

No Attribute
The original game uses 01 but there seem to be no discernable effect

Enemy 12 - Alien Mouth

No Attribute

Enemy 13 - White Sentient Blob

This enemy is normally generated by the Alien Mouth (12) during gameplay, but it can be used as a stand-alone enemy.

Enemy 14 - Alien Spider

No Attribute

Enemy 15 - Spider Spawn

No Attribute

Enemy 16 - Heart

No Attribute

----

// End of Document //

--------
