Skip to content

Commit 664e6cc

Browse files
committed
reinstate resurrect-adv
1 parent 7ea5ab7 commit 664e6cc

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

changelog.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Template for new versions:
3434
- `fix/engravings`: fix corrupt engraving tiles
3535
- `unretire-anyone`: (reinstated) choose anybody in the world as an adventurer
3636
- `reveal-adv-map`: (reinstated) reveal (or hide) the adventure map
37+
- `resurrect-adv`: (reinstated) allow your adventurer to recover from death
3738

3839
## New Features
3940
- `instruments`: new subcommand ``instruments order`` for creating instrument work orders

docs/resurrect-adv.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resurrect-adv
33

44
.. dfhack-tool::
55
:summary: Bring a dead adventurer back to life.
6-
:tags: unavailable
6+
:tags: adventure armok units
77

88
Have you ever died, but wish you hadn't? This tool can help : ) When you see the
99
"You are deceased" message, run this command to be resurrected and fully healed.

full-heal.lua

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- Attempts to fully heal the selected unit
2-
--author Kurik Amudnil, Urist DaVinci
3-
--edited by expwnent and AtomicChicken
41
--@ module = true
52

63
local utils = require('utils')
@@ -45,7 +42,7 @@ function addResurrectionEvent(histFigID)
4542
df.global.hist_event_next_id = df.global.hist_event_next_id + 1
4643
end
4744

48-
function heal(unit,resurrect,keep_corpse)
45+
function heal(unit, resurrect, keep_corpse)
4946
if not unit then
5047
return
5148
end

resurrect-adv.lua

+8-23
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
1-
-- Bring your adventurer back to life.
2-
-- author: Atomic Chicken
3-
-- essentially a wrapper for "full-heal.lua"
4-
5-
--[====[
6-
7-
resurrect-adv
8-
=============
9-
Brings a dead adventurer back to life, fully healing them
10-
in the process.
11-
12-
This script only targets the current player character in
13-
your party, and should be run after being presented with
14-
the "You are deceased" message. It is not possible to
15-
resurrect the adventurer after the game has been ended.
16-
17-
]====]
18-
191
local fullHeal = reqscript('full-heal')
202

21-
if df.global.gamemode ~= df.game_mode.ADVENTURE then
22-
qerror("This script can only be used in adventure mode!")
3+
if not dfhack.world.isAdventureMode() then
4+
qerror("This script can only be used in adventure mode!")
235
end
246

25-
local adventurer = df.nemesis_record.find(df.global.adventure.player_id).unit
7+
local adventurer = dfhack.world.getAdventurer()
268
if not adventurer or not adventurer.flags2.killed then
27-
qerror("Your adventurer hasn't died yet!")
9+
qerror("Your adventurer hasn't died yet!")
2810
end
2911

3012
fullHeal.heal(adventurer, true)
31-
df.global.adventure.player_control_state = 1 -- this ensures that the player will be able to regain control of their unit after resurrection if the script is run before hitting DONE at the "You are deceased" message
13+
14+
-- this ensures that the player will be able to regain control of their unit after
15+
-- resurrection if the script is run before hitting DONE at the "You are deceased" message
16+
df.global.adventure.player_control_state = 1

0 commit comments

Comments
 (0)