-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to extermiante all wild creatures #999
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,6 +30,10 @@ Examples | |||||
Kill the ravens flying around the map (but only the male ones). | ||||||
``exterminate GOBLIN --method magma --only-visible`` | ||||||
Kill all visible, hostile goblins on the map by boiling them in magma. | ||||||
``exterminate all`` | ||||||
Kill all wild creatures. | ||||||
``exterminate all:FEMALE`` | ||||||
Kill all wild female creatures. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Options | ||||||
------- | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -181,6 +181,33 @@ if positionals[1]:lower() == 'undead' then | |||||||||||||||
count = count + 1 | ||||||||||||||||
end | ||||||||||||||||
end | ||||||||||||||||
elseif positionals[1]:split(':')[1] == "all" then | ||||||||||||||||
local selected_caste = nil | ||||||||||||||||
|
||||||||||||||||
if string.find(positionals[1], ':') then | ||||||||||||||||
local tokens = positionals[1]:split(':') | ||||||||||||||||
selected_caste = tokens[2] | ||||||||||||||||
end | ||||||||||||||||
Comment on lines
+185
to
+190
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize this was copied from the section below, but since you don't care about the "race" ( |
||||||||||||||||
|
||||||||||||||||
for _, unit in pairs(df.global.world.units.active) do | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
||||||||||||||||
if not checkUnit(unit) then | ||||||||||||||||
goto skipunit | ||||||||||||||||
end | ||||||||||||||||
if options.only_visible and not dfhack.units.isVisible(unit) then | ||||||||||||||||
goto skipunit | ||||||||||||||||
end | ||||||||||||||||
if not options.include_friendly and isUnitFriendly(unit) then | ||||||||||||||||
goto skipunit | ||||||||||||||||
end | ||||||||||||||||
if selected_caste and selected_caste ~= df.creature_raw.find(unit.race).caste[unit.caste].caste_id then | ||||||||||||||||
goto skipunit | ||||||||||||||||
end | ||||||||||||||||
|
||||||||||||||||
killUnit(unit, options.method) | ||||||||||||||||
count = count + 1 | ||||||||||||||||
:: skipunit :: | ||||||||||||||||
end | ||||||||||||||||
else | ||||||||||||||||
local selected_race, selected_caste = positionals[1], nil | ||||||||||||||||
|
||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.