Misi
Terrarian
Hello! im having trouble to find where my mistake is, i cant find the reason why my mod seems to be lacking a resource or something.
I think the main problem is happening on the line: "using ElexonPLayStyle.Content.Items.projectiles.Armas;", since it seems that the part: ''projectiles.Armas;'' cannot find the class: "EspadaCortaProyectil" from the code: "EspadaCortaProyectil.cs"
If someone would be interested in helping me i would be so grate full,
Also sorry if some words are in Spanish.
I think the main problem is happening on the line: "using ElexonPLayStyle.Content.Items.projectiles.Armas;", since it seems that the part: ''projectiles.Armas;'' cannot find the class: "EspadaCortaProyectil" from the code: "EspadaCortaProyectil.cs"
If someone would be interested in helping me i would be so grate full,
Also sorry if some words are in Spanish.
C#:
using Terraria;
using Terraria.ModLoader;
using Terraria.GameContent.Creative;
using Terraria.ID;
using ElexonPLayStyle.Content.Items.projectiles.Armas;
namespace ElexonPLayStyle.Content.Items.Armas
{ internal class EspadaCorta: ModItem
{
public override void SetStaticDefaults()
{
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 32;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Rapier;
Item.UseSound = SoundID.Item1;
Item.DamageType = DamageClass.Melee;
Item.damage = 17;
Item.knockBack = 4f;
Item.rare = ItemRarityID.Red;
Item.value = Item.buyPrice(gold: 20);
Item.noUseGraphic = true;
Item.noMelee = true;
Item.shootSpeed = 2.1f;
Item.shoot = ModContent.ProjectileType<EspadaCortaProyectil>();
}
}
}
C#:
using Terraria;
using Terraria.ModLoader;
using Terraria.GameContent.Creative;
using Terraria.ID;
using Microsoft.Xna.Framework;
namespace ElexonPLayStyle.Content.Items.Projectiles.Armas
{
internal class EspadaCortaProyectil : ModProjectile
{
public override void SetDefaults()
{
Projectile.width = 24;
Projectile.height = 24;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Melee;
Projectile.ownerHitCheck = true;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 300;
Projectile.aiStyle = ProjAIStyleID.ShortSword;
}
public override void AI()
{
base.AI();
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 - MathHelper.PiOver4 * Projectile.spriteDirection;
int halfProjWidth = Projectile.width / 2;
int halfProjHeight = Projectile.height / 2;
DrawOriginOffsetX = 0;
DrawOffsetX = -((40 / 2) - halfProjWidth);
DrawOriginOffsetY = -((40 / 2) - halfProjHeight);
}
}
}