--- Sonic Robo Blast 2 - Retro Bossses + Maces and Chains Resource ---

This text document will guide you through the steps of properly setting up these 
bosses and the "secret" 2.1/2.0 mace system.

If you plan to use anything from this PK3, please do not include this document. 
Additionally, everything in the SOC, Music, Maps, and Graphics folders are not 
required for these assets to work in a different mod.

(Most of this information comes from the SRB2 Wiki)

-- COMMONALITIES --

By default, all of these bosses will cause an Egg Capsule to appear upon death, 
if it is set up. If any boss has the "Special" flag set (in Binary maps), the 
stage will immediately end upon death, instead.

There are certain Lua files included in this pack that are required for certain 
bosses to work. Here is a list:

LUA_CMMN - Used by all bosses except for 2.1 and 2.0 Brak Eggman
LUA_OJTF - Used by 2.1 and 2.0 Egg Mobile, and 2.1 Metal Sonic
LUA_EMCM - Used by 2.1 and 2.0 Egg Mobile
LUA_ENCM - Used by 2.1 and 2.0 Egg Slimer
LUA_EOCM - Used by 2.1 and 2.0 Sea Egg
LUA_OMCE - Used by 2.1 Eggscalibur
LUA_BECM - Used by 2.1 and 2.0 Brak Eggman

-- EGG MOBILE (Greenflower Boss) --

** 2.0 Version **

Thing Type = 4050

This boss spawns 33 fracunits above the ground, unless its Z position is 
overridden. Adding the "Ambush" flag (in Binary maps) will spawn a spike ball 
shield around the boss, akin to the pre-2.1 CEZ boss.

** 2.1 Version **

Thing Type = 4040

This boss spawns 128 fracunits above the ground, unless its Z position is 
overridden. Adding the "Ambush" flag (in Binary maps) will disable the 
horizontal aiming of the laser attack.

** Both Versions **

The file LUA_EMCM is required for both versions to work, as it freeslots and 
defines sprites and states that are used in them. If you plan to use both bosses 
in the same WAD/PK3, you only need to copy this file once. Regardless, it must 
be loaded before either.

-- EGG SLIMER (Techno Hill Boss) --

** 2.0 Version **

Thing Type = 4051

Setting the "Extra" flag (in Binary maps) on the boss's map Thing will change 
its behavior to that of its pre-1.09.4 version. This version will still look for 
an axis, but it will use its own hardcoded radius instead. It will also not 
speed up when hit, regardless of the setting chosen.

By default, the boss will go into its pogo state if it does not find an axis. To 
prevent this (and instead make the boss die instantly), set the map Thing's 
parameter to 1 (in Binary maps).

** 2.1 Version **

Thing Type = 4041

** Both Versions **

This boss's setup is nearly identical to 2.2's version, so instead, here's a 
link to the current boss's object page on the wiki: 
https://wiki.srb2.org/wiki/Egg_Slimer

The file LUA_ENCM is required for both versions to work, as it freeslots and 
defines sprites and states that are used in them. If you plan to use both bosses 
in the same WAD/PK3, you only need to copy this file once. Regardless, it must 
be loaded before either.

-- SEA EGG (Deep Sea Boss) --

** 2.0 Version **

Thing Type = 4052

In Binary maps, this version makes use of the LE_PINCHPHASE tag to raise the 
water, and the LE_BOSSDEATH tag to lower the water. Both tags are used in the 
example map.

In UDMF, the user can set their own tags for when the boss enters its pinch 
phase and when it dies.

** 2.1 Version **

Thing Type = 4042

** Both Versions **

This boss behaves quite differently from its 2.2 counterpart. It requires a 
network of 6 to 16 waypoints, each numbered using their Angle value. This boss 
goes straight to the waypoint with an Angle (Argument 1/Sea Egg sequence in 
UDMF) of 0, then randomly decides on a waypoint with an Angle between 1 and 5. 
The next waypoint it goes to is determined by the Parameter value (Tag in UDMF) 
or Thing type number given to the current waypoint (The Thing type number is 
calculated as 292, plus the Angle of the next waypoint multiplied by 4096).

When this boss reaches the waypoint with Angle 0 again, it chooses another 
random waypoint with an Angle between 1 and 5, repeating the process. It will 
fire torpedoes at the player when it's stationed at a waypoint with the "Ambush" 
flag set (Argument 9 in UDMF).

The file LUA_EOCM is required for both versions to work, as it freeslots and 
defines sprites and states that are used by both versions. If you plan to use 
both bosses in the same WAD/PK3, you only need to copy this file once. 
Regardless, it must be loaded before either.

-- EGGSCALIBUR (Castle Eggman Boss) --

Thing Type = 4043

This boss makes use of a cage made out of FOFs that it can raise and lower 
during the fight. Please note that the FOF control sectors will need the tag 
65534 for this to work.

In UDMF, the user can specify what tag to use for the cage FOFs.

This boss makes use of the ported 2.1 mace system, which uses a slightly 
different setup compared to 2.2's mace system. As such, it requires LUA_OMCE to 
function properly. Look further below for an in-depth explanation on how to set 
these up.

-- METAL SONIC (Egg Rock Boss) --

Thing Type = 4048

This boss will need "gather points" (same as the 2.2 version) placed on the map 
to be able to use his energy ball attacks. Otherwise, he will resort to his 
other methods of attack.

-- BRAK EGGMAN (Egg Rock Core Boss) --

** 2.0 Version **

Thing Type = 4056

This boss uses a network of five boss waypoints to determine where it can jump 
to and stand on. When a player is hit by the boss's goop, the boss will jump 
to the waypoint closest to that player. The boss will interpret a waypoint with 
no flags as the "center" platform, and it will be ignored after the sixth hit. 
After it throws missiles, the boss will jump to the center platform if it is not 
already on it or it is not disabled. Otherwise, it will jump to a random 
platform instead.

The five waypoints should have these flags set (only in Binary):

Waypoint 1 = No Flags
Waypoint 2 = Extra
Waypoint 3 = Flip
Waypoint 4 = Extra and Flip
Waypoint 5 = Special

In UDMF, the user can specify each waypoint's number by using the "Brak Eggman 
sequence" argument.

*** IMPORTANT NOTES ***

This boss needs the "Special" flag (in Binary maps) to be set on its map Thing 
if there is no egg capsule. Otherwise, the stage will not end.

In binary maps, this boss will automatically scale to twice the default in a 
level (2*FRACUNIT in regular levels, FRACUNIT in "OldBrak" levels). This 
behavior can be disabled if the "Extra" flag is set on the map Thing's flags.

In UDMF maps, the user can set the boss's scale by disabling automatic scaling 
in the map Thing's "flags" under the "Args" tab.

** 2.1 Version **

Thing Type = 4049

This boss gains an eletric shield when the "Ambush" flag is set. It also makes 
use of the LE_BRAKVILEATACK tag, which is used in the example map to raise the 
barriers when Brak begins his "sniping attack". Otherwise, this boss functions 
identically to its 2.2 counterpart, with the exception of its death behavior 
(it doesn't get flung off the arena).

** Both Versions **

The file LUA_BECM is required for both versions to work, as it freeslots sprites 
that are used in them. If you plan to use both bosses in the same WAD/PK3, you 
only need to copy this file once. Regardless, it must be loaded before either.

-- 2.0/2.1 MACE SYSTEM --

** Thing Types **

3104 = Old Spinning Mace Spawnpoint
3105 = Old Swinging Mace Spawnpoint
3106 = Old Hanging Chain Spawnpoint
3107 = Old Spinning Chain Spawnpoint
3108 = Old Hidden Chain Spawnpoint

Setting the "Ambush" flag on any of the chain spawn Things will make them use 
the "big" maces/chains rather than the smaller ones.

Setting the "Extra" flag on any of the chain spawn Things (besides the hidden 
sling) will make them use the 2.0 maces/chains rather than the 2.1 versions.

Linedef type 9 is used for setting up maces in Binary maps, just like 2.2. 
However, the parameters to pass in are slightly different from 2.2's maces:

	*Linedef tag*
	Should be set to the Angle of the mace/chain you are controlling.

	*Floor height*
	Determines the spinning/swinging direction of the mace/chain.
	(For swinging maces/chains, this is limited to instances where all 
	maces/chains in a control sector are given the same properties)

	*Ceiling height*
	Spinning maces/chains - Determines the maximum speed in FRACUNITs per 16 tics.
		(NOTE: This should be the value you would put for the chain's normal speed multiplied by 16.
		ex. Normal speed is 4, desired maximum speed is 16, multiply that by 16, use 256 as the maximum speed)
	Swinging maces/chains - Determines the swinging angle
	Both - Setting this to 0 makes the mace/chain stationary

	*Linedef X distance*
	Determines the number of chain links in the mace/chain.
	
	*Linedef Y distance*
	Determines the speed of the mace/chain in FRACUNITs per tic (0 is stationary).
	
	*Front texture X offset*
	Spinning maces/chains - Determines the spinning direction 
		(between 0 and 359; 0 and 180 are vertical, 90 and 270 horizontal)
	Swinging maces/chains - Determines the spawn angle
	
	*Front texture Y offset*
	Spinning maces/chains - Determines the swinging direction
		(between 0 and 359; 0 and 180 are vertical, 90 and 270 horizontal)
	Swinging maces/chains - Determines the spawn angle 
		(between 0 and 359; 0 is east)
	
	*Not Climbable linedef flag*
	When set, this lets the player change the direction of the spinning chains 
	ONLY. This has been changed from 2.1, where the flag disabled this behavior, 
	in order to stay consistent with 2.2's spinning chains.
	
	*Repeat Midtexture linedef flag*
	When set, this prevents the tagged chain/mace from performing distance 
	checks on players. When unchecked, the chain/mace disables its movement when 
	there are no players near it to reduce CPU load. This option was not present 
	in 2.1 and has been added from 2.2 as a "Quality-of-Life" improvement.

Most of these options can be set under the object's "Args" tab in Ultimate Zone 
Builder for UDMF maps.

The "Hidden Sling" chain should be used alongside a control linedef of type 442 
in order for it to appear in-stage by changing its state.
