L-F Hunter
Terrarian
I'm having an error with some of my code. When I tried to build it, it displayed this message:
c:\Users\J Simp\Documents\My Games\Terraria\ModLoader\Mod Sources\GracelessMod\Items\Armor\NaturalHood.cs(28,63) : error CS0118: 'GracelessMod.Items' is a 'namespace' but is used like a 'type'
I searched everywhere within my code, but I could not find a problem. I would appreciate any help I could get on the subject.
Code Causing Error:
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace GracelessMod.Items.Armor
{
public class NaturalHood : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Head);
return true;
}
public override void SetDefaults()
{
item.name = "Natural Hood";
item.width = 18;
item.height = 18;
item.toolTip = "You can hear the call of the wild drumming in your ear";
AddTooltip2("+20% Summon Knockback");
item.value = 10000;
item.rare = 1;
item.defense = 1;
}
public override bool IsArmorSet(Item head, Item body, Items legs)
{
return body.type == mod.ItemType("NaturalRobe") && legs.type = null;
}
public override void UpdateArmorSet(Player player)
{
player.summonKnockback *= 1.20F;
}
public override void UpdateEquip(Player player)
{
player.moveSpeed += 0.05F;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "EssenseOfGaia", 2);
recipe.AddIngredient(null, "Wood", 15);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
c:\Users\J Simp\Documents\My Games\Terraria\ModLoader\Mod Sources\GracelessMod\Items\Armor\NaturalHood.cs(28,63) : error CS0118: 'GracelessMod.Items' is a 'namespace' but is used like a 'type'
I searched everywhere within my code, but I could not find a problem. I would appreciate any help I could get on the subject.
Code Causing Error:
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace GracelessMod.Items.Armor
{
public class NaturalHood : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Head);
return true;
}
public override void SetDefaults()
{
item.name = "Natural Hood";
item.width = 18;
item.height = 18;
item.toolTip = "You can hear the call of the wild drumming in your ear";
AddTooltip2("+20% Summon Knockback");
item.value = 10000;
item.rare = 1;
item.defense = 1;
}
public override bool IsArmorSet(Item head, Item body, Items legs)
{
return body.type == mod.ItemType("NaturalRobe") && legs.type = null;
}
public override void UpdateArmorSet(Player player)
{
player.summonKnockback *= 1.20F;
}
public override void UpdateEquip(Player player)
{
player.moveSpeed += 0.05F;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "EssenseOfGaia", 2);
recipe.AddIngredient(null, "Wood", 15);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}