private void UpdateBlueprint(ItemBlueprint bp, JSONObject o) { bp.rarity = GetRarity(o); if (!_craftingController) { bp.time = o.GetFloat("time", 0); } bp.amountToCreate = o.GetInt("amountToCreate", 1); //bp.UnlockPrice = o.GetInt("UnlockPrice", 0); //bp.UnlockLevel = o.GetInt("UnlockLevel", 10); bp.blueprintStackSize = o.GetInt("blueprintStackSize"); //bp.userCraftable = o.GetBoolean("userCraftable", true); bp.isResearchable = o.GetBoolean("isResearchable", true); bp.NeedsSteamItem = o.GetBoolean("NeedsSteamItem", false); var ingredients = o.GetArray("ingredients"); bp.ingredients.Clear(); foreach (var ingredient in ingredients) { var itemDef = GetItem(ingredient.Obj, "shortname"); if (itemDef == null) { continue; } bp.ingredients.Add(new ItemAmount(itemDef, ingredient.Obj.GetFloat("amount", 0))); } }
private void UpdateGatherPropertyEntry(ResourceDispenser.GatherPropertyEntry entry, JSONObject obj) { entry.conditionLost = obj.GetFloat("conditionLost", 0); entry.destroyFraction = obj.GetFloat("destroyFraction", 0); entry.gatherDamage = obj.GetFloat("gatherDamage", 0); }