/// <summary> /// Validly adds an affix to the item. /// </summary> /// <param name="item"></param> public bool AddRandomAffix(Item item) { Affix newAffix = PoMAffixController.RollNewAffix(this, item); if (newAffix == null) { return(false); } AddAffix(newAffix, item); UpdateName(item); return(true); }
public void RollAffixes(NPC npc) { Affix newAffix; int freeAffixes = FreeAffixes; for (int i = 0; i < freeAffixes; i++) { if (i >= rarity.minAffixes && Main.rand.NextFloat(0, 1) > rarity.chanceToRollAffix) { break; } newAffix = PoMAffixController.RollNewAffix(this, npc); if (newAffix == null) { break; } AddAffix(newAffix, npc); } }