Endershot355
Steampunker
For some reason its saying that bubbleArmor does not exist in this context
You know how to get the correct class instance, right?For some reason its saying that bubbleArmor does not exist in this context
player.GetModPlayer<MyModPlayer>(mod).blablabla
Do try to get a better understanding of wat you're doing. Look up the function on the tModLoader wiki and try to comprehend it.public override void UpdateArmorSet(Player player)
{
player.setBonus = "Increased Melee Stats";
player.meleeDamage *= 0.3f;
player.meleeSpeed += 0.3f;
player.GetModPlayer<MyModPlayer>(mod).bubbleArmor = true;
}
Nope. Not working. Says something.
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Items\Armor\EnderuimChest.cs(36,24) : error CS0246: The type or namespace name 'MyModPlayer' could not be found (are you missing a using directive or an assembly reference?)
player.noKnockback = true;Yes it built
[doublepost=1461753485,1461753345][/doublepost]Whats the code snippet that makes you immune to knockback?
[doublepost=1461753520][/doublepost]like
player.knockback += 0f;
Thanksplayer.noKnockback = true;
Look it up on your item? Where are you trying to pull this off?Thanks
[doublepost=1461753759,1461753570][/doublepost]if ModPlayer.bubbleActive = true;
{
player.noKnockback = true;
}
This isnt seeming to work... do I have to do that long line of code again"
I am doing this in the armour code.Look it up on your item? Where are you trying to pull this off?
Why not in the ModPlayer code? You can do that there too.I am doing this in the armour code.
workedWhy not in the ModPlayer code? You can do that there too.
Why not?worked
[doublepost=1461754318,1461754123][/doublepost]SIGH
For some reason I cannot get a set bonus.
I put the full set on and it doesnt trigger any of the set bonuses, and the set bonus message isnt appearing.Why not?
Could you show your item code once again?I put the full set on and it doesnt trigger any of the set bonuses, and the set bonus message isnt appearing.
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Enderuim.Items.Armor
{
public class EnderuimChest : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Body);
return true;
}
public override void SetDefaults()
{
item.name = "Enderuim Chestplate";
item.width = 22;
item.height = 24;
item.rare = 2;
item.defense = 38;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == mod.ItemType("EnderuimHelm") && legs.type == mod.ItemType("EnderuimLeggings");
}
public override void UpdateArmorSet(Player player)
{
player.setBonus = "Staying still will make you invincable and take no knockback. Melee abilities increased.";
player.meleeDamage *= 0.3f;
player.meleeSpeed += 0.3f;
player.GetModPlayer<EnderuimBubble>(mod).bubbleArmor = true;
}
public override void UpdateEquip(Player player)
{
player.meleeDamage += 0.2f;
player.meleeSpeed += 0.2f;
}
}
}
This is the code where you check if your set is valid:Code:using System; using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace Enderuim.Items.Armor { public class EnderuimChest : ModItem { public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips) { equips.Add(EquipType.Body); return true; } public override void SetDefaults() { item.name = "Enderuim Chestplate"; item.width = 22; item.height = 24; item.rare = 2; item.defense = 38; } public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == mod.ItemType("EnderuimHelm") && legs.type == mod.ItemType("EnderuimLeggings"); } public override void UpdateArmorSet(Player player) { player.setBonus = "Staying still will make you invincable and take no knockback. Melee abilities increased."; player.meleeDamage *= 0.3f; player.meleeSpeed += 0.3f; player.GetModPlayer<EnderuimBubble>(mod).bubbleArmor = true; } public override void UpdateEquip(Player player) { player.meleeDamage += 0.2f; player.meleeSpeed += 0.2f; } } }
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == mod.ItemType("EnderuimHelm") && legs.type == mod.ItemType("EnderuimLeggings");
}
if (npc.type == NPCID.GreekSkeleton && !Main.expertMode)
{
if(Main.rand.Next(0, 15) == 0)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CaesarSword"));
}
}