diff --git a/crops.csv b/crops.csv index e27de35..e558b3e 100644 --- a/crops.csv +++ b/crops.csv @@ -1,11 +1,27 @@ -#name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,light_min,light_max,infect_rate_base,infect_rate_monoculture,spread_rate -default,1,,10,8,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -barley,1,,10,7,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -coffee,1,,20,5,2,1,,,,1,,3,25,50,10,50,50,1000,11,14,1e-5,1e-3,1e-3 -cocoa,1,,20,5,2,1,,,,1,,3,25,50,10,50,50,1000,11,14,1e-5,1e-3,1e-3 -corn,1,,10,8,2,1,,,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -culturewheat,1,,100,4,2,,11,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -mustard,1,,10,5,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -potato,1,,10,4,2,1,,,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -spelt,1,,10,7,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 -wheat,1,culturewheat,10,8,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3 +#name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,to_dig,has_harvest,on_soil,punchable,infectable,seed_extractable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,light_min,light_max,infect_rate_base,infect_rate_monoculture,spread_rate +default,1,,10,8,2,1,,,,,,,,3,15,50,10,50,0,31000,11,14,1E-05,0.001,0.001 +barley,1,,10,7,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +beetroot,1,,10,5,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +blackberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +blueberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +carrot,1,,10,8,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +chili,1,,20,8,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001 +coffee,1,,20,5,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001 +cocoa,1,,20,5,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001 +corn,1,,10,8,2,2,,,,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +cotton,1,,10,8,2,2,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +culturewheat,1,,100,4,2,1,1,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +garlic,1,,10,5,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +hemp,,,10,8,2,2,,,1,1,,1,,3,,50,10,50,0,100,11,14,1E-05,0.001,0.001 +hop,1,,10,7,2,1,,,1,1,1,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +mustard,1,,10,5,2,1,,,1,,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +potato,1,,10,4,2,2,,,,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +raspberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +rhubarb,1,,10,3,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +spelt,1,,10,7,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +strawberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +tea,1,,20,5,2,1,,,,,1,,1,3,25,50,10,50,50,,11,14,1E-05,0.001,0.001 +tobaco,,,10,8,2,2,,,,1,,1,1,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +tomato,1,,10,8,2,1,,,1,1,1,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 +urtica,,,10,8,2,1,,,1,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.01 +wheat,1,culturewheat,10,8,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001 diff --git a/crops.lua b/crops.lua index c663212..6cdbd1c 100644 --- a/crops.lua +++ b/crops.lua @@ -7,11 +7,10 @@ local crop_definition = {} local file = io.open(farming.path .. "/crops.csv", "r") for line in file:lines() do local attribs = line:split(",", true) - local name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable,snappy, - temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,infect_rate_base, - infect_rate_monoculture,spread_rate = unpack(attribs) + local name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable, + seed_extractable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max, + infect_rate_base,infect_rate_monoculture,spread_rate = unpack(attribs) if #name > 0 and name:sub(1,1) ~= "#" and #enabled > 0 and #steps > 0 then - print(dump(attribs)) biom_def={min_temp=tonumber(temperature_min) or 0, max_temp=tonumber(temperature_max) or 100, min_humidity=tonumber(humidity_min) or 0, @@ -19,25 +18,22 @@ for line in file:lines() do spawnon={spawn_min=tonumber(elevation_min) or 0, spawn_max=tonumber(elevation_max)} or 31000, } - print(dump(biom_def)) - local crop_biom=farming.get_biomes(biom_def) - print(dump(crop_biom)) crop_definition[name]={ paramtype2 = "meshoptions", fertility = {"grassland"}, place_param2 = 3, groups = {farming=1}, steps = tonumber(steps), - grow_time_mean=tonumber(grow_time_mean) or 100, - harvest_max=tonumber(harvest_max) or 2, - light_min=tonumber(light_min) or 13, + grow_time_mean=tonumber(grow_time_mean), + harvest_max=tonumber(harvest_max), + light_min=tonumber(light_min), light_max=tonumber(light_max) or default.LIGHT_MAX, - temperature_min=tonumber(temperature_min) or 0, - temperature_max=tonumber(temperature_max) or 100, - humidity_min=tonumber(humidity_min) or 0, - humidity_max=tonumber(humidity_max) or 100, - elevation_min=tonumber(elevation_min) or 0, - elevation_max=tonumber(elevation_max) or 31000, + temperature_min=tonumber(temperature_min), + temperature_max=tonumber(temperature_max), + humidity_min=tonumber(humidity_min), + humidity_max=tonumber(humidity_max), + elevation_min=tonumber(elevation_min), + elevation_max=tonumber(elevation_max), description=S(name), eat_hp=tonumber(eat_hp), next_plant=next_plant, @@ -68,6 +64,36 @@ for line in file:lines() do if #infectable > 0 then crop_definition[name].groups["infectable"]=tonumber(infectable) end + if #seed_extractable > 0 then + crop_definition[name].groups["seed_extractable"]=tonumber(seed_extractable) + end + if #snappy > 0 then + crop_definition[name].groups["snappy"]=tonumber(snappy) + else + crop_definition[name].groups["snappy"]=3 + end end - print(dump(crop_definition)) end + +if crop_definition["default"]~=nil then + local default_def = crop_definition["default"] + print(#crop_definition) + print(dump(default_def)) + for i,tdef in ipairs(crop_definition) do + print(dump(tdef)) + if tdef.name ~= "default" then + local tdef_name = tdef.name + for _,colu in ipairs({"rarety","harvest_max","temperature_min","temperature_max", + "humidity_min","humidity_max","elevation_min","elevation_max", + "infect_rate_base","infect_rate_monoculture","spread_rate"}) do + print(colu) + if crop_definition[tdef_name][colu] == nil then + print(colu) + print(default_def[colu]) + crop_definition[tdef_name][colu] = default_def[colu] + end + end + end + end +end +-- print(dump(crop_definition)) diff --git a/locale/de.po b/locale/de.po index 69e7e12..6e43762 100644 --- a/locale/de.po +++ b/locale/de.po @@ -86,3 +86,15 @@ msgstr "Tomate" msgid "Hops" msgstr "Hopfen" + +msgid "Urtica" +msgstr "Brennnessel" + +msgid "Hemp" +msgstr "Hanf" + +msgid "Tobaco" +msgstr "Tabak" + +msgid "Tea" +msgstr "Tee"