Files
CalamityModPublic/Items/Weapons/Magic/AcidGun.cs
T
Ozzatron 22afdd3933 1 - Calamity sell prices increase much more sharply with rarity.
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.
2024-04-17 21:20:17 -04:00

73 lines
2.6 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class AcidGun : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.width = 42;
Item.height = 28;
Item.damage = 28;
Item.DamageType = DamageClass.Magic;
Item.mana = 9;
Item.useTime = Item.useAnimation = 45;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 1.5f;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item13;
Item.autoReuse = true;
Item.shootSpeed = 14f;
Item.shoot = ModContent.ProjectileType<AcidGunStream>();
}
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int acid1 = Projectile.NewProjectile(source, position, velocity.RotatedBy(MathHelper.ToRadians(-8f)), type, damage, knockback, player.whoAmI);
int acid2 = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
int acid3 = Projectile.NewProjectile(source, position, velocity.RotatedBy(MathHelper.ToRadians(8f)), type, damage, knockback, player.whoAmI);
// Keep track of the other 2 acid streams
if (Main.projectile.IndexInRange(acid1))
{
Main.projectile[acid1].ai[0] = acid2;
Main.projectile[acid1].ai[1] = acid3;
}
if (Main.projectile.IndexInRange(acid2))
{
Main.projectile[acid2].ai[0] = acid1;
Main.projectile[acid2].ai[1] = acid3;
}
if (Main.projectile.IndexInRange(acid3))
{
Main.projectile[acid3].ai[0] = acid1;
Main.projectile[acid3].ai[1] = acid2;
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<Acidwood>(35).
AddIngredient<SulphuricScale>(10).
AddTile(TileID.Anvils).
Register();
}
}
}