Skip to content

Commit f1146d4

Browse files
committed
reuse rejuvenate logic in armoks-blessing
instead of providing an alternate, less complete implementation
1 parent 25ad971 commit f1146d4

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

armoks-blessing.lua

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
-- Adjust all attributes of all dwarves to an ideal
22
-- by vjek
33

4+
local rejuvenate = reqscript('rejuvenate')
45
local utils = require('utils')
56

6-
function rejuvenate(unit)
7-
if unit==nil then
8-
print ("No unit available! Aborting with extreme prejudice.")
9-
return
10-
end
11-
12-
local current_year=df.global.cur_year
13-
local newbirthyear=current_year - 20
14-
if unit.birth_year < newbirthyear then
15-
unit.birth_year=newbirthyear
16-
end
17-
if unit.old_year < current_year+100 then
18-
unit.old_year=current_year+100
19-
end
20-
21-
end
227
-- ---------------------------------------------------------------------------
238
function brainwash_unit(unit)
249
if unit==nil then
@@ -251,7 +236,7 @@ function adjust_all_dwarves(skillname)
251236
print("Adjusting "..dfhack.df2console(dfhack.TranslateName(dfhack.units.getVisibleName(v))))
252237
brainwash_unit(v)
253238
elevate_attributes(v)
254-
rejuvenate(v)
239+
rejuvenate.rejuvenate(v, true)
255240
if skillname then
256241
if df.job_skill_class[skillname] then
257242
LegendaryByClass(skillname,v)

0 commit comments

Comments
 (0)