Skip to content

Commit

Permalink
Creating meat bits is now dependent on calories of the meat used
Browse files Browse the repository at this point in the history
  • Loading branch information
eurqa committed Apr 6, 2024
1 parent 9a763bb commit ecc2d86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
14 changes: 14 additions & 0 deletions Contents/mods/DefsLTS/media/lua/server/HandlerRecipeReturns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 5 additions & 14 deletions Contents/mods/DefsLTS/media/scripts/LTSRecipesFood.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ecc2d86

Please sign in to comment.