-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added script commute-sentence to commute the prison sentence of a sel…
…ected unit
- Loading branch information
1 parent
efce40c
commit 978aa41
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
local utils = require('utils') | ||
local argparse = require('argparse') | ||
|
||
local function commute_sentence(unit) | ||
for _,punishment in ipairs(df.global.plotinfo.punishments) do | ||
if punishment.criminal == unit.id then | ||
punishment.prison_counter = 0 | ||
return | ||
end | ||
end | ||
qerror('Unit is not currently serving a sentence!') | ||
end | ||
|
||
unit = dfhack.gui.getSelectedUnit(true) | ||
if not unit then | ||
qerror('No unit selected!') | ||
else | ||
commute_sentence(unit) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
commute-sentence | ||
================ | ||
|
||
.. dfhack-tool:: | ||
:summary: Commute the prison sentences of convicted criminals. | ||
:tags: fort armok units | ||
|
||
If a unit is currently serving out their sentence but you want them released | ||
for whatever reason, this tool can commute their sentence. Just select the unit | ||
and run the command. | ||
|
||
usage | ||
----- | ||
|
||
:: | ||
commute-sentence |