---
F-Zero Expansion for HPMod
---
//by RetroStation

//What is it?
F-Zero is an expansion module for HPMod which replicates mechanics from the F-Zero games. Press Custom2 after Lap 2 to boost! Offers two modes, Standard and Classic.

//Thanks
Kart Krew for making SRB2 Kart and introducing the V2 ring mechanic.
Ang for answering 90% of my lua-related questions (this is not an exaggeration; I asked him a LOT).
Callmore for HPMod; this mod literally wouldn't exist without it.
DarkyBenji for Announcer SFX.
Motobugger for originally making the suggestions that led to this mod.
Scott Falco for streaming the mod and providing suggestions/feedback.
PKTheThird for telling me about Scott's stream.
Every single player who joined F-Zero sessions to playtest.


//Intended Gameplay
Please set the following HPMod commands:
hpmod_wallbonkdamage on
hpmod_maxhp 75
hpmod_maxhpperplayerminplayers 15

//How To NYOOOOOM
After Lap 2 (or at the start of 1-lap maps), Boost Power becomes available, indicated by either a message in chat, or the famous "YOU GOT BOOST POWER" audio clip. Press Custom2 to activate Boost Power and gain an increase in speed and acceleration, at the cost of 2HP/s. There is a 17-tic cooldown in between manual toggles to prevent accidentally spamming the input.

//Boost Power
While Boost Power is active, in addition to gradual HP loss, you will also leave a sparkle trail behind you. Boost Power remains active until you either manually toggle it off, or if you trip one of the safety checks (to prevent additional damage via Boost Power or prevent Grow from being more powerful than it is):
- Driving into offroad sectors without offroad-ignoring items (Invincibility, Hyudoro, Sneaker effects)
- During Grow
- Holding a banana, Eggman, or mine behind you (Allowing Boost Power here would defeat the purpose of the speed penalty incurred by holding these items behind you)
- Falling off the map
- Being hit with a hazard or an item

Boost Power offers speed and acceleration bonuses depending on your position and your Speed stat. Accel characters like Tails gain a higher acceleration bonus than faster characters like Flicky. 1SPD characters gain a 25% bonus to acceleration, while 9SPD only gain a 10% bonus. Characters in between gain a bonus on a linear basis (e.g. 5SPD gains a 17.5% bonus). 1st place's top speed will be 25% less than the rest of the pack to allow everyone else to catch up. So, 1st place will have +75%/+100% top speed in Standard/Classic respectively compared to the rest of the pack (listed below in Modes).

//Offroad and Walls
Driving into walls or offroad sectors unprotected will deal damage. Wall damage is proportionate to speed, while offroad sectors deal variable damage: 2HP/s (Standard), or 4HP/s (Classic). If you are thrown into offroad by an item or hazard, you will not incur offroad damage until you recover from spinout.

//Healing
Driving over boost sectors and collecting objects that grant items (Item boxes, hot air balloons, item panels) will heal you at variable rates. Boost panels will heal you at 1HP/tic, allowing better healing on longer sectors. Item objects grant you either 10HP(Standard) or 15HP(Classic).

//SPB Heal Denial
If you are being targeted by an SPB, you will retain the ability to boost but cannot heal. Additionally, players behind you will recover health at 1HP/s to help them catch up.

//Modes
Standard - Kart mixed with F-Zero. Managing you health is important here, since having 0HP will eliminate you from the race. Boost Power is +100% speed.

Classic - True F-Zero. No Items, but item objects now heal for more, and Boost Power is +125% top speed! Additionally, if your HP falls to 5 or less, your top speed will drop to 90%, so drive safely!

//Server Commands (requires admin)
fz_enabled - Toggles whether F-Zero mechanics are enabled.
fz_classic - Toggles Classic mode. Off is Standard Mode.

//WARNING
PLEASE DO NOT RUN THE FOLLOWING MODS, AS F-ZERO WAS NOT DESIGNED TO WORK WITH THEM
- CombiRing
- Team Sonic Racing
- F-Zero GX Announcer


//CHANGELOG


---
V3
---

==Adjustments==
*Boost Power has been overhauled and is now tied to k_speedboost instead of k_boostpower. This makes map and item interactions more consistent.
*Characters now gain an accel boost during Boost Power, proportionate to their speed stat. Ranges from 10-25%, 9-1SPD respectively in even increments.
*Sneaker/Boost sectors, Drift Boosts, and Invincibility now have their k_accelboost values hardcoded during Boost Power to prevent Boost Power's accel boost from overriding a better bonus.
*Grow now completely ignores offroad and has the same accel bonus as Invincibility (+300%), at the cost of being unable to use Boost Power. This makes Grow less situational while also preventing it from making Invincibility weaker by comparison.

==Visuals==
*A status indicator next to your HP Bar will now convey several icons depicting Boost Power state. This allows players to check their Boost Power status during Invincibility in particular, as Boost Power's sparkle trail blends with Invincibility.
-Steady static: Boost Power not ready (Either Lap 1 or during cooldown).
-Flame Shield: Boost Power Ready.
-Sparkles: Boost Power active.
-Eggman: Uh-oh.


//PREVIOUS VERSIONS


---
V2
---

==Mechanics==
*Boost Power is now a toggle, rather than being held. 17tic cooldown between button presses to avoid accidental double-toggles.
*HP drain is now 2HP/s (from 3)
*Additional safety checks to accompany the new toggle.
*SPB Rush now heals anyone who either isn't 1st or the SPB target at 1HP/s, even when boosting.
*Offroad Damage reduced to 2HP/s (Standard), 4HP/s (Classic) (from 5, 10 respectively). This makes it less punishing for people who get yeeted square into offroad.
*Standard Item object now heal for 10HP (from 5).
*Classic Item objects now heal for 15HP (from 5), but now have a cooldown. This is to prevent the first person to reach an item set from clearing house.
*You now have unlimited boost power while using Grow, Hyudoro, or Invincibility.
*Grow is now immune to offroad. You will still hear offroad sound effects, but the offroad speed penalty will not apply.

==Audio==
*F-Zero GX Announcer, thanks to DarkyBenji.
*Audio indicator when Boost Power is active.

==Visuals=
*Activating Boost Power now gives you a sparkle trail as a visual indicator, but no longer spawns a boost trail, to eliminate confusion as to whether someone is under the effects of a sneaker boost (hello, Sneaker Ramming).

==Cross-Mod Support==
*Boost Power is adjusted to support Marsh's F-Zero maps. Additionally, recharge sectors in F-Zero maps now heal at the same rate as boost sectors.
*Boost Power is amplified and enabled at the start of Dreamscape Garden's KAR Drag Race 3.


---
V1.1-hotfix
---
*Added a special check for 1-lap maps, such as KAR Drag Race 3. Boost Power is 250% speed, +400% accel and is available from the start.


---
V1.1
---
*SPB Heal denial rewritten to allow compatibility with Acrobatics' trick denial.
*Boost Power is now set to CUSTOM2 and can be used when in possession of an item, but not if you're holding it behind you (Banana, Eggbomb). This now allows compatibility with Hornmod and Acrobatics' Store style.
*Boost sectors' additional speed/accel bonus normalized to prevent ramps with multiple boost sectors (Grand Metropolis, Boiling Bedrock) from sending you off the map.


---
V1
---
Initial Message Board Release.