wch
Terrarian
Aha, now I understand this.You'll want to look up the difference between = and ==. One is assigning, and the other is comparing for equality. The code "head.name = "Wooden Helmet"" is actually returning the string "Wooden Helmet", not a boolean value as you assumed.
As for my "Super Ironskin Potion", it failed again... This is quite heart-breaking.
You see
public class SuperIronskin : ModItem
{
public override void SetDefaults()
{
item.name = "Super Ironskin Potion";
item.width = 12;
item.height = 12;
item.value = 200;
item.maxStack = 999;
AddTooltip("This is a stronger Iron Potion.");
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
}
public override bool ConsumeItem(Player player)
{
player.AddBuff(BuffID.Ironskin, 120);
return true;
}
Well, I do create an item named "Super Ironskin Potion" with the texture I attached. Problem is...wired. I cannot drink it actually. Really don't know what to do.
One more thing, could you send me a copy of decompiled files of vanilla game?
Maybe I don't need the entire game, but having some weapon, armor and potion examples could be really useful, for I frequently stuck in some really basic questions like "how to express 'critical damage chance'" or "how to give a bonus to defense".
It seems you know all these stuff! I simply don't realize I should use the sentence "player.meleeCrit += 1" to modify the "critical damage chance".
Have you seen to the decompiled files? Or this is just a kind of knowledge? I think it would be annoying if I'm going to ask every single usage of these, maybe you could tell me where I can refer to.