-
Notifications
You must be signed in to change notification settings - Fork 8
/
list-deities.lua
28 lines (24 loc) · 926 Bytes
/
list-deities.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- print('race=', df.historical_entity.find(df.global.ui.civ_id).race)
-- for _,f in pairs(df.global.world.history.figures) do
-- if f.flags.deity and f.race==572 then
-- print(f, f.id, 'race=', f.race)
-- end
-- end
-- found={}
-- for _, hfid in ipairs(df.historical_entity.find(df.global.ui.civ_id).histfig_ids) do
-- for _, link in ipairs(df.historical_figure.find(hfid).histfig_links) do
-- if df.histfig_hf_link_deityst:is_instance(link) then
-- found[link.target_hf] = true
-- end
-- end
-- end
-- for did in pairs(found) do
-- print(did)
-- end
unit = dfhack.gui.getSelectedUnit()
for _, link in ipairs(df.historical_figure.find(unit.hist_figure_id).histfig_links) do
if df.histfig_hf_link_deit:is_instance(link) then
deity = df.historical_figure.find(link.target_hf)
print(dfhack.df2console(dfhack.TranslateName(deity.name)))
end
end