summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-11 19:50:10 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-19 18:36:19 +0200
commitcd328f56d295a6e8c17cd12110368a489cf82b58 (patch)
treef455f23bd2226e80d35ed7bd8b4f1008681dcc5d
parent7833f2577399f212be5c107611f291be1b47ce8f (diff)
Lua: Move activation of Theme's Maia "aggravation" to C
-rw-r--r--lib/mods/theme/scpt/init.lua3
-rw-r--r--lib/mods/theme/scpt/monsters.lua15
-rw-r--r--src/lua_bind.c9
-rw-r--r--src/modules.c2
4 files changed, 10 insertions, 19 deletions
diff --git a/lib/mods/theme/scpt/init.lua b/lib/mods/theme/scpt/init.lua
index af299f2c..edc82fe1 100644
--- a/lib/mods/theme/scpt/init.lua
+++ b/lib/mods/theme/scpt/init.lua
@@ -12,6 +12,3 @@ initialize_bookable_spells()
-- Some tests, if the file is not present, this is fine
tome_dofile_anywhere(ANGBAND_DIR_SCPT, "dg_test.lua", FALSE)
-
--- Add monster interaction
-tome_dofile("monsters.lua")
diff --git a/lib/mods/theme/scpt/monsters.lua b/lib/mods/theme/scpt/monsters.lua
deleted file mode 100644
index 0f4c8cda..00000000
--- a/lib/mods/theme/scpt/monsters.lua
+++ /dev/null
@@ -1,15 +0,0 @@
--- This file holds various things that govern monster behaviour with respect to the player
-
-add_hooks{
-[HOOK_GAME_START] = function()
-
- if ((get_race_name() == "Maia") and
- (player_has_corruption(CORRUPT_BALROG_AURA) ~= TRUE) and
- (player_has_corruption(CORRUPT_BALROG_WINGS) ~= TRUE) and
- (player_has_corruption(CORRUPT_BALROG_STRENGTH) ~= TRUE) and
- (player_has_corruption(CORRUPT_BALROG_FORM) ~= TRUE)) then
- -- "Proper" Maiar aggravate evil beings
- timer_aggravate_evil_enable()
- end
-end,
-}
diff --git a/src/lua_bind.c b/src/lua_bind.c
index 34a89613..ab1a19c8 100644
--- a/src/lua_bind.c
+++ b/src/lua_bind.c
@@ -548,7 +548,14 @@ void timer_aggravate_evil_enable()
void timer_aggravate_evil_callback()
{
- dispel_evil(0);
+ if ((p_ptr->prace == RACE_MAIA) &&
+ (!player_has_corruption(CORRUPT_BALROG_AURA)) &&
+ (!player_has_corruption(CORRUPT_BALROG_WINGS)) &&
+ (!player_has_corruption(CORRUPT_BALROG_STRENGTH)) &&
+ (!player_has_corruption(CORRUPT_BALROG_FORM)))
+ {
+ dispel_evil(0);
+ }
}
cptr get_spell_info(s32b s)
diff --git a/src/modules.c b/src/modules.c
index 01f1be00..c4bea6eb 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -1152,6 +1152,8 @@ void init_hooks_module()
case MODULE_THEME:
{
+ timer_aggravate_evil_enable();
+
add_hook_new(HOOK_PLAYER_LEVEL,
auto_stat_gain_hook,
"auto_stat_gain",