Files
CalamityModPublic/Items/Weapons/Summon/HivePod.cs
T
Altixal 11f4ab20a0 Sentry changes
- Atlas Munitions is now resummonable
- Calamity ground sentries now spawn at their resting spot
- The aforementioned ground sentries no longer try to "climb" platforms
2024-04-26 17:51:22 +07:00

45 lines
1.7 KiB
C#

using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class HivePod : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.width = 46;
Item.height = 50;
Item.damage = 125;
Item.mana = 10;
Item.DamageType = DamageClass.Summon;
Item.sentry = true;
Item.autoReuse = true;
Item.useTime = Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 4f;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.UseSound = SoundID.Item78;
Item.shoot = ModContent.ProjectileType<Hive>();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
player.FindSentryRestingSpot(type, out int XPosition, out int YPosition, out int YOffset);
YOffset += 5;
position = new Vector2((float)XPosition, (float)(YPosition - YOffset));
int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
player.UpdateMaxTurrets();
return false;
}
}
}