From 203d42e75a02c68d7cda9ff85023910bd1a0a6f4 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 7 Apr 2012 15:45:47 +0200 Subject: Lua: Refactor Lua-based powers into C --- src/powers.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/powers.c') diff --git a/src/powers.c b/src/powers.c index 12b2c2c0..2f0206aa 100644 --- a/src/powers.c +++ b/src/powers.c @@ -1221,7 +1221,32 @@ static void power_activate(int power) use_ability_blade(); break; + case POWER_INVISIBILITY: + set_invis(20 + randint(30), 30); + break; + + case POWER_WEB: + /* Warning, beware of f_info changes .. I hate to do that .. */ + grow_things(16, 1 + (p_ptr->lev / 10)); + break; + + case POWER_COR_SPACE_TIME: + if (p_ptr->corrupt_anti_teleport_stopped) + { + p_ptr->corrupt_anti_teleport_stopped = FALSE; + msg_print("You stop controlling your corruption."); + p_ptr->update |= PU_BONUS; + } + else + { + p_ptr->corrupt_anti_teleport_stopped = TRUE; + msg_print("You start controlling your corruption, teleportation works once more."); + p_ptr->update |= PU_BONUS; + } + break; + default: + if (!process_hooks(HOOK_ACTIVATE_POWER, "(d)", power)) { msg_format("Warning power_activate() called with invalid power(%d).", power); -- cgit v1.2.3