using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace SacredTools.Weapons
{
public class NovaKnifePack : ModItem
{
public override void SetDefaults()
{
item.name = "Nova Knife Pack";
item.damage = 90;
item.noMelee = true;
item.thrown = true;
item.width = 40;
item.height = 40;
item.toolTip = "'throws several Nova Knifes'";
item.useTime = 16;
item.useAnimation = 16;
item.useStyle = 1;
item.knockBack = 4;
item.rare = 10;
item.value = Item.sellPrice(0, 10, 0, 0);
item.useSound = 1;
item.autoReuse = false;
item.shoot = mod.ProjectileType("NovaKnife");
item.shootSpeed = 10f;
item.useTurn = true;
item.maxStack = 1;
item.consumable = false;
item.noUseGraphic = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "FragmentNova", 18);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this, 15);
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float spread = 45f * 0.0174f;//45 degrees converted to radians
float baseSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
double baseAngle = Math.Atan2(speedX, speedY);
double randomAngle = baseAngle+(Main.rand.NextFloat()-0.5f)*spread;
speedX = baseSpeed*(float)Math.Sin(randomAngle);
speedY = baseSpeed*(float)Math.Cos(randomAngle);
return true;
}
}
}
nvm, found something... problem is: WHY DOES THIS NOT WORK?!?!?!
Code:using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ModLoader; namespace SacredTools.Weapons { public class NovaKnifePack : ModItem { public override void SetDefaults() { item.name = "Nova Knife Pack"; item.damage = 90; item.noMelee = true; item.thrown = true; item.width = 40; item.height = 40; item.toolTip = "'throws several Nova Knifes'"; item.useTime = 16; item.useAnimation = 16; item.useStyle = 1; item.knockBack = 4; item.rare = 10; item.value = Item.sellPrice(0, 10, 0, 0); item.useSound = 1; item.autoReuse = false; item.shoot = mod.ProjectileType("NovaKnife"); item.shootSpeed = 10f; item.useTurn = true; item.maxStack = 1; item.consumable = false; item.noUseGraphic = true; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "FragmentNova", 18); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 15); recipe.AddRecipe(); } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float spread = 45f * 0.0174f;//45 degrees converted to radians float baseSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY); double baseAngle = Math.Atan2(speedX, speedY); double randomAngle = baseAngle+(Main.rand.NextFloat()-0.5f)*spread; speedX = baseSpeed*(float)Math.Sin(randomAngle); speedY = baseSpeed*(float)Math.Cos(randomAngle); return true; } } }
it always gets the GetTexture error and the mod gets disabled... WHY?!?!?! THERE IS THE SPRITE!!!!!!!!!!!!
What do I do with the ExampleMod when I download it? Do I put the Mod Sources folder and dllReferences folder in the Mod Compile Folder?
Check method damage in the vanilla code, with the type of a rocket. (Then, you include that in OnhitNpc or other.)hey snrasha ur back!
sorry to bother, but how do i make a projectile make an animated explosion when it hits something??
(with sound and dust and stuff, and damage)
SORRY, I DIDNT FIND ANYTHING