Tomb Titivator
Posts: 857
Joined: Monday, 31st January 2011, 23:19
Auto Butcher
https://crawl.develz.org/tavern/viewtopic.php?f=5&t=5624
Now this code is incredibly short... so I'm wondering... if I fixed it up a bit to deal with spriggans and mummies not eating meat and ghouls and orcs eating rotten meat and tossed it in a LUA file could it possibly be officially added to the game?
The script is as follows:
- Code:
sacrifice_before_explore=true
autopickup_no_burden=false
runrest_stop_message=corpse
confirm_butcher=never
easy_eat_gourmand=true
easy_eat_contaminated=true
auto_eat_chunks=true
prompt_for_swap=false
:function hungry()
: if you.nauseous() then return you.hunger()<2 end
: if you.gourmand() or you.race()=="Kobold" or you.race()=="Felid"
: then return you.hunger()<7
: end
: return you.hunger()<4
:end
:function over(a)
: for _,b in pairs(you.floor_items()) do
: if b.name()==a.name() then return true end
: end
:end
:function corpse_dance(a)
: if not hungry() or not string.find(a.name(),"corpse")
: or food.rotting(a) or food.dangerous(a) then return end
: if over(a) then crawl.sendkeys("c") return end
: return true
:end
:add_autopickup_func(corpse_dance)
I'm thinking that it could be simplified into a single butcher_when_hungry function that can be tossed in a LUA file like the archaic function that found a weapon to butcher with at the start of the game before we all had pocket knives.