public void CreateItem(Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem) { // Verify if the type is in the list of the craftable item if (CraftItems.SearchFor(type) != null) { realCraftItem.Craft(from, this, typeRes, tool); } }
public virtual CraftItem FindCraft(Type type, bool subClasses) { if (CraftItems != null) { return(subClasses ? CraftItems.SearchForSubclass(type) : CraftItems.SearchFor(type)); } return(null); }
public void CreateItem(Mobile from, Type type, Type typeRes, ITool tool, CraftItem realCraftItem) { CraftItem craftItem = CraftItems.SearchFor(type); if (craftItem != null) { realCraftItem.Craft(from, this, typeRes, tool); } }
public int AddMapCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, int maplevel, TextDefinition nameRes, int amount, TextDefinition message) { CraftItem craftItem = new CraftItem(typeItem, group, name); craftItem.AddMapRes(typeRes, maplevel, nameRes, amount, message); craftItem.AddSkill(MainSkill, minSkill, maxSkill); DoGroup(group, craftItem); return(CraftItems.Add(craftItem)); }
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) { CraftItem craftItem = new CraftItem(typeItem, group, name); craftItem.AddRes(typeRes, nameRes, amount, message); craftItem.AddSkill(skillToMake, minSkill, maxSkill); DoGroup(group, craftItem); return(CraftItems.Add(craftItem)); }
private void Awake() { items = FindObjectOfType <Items>(); player = FindObjectOfType <Player>(); inventory = FindObjectOfType <Inventory>(); move = FindObjectOfType <Movement>(); battleM = FindObjectOfType <BattleEvent>(); clas = FindObjectOfType <Classes>(); craft = FindObjectOfType <CraftItems>(); }
public void CreateItem(Mobile from, Type type, Type typeRes, ITool tool, CraftItem realCraftItem) { // Verify if the type is in the list of the craftable item CraftItem craftItem = CraftItems.SearchFor(type); if (craftItem != null) { // The item is in the list, try to create it // Test code: items like sextant parts can be crafted either directly from ingots, or from different parts realCraftItem.Craft(from, this, typeRes, tool); //craftItem.Craft( from, this, typeRes, tool ); } }
public virtual int AddCraft(CraftInfo info) { if (info == null || info.TypeOf == null || info.Resources == null || info.Resources.Length == 0) { return(-1); } var item = info.TypeOf.CreateInstanceSafe <Item>(); if (item == null) { return(-1); } item.Delete(); var res = info.Resources[0]; var index = AddCraft( info.TypeOf, info.Group, info.Name, info.MinSkill, info.MaxSkill, res.TypeOf, res.Name, res.Amount, String.Format("You do not have the required {0} to craft that item.", res.Name.GetString())); if (info.Resources.Length > 1) { foreach (var r in info.Resources.Skip(1)) { AddRes( index, r.TypeOf, r.Name, r.Amount, String.Format("You do not have the required {0} to craft that item.", r.Name.GetString())); } } info.OnAdded(CraftItems.GetAt(index)); return(index); }
/// <summary> /// Стоимость покупки за основную валюту /// </summary> public decimal?GetBuyCost(Data data) { if (!CraftItems.Any()) { return(null); } var sum = 0m; foreach (var craftItem in CraftItems) { var cost = craftItem.GetBuyPrice(data); if (cost == null) { return(null); } var value = cost.Value; if (craftItem.ItemId == Item.WorkScoreId) { var pro = data.Professions.FirstOrDefault(p => p.Id == ProfessionId); if (pro != null && pro.Level > 0) { var oldCount = craftItem.Count; try { craftItem.Count = Math.Round(craftItem.Count * pro.GetRatio()); value = craftItem.GetBuyPrice(data).Value; } finally { craftItem.Count = oldCount; } } } sum += value; } return(sum); }
public void SetUseSubRes2(int index, bool val) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.UseSubRes2 = val; }
public void AddRecipe(int index, int id) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddRecipe(id, this); }
public void AddResCallback(int index, Func <Mobile, ConsumeType, int> func) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ConsumeResCallback = func; }
public void AddSkill(int index, SkillName skillToMake, double minSkill, double maxSkill) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddSkill(skillToMake, minSkill, maxSkill); }
public void AddCraftItem(CraftItem craftItem) { CraftItems.Add(craftItem); }
public void SetBeverageType(int index, BeverageType requiredBeverage) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiredBeverage = requiredBeverage; }
public void SetDisplayID(int index, int id) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.DisplayID = id; }
public void AddCraftAction(int index, Action <Mobile, CraftItem, ITool> action) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.TryCraft = action; }
public void SetRequiresMechanicalLife(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresMechanicalLife = true; }
public void SetNeedOven(int index, bool needOven) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedOven = needOven; }
public void SetRequireResTarget(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresResTarget = true; }
public void SetRequiresBasketWeaving(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresBasketWeaving = true; }
public void SetNeedMill(int index, bool needMill) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedMill = needMill; }
public void ForceExceptional(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ForceExceptional = true; }
/// <summary> /// Add a callback Action to allow mutating the crafted item. Handy when you have a single Item Type but you want to create variations of it. /// </summary> /// <param name="index"></param> /// <param name="action"></param> public void SetMutateAction(int index, Action <Mobile, Item, ITool> action) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.MutateAction = action; }
public void SetMinSkillOffset(int index, double skillOffset) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.MinSkillOffset = skillOffset; }
public void SetForceSuccess(int index, int success) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ForceSuccessChance = success; }
public void AddCreateItem(int index, Func <Mobile, CraftItem, ITool, Item> func) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.CreateItem = func; }
public void AddMapRes(int index, Type type, int maplevel, TextDefinition name, int amount, TextDefinition message) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddMapRes(type, maplevel, name, amount, message); }
public void SetData(int index, object data) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.Data = data; }
public void SetNeedWater(int index, bool needWater) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedWater = needWater; }