Eli10293
Spazmatism
I just realized that after I postedIt seems I forgot to put a "." between "position" and "y".
Edit:
I just tried the code out and the mod builds but the projectile doesn't spawn at all :/It seems I forgot to put a "." between "position" and "y".
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TEM.Items.Hardmode.Weapons
{
public class Apophis : ModItem
{
public override void SetDefaults()
{
item.name = "Apophis";
item.damage = 100;
item.melee = true;
item.width = 66;
item.height = 66;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 10;
item.value = 0;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
}
public override Color? GetAlpha(Color lightColor)
{
return Color.White;
}
public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
Projectile.NewProjectile(target.position.X, target.position.Y - 100f, 0, 8, mod.ProjectileType("ApophisRock"), 10, 4f, Main.myPlayer, 0f, 0f);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FragmentSolar, 18);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}
}
}