public HoverbikeEngineEfficiencyModule() : base("HoverbikeEngineEfficiencyModule", "Snowfox Engine Efficiency Module", "Optimises Snowfox power use, reducing battery consumption by 35%. Stacks up to twice.") { OnFinishedPatching += () => { HoverbikeUpdater.AddEfficiencyMultiplier(this.TechType, efficiencyModifier, maxUpgrades: maxUpgrades); Main.AddModTechType(this.TechType); }; }
public HoverbikeMobilityUpgrade() : base("HoverbikeMobilityUpgrade", "Snowfox Mobility Upgrade", "Allows Snowfox to jump, travel on water, and provides a modest bonus to speed, without increasing power consumption. Does not stack with Speed Module or Efficiency Upgrade.") { OnFinishedPatching += () => { HoverbikeUpdater.AddEfficiencyMultiplier(this.TechType, efficiencyModifier, upgradePriority, maxStack); HoverbikeUpdater.AddMovementModifier(this.TechType, speedMultiplier, cooldownMultiplier, upgradePriority, maxStack); Main.AddModTechType(this.TechType); }; }
public HoverbikeSpeedModule() : base("HoverbikeSpeedModule", "Snowfox Speed Module", "Increases Snowfox speed, but also significantly increases power consumption. Does not stack.") { OnFinishedPatching += () => { HoverbikeUpdater.AddEfficiencyMultiplier(this.TechType, powerConsumptionModifier); HoverbikeUpdater.AddMovementModifier(this.TechType, speedMultiplier, cooldownMultiplier, maxStack); Main.AddModTechType(this.TechType); }; }
public static bool WaterHoverMode(Hoverbike instance) { // This method is called in Hoverbike.HoverEngines(), made so via transpiler, and is only called once the code has already established that the Hoverbike is over water. // Also, since we want to fool the game into thinking the hoverbike is not over water if a valid travel module is installed, we need to invert the boolean. // This is because the return result of this method is assigned to the hoverbike's "over water" field; if we want the hoverbike to believe it is over land and thus is allowed // to boost and jump, we have to say "No, you're not over water" if a travel module is present. if (instance?.gameObject == null) { return(true); } return(!HoverbikeUpdater.StaticHasTravelModule(instance)); //instance.modules.GetCount(Main.prefabHbWaterTravelModule.TechType) < 1; }
public static void PostStart(Hoverbike __instance) { HoverbikeUpdater component = __instance.gameObject.EnsureComponent <HoverbikeUpdater>(); component.Initialise(ref __instance); if (__instance.gameObject != null && __instance.gameObject.TryGetComponent <LiveMixin>(out LiveMixin mixin) && Main.defaultHealth.TryGetValue(TechType.Hoverbike, out float defaultHealth)) { float instanceHealthPct = Mathf.Min(mixin.GetHealthFraction(), 1f); float maxHealth = defaultHealth * Main.config.HoverbikeHealthMult; mixin.data.maxHealth = maxHealth; mixin.health = maxHealth * instanceHealthPct; } }