2 - (Example) Post DoG items are now 2 platinum instead of 1 platinum 40 gold. 3 - (Example) Dev items are now 2 platinum 80 gold instead of 2 platinum. 4 - Privated numeric rarity item values. 5 - All assigned item values use the rarity's names, e.g. RarityLightPurpleBuyPrice.
70 lines
2.6 KiB
C#
70 lines
2.6 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Typeless;
|
|
using CalamityMod.Tiles.Furniture.CraftingStations;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Goobow : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 32;
|
|
Item.height = 96;
|
|
Item.damage = 33;
|
|
Item.DamageType = DamageClass.Ranged;
|
|
Item.useTime = 31;
|
|
Item.useAnimation = 31;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 3f;
|
|
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
|
|
Item.rare = ItemRarityID.LightRed;
|
|
Item.UseSound = SoundID.Item5;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ProjectileID.WoodenArrowFriendly;
|
|
Item.shootSpeed = 12f;
|
|
Item.useAmmo = AmmoID.Arrow;
|
|
Item.Calamity().canFirePointBlankShots = true;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
|
float piOver10 = 0.1f * MathHelper.Pi;
|
|
int projAmt = 2;
|
|
|
|
velocity.Normalize();
|
|
velocity *= 20f;
|
|
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
|
for (int i = 0; i < projAmt; i++)
|
|
{
|
|
float offsetAmt = i - (projAmt - 1f) / 2f;
|
|
Vector2 offset = velocity.RotatedBy((double)(piOver10 * offsetAmt), default);
|
|
if (!canHit)
|
|
{
|
|
offset -= velocity;
|
|
}
|
|
int index = Projectile.NewProjectile(spawnSource, source + offset, velocity * 0.6f, ModContent.ProjectileType<SlimeStream>(), damage / 4, 0f, player.whoAmI, i);
|
|
if (index.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[index].DamageType = DamageClass.Ranged;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<PurifiedGel>(18).
|
|
AddIngredient<BlightedGel>(18).
|
|
AddTile<StaticRefiner>().
|
|
Register();
|
|
}
|
|
}
|
|
}
|