feat: Free Bat Flight, the old bat flight as a choice
The old bat flight is back as Free Flight: vanilla debug fly, up to 50 m/s, no stamina and no weight limit, Jump rises and Left Ctrl sinks. Each player picks it with Aswid - Bat Form / Free Bat Flight (local, never synced). The synced Bat Flight Rule (PlayerChoice, AlwaysStaminaFlight, AlwaysFreeFlight) lets the host or server decide for everyone. The mode is read when the form goes up, so a change counts from the next transform. Debug fly makes vanilla treat the player as absent: no monster sees, hears or wakes for them, and hits are dropped. The six patches removed in v1.6.1 are back in AswidBatForm, for bats only and with no switch, so a free bat is fast but not invisible or immortal. Turning flight off now clears both flags, so death and reset end either flight. The compendium shows the Free Flight line when it is the active mode. Asked for by MrBiffty, who builds tall with the bat.
This commit is contained in:
parent
fc5d6b8abc
commit
6f439f37c3
8 changed files with 176 additions and 23 deletions
|
|
@ -74,8 +74,24 @@ namespace RacesOfValheim
|
|||
// The bat flies on the same directed flight as the Skadi's drakes (DirectedFlight.cs),
|
||||
// with its own numbers. It used to fly on vanilla's debug-fly flag: 50 m/s, free, blind
|
||||
// to carry weight, and ignored by every monster until AswidBatAggro lied to six vanilla
|
||||
// methods about it. None of that is left.
|
||||
// methods about it. The old flight came back as Free Flight, for players who want it
|
||||
// (building tall); AswidBatForm holds the aggro patches it needs.
|
||||
public enum EncumberedMode { Allowed, Blocked }
|
||||
public enum BatFlightRuleMode { PlayerChoice, AlwaysStaminaFlight, AlwaysFreeFlight }
|
||||
|
||||
public static ConfigEntry<bool> FreeBatFlight;
|
||||
public static ConfigEntry<BatFlightRuleMode> BatFlightRule;
|
||||
|
||||
/// <summary>Which flight a bat taken now gets: the server's rule first, then the player's own pick.</summary>
|
||||
public static bool UsesFreeBatFlight()
|
||||
{
|
||||
switch (BatFlightRule.Value)
|
||||
{
|
||||
case BatFlightRuleMode.AlwaysStaminaFlight: return false;
|
||||
case BatFlightRuleMode.AlwaysFreeFlight: return true;
|
||||
default: return FreeBatFlight.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static ConfigEntry<float> BatTurnSpeed;
|
||||
public static ConfigEntry<float> BatGlideSpeed;
|
||||
|
|
@ -240,6 +256,10 @@ namespace RacesOfValheim
|
|||
new ConfigDescription("How far the camera rolls. 1 is about 4 degrees. Local.", new AcceptableValueRange<float>(0f, 3f)));
|
||||
|
||||
const string batform = "Aswid - Bat Form";
|
||||
FreeBatFlight = config.Bind(batform, "Free Bat Flight", false,
|
||||
new ConfigDescription("Off: Stamina Flight, the settings below. On: the old Free Flight, up to 50 m/s with no stamina cost and no weight limit; Jump rises, Crouch sinks. Your own choice, unless the server's Bat Flight Rule forces one. Takes effect the next time you become a bat."));
|
||||
BatFlightRule = config.Bind(batform, "Bat Flight Rule", BatFlightRuleMode.PlayerChoice,
|
||||
new ConfigDescription("Server rule. PlayerChoice: each player's Free Bat Flight setting decides. AlwaysStaminaFlight / AlwaysFreeFlight: every bat flies that way. On a server only the host's or the server's value counts."));
|
||||
// Same controls as the Skadi's drake: aim with the camera, W beats forward, Shift
|
||||
// sprints, S beats backwards, and letting go hovers briefly before gliding down.
|
||||
BatTurnSpeed = config.Bind(batform, "Turn Speed", 180f,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue