diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-09 18:45:33 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-09 19:47:28 +0200 |
commit | 24778733a4fd919a7646750ebb0211dca689b245 (patch) | |
tree | 6a6fa93cb3b264424fa775805839d7d8be2d5053 | |
parent | 4d77bc8053e1fda66f1e3f805f0a2cb74fba6201 (diff) |
Lua: Move "Death Touch" ability to C
-rw-r--r-- | lib/mods/theme/scpt/mkeys.lua | 16 | ||||
-rw-r--r-- | lib/scpt/mkeys.lua | 16 | ||||
-rw-r--r-- | src/defines.h | 1 | ||||
-rw-r--r-- | src/skills.c | 18 |
4 files changed, 19 insertions, 32 deletions
diff --git a/lib/mods/theme/scpt/mkeys.lua b/lib/mods/theme/scpt/mkeys.lua index ae8ad2b1..8bdc83bc 100644 --- a/lib/mods/theme/scpt/mkeys.lua +++ b/lib/mods/theme/scpt/mkeys.lua @@ -1,21 +1,5 @@ -- Mkeys for skills & abilities --- Death touch ability -add_mkey -{ - ["mkey"] = 100, - ["fct"] = function() - if player.csp > 40 then - increase_mana(-40) - set_project(randint(30) + 10, GF_INSTA_DEATH, 1, 0, bor(PROJECT_STOP, PROJECT_KILL)) - energy_use = 100 - else - msg_print("You need at least 40 mana.") - end - end, -} - - -- Geomancy skill add_mkey { diff --git a/lib/scpt/mkeys.lua b/lib/scpt/mkeys.lua index ae8ad2b1..8bdc83bc 100644 --- a/lib/scpt/mkeys.lua +++ b/lib/scpt/mkeys.lua @@ -1,21 +1,5 @@ -- Mkeys for skills & abilities --- Death touch ability -add_mkey -{ - ["mkey"] = 100, - ["fct"] = function() - if player.csp > 40 then - increase_mana(-40) - set_project(randint(30) + 10, GF_INSTA_DEATH, 1, 0, bor(PROJECT_STOP, PROJECT_KILL)) - energy_use = 100 - else - msg_print("You need at least 40 mana.") - end - end, -} - - -- Geomancy skill add_mkey { diff --git a/src/defines.h b/src/defines.h index 8a340a4c..fe689725 100644 --- a/src/defines.h +++ b/src/defines.h @@ -609,6 +609,7 @@ #define MKEY_BOULDER 21 #define MKEY_COMPANION 22 #define MKEY_PIERCING 23 +#define MKEY_DEATH_TOUCH 100 /*** Screen Locations ***/ diff --git a/src/skills.c b/src/skills.c index aba838be..fd6c37a2 100644 --- a/src/skills.c +++ b/src/skills.c @@ -1056,6 +1056,24 @@ void do_cmd_activate_skill() case MKEY_PIERCING: do_cmd_set_piercing(); break; + case MKEY_DEATH_TOUCH: + { + if (p_ptr->csp > 40) + { + increase_mana(-40); + set_project(randint(30) + 10, + GF_INSTA_DEATH, + 1, + 0, + PROJECT_STOP | PROJECT_KILL); + energy_use = 100; + } + else + { + msg_print("You need at least 40 mana."); + } + break; + } default: process_hooks(HOOK_MKEY, "(d)", x_idx); break; |