Files
CalamityModPublic/Items/Weapons/Summon/SlimePuppetStaff.cs
T
Altixal e0bf810be7 Added token knockback to all weapons
Change carried over from 1.4.4

Also did a little regexing oops
2024-08-11 11:07:20 +07:00

58 lines
2.0 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.NPCs.SlimeGod;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class SlimePuppetStaff : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.width = 32;
Item.height = 34;
Item.damage = 10;
Item.mana = 10;
Item.useAnimation = Item.useTime = 29;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.noMelee = true;
Item.knockBack = 3.6f;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.UseSound = SlimeGodCore.PossessionSound;
Item.shoot = ModContent.ProjectileType<SlimePuppet>();
Item.shootSpeed = 10f;
Item.autoReuse = true;
Item.DamageType = DamageClass.Summon;
}
public override Vector2? HoldoutOrigin() => new Vector2(12f);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, Main.myPlayer);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<PurifiedGel>(18).
AddIngredient<BlightedGel>(18).
AddTile<StaticRefiner>().
Register();
}
}
}