时间:2016-01-30 09:07:57 来源:当游网 作者:当游网 编辑:rawsyww 字体大小:
太妃糖:
taffy =
{
test = function(cooker, names, tags) return tags.sweetener and tags.sweetener >= 3 and not tags.meat end,
priority = 10,
foodtype = "VEGGIE",
health = -TUNING.HEALING_SMALL,
hunger = TUNING.CALORIES_SMALL*2,
perishtime = TUNING.PERISH_SLOW,
sanity = TUNING.SANITY_MED,
cooktime = 2,
tags = {"honeyed}
},
这个公式里面有tags.sweetener >= 3,意味着甜度大于等于3。整个公式是说:甜度大于等于3,且不能有肉(not tags.meat)。那么这里就要用到之前cooking.lua里面的数据了。在cooking.lua里面搜索sweetener,找到唯一一行:
AddIngredientValues({"honey", "honeycomb}, {sweetener=1}, true)
意味着蜂蜜和蜂房都可以提供1甜度。那么我们就知道,至少需要三个蜂蜜或蜂房。当然,拿蜂房做菜非常的奢侈。
另外要注意太妃糖里面health = -TUNING.HEALING_SMALL,这一行。注意等号后面的那个负号,意味着吃太妃糖要损血,减少的血量是HEALING_SMALL,具体值可以在tuning.lua里面查询。
茄子饭/茄子煲/茄子杂烩之类的名字:
stuffedeggplant =
{
test = function(cooker, names, tags) return (names.eggplant or names.eggplant_cooked) and tags.veggie and tags.veggie > 1 end,
priority = 1,
foodtype = "VEGGIE",
health = TUNING.HEALING_SMALL,
hunger = TUNING.CALORIES_LARGE,
perishtime = TUNING.PERISH_SLOW,
sanity = TUNING.SANITY_TINY,
temperature = TUNING.HOT_FOOD_BONUS_TEMP,
temperatureduration = TUNING.FOOD_TEMP_BRIEF,
cooktime = 2,
},
这里面出现了稀有的温度属性:
temperature = TUNING.HOT_FOOD_BONUS_TEMP,
temperatureduration = TUNING.FOOD_TEMP_BRIEF,
temperature是温度影响,HOT_FOOD_BONUS_TEMP,可以在tuning.lua里面搜到是40,显然吃这个会让角色体温升高。相对的还有COLD_FOOD_BONUS_TEMP=-40,意思也不用我说了吧。
temperatureduration是温度持续时间,可以在tuning.lua里面搜到FOOD_TEMP_BRIEF = 5。当然数值越长,持续越久。由于没有装显示体温的mod,也无力测试具体数值,有兴趣的话大家可以自己试试。
鱼排:
fishsticks =
{
test = function(cooker, names, tags) return tags.fish and names.twigs and (tags.inedible and tags.inedible <= 1) end,
priority = 10,
foodtype = "MEAT",
health = TUNING.HEALING_LARGE,
hunger = TUNING.CALORIES_LARGE,
perishtime = TUNING.PERISH_MED,
sanity = TUNING.SANITY_TINY,
cooktime = 2,
tags = {"catfood}
},
公式里面出现了tags.inedible,inedible在这里可以解释为“不可食度”,唯一具有该度的就是树枝(twigs)。tags.inedible and tags.inedible <= 1就是说有不可食度大于0,不大于1。整个公式是说:有鱼(tags.fish),有树枝(names.twigs),且不可食度大于0,不大于1。再简单点讲就是有鱼,有且仅有一个树枝。
下面一条tags = {"catfood},应该与RoG DLC中的猫相关。
SW里面的咖啡:
coffee =
{
test = function(cooker, names, tags) return names.coffeebeans_cooked and (names.coffeebeans_cooked == 4 or (names.coffeebeans_cooked == 3 and (tags.dairy or tags.sweetener))) end,
priority = 30,
foodtype = "VEGGIE",
health = TUNING.HEALING_SMALL,
hunger = TUNING.CALORIES_TINY,
perishtime = TUNING.PERISH_MED,
sanity = -TUNING.SANITY_TINY,
caffeinedelta = TUNING.CAFFEINE_FOOD_BONUS_SPEED,
caffeineduration = TUNING.FOOD_SPEED_LONG,
cooktime = 0.5,
},
相信看到这里的人应该能看懂公式了:4个烤咖啡豆或者3烤咖啡豆加一奶制品或蜂蜜。
下面比较特殊的两行:
caffeinedelta = TUNING.CAFFEINE_FOOD_BONUS_SPEED,
caffeineduration = TUNING.FOOD_SPEED_LONG,
咖啡的效果在于加速,caffeinedelta为增加的速度量
tuning.lua中有:
CAFFEINE_FOOD_BONUS_SPEED = 5, -- player base speed plus this, 6 is normal walk speed
好心的程序员用注释告诉我们,普通行走速度为6,喝了咖啡再加5,将近翻倍。
然后持续时间caffeineduration = FOOD_SPEED_LONG = total_day_time / 2,喝咖啡加速效果持续半天。
以上就是饥荒游戏中食谱代码的解析了,希望对玩家们有所帮助。
0
提示:支持键盘“← →”键翻页