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
/
ghostly.lua
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
26 lines (22 loc) · 688 Bytes
master
Breadcrumbs
scripts
/
ghostly.lua
Copy path
Top
File metadata and controls
Code
Blame
26 lines (22 loc) · 688 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
-- Turns an adventurer into a ghost or back
--[====[
ghostly
=======
Toggles an adventurer's ghost status. Useful for walking through walls, avoiding
attacks, or recovering after a death.
]====]
if df.global.gamemode ~= df.game_mode.ADVENTURE then
qerror('This script must be used in adventure mode')
end
local unit = df.global.world.units.active[0]
if unit then
if unit.flags1.inactive then
unit.flags1.inactive = false
unit.flags3.ghostly = true
elseif unit.body.components.body_part_status[0].missing then
unit.flags1.inactive = true
unit.flags3.ghostly = false
else
unit.flags3.ghostly = not unit.flags3.ghostly
end
end
You can’t perform that action at this time.