Last active
August 29, 2015 14:13
-
-
Save IndigoFenix/13d56eaecd6038e63167 to your computer and use it in GitHub Desktop.
Turns a selected unit into a ghost and back again. Works in adventure mode too!
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
--Turn ghost on or off | |
local unit=dfhack.gui.getSelectedUnit() | |
if unit == nil then | |
unit = df.unit.find(df.global.ui_advmode.player_id) | |
end | |
if unit then | |
if unit.flags1.dead then | |
unit.flags1.dead = false | |
unit.flags3.ghostly = true | |
else | |
if unit.body.components.body_part_status[0].missing then | |
unit.flags3.ghostly = false | |
unit.flags1.dead = true | |
else | |
unit.flags3.ghostly = not unit.flags3.ghostly | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment