//////////////// public static void ActivateIf(Player player, bool syncIfClient) { var config = SpiritWalkingConfig.Instance; var myplayer = player.GetModPlayer <SpiritWalkingPlayer>(); if (myplayer.IsSpiritWalking) { return; } if (SpiritWalkLogic.IsUponOpenAir(player)) { if (!config.Get <bool>(nameof(config.OpenAirAllowsEngagingSpiritWalk))) { Main.NewText("Cannot enage spirit walking upon open air.", Color.Yellow); return; } } if (!SpiritWalkLogic.ApplyActivateCostIf(player)) { return; } // SpiritWalkFlightLogic.ActivateFlightBehavior(myplayer); SpiritWalkLogic.ActivatePlayerForm(player); SpiritWalkFxLogic.ActivationFx(myplayer); SpiritWalkPelletsLogic.ActivationPreparations(myplayer); // myplayer.IsSpiritWalking = true; SpiritWalkingAPI.RunSpiritWalkActivationHooks(player, true); // if (syncIfClient) { if (Main.netMode == NetmodeID.MultiplayerClient) { SpiritWalkStateProtocol.Broadcast(myplayer); } } }
private static void UpdateForSpiritWalk(SpiritWalkingPlayer myplayer) { if (SpiritWalkLogic.IsUponOpenAir(myplayer.player)) { SpiritWalkFlightLogic.ApplySpiritWalkOpenAirFriction(myplayer.player); SpiritWalkFxLogic.ApplySpiritWalkOpenAirFriction(myplayer.player); } // SpiritWalkLogic.UpdateSpiritWalkCost(myplayer.player); SpiritWalkLogic.RunFinalDashIf(myplayer); // myplayer.player.gravity = 0f; // SpiritWalkFlightLogic.UpdateWalk(myplayer); SpiritWalkPelletsLogic.UpdateWalk(myplayer); }