|
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 |
| - |
19 | 1 | local fullHeal = reqscript('full-heal')
|
20 | 2 |
|
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!") |
23 | 5 | end
|
24 | 6 |
|
25 |
| -local adventurer = df.nemesis_record.find(df.global.adventure.player_id).unit |
| 7 | +local adventurer = dfhack.world.getAdventurer() |
26 | 8 | 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!") |
28 | 10 | end
|
29 | 11 |
|
30 | 12 | 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