thekaner
Terrarian
I've made a working flail, but I've no idea how to set the chain ID. The strangest part to me is that the chain that is shown at default is not from the weapon I've decided to CloneDefaults from (I just did that to ensure the AI works properly, and to speed up some development process), although I have heard in past updates that chains go in the projectile code anyway.
The chain it defaults too is the blue Chain3 texture and I'm not sure why, I thought maybe it would be the default Chain texture, nothing, or hopefully the file I named 'MFlailCopper_Chain' in the same folder.
Please help! here is the code I'm using (Not sure how to place a 'code' looking thing like some people, so here it is just raw in text).
Item Code:
internal class MFlailCopper : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Copper Flail");
//Tooltip.SetDefault("Go crazy!");
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults()
{
Item.CloneDefaults(ItemID.Mace);
//Item.width = 32;
//Item.height = 32;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 11;
Item.knockBack = 5;
Item.useAnimation = Item.useTime = 120;
Item.scale = 1.1f;
Item.noUseGraphic = true;
Item.shootSpeed = 5f;
Item.UseSound = SoundID.Item1;
Item.rare = ItemRarityID.White;
Item.channel = true;
Item.noMelee = true;
Item.shoot = ModContent.ProjectileType<MFlailCopperProjectile>();
}
public override void AddRecipes()
{
Recipe copperCowl = CreateRecipe();
copperCowl.AddIngredient(ItemID.CopperBar, 7);
copperCowl.AddIngredient(ItemID.Chain, 8);
copperCowl.AddRecipeGroup("Wood", 8);
copperCowl.AddTile(TileID.HeavyWorkBench);
copperCowl.Register();
}
}
Projectile Code
internal class MFlailCopperProjectile : ModProjectile
{
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.ownerHitCheck = true;
Projectile.ownerHitCheckDistance = 100f;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 3000;
Projectile.aiStyle = ProjAIStyleID.Flail;
}
}
The chain it defaults too is the blue Chain3 texture and I'm not sure why, I thought maybe it would be the default Chain texture, nothing, or hopefully the file I named 'MFlailCopper_Chain' in the same folder.
Please help! here is the code I'm using (Not sure how to place a 'code' looking thing like some people, so here it is just raw in text).
Item Code:
internal class MFlailCopper : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Copper Flail");
//Tooltip.SetDefault("Go crazy!");
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults()
{
Item.CloneDefaults(ItemID.Mace);
//Item.width = 32;
//Item.height = 32;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 11;
Item.knockBack = 5;
Item.useAnimation = Item.useTime = 120;
Item.scale = 1.1f;
Item.noUseGraphic = true;
Item.shootSpeed = 5f;
Item.UseSound = SoundID.Item1;
Item.rare = ItemRarityID.White;
Item.channel = true;
Item.noMelee = true;
Item.shoot = ModContent.ProjectileType<MFlailCopperProjectile>();
}
public override void AddRecipes()
{
Recipe copperCowl = CreateRecipe();
copperCowl.AddIngredient(ItemID.CopperBar, 7);
copperCowl.AddIngredient(ItemID.Chain, 8);
copperCowl.AddRecipeGroup("Wood", 8);
copperCowl.AddTile(TileID.HeavyWorkBench);
copperCowl.Register();
}
}
Projectile Code
internal class MFlailCopperProjectile : ModProjectile
{
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.ownerHitCheck = true;
Projectile.ownerHitCheckDistance = 100f;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 3000;
Projectile.aiStyle = ProjAIStyleID.Flail;
}
}