Skip to content

make-legendary: Add 'fortress' option to make all fortress citizens l… #1421

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions make-legendary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ function PrintSkillClassList()
print('For example: Medical will make all medical skills legendary')
end

function FortressLegendary()
local count = 0
local units = dfhack.units.getCitizens()

if #units == 0 then
qerror('No fortress citizens found. Are you in fortress mode?')
return
end

for _, unit in ipairs(units) do
for i in ipairs(df.job_skill) do
legendize(unit, i)
end
print('The secrets of the depths have been mastered by ' .. getName(unit))
count = count + 1
end

print(string.format('\nMade %d fortress citizens legendary!', count))
end

--main script operation starts here
----
local opt = ...
Expand All @@ -98,6 +118,9 @@ elseif opt == 'classes' then
elseif opt == 'all' then
BreathOfArmok()
return
elseif opt == 'fortress' then
FortressLegendary()
return
elseif df.job_skill_class[opt] then
LegendaryByClass(opt)
return
Expand Down
Loading