public override ItemSurrogate GenerateItem(ItemData data) { ItemSurrogate newItem = new ItemSurrogate(); newItem.data = data; newItem.template = this; if (prefix != null) { EnchantmentTemplate template = prefix.GetEnchantment(); if (template != null) { newItem.Prefix = new Enchantment(template); } } if (suffix != null) { EnchantmentTemplate template = suffix.GetEnchantment(); if (template != null) { newItem.Suffix = new Enchantment(template); } } SetupGraph(newItem); ItemInputNode node = GetNode <ItemInputNode> (); newItem.owner.onChanged += () => { if (node == null) { return; } node.Owner[newItem].Value = newItem.owner.Value; }; node.StackSize[newItem].Value = newItem.Quantity; newItem.data.quantity.onChanged += () => { node.StackSize[newItem].Value = newItem.Quantity; }; return(newItem); }
public override ItemSurrogate GenerateItem(ItemData data) { ItemSurrogate newItem = new ItemSurrogate { data = data, template = this }; SetupGraph(newItem); IInputNode <ItemSurrogate>[] itemNodes = GetNodes <IInputNode <ItemSurrogate> > (); foreach (var itemNode in itemNodes) { itemNode.SetTarget(newItem, newItem); } if (prefix != null) { EnchantmentTemplate template = prefix.GetEnchantment(); if (template != null) { newItem.Prefix = new Enchantment(template); } } if (suffix != null) { EnchantmentTemplate template = suffix.GetEnchantment(); if (template != null) { newItem.Suffix = new Enchantment(template); } } return(newItem); }
public Enchantment(EnchantmentTemplate _template) { template = _template; }
public EnchantmantData(EnchantmentTemplate id, short overrideSeed) { //EnchantmentID = EnchantmentDatabase.Instance.Enchantments.GetKey (ID); seed.Value = overrideSeed; }
public EnchantmantData(EnchantmentTemplate id) { //EnchantmentID = EnchantmentDatabase.Instance.Enchantments.GetKey (ID); seed.Value = RandomSeed(); }