exterminate: add butcher mode

develop
jj 2013-04-03 00:57:50 +02:00
parent a7bd2e97ab
commit 3da85a2134
2 changed files with 28 additions and 10 deletions

@ -4,7 +4,7 @@ DFHack future
- masspit: designate caged creatures in a zone for pitting - masspit: designate caged creatures in a zone for pitting
- locate_ore: scan the map for unmined ore veins - locate_ore: scan the map for unmined ore veins
Misc improvements: Misc improvements:
- exterminate: renamed from slayrace, add help message - exterminate: renamed from slayrace, add help message, add butcher mode
- autoSyndrome: disable by default - autoSyndrome: disable by default
DFHack v0.34.11-r3 DFHack v0.34.11-r3

@ -5,7 +5,19 @@
race = $script_args[0] race = $script_args[0]
# if the 2nd parameter is 'magma', magma rain for the targets instead of instant death # if the 2nd parameter is 'magma', magma rain for the targets instead of instant death
magma = ($script_args[1] == 'magma') # if it is 'butcher' mark all units for butchering (wont work with hostiles)
kill_by = $script_args[1]
case kill_by
when 'magma'
slain = 'burning'
when 'slaughter', 'butcher'
slain = 'marked for butcher'
when nil
slain = 'slain'
else
race = 'help'
end
checkunit = lambda { |u| checkunit = lambda { |u|
(u.body.blood_count != 0 or u.body.blood_max == 0) and (u.body.blood_count != 0 or u.body.blood_max == 0) and
@ -16,12 +28,8 @@ checkunit = lambda { |u|
} }
slayit = lambda { |u| slayit = lambda { |u|
if not magma case kill_by
# just make them drop dead when 'magma'
u.body.blood_count = 0
# some races dont mind having no blood, ensure they are still taken care of.
u.animal.vanish_countdown = 2
else
# it's getting hot around here # it's getting hot around here
# !!WARNING!! do not call on a magma-safe creature # !!WARNING!! do not call on a magma-safe creature
ouh = df.onupdate_register("exterminate ensure #{u.id}", 1) { ouh = df.onupdate_register("exterminate ensure #{u.id}", 1) {
@ -34,6 +42,14 @@ slayit = lambda { |u|
df.map_tile_at(x, y, z).spawn_magma(7) df.map_tile_at(x, y, z).spawn_magma(7)
end end
} }
when 'butcher', 'slaughter'
# mark for slaughter at butcher's shop
u.flags2.slaughter = true
else
# just make them drop dead
u.body.blood_count = 0
# some races dont mind having no blood, ensure they are still taken care of.
u.animal.vanish_countdown = 2
end end
} }
@ -65,10 +81,12 @@ With the special argument 'undead', kill all undead creatures/thralls.
The targets will bleed out on the next game tick, or if they are immune to that, will vanish in a puff of smoke. The targets will bleed out on the next game tick, or if they are immune to that, will vanish in a puff of smoke.
The special final argument 'magma' will make magma rain on the targets instead. The special final argument 'magma' will make magma rain on the targets instead.
The special final argument 'butcher' will mark the targets for butchering instead.
Ex: exterminate gob Ex: exterminate gob
exterminate elve magma exterminate elve magma
exterminate him exterminate him
exterminate pig butcher
EOS EOS
when 'him', 'her', 'it', 'that' when 'him', 'her', 'it', 'that'
@ -94,7 +112,7 @@ when /^undead/i
count += 1 count += 1
end end
} }
puts "slain #{count} undeads" puts "#{slain} #{count} undeads"
else else
raw_race = df.match_rawname(race, all_races.keys) raw_race = df.match_rawname(race, all_races.keys)
@ -112,6 +130,6 @@ else
count += 1 count += 1
end end
} }
puts "slain #{count} #{raw_race}" puts "#{slain} #{count} #{raw_race}"
end end