Skip to content

Commit a04ee8c

Browse files
authored
make-legendary: Add 'fortress' option to make all fortress citizens legendary
1 parent 9043155 commit a04ee8c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

make-legendary.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ function PrintSkillClassList()
8080
print('For example: Medical will make all medical skills legendary')
8181
end
8282

83+
function FortressLegendary()
84+
local count = 0
85+
local units = dfhack.units.getCitizens()
86+
87+
if #units == 0 then
88+
qerror('No fortress citizens found. Are you in fortress mode?')
89+
return
90+
end
91+
92+
for _, unit in ipairs(units) do
93+
for i in ipairs(df.job_skill) do
94+
legendize(unit, i)
95+
end
96+
print('The secrets of the depths have been mastered by ' .. getName(unit))
97+
count = count + 1
98+
end
99+
100+
print(string.format('\nMade %d fortress citizens legendary!', count))
101+
end
102+
83103
--main script operation starts here
84104
----
85105
local opt = ...
@@ -98,6 +118,9 @@ elseif opt == 'classes' then
98118
elseif opt == 'all' then
99119
BreathOfArmok()
100120
return
121+
elseif opt == 'fortress' then
122+
FortressLegendary()
123+
return
101124
elseif df.job_skill_class[opt] then
102125
LegendaryByClass(opt)
103126
return

0 commit comments

Comments
 (0)