diff --git a/Buffs/Mounts/ExoTankBuff.cs b/Buffs/Mounts/ExoTankBuff.cs new file mode 100644 index 0000000000..4512f85452 --- /dev/null +++ b/Buffs/Mounts/ExoTankBuff.cs @@ -0,0 +1,21 @@ +using CalamityMod.Items.Mounts; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Mounts +{ + public class ExoTankBuff : ModBuff + { + public override void SetStaticDefaults() + { + 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; + } + } +} diff --git a/Buffs/Mounts/ExoTankBuff.png b/Buffs/Mounts/ExoTankBuff.png new file mode 100644 index 0000000000..f5986ce912 Binary files /dev/null and b/Buffs/Mounts/ExoTankBuff.png differ diff --git a/Items/Mounts/ExoArmamentsKit.cs b/Items/Mounts/ExoArmamentsKit.cs new file mode 100644 index 0000000000..fb5967b861 --- /dev/null +++ b/Items/Mounts/ExoArmamentsKit.cs @@ -0,0 +1,24 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Mounts +{ + public class ExoArmamentsKit : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Mounts"; + public override void SetDefaults() + { + Item.width = 50; + Item.height = 44; + Item.useAnimation = Item.useTime = 20; + Item.useStyle = ItemUseStyleID.HoldUp; + Item.UseSound = SoundID.Item94; + Item.noMelee = true; + Item.mountType = ModContent.MountType(); + + Item.value = Item.sellPrice(gold: 5); + Item.master = true; + } + } +} diff --git a/Items/Mounts/ExoArmamentsKit.png b/Items/Mounts/ExoArmamentsKit.png new file mode 100644 index 0000000000..1e8a75fcb1 Binary files /dev/null and b/Items/Mounts/ExoArmamentsKit.png differ diff --git a/Items/Mounts/ExoTank.cs b/Items/Mounts/ExoTank.cs new file mode 100644 index 0000000000..4fa1fb0d4a --- /dev/null +++ b/Items/Mounts/ExoTank.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.Mounts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Mounts +{ + public class ExoTank : ModMount + { + public override void SetStaticDefaults() + { + MountData.spawnDust = DustID.Iron; + MountData.spawnDustNoGravity = true; + MountData.buff = ModContent.BuffType(); + + // Attack (lasers; rockets are determined by extra frames) + MountData.abilityCooldown = 6; + + // Horizontal movement + MountData.runSpeed = 9f; + MountData.dashSpeed = 22.5f; + MountData.swimSpeed = 9f; + MountData.acceleration = 0.5f; + + // Vertical movement + MountData.fallDamage = 0f; + MountData.jumpHeight = 10; + MountData.jumpSpeed = 12f; + + // Frames and offsets + MountData.totalFrames = 3; + MountData.heightBoost = 80; + int[] array = new int[MountData.totalFrames]; + for (int l = 0; l < array.Length; l++) + array[l] = 76; + + MountData.playerYOffsets = array; + MountData.playerHeadOffset = 0; + MountData.bodyFrame = 3; + MountData.xOffset = 0; + MountData.yOffset = -16; + MountData.standingFrameCount = 1; + MountData.standingFrameDelay = 12; + MountData.standingFrameStart = 0; + MountData.runningFrameCount = 3; + MountData.runningFrameDelay = 24; + MountData.runningFrameStart = 0; + MountData.flyingFrameCount = 0; + MountData.flyingFrameDelay = 0; + MountData.flyingFrameStart = 0; + MountData.inAirFrameCount = 1; + MountData.inAirFrameDelay = MountData.standingFrameDelay; + MountData.inAirFrameStart = 0; + MountData.idleFrameCount = 1; + MountData.idleFrameDelay = MountData.standingFrameDelay; + MountData.idleFrameStart = 0; + MountData.idleFrameLoop = true; + MountData.swimFrameCount = MountData.inAirFrameCount; + MountData.swimFrameDelay = MountData.inAirFrameDelay; + MountData.swimFrameStart = MountData.inAirFrameStart; + if (Main.netMode != NetmodeID.Server) + { + MountData.backTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/ExoTankExtra"); + MountData.backTextureExtraGlow = ModContent.Request("CalamityMod/Items/Mounts/ExoTankExtraGlow"); + MountData.frontTextureGlow = ModContent.Request("CalamityMod/Items/Mounts/ExoTank_FrontGlow"); + MountData.textureWidth = MountData.backTexture.Width(); + MountData.textureHeight = MountData.backTexture.Height(); + } + } + + public override bool UpdateFrame(Player mountedPlayer, int state, Vector2 velocity) + { + // Locked to 2 states: moving and not moving + if (state != 0) + state = 1; + + // Advances weapon frames while attacking OR while not attacking but mid-animation + Mount tank = mountedPlayer.mount; + if (tank._aiming || tank._frameExtra > 0) + tank._frameExtraCounter++; + + if (tank._frameExtraCounter >= 5f) + { + tank._frameExtraCounter = 0f; + tank._frameExtra++; + if (tank._frameExtra >= 8) + tank._frameExtra = 0; + } + return true; + } + + 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) + { + // Modify frames for backTextureExtra (weapons) and its glow + if (drawType == 1) + frame = texture.Frame(1, 8, 0, drawPlayer.mount._frameExtra); + + return true; + } + } +} diff --git a/Items/Mounts/ExoTankExtra.png b/Items/Mounts/ExoTankExtra.png new file mode 100644 index 0000000000..299cf3bba1 Binary files /dev/null and b/Items/Mounts/ExoTankExtra.png differ diff --git a/Items/Mounts/ExoTankExtraGlow.png b/Items/Mounts/ExoTankExtraGlow.png new file mode 100644 index 0000000000..d3c2aeba0f Binary files /dev/null and b/Items/Mounts/ExoTankExtraGlow.png differ diff --git a/Items/Mounts/ExoTank_Back.png b/Items/Mounts/ExoTank_Back.png new file mode 100644 index 0000000000..d1c13b1c19 Binary files /dev/null and b/Items/Mounts/ExoTank_Back.png differ diff --git a/Items/Mounts/ExoTank_Front.png b/Items/Mounts/ExoTank_Front.png new file mode 100644 index 0000000000..1af22c803f Binary files /dev/null and b/Items/Mounts/ExoTank_Front.png differ diff --git a/Items/Mounts/ExoTank_FrontGlow.png b/Items/Mounts/ExoTank_FrontGlow.png new file mode 100644 index 0000000000..b1ddb46c1b Binary files /dev/null and b/Items/Mounts/ExoTank_FrontGlow.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 776862a581..12a7432de8 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -307,6 +307,11 @@ DraedonGamerChairBuff: { Description: Riding a physics defying gamer chair } +ExoTankBuff: { + DisplayName: Rainbow Road Roller + Description: Your foes shall fall within your calculations +} + GazeOfCrysthamyrBuff: { DisplayName: Gaze of Crysthamyr Description: You are riding a shadow dragon diff --git a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson index 0eaacd1020..5c461dc03f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson @@ -3,6 +3,15 @@ Brimrose: { Tooltip: Summons a brimrose mount } +ExoArmamentsKit: { + DisplayName: Exo Armaments Kit + Tooltip: + ''' + Summons a rideable war machine + 'A superweapon just right for your stature' + ''' +} + ExoThrone: { DisplayName: Exo Box Tooltip: diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 865d154ccf..dbd6a74ecb 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1577,6 +1577,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Relic npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf(CanDropLoot, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf(CanDropLoot, ModContent.ItemType(), 4); // GFB Broken Water Filter var GFBOnly = npcLoot.DefineConditionalDropSet(DropHelper.GFB);