forked from DFHack/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfillneeds.lua
More file actions
25 lines (19 loc) · 711 Bytes
/
fillneeds.lua
File metadata and controls
25 lines (19 loc) · 711 Bytes
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
-- Use with a unit selected to make them focused and unstressed.
--[====[
fillneeds
=========
Use with a unit selected to make them focused and unstressed.
Alternatively, a unit can be specified by passing ``-unit UNIT_ID``
]====]
local utils = require('utils')
local args = utils.processArgs({...})
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
function satisfyNeeds(unit)
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_level = -1000000
end
satisfyNeeds(unit)