Auto Butcher


Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

User avatar

Tomb Titivator

Posts: 857

Joined: Monday, 31st January 2011, 23:19

Post Friday, 7th September 2012, 02:14

Auto Butcher

I wrote a little script that automatically butchers and eats corpses when you're hungry:

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.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 7th September 2012, 22:57

Re: Auto Butcher

Including it in the game means maintaining it. I don't want to take over the burden of maintaining this script, it's not useful enough IMO.

I think it would be good to have a place which holds 3rd party lua scripts and config files. Could be a section on the dev wiki maybe. If someone could set up such a thing, that would be great.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Pandemonium Purger

Posts: 1337

Joined: Saturday, 7th July 2012, 02:28

Location: Limbo

Post Friday, 7th September 2012, 23:20

Re: Auto Butcher

I found it quite convenient in sparing me from the trouble of mashing 'c' and 'e' all the time through the first 13 floors of the dungeon.
take it easy
  Code:
!lg * won !DD-- min=turns -log
<Sequell> 20749. Bloax, XL24 VSTm, T:13320: http://crawl.lantea.net/crawl/morgue/Bloax/morgue-Bloax-20140907-000920.txt

Did you know that I like ruining crawl every now and then? Go check it out.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Saturday, 8th September 2012, 00:03

Re: Auto Butcher

There's already auto_eat_chunks to fix needing to press 'e'. I guess I just don't find pressing 'c' every few minutes that onerous. If I forget to do it on time, I get a helpful yellow reminder from the game.
User avatar

Pandemonium Purger

Posts: 1337

Joined: Saturday, 7th July 2012, 02:28

Location: Limbo

Post Saturday, 8th September 2012, 11:13

Re: Auto Butcher

That doesn't work well with a troll (unless you like hanging around hungry/satiated), and you still have to move onto the corpse, press c and then e a couple of times.

With this, it's just o - and that's it.

Unless I'm of course way behind all this stuff, which is very possible.
take it easy
  Code:
!lg * won !DD-- min=turns -log
<Sequell> 20749. Bloax, XL24 VSTm, T:13320: http://crawl.lantea.net/crawl/morgue/Bloax/morgue-Bloax-20140907-000920.txt

Did you know that I like ruining crawl every now and then? Go check it out.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Saturday, 8th September 2012, 11:25

Re: Auto Butcher

Bloax wrote:Unless I'm of course way behind all this stuff, which is very possible.

You are. auto_eat works just fine with trolls now.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Pandemonium Purger

Posts: 1337

Joined: Saturday, 7th July 2012, 02:28

Location: Limbo

Post Saturday, 8th September 2012, 12:52

Re: Auto Butcher

Ah, good to know.
take it easy
  Code:
!lg * won !DD-- min=turns -log
<Sequell> 20749. Bloax, XL24 VSTm, T:13320: http://crawl.lantea.net/crawl/morgue/Bloax/morgue-Bloax-20140907-000920.txt

Did you know that I like ruining crawl every now and then? Go check it out.

Temple Termagant

Posts: 8

Joined: Friday, 27th May 2011, 20:58

Post Tuesday, 25th September 2012, 06:56

Re: Auto Butcher

Related to this thread is https://crawl.develz.org/tavern/viewtopic.php?f=8&t=5843, which adds an auto_butcher feature directly into the game code.

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 111 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.