diff --git a/Enums/VanillaWingID.cs b/Enums/VanillaWingID.cs index 1604736eea..5e050247a1 100644 --- a/Enums/VanillaWingID.cs +++ b/Enums/VanillaWingID.cs @@ -12,7 +12,7 @@ BoneWings = 8, FlameWings = 9, FrozenWings = 10, - SpectreWings = 11, + GhostWings = 11, // Spectre Wings SteampunkWings = 12, LeafWings = 13, BatWings = 14, diff --git a/Items/Accessories/Wings/AureateBooster.cs b/Items/Accessories/Wings/AureateBooster.cs index d9ac581d6b..1f398082de 100644 --- a/Items/Accessories/Wings/AureateBooster.cs +++ b/Items/Accessories/Wings/AureateBooster.cs @@ -19,6 +19,11 @@ namespace CalamityMod.Items.Accessories.Wings public override float MaxAscentSpeed => 2.5f; public override float BaseAscent => 0.125f; + // How powerful the acceleration increase is while pressing UP + // This also affects the flight time tick rate + // 1f = 2x as fast and 2x flight time drainage + public static float BoostPower = 1.5f; + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 8f, 1.5f); public override void SetDefaults() @@ -84,6 +89,36 @@ namespace CalamityMod.Items.Accessories.Wings player.noFallDmg = true; } + public override void AdditionalFlightMovement(Player player) + { + if (player.TryingToHoverUp) + { + player.velocity.Y -= BaseAscent * BoostPower * player.gravDir; + if (player.gravDir == 1f) + { + if (player.velocity.Y > 0f) + player.velocity.Y -= BonusAscentWhileFalling * BoostPower; + else if (player.velocity.Y > Player.jumpSpeed * RisingSpeedThreshold * -BoostPower) + player.velocity.Y -= BonusAscentWhileRising * BoostPower; + + if (player.velocity.Y < Player.jumpSpeed * MaxAscentSpeed * -BoostPower) + player.velocity.Y = Player.jumpSpeed * MaxAscentSpeed * -BoostPower; + } + else + { + if (player.velocity.Y < 0f) + player.velocity.Y += BonusAscentWhileFalling * BoostPower; + else if (player.velocity.Y < Player.jumpSpeed * RisingSpeedThreshold * BoostPower) + player.velocity.Y += BonusAscentWhileRising * BoostPower; + + if (player.velocity.Y > Player.jumpSpeed * MaxAscentSpeed * BoostPower) + player.velocity.Y = Player.jumpSpeed * MaxAscentSpeed * BoostPower; + } + + player.wingTime -= BoostPower - 1f; + } + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/Wings/HadarianWings.cs b/Items/Accessories/Wings/HadarianWings.cs index 605d72a518..9c7065c2c9 100644 --- a/Items/Accessories/Wings/HadarianWings.cs +++ b/Items/Accessories/Wings/HadarianWings.cs @@ -34,18 +34,6 @@ namespace CalamityMod.Items.Accessories.Wings { if (player.controlJump && player.wingTime > 0f && player.jump == 0) { - bool hovering = player.TryingToHoverDown && !player.merman; - if (hovering) - { - player.velocity.Y *= 0.2f; - if (player.velocity.Y > -2f && player.velocity.Y < 2f) - { - // I can't get the player to have zero y velocity (setting it to 0 doesn't work and I tried a lot of numbers) - player.velocity.Y = 0.105f; - } - player.wingTime += 0.75f; - } - if (player.velocity.Y != 0f && !hideVisual) { float xOffset = 4f; @@ -53,7 +41,7 @@ namespace CalamityMod.Items.Accessories.Wings { xOffset = -40f; } - if (!hovering || Main.rand.NextBool(3)) + if (!player.TryingToHoverDown || Main.rand.NextBool(3)) { int idx = Dust.NewDust(new Vector2(player.Center.X + xOffset, player.Center.Y - 15f), 30, 30, ModContent.DustType(), 0f, 0f, 100, default, 1.75f); Main.dust[idx].noGravity = true; @@ -68,5 +56,16 @@ namespace CalamityMod.Items.Accessories.Wings } player.noFallDmg = true; } + + public override void AdditionalFlightMovement(Player player) + { + if (player.TryingToHoverDown && player.controlJump && player.wingTime > 0f && !player.merman) + { + player.wingTime += 0.5f; + player.velocity.Y *= 0.8f; + if (player.velocity.Y > -2f && player.velocity.Y < 1f) + player.velocity.Y = 1E-05f; + } + } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 6cb31e0ae7..40f99652f0 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -195,13 +195,17 @@ namespace CalamityMod.Items // 160 -> 180 flight time, 7.5 -> 6.25 horizontal speed stats[(int)VanillaWingID.BatWings].FlyTime = 180; stats[(int)VanillaWingID.BatWings].AccRunSpeedOverride = 6.25f; + // 1 -> 1.5 acceleration multiplier + stats[(int)VanillaWingID.ButterflyWings].AccRunAccelerationMult = 1.5f; // 170 -> 240 flight time stats[(int)VanillaWingID.BoneWings].FlyTime = 240; - // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 2 acceleration multiplier + // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 1.5 acceleration multiplier stats[(int)VanillaWingID.LeafWings].FlyTime = 170; stats[(int)VanillaWingID.LeafWings].AccRunSpeedOverride = 9f; - stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 2f; + stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 1.5f; + // (Spectre Wings) 1 -> 2 acceleration multiplier + stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 2f; // 170 -> 210 flight time stats[(int)VanillaWingID.BeetleWings].FlyTime = 210; @@ -1430,6 +1434,12 @@ namespace CalamityMod.Items if (item.type == ItemID.DemonWings && !player.mount.Active) player.maxFallSpeed *= 1.3f; + if (item.type == ItemID.BeeWings && !player.mount.Active && !player.controlDown) + { + player.gravity *= 0.6f; + player.maxFallSpeed *= 0.6f; + } + if (item.type == ItemID.FinWings) player.ignoreWater = true; @@ -1529,6 +1539,10 @@ namespace CalamityMod.Items maxAscentMultiplier *= 0.9f; constantAscend *= 5f; break; + case ItemID.GhostWings: + maxAscentMultiplier *= 0.904f; + constantAscend *= 5f; + break; default: break; } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 2e9d17cd40..bbe4afbd13 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1274,7 +1274,7 @@ namespace CalamityMod.Items AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.BeeWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f, "BeeWings"); if (item.type == ItemID.HarpyWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); @@ -1289,7 +1289,7 @@ namespace CalamityMod.Items AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.GhostWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.5f); if (item.type == ItemID.BeetleWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 1dacff8d6c..1d3d11350b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -3,6 +3,7 @@ AureateBooster: { Tooltip: ''' {$CommonItemTooltip.FlightAndSlowfall} + {$CommonItemTooltip.PressUpToBooster} 'Mach speed with style!' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson index 3fd75618bf..ee98b04684 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson @@ -1,3 +1,4 @@ +BeeWings: Decreases fall speed while not pressing {$Key.DOWN} BoneWings: Halves flight time when taking a hit DemonWings: Increases fall speed FestiveWings: Homing ornaments rain down as you fly