diff --git a/Contents/mods/DefsLTS/media/lua/server/HandlerRecipeReturns.lua b/Contents/mods/DefsLTS/media/lua/server/HandlerRecipeReturns.lua index 3d5c591..aaefce8 100644 --- a/Contents/mods/DefsLTS/media/lua/server/HandlerRecipeReturns.lua +++ b/Contents/mods/DefsLTS/media/lua/server/HandlerRecipeReturns.lua @@ -22,3 +22,17 @@ function giveMaintenanceTools(items, result, player) player:getInventory():AddItem("Base.Wrench"); end +function GiveMeatBits (items,result,player) + local meat = nil; + for i=0,items:size() - 1 do + if instanceof(items:get(i), "Food") then + meat = items:get(i); + break; + end + end + print("calories:"..meat:getCalories()); + local meatBits = math.floor(meat:getCalories()/27) + for i=1,meatBits - 1 do + player:getInventory():AddItem("DLTS.LTSBitsMeat"); + end +end \ No newline at end of file diff --git a/Contents/mods/DefsLTS/media/scripts/LTSRecipesFood.txt b/Contents/mods/DefsLTS/media/scripts/LTSRecipesFood.txt index 89cda21..98bc968 100644 --- a/Contents/mods/DefsLTS/media/scripts/LTSRecipesFood.txt +++ b/Contents/mods/DefsLTS/media/scripts/LTSRecipesFood.txt @@ -280,21 +280,12 @@ module DLTS { /** ------------------------------------------------------------------------- **/ /** Preparing Bits from Food Items **/ - - recipe LTS Cut Bits of Meat { - keep HuntingKnife/KitchenKnife/BreadKnife/MeatCleaver/Machete/FlintKnife, - MuttonChop/PorkChop/Steak/Rabbitmeat/Salmon/FishFillet, - Result:LTSBitsMeat=7, - Sound:PZ_FoodSlicing, - Time:40.0, - Category:LTS-Food, - OnGiveXP:CraftXP_FoodBase, - } - + recipe LTS Cut Bits of Meat { - keep HuntingKnife/KitchenKnife/BreadKnife/MeatCleaver/Machete/FlintKnife, - Smallanimalmeat/Smallbirdmeat, - Result:LTSBitsMeat=3, + keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver/Machete, + MuttonChop/PorkChop/Steak/Rabbitmeat/Salmon/FishFillet/Smallanimalmeat/Smallbirdmeat, + Result:LTSBitsMeat=1, + OnCreate:GiveMeatBits, Sound:PZ_FoodSlicing, Time:40.0, Category:LTS-Food,