時間:2016-01-30 09:07:57 來源:當游網(wǎng) 作者:當游網(wǎng) 編輯: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里面的數(shù)據(jù)了。在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,
},
這里面出現(xiàn)了稀有的溫度屬性:
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是溫度持續(xù)時間,可以在tuning.lua里面搜到FOOD_TEMP_BRIEF = 5。當然數(shù)值越長,持續(xù)越久。由于沒有裝顯示體溫的mod,也無力測試具體數(shù)值,有興趣的話大家可以自己試試。
魚排:
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}
},
公式里面出現(xiàn)了tags.inedible,inedible在這里可以解釋為“不可食度”,唯一具有該度的就是樹枝(twigs)。tags.inedible and tags.inedible <= 1就是說有不可食度大于0,不大于1。整個公式是說:有魚(tags.fish),有樹枝(names.twigs),且不可食度大于0,不大于1。再簡單點講就是有魚,有且僅有一個樹枝。
下面一條tags = {"catfood},應(yīng)該與RoG DLC中的貓相關(guān)。
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,
},
相信看到這里的人應(yīng)該能看懂公式了: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,將近翻倍。
然后持續(xù)時間caffeineduration = FOOD_SPEED_LONG = total_day_time / 2,喝咖啡加速效果持續(xù)半天。
以上就是饑荒游戲中食譜代碼的解析了,希望對玩家們有所幫助。
0
提示:支持鍵盤“← →”鍵翻頁