tyrian.hdt:

// episode 1 data offset:
episode1DataLoc:32

[at episode1DataLoc]
// Note: Tyrian doesn't actually use these, they are hardcoded in the source for some reason.
WEAP_NUM:16 = 780
PORT_NUM:16 = 42
POWER_NUM:16 = 6 (Note: SPECIAL_NUM isn't on the file)
SHIP_NUM:16 = 13
OPTION_NUM:16 = 30
SHILED_NUM:16 = 10
ENEMY_NUM:16 = 850

// Size in bytes: 0x50
// Bullet patterns
struct weapons {
	drain:16 // Filler, not used
	shotRepeat:8 // Rate of fire (lower == faster)
	multi:8 // How many to shoot at once (use to shoot multiple pattern frames at once)
	weapAni:16 // Number of frames in the animation (0 == 1 frame, 1 == 2 frames, ...)
	max:8 // Number of pattern frames (better explanation needed =P it cycles thru the 8x arrays)
	tx:8 // TODO: Not used in player
	ty:8 // TODO: Not used in player
	aim:8 // Homing ability, the bigger the number, the more the shot can turn

	// There's one of these for each frame
	8x attack:8 // Attacking power and effect (99 == Ice, >=250: Attacking power is attack-250 and goes thru enemies)
	8x del:8 // Shot life (how long before it disappears)
	8x sx:s8 // Horizontal speed
	8x sy:s8 // Vertical speed
	8x bx:s8 // Horizontal offset
	8x by:s8 // Vertical offset
	8x sg:16 // Shape number (graphics)

	acceleration:s8 // Vertical acceleration
	accelerationx:s8 // Horizontal acceleration
	circleSize:8 // Perturbs the weapons travel:
		// 0-19: Circle (radius)
		// Other produce varying results, experiment (pattern changes roughly ever 20 steps)

	sound:8 // Sound the effect makes (0 == no sound)
	trail:8 // Shot trail effect (0xFF == none, 0x62 == smoke, others == various or garbage, experiment)
	shipBlastFilter:8 // TODO: Not sure, but probably has something to do with the color enemies get after being hit
} WEAP_NUM+1 (780+1)

// Weapons:
struct weaponPort {
	str_len:8 = 0x1E // Pascal string length, leave alone
	name:str30 // Weapon name
	opnum:8 // How many firing modes weapon has. (1 or 2, only really works for rear guns)
	2x { // Weapon patterns (What it does, it's an index into the weapons structure). One for each firing mode.
		11x op:16 // Each entry corresponds to a power level
	}
	cost:16 // How much does the weapon cost. Upgrades are calculated off this.
	itemGraphic:16 // Weapon graphic in the shop.
	powerUse:16 // Power drain when firing
} PORT_NUM+1 (42+1)

// Special moves, those things that show up in the upper left corner with a fake charging bar
struct special {
	str_len:8 = 0x1E // Pascal string length, leave alone
	name:str30 // Name
	itemGraphic:16 // The graphic that's displayed during gameplay
	pwr:8 // Time needed between recharges, may be overridden
	sType:8 // Determines the type of the special: TODO
	wpn:16 // Argument used for some kinds of sType
} SPECIAL_NUM+1 (46+1)

// Generators
struct powerSys {
	str_len:8 = 0x1E // Pascal string length
	name:str30 // Name
	itemGraphic:16 // Graphic that's displayed in the shop
	power:s8 // Amount of power provided by generator
	speed:8 // Unused
	cost:16 // Cost in shop
} POWER_NUM+1 (6+1)

// Ships
struct ships {
	str_len:8 = 0x1E // String length
	name:str30 // Name
	shipGraphic:16 // Graphic used in-game
	itemGraphic:16 // Graphic in shop
	ani:8 // Sets the threshold for when to change to the turning frames
	spd:s8 // Unused
	dmg:8 // amount of armor ship has
	cost:16 // Cost in shop
	bigShipGraphic:8 // Big graphic displayed on the left while in shop
} SHIP_NUM+1 (13+1)

// Sidekicks
struct options {
	str_len:8 = 0x1E // String length
	name:str30 // Name
	pwr:8 // Number of charge stages
	itemGraphic:16 // Graphic in shop
	cost:16 // Cost in shop
	tr:8 // Position and movement of sidekick
		// 0: Attached to side of ship
		// 1: Follower ship with turning graphics
		// 2: Attached to front of ship (player can "launch" if right sidekick)
		// 3: Follower ship with normal graphic
		// 4: Orbits around ship
	option:8 // Determines animation for ship
		// 0: Invisible
		// 1: Constantly animating
		// 2: Animates when firing
	opspd:s8 // Unused
	ani:8 // Number of frames in animation
	20x gr:16 // In-game sprite for each animation frame
	wport:8 // Weapon used for power usage, etc (index into weaponPort array)
	wpnum:16 // Bullet pattern (index into weapon array)
	ammo:8 // Amount of ammo
	stop:8 // Unused
	iconGr:8 // Icon in ammo indicators
} OPTION_NUM+1 (30+1)

struct shields {
	str_len:8 = 0x1E // String length
	name:str30 // Name
	tpwr:8 // Generator power needed to charge
	mpwr:8 // Amount of protection
	itemGraphic:16 // Item icon in shop
	cost:16 // Cost in shop
} SHIELD_NUM+1 (10+1)

// Enemy definitions (warning: some of this may be wrong)
struct enemyDat {
	ani:8 // Number of frames in animation
	3x tur:8 // Type of shot to fire (index into weapon) (1st: downwards, 2nd: right, 3rd: left)
	3x freq:8 // Wait between shots
	xmove:s8 // Horizontal speed
	ymove:s8 // Vertical speed
	xaccel:s8
	yaccel:s8
	xcaccel:s8 // Horizontal acceleration, more is less
	ycaccel:s8 // Vertical acceleration
	startx:s16
	starty:s16
	startxc:s8
	startyc:s8
	armor:8
	esize:8
	eGraphic:16
	explosionType:8
	animate:8
	shapeBank:8
	xRev:s8
	yRev:s8
	dgr:16
	dLevel:s8
	dAni:s8
	eLaunchFreq:8
	eLaunchType:16
	value:s16
	eEnemyDie:16
} ENEMY_NUM+1 (850+1)
