diff --git a/Buffs/Mounts/MarniteLiftBuff.cs b/Buffs/Mounts/MarniteLiftBuff.cs new file mode 100644 index 0000000000..af2c45bb82 --- /dev/null +++ b/Buffs/Mounts/MarniteLiftBuff.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Mounts; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Items.Armor.MarniteArchitect; + +namespace CalamityMod.Buffs.Mounts +{ + public class MarniteLiftBuff : ModBuff + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Marnite Lift"); + Description.SetDefault("Do you even..?"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.mount.SetMount(ModContent.MountType(), player); + player.buffTime[buffIndex] = 10; // reset buff time + player.GetModPlayer().mounted = true; + } + } +} diff --git a/Buffs/Mounts/MarniteLiftBuff.png b/Buffs/Mounts/MarniteLiftBuff.png new file mode 100644 index 0000000000..4132c8d3d6 Binary files /dev/null and b/Buffs/Mounts/MarniteLiftBuff.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear.png b/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear.png new file mode 100644 index 0000000000..5d9e41a13f Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear_Head.png b/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear_Head.png new file mode 100644 index 0000000000..3a9521322e Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteArchitectHeadgear_Head.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs new file mode 100644 index 0000000000..fc2ecea1c3 --- /dev/null +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -0,0 +1,480 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Materials; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static Microsoft.Xna.Framework.Input.Keys; +using static Terraria.ModLoader.ModContent; +using Terraria.GameInput; +using CalamityMod.Items.Mounts; +using CalamityMod.Buffs.Mounts; +using Microsoft.Xna.Framework.Graphics; +using System.Linq; +using ReLogic.Utilities; + + +namespace CalamityMod.Items.Armor.MarniteArchitect +{ + [AutoloadEquip(EquipType.Head)] + public class MarniteArchitectHeadgear : ModItem + { + + public static readonly SoundStyle LiftSpawnSound = new("CalamityMod/Sounds/Item/MarniteLiftSummon"); + public static readonly SoundStyle LiftGoAwaySound = new("CalamityMod/Sounds/Item/MarniteLiftUnsummon"); + public static readonly SoundStyle LiftHummSound = new("CalamityMod/Sounds/Item/MarniteLiftHumm") { IsLooped = true}; + + public static float LiftRaiseSpeed = 2f; + public static float MaxLiftHeight = 180f; + + public override void Load() + { + On.Terraria.Player.QuickMount += ActivateLift; + } + + public override void Unload() + { + On.Terraria.Player.QuickMount -= ActivateLift; + } + + + public override void SetStaticDefaults() + { + SacrificeTotal = 1; + DisplayName.SetDefault("Marnite Architect Headgear"); + Tooltip.SetDefault("Increases block placement range by 5"); + + if (Main.netMode == NetmodeID.Server) + return; + + int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); + ArmorIDs.Head.Sets.DrawFullHair[equipSlot] = true; + } + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = Item.buyPrice(0, 0, 75, 0); + Item.rare = ItemRarityID.Blue; + Item.defense = 0; + } + + private void ActivateLift(On.Terraria.Player.orig_QuickMount orig, Player self) + { + //Spoof the mount thing + if (!self.mount.Active && HasArmorSet(self) && self.miscEquips[Player.miscSlotMount].IsAir) + { + if (self.frozen || self.tongued || self.webbed || self.stoned || self.gravDir == -1f || self.dead || self.noItems) + return; + + int liftMountType = MountType(); + + if (self.mount.CanMount(liftMountType, self)) + { + self.mount.SetMount(liftMountType, self); + SoundEngine.PlaySound(LiftSpawnSound, self.Center); + } + + } + + else + orig(self); + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType(); + public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType(); + public bool IsPartOfSet(Item item) => item.type == ItemType() || + item.type == ItemType(); + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Marnite Lift"; + player.GetModPlayer().setEquipped = true; + } + + public override void UpdateEquip(Player player) + { + //Tile range is a static variable did you know that? That's quite funny. I assume it's just because its not like other players would need to know about the players reach + if (Main.myPlayer == player.whoAmI) + { + Player.tileRangeX += 5; + Player.tileRangeY += 4; //Extendo grip also increases vertical tile range by one less than horizontal + } + } + + public static void ModifySetTooltips(ModItem item, List tooltips) + { + if (HasArmorSet(Main.LocalPlayer)) + { + int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); + + if (setBonusIndex != -1) + { + TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", "Marnite Lift - You can summon a a lift under your feet to reach higher up"); + setBonus1.OverrideColor = Color.Lerp(new Color(255, 243, 161), new Color(137, 162, 255), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); + tooltips[setBonusIndex] = setBonus1; + + TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", "The lift gets summoned when the mount hotkey gets pressed [c/D4C870:without any mounts equipped]"); + setBonus2.OverrideColor = new Color(145, 197, 239); + tooltips.Insert(setBonusIndex + 1, setBonus2); + + TooltipLine setBonus3 = new TooltipLine(item.Mod, "CalamityMod:SetBonus3", "Using the Up and Down keys can change the lift's height"); + setBonus3.OverrideColor = new Color(145, 197, 239); + tooltips.Insert(setBonusIndex + 2, setBonus3); + } + + } + } + public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); + + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyGoldCrown"). + AddIngredient(ItemID.Granite, 5). + AddIngredient(ItemID.Marble, 5). + AddTile(TileID.Anvils). + Register(); + } + } + + [AutoloadEquip(EquipType.Body)] + public class MarniteArchitectToga : ModItem + { + public override void Load() + { + if (Main.netMode == NetmodeID.Server) + return; + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs", EquipType.Legs, this); + } + + public override void SetStaticDefaults() + { + SacrificeTotal = 1; + DisplayName.SetDefault("Marnite Architect Toga"); + Tooltip.SetDefault("Increases tile placement speed by 50%"); + + if (Main.netMode == NetmodeID.Server) + return; + } + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = Item.buyPrice(0, 0, 75, 0); + Item.rare = ItemRarityID.Blue; + Item.defense = 1; + } + + public override void UpdateEquip(Player player) + { + player.tileSpeed += 0.5f; + if (player.mount.Active) + return; + } + + public override void ModifyTooltips(List tooltips) => MarniteArchitectHeadgear.ModifySetTooltips(this, tooltips); + + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyGoldBar", 2). + AddIngredient(ItemID.Silk, 15). + AddIngredient(ItemID.Granite, 15). + AddIngredient(ItemID.Marble, 15). + AddTile(TileID.Anvils). + Register(); + } + + public override void SetMatch(bool male, ref int equipSlot, ref bool robes) + { + robes = true; + equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); + } + } + + public class MarniteArchitectPlayer : ModPlayer + { + public bool setEquipped = false; + public bool mounted = false; + public SlotId liftDroningSoundSlot; + + public override void ResetEffects() + { + setEquipped = false; + mounted = false; + } + + public override void UpdateDead() + { + setEquipped = false; + mounted = false; + } + + public override void PostUpdateMiscEffects() + { + if (!setEquipped && Player.mount.Type == ModContent.MountType() && Player.mount.Active) + Player.mount.Dismount(Player); + + if (mounted) + { + if (!SoundEngine.TryGetActiveSound(liftDroningSoundSlot, out var soundPlaying)) + liftDroningSoundSlot = SoundEngine.PlaySound(MarniteArchitectHeadgear.LiftHummSound, Player.Center); + + else + { + soundPlaying.Position = Player.Center; + float distanceToGround = RaycastGround(true).Y; + soundPlaying.Volume = 1 - (distanceToGround / MarniteArchitectHeadgear.MaxLiftHeight) * 0.3f; + } + + + + //Do something to prevent the player from having only one feet showing?? + } + + else + { + if (SoundEngine.TryGetActiveSound(liftDroningSoundSlot, out var soundPlaying)) + { + soundPlaying.Stop(); + liftDroningSoundSlot = SlotId.Invalid; + } + } + } + + public Vector2 RaycastGround(bool centerOnly = false) + { + float closestDistance = (MarniteArchitectHeadgear.MaxLiftHeight + 1); + + if (centerOnly) + { + Vector2 basePosition = Player.Bottom; + + for (float j = 0; j < closestDistance; j += 8f) + { + Point tileToCheck = (basePosition + Vector2.UnitY * j).ToSafeTileCoordinates(); + + if (Main.tile[tileToCheck].IsTileSolidGround()) + { + closestDistance = j; + break; + } + } + + return Vector2.UnitY * closestDistance; + } + + for (float i = 0; i < Player.width; i += Player.width / 6f) + { + Vector2 basePosition = Player.BottomLeft + Vector2.UnitX * i; + + for (float j = 0; j < closestDistance; j += 8f) + { + Point tileToCheck = (basePosition + Vector2.UnitY * j).ToSafeTileCoordinates(); + + if (Main.tile[tileToCheck].IsTileSolidGround()) + { + closestDistance = j; + break; + } + } + } + + return Vector2.UnitY * closestDistance; + } + + public float BestLiftDistanceFromGround() + { + Vector2 closestGround = RaycastGround(); + if (closestGround.Y > MarniteArchitectHeadgear.MaxLiftHeight) + return -1; + + return closestGround.Y; + } + + public override void PreUpdateMovement() + { + if (mounted) + { + float distanceToGround = BestLiftDistanceFromGround(); + + if (distanceToGround >= 0) + { + float newVelocity; + + if (Player.controlUp || Player.controlJump) + { + newVelocity = -MarniteArchitectHeadgear.LiftRaiseSpeed; + + if (distanceToGround + MarniteArchitectHeadgear.LiftRaiseSpeed > MarniteArchitectHeadgear.MaxLiftHeight - 3) + { + newVelocity = ((MarniteArchitectHeadgear.MaxLiftHeight - 3) - distanceToGround) * -1; + } + + Player.fallStart = (int)(Player.Center.Y / 16); + } + + else if (Player.controlDown) + { + newVelocity = MarniteArchitectHeadgear.LiftRaiseSpeed; + + if (Collision.TileCollision(Player.position, new Vector2(Player.velocity.X, newVelocity), Player.width, Player.height, true, false, (int)Player.gravDir).Y == 0f) + newVelocity = 0.5f; + } + else + newVelocity = 0f; + + + if (Math.Abs(Player.velocity.Y) < 4f) + { + Player.velocity.Y = newVelocity; + Player.fallStart = (int)(Player.Center.Y / 16); + } + + else + Player.velocity.Y = MathHelper.Lerp(Player.velocity.Y, newVelocity, 0.12f); + } + + } + } + } + + public class MarniteLift : ModMount + { + + public override void SetStaticDefaults() + { + // Movement + MountData.jumpHeight = 0; // How high the mount can jump. + MountData.acceleration = 0.2f; // The rate at which the mount speeds up. + MountData.jumpSpeed = 0f; // The rate at which the player and mount ascend towards (negative y velocity) the jump height when the jump button is presssed. + MountData.blockExtraJumps = true; // Determines whether or not you can use a double jump (like cloud in a bottle) while in the mount. + MountData.constantJump = false; // Allows you to hold the jump button down. + MountData.fallDamage = 1f; // Fall damage multiplier. + MountData.runSpeed = 2f; // The speed of the mount + MountData.dashSpeed = 2f; // The speed the mount moves when in the state of dashing. + MountData.flightTimeMax = 0; // The amount of time in frames a mount can be in the state of flying. + MountData.fatigueMax = 0; + MountData.usesHover = false; + + // Misc + MountData.buff = BuffType(); // The ID number of the buff assigned to the mount. + + // Effects + MountData.spawnDust = 6; // The ID of the dust spawned when mounted or dismounted. + + // Frame data and player offsets + MountData.totalFrames = 1; // Amount of animation frames for the mount + MountData.heightBoost = 0; // Height between the mount and the ground + MountData.playerYOffsets = Enumerable.Repeat(33, 1).ToArray(); // Fills an array with values for less repeating code + MountData.xOffset = 0; + MountData.yOffset = 0; + MountData.bodyFrame = 0; + MountData.playerHeadOffset = 4; + + //Sprites + if (Main.netMode != NetmodeID.Server) + { + MountData.frontTextureGlow = ModContent.Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); + } + } + + public override void UpdateEffects(Player player) + { + Lighting.AddLight(player.Bottom + Vector2.UnitY * 10f, Color.DeepSkyBlue.ToVector3()); + + float centerDistance = player.GetModPlayer().RaycastGround(true).Y; + + if (centerDistance <= MarniteArchitectHeadgear.MaxLiftHeight) + { + if (Main.rand.NextFloat() > (centerDistance / MarniteArchitectHeadgear.MaxLiftHeight) * 0.6f && Main.rand.NextBool()) + { + float scale = 1.2f - (centerDistance / MarniteArchitectHeadgear.MaxLiftHeight) * 0.7f; + Dust dust = Dust.NewDustPerfect(player.Bottom + Vector2.UnitY * centerDistance + Vector2.UnitX * Main.rand.Next(-16, 16), 31, new Vector2((Main.rand.NextFloat(-8, 8) * scale) - player.velocity.X, Main.rand.NextFloat(-1, 1)), 120, Scale : scale * 1.5f); + } + } + + if (Main.rand.NextBool(3)) + { + float speedRotation = player.velocity.X * 0.03f; + + Dust dust = Dust.NewDustPerfect(player.Bottom + Vector2.UnitX.RotatedBy(speedRotation) * Main.rand.Next(-6, 6) + Vector2.UnitY.RotatedBy(speedRotation) * -2f, 229, Vector2.UnitY.RotatedBy(speedRotation) * Main.rand.NextFloat(1f, 3f), 120, Scale: Main.rand.NextFloat(0.6f, 1f)); + dust.noGravity = true; + } + } + + public void DustEffects(Player player) + { + for (int j = 0; j < 17; j++) + { + Vector2 direction = Main.rand.NextVector2CircularEdge(1f, 1f); + int dustType = Main.rand.NextBool() ? 240 : 236; + Dust.NewDustPerfect(player.Bottom + (direction * 3) + Vector2.UnitY * 10f, dustType, direction.RotatedBy(Main.rand.NextFloat(-0.2f, 0.2f) - 1.57f) * Main.rand.Next(1, 3), 0, new Color(255, 255, 60) * 0.8f, 0.6f); + } + } + + public override void SetMount(Player player, ref bool skipDust) + { + DustEffects(player); + skipDust = true; + } + + public override void Dismount(Player player, ref bool skipDust) + { + SoundEngine.PlaySound(MarniteArchitectHeadgear.LiftGoAwaySound, player.Center); + DustEffects(player); + skipDust = true; + } + + public static Vector2 GetFireSquish(float timeOffset, float timeSpeed) + { + return new Vector2((float)Math.Sin(Main.GlobalTimeWrappedHourly * timeSpeed + timeOffset) * 0.1f + 1f, 1.2f - 0.3f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * timeSpeed + timeOffset)); + } + + public override bool Draw(List playerDrawData, int drawType, Player drawPlayer, ref Texture2D texture, ref Texture2D glowTexture, ref Vector2 drawPosition, ref Rectangle frame, ref Color drawColor, ref Color glowColor, ref float rotation, ref SpriteEffects spriteEffects, ref Vector2 drawOrigin, ref float drawScale, float shadow) + { + rotation = drawPlayer.velocity.X * 0.03f; + drawPlayer.fullRotation = rotation; + + // Draw is called for each mount texture we provide, so we check drawType to avoid duplicate draws. + if (drawType == 0) + { + Texture2D platformTex = MountData.frontTexture.Value; + Texture2D fireTex = MountData.frontTextureGlow.Value; + + Vector2 fireOrigin = new Vector2(fireTex.Width / 2f, 0f); + Color fireColor = Color.White; + + for (int i = 0; i < 3; i++) + { + fireColor = Color.White; + Vector2 fireScale = GetFireSquish(i * 0.6f, 14f); + fireColor.A = (byte)(210 - i * 70); + fireColor *= (0.3f + 0.35f * i); + fireScale *= drawScale * (1.5f - 0.25f * i); + + playerDrawData.Add(new DrawData(fireTex, drawPosition + new Vector2(0, 8), new Rectangle(0, 0, fireTex.Width, fireTex.Height), fireColor, drawPlayer.fullRotation, fireOrigin, fireScale * drawScale, SpriteEffects.None, 0)); + } + + playerDrawData.Add(new DrawData(platformTex, drawPosition, new Rectangle(0, 0, platformTex.Width, platformTex.Height), drawColor, drawPlayer.fullRotation, platformTex.Size() / 2f, drawScale, SpriteEffects.None, 0)); + } + + return false; + } + } +} diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectToga.png b/Items/Armor/MarniteArchitect/MarniteArchitectToga.png new file mode 100644 index 0000000000..3233cbb33f Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteArchitectToga.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectToga_Body.png b/Items/Armor/MarniteArchitect/MarniteArchitectToga_Body.png new file mode 100644 index 0000000000..ead3bf33af Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteArchitectToga_Body.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs.png b/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs.png new file mode 100644 index 0000000000..8ba3f5b115 Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteLiftFire.png b/Items/Armor/MarniteArchitect/MarniteLiftFire.png new file mode 100644 index 0000000000..17c5b7cd7e Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteLiftFire.png differ diff --git a/Items/Armor/MarniteArchitect/MarniteLift_Front.png b/Items/Armor/MarniteArchitect/MarniteLift_Front.png new file mode 100644 index 0000000000..9ce7c7de80 Binary files /dev/null and b/Items/Armor/MarniteArchitect/MarniteLift_Front.png differ diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index db91b1b8fe..309e5236a9 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -1,32 +1,17 @@ -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Terraria.DataStructures; -using CalamityMod.Items.Accessories.Vanity; -using CalamityMod.Cooldowns; -using CalamityMod.Projectiles.Magic; -using Terraria.Audio; -using ReLogic.Content; -using Microsoft.Xna.Framework.Graphics; -using System.Linq; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using static CalamityMod.CalamityUtils; -using static Terraria.ModLoader.ModContent; -using static Microsoft.Xna.Framework.Input.Keys; -using System; -using CalamityMod.Items.BaseItems; +using System; using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Materials; using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static Microsoft.Xna.Framework.Input.Keys; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Armor.Wulfrum { @@ -252,7 +237,6 @@ namespace CalamityMod.Items.Armor.Wulfrum } } - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); public override void UpdateEquip(Player player) diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index eb9e085b31..c7a14e40d6 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup(ItemID.Diamond). + AddIngredient(ItemID.Diamond). AddRecipeGroup("AnyGoldBar", 3). AddIngredient(ItemID.Granite, 5). AddIngredient(ItemID.Marble, 5). diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index d9d8bedf1b..7801c029f0 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -74,33 +74,36 @@ namespace CalamityMod.Projectiles.Melee else if (MoveInIntervals <= 0f) { - Vector2 newVelocity = Owner.Calamity().mouseWorld - Owner.MountedCenter; - - if (Main.tile[Player.tileTargetX, Player.tileTargetY].HasTile) + if (Main.myPlayer == Projectile.owner) { - newVelocity = new Vector2(Player.tileTargetX, Player.tileTargetY) * 16f + Vector2.One * 8f - Owner.MountedCenter; - MoveInIntervals = 2f; + Vector2 newVelocity = Owner.Calamity().mouseWorld - Owner.MountedCenter; + + if (Main.tile[Player.tileTargetX, Player.tileTargetY].HasTile) + { + newVelocity = new Vector2(Player.tileTargetX, Player.tileTargetY) * 16f + Vector2.One * 8f - Owner.MountedCenter; + MoveInIntervals = 2f; + } + + newVelocity = Vector2.Lerp(newVelocity, Projectile.velocity, 0.7f); + if (float.IsNaN(newVelocity.X) || float.IsNaN(newVelocity.Y)) + newVelocity = -Vector2.UnitY; + + if (newVelocity.Length() < 50f) + newVelocity = newVelocity.SafeNormalize(-Vector2.UnitY) * 50f; + + //Tile reach is a fucking square in terraria. Can you believe that? + int tileBoost = Owner.inventory[Owner.selectedItem].tileBoost; + int fullRangeX = (Player.tileRangeX + tileBoost - 1) * 16 + 11; //Why are those 2 separate variables? Whatever + int fullRangeY = (Player.tileRangeY + tileBoost - 1) * 16 + 11; + + newVelocity.X = Math.Clamp(newVelocity.X, -fullRangeX, fullRangeX); + newVelocity.Y = Math.Clamp(newVelocity.Y, -fullRangeY, fullRangeY); + + if (newVelocity != Projectile.velocity) + Projectile.netUpdate = true; + + Projectile.velocity = newVelocity; } - - newVelocity = Vector2.Lerp(newVelocity, Projectile.velocity, 0.7f); - if (float.IsNaN(newVelocity.X) || float.IsNaN(newVelocity.Y)) - newVelocity = -Vector2.UnitY; - - if (newVelocity.Length() < 50f) - newVelocity = newVelocity.SafeNormalize(-Vector2.UnitY) * 50f; - - //Tile reach is a fucking square in terraria. Can you believe that? - int tileBoost = Owner.inventory[Owner.selectedItem].tileBoost; - int fullRangeX = (Player.tileRangeX + tileBoost - 1) * 16 + 11; //Why are those 2 separate variables? Whatever - int fullRangeY = (Player.tileRangeY + tileBoost - 1) * 16 + 11; - - newVelocity.X = Math.Clamp(newVelocity.X, -fullRangeX, fullRangeX); - newVelocity.Y = Math.Clamp(newVelocity.Y, -fullRangeY, fullRangeY); - - if (newVelocity != Projectile.velocity) - Projectile.netUpdate = true; - - Projectile.velocity = newVelocity; } //Projectile.spriteDirection = Math.Sign(Projectile.velocity.X); diff --git a/Sounds/Item/MarniteLiftHumm.ogg b/Sounds/Item/MarniteLiftHumm.ogg new file mode 100644 index 0000000000..0e784f6eb6 Binary files /dev/null and b/Sounds/Item/MarniteLiftHumm.ogg differ diff --git a/Sounds/Item/MarniteLiftSummon.ogg b/Sounds/Item/MarniteLiftSummon.ogg new file mode 100644 index 0000000000..bf9ddb0cb8 Binary files /dev/null and b/Sounds/Item/MarniteLiftSummon.ogg differ diff --git a/Sounds/Item/MarniteLiftUnsummon.ogg b/Sounds/Item/MarniteLiftUnsummon.ogg new file mode 100644 index 0000000000..acfb139d90 Binary files /dev/null and b/Sounds/Item/MarniteLiftUnsummon.ogg differ diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 70a553839a..efeb7040f4 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -26,7 +26,7 @@ namespace CalamityMod public static int AnyCopperBar, AnySilverBar, AnyGoldOre, AnyGoldBar, AnyEvilBar, AnyCobaltBar, AnyMythrilBar, AnyAdamantiteBar; public static int EvilPowder, Boss2Material, CursedFlameIchor, AnyEvilWater, AnyEvilFlask; public static int AnyStoneBlock, AnySnowBlock, AnyIceBlock, SiltGroup, AnyEvilBlock, AnyGoodBlock; - public static int AnyWoodenSword, AnyZapinator, AnyHallowedHelmet, AnyHallowedPlatemail, AnyHallowedGreaves, LunarPickaxe, LunarHamaxe; + public static int AnyWoodenSword, AnyZapinator, AnyHallowedHelmet, AnyHallowedPlatemail, AnyHallowedGreaves, AnyGoldCrown, LunarPickaxe, LunarHamaxe; public static int ManaFlowersGroup, QuiversGroup, WingsGroup; private static void ModifyVanillaRecipeGroups() @@ -404,6 +404,14 @@ namespace CalamityMod }); AnyHallowedGreaves = RecipeGroup.RegisterGroup("AnyHallowedGreaves", group); + // Gold and Platinum Crowns + group = new RecipeGroup(() => "Any Gold Crown", new int[] + { + ItemID.GoldCrown, + ItemID.PlatinumCrown + }); + AnyGoldCrown = RecipeGroup.RegisterGroup("AnyGoldCrown", group); + // Vanilla Luminite Pickaxes and Genesis Pickaxe group = new RecipeGroup(() => "Any Lunar Pickaxe", new int[] {