Add brew, mill, and thread to ban-cooking. See #796.

brew: bans cooking of plants and fruits that can be made into alcohol
(assuming default brewing reaction)
mill: bans cooking of plants that can be milled.
thread: bans cooking of plants that can be turned into thread.
develop
Ben Lubar 2016-01-18 15:07:09 -06:00
parent 0b2ba377be
commit d36bb20d91
1 changed files with 26 additions and 1 deletions

@ -5,7 +5,8 @@ ban-cooking
=========== ===========
A more convenient way to ban cooking various categories of foods than the A more convenient way to ban cooking various categories of foods than the
kitchen interface. Usage: ``ban-cooking <type>``. Valid types are ``booze``, kitchen interface. Usage: ``ban-cooking <type>``. Valid types are ``booze``,
``honey``, ``tallow``, ``oil``, and ``seeds`` (non-tree plants with seeds). ``honey``, ``tallow``, ``oil``, ``seeds`` (non-tree plants with seeds),
``brew``, ``mill``, and ``thread``.
=end =end
@ -87,11 +88,35 @@ $script_args.each do |arg|
end end
end end
when 'brew'
df.world.raws.plants.all.each do |p|
m = df.decode_mat(p.material_defs.type_basic_mat, p.material_defs.idx_basic_mat).material
ban_cooking[p.material_defs.type_basic_mat, p.material_defs.idx_basic_mat, :PLANT] if m.reaction_product and m.reaction_product.id and m.reaction_product.id.include?('DRINK_MAT')
p.growths.each do |g|
m = df.decode_mat(g).material
ban_cooking[g.mat_type, g.mat_index, :PLANT_GROWTH] if m.reaction_product and m.reaction_product.id and m.reaction_product.id.include?('DRINK_MAT')
end
end
when 'mill'
df.world.raws.plants.all.each do |p|
ban_cooking[p.material_defs.type_basic_mat, p.material_defs.idx_basic_mat, :PLANT] if m.flags[:MILL]
end
when 'thread'
df.world.raws.plants.all.each do |p|
ban_cooking[p.material_defs.type_basic_mat, p.material_defs.idx_basic_mat, :PLANT] if m.flags[:THREAD]
end
else else
puts "ban-cooking booze - bans cooking of drinks" puts "ban-cooking booze - bans cooking of drinks"
puts "ban-cooking honey - bans cooking of honey bee honey" puts "ban-cooking honey - bans cooking of honey bee honey"
puts "ban-cooking tallow - bans cooking of tallow" puts "ban-cooking tallow - bans cooking of tallow"
puts "ban-cooking oil - bans cooking of oil" puts "ban-cooking oil - bans cooking of oil"
puts "ban-cooking seeds - bans cooking of plants that have seeds (tree seeds don't count)" puts "ban-cooking seeds - bans cooking of plants that have seeds (tree seeds don't count)"
puts "ban-cooking brew - bans cooking of plants that can be brewed into alcohol"
puts "ban-cooking mill - bans cooking of plants that can be milled into powder"
puts "ban-cooking thread - bans cooking of plants that can be turned into thread"
end end
end end