Registry Mirror
搜索
Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Files
Expand file tree
master
Breadcrumbs
scripts
/
fillneeds.lua
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
26 lines (24 loc) · 735 Bytes
master
Breadcrumbs
scripts
/
fillneeds.lua
Copy path
Top
File metadata and controls
Code
Blame
26 lines (24 loc) · 735 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
local utils = require('utils')
local validArgs = utils.invert({'all', 'unit'})
local args = utils.processArgs({...}, validArgs)
function satisfyNeeds(unit)
if not unit.status.current_soul then
return
end
local mind = unit.status.current_soul.personality.needs
for k,v in ipairs(mind) do
mind[k].focus_level = 400
end
unit.status.current_soul.personality.stress = -1000000
end
if args.all then
for _, unit in ipairs(dfhack.units.getCitizens()) do
satisfyNeeds(unit)
end
else
local unit = args.unit and df.unit.find(args.unit) or dfhack.gui.getSelectedUnit(true)
if not unit then
qerror('A unit must be specified or selected.')
end
satisfyNeeds(unit)
end
You can’t perform that action at this time.