diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-04-09 11:16:40 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-04-09 11:44:10 +0200 |
commit | 4d4de63ce360e1b4fe6248b6e18ebd48f618d504 (patch) | |
tree | 59120f39245613f1c368242d941ea728b6e45397 /src | |
parent | c81957d766f664bbffc5ec1976a5013f955e0d82 (diff) |
Lua: Clean up handling of Theme GOD_* variables
Diffstat (limited to 'src')
-rw-r--r-- | src/externs.h | 8 | ||||
-rw-r--r-- | src/lua_bind.c | 32 | ||||
-rw-r--r-- | src/player.pkg | 5 | ||||
-rw-r--r-- | src/q_god.c | 8 | ||||
-rw-r--r-- | src/spells1.c | 4 | ||||
-rw-r--r-- | src/variable.c | 4 | ||||
-rw-r--r-- | src/xtra1.c | 6 |
7 files changed, 22 insertions, 45 deletions
diff --git a/src/externs.h b/src/externs.h index 2da4f38d..774be450 100644 --- a/src/externs.h +++ b/src/externs.h @@ -598,6 +598,10 @@ extern s32b DUNGEON_ASTRAL_WILD_X; extern s32b DUNGEON_ASTRAL_WILD_Y; extern deity_type *deity_info; extern s32b max_gods; +extern s32b GOD_AULE; +extern s32b GOD_VARDA; +extern s32b GOD_ULMO; +extern s32b GOD_MANDOS; extern timer_type *gl_timers; extern s16b tim_precognition; extern const char *get_version_string(); @@ -1800,10 +1804,6 @@ extern void desc_quest(int q_idx, int d, char *desc); extern s16b add_new_gods(char *name); extern void desc_god(int g_idx, int d, char *desc); extern int get_lua_int(cptr name); -extern s16b get_god_AULE(); -extern s16b get_god_VARDA(); -extern s16b get_god_ULMO(); -extern s16b get_god_MANDOS(); extern bool_ get_com_lua(cptr promtp, int *com); diff --git a/src/lua_bind.c b/src/lua_bind.c index fa88a7c1..ca65cffd 100644 --- a/src/lua_bind.c +++ b/src/lua_bind.c @@ -589,38 +589,6 @@ int get_lua_int(cptr name) return exec_lua(format("return %s", name)); } -static int get_god_theme(cptr name) -{ - if (game_module_idx == MODULE_THEME) - { - return exec_lua(format("return GOD_%s", name)); - } - else - { - return -1; - } -} - -s16b get_god_AULE() -{ - return get_god_theme("AULE"); -} - -s16b get_god_MANDOS() -{ - return get_god_theme("MANDOS"); -} - -s16b get_god_VARDA() -{ - return get_god_theme("VARDA"); -} - -s16b get_god_ULMO() -{ - return get_god_theme("ULMO"); -} - /* * Returns the direction of the compass that y2, x2 is from y, x * the return value will be one of the following: north, south, diff --git a/src/player.pkg b/src/player.pkg index 0466b322..e9649729 100644 --- a/src/player.pkg +++ b/src/player.pkg @@ -3098,6 +3098,11 @@ extern s16b dun_level; #define GOD_YAVANNA 5 /** @} */ +extern s32b GOD_AULE; +extern s32b GOD_VARDA; +extern s32b GOD_ULMO; +extern s32b GOD_MANDOS; + /** @fn inc_piety(int god, s32b amt) * @brief Increase piety for god "god" by amount "amt".\n diff --git a/src/q_god.c b/src/q_god.c index 7c48f128..04a5eb15 100644 --- a/src/q_god.c +++ b/src/q_god.c @@ -951,19 +951,19 @@ static void set_god_dungeon_attributes() { quest_god_set_god_dungeon_attributes_yavanna(); } - else if (p_ptr->pgod == get_god_AULE()) + else if (p_ptr->pgod == GOD_AULE) { quest_god_set_god_dungeon_attributes_aule(); } - else if (p_ptr->pgod == get_god_VARDA()) + else if (p_ptr->pgod == GOD_VARDA) { quest_god_set_god_dungeon_attributes_varda(); } - else if (p_ptr->pgod == get_god_ULMO()) + else if (p_ptr->pgod == GOD_ULMO) { quest_god_set_god_dungeon_attributes_ulmo(); } - else if (p_ptr->pgod == get_god_MANDOS()) + else if (p_ptr->pgod == GOD_MANDOS) { quest_god_set_god_dungeon_attributes_mandos(); } diff --git a/src/spells1.c b/src/spells1.c index 8350a4ff..477dfdb9 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -944,7 +944,7 @@ void recall_player(int d, int f) */ static void project_check_gods(int typ) { - if (p_ptr->pgod == get_god_VARDA()) + if (p_ptr->pgod == GOD_VARDA) { if ((typ == GF_LITE) || (typ == GF_LITE_WEAK)) { @@ -953,7 +953,7 @@ static void project_check_gods(int typ) } } - if (p_ptr->pgod == get_god_ULMO()) + if (p_ptr->pgod == GOD_ULMO) { if ((typ == GF_FIRE) || (typ == GF_HELL_FIRE) || diff --git a/src/variable.c b/src/variable.c index c4388457..c3530df8 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1575,6 +1575,10 @@ s32b DUNGEON_ASTRAL_WILD_Y = 19; */ deity_type *deity_info; s32b max_gods = MAX_GODS_INIT; +s32b GOD_AULE = -99; +s32b GOD_VARDA = -99; +s32b GOD_ULMO = -99; +s32b GOD_MANDOS = -99; /* * Timers diff --git a/src/xtra1.c b/src/xtra1.c index 09315ed3..9c368a0f 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -2444,7 +2444,7 @@ static void calc_gods() } /* Aule provides to-hit/damage bonuses and fire resistance */ - GOD(get_god_AULE()) + GOD(GOD_AULE) { if (p_ptr->grace > 0) { @@ -2470,7 +2470,7 @@ static void calc_gods() /* Mandos provides nether resistance and, while praying, nether immunity and prevents teleportation. */ - GOD(get_god_MANDOS()) + GOD(GOD_MANDOS) { p_ptr->resist_neth = TRUE; @@ -2489,7 +2489,7 @@ static void calc_gods() /* Ulmo provides water breath and, while praying can provide poison resistance and magic breath. */ - GOD(get_god_ULMO()) + GOD(GOD_ULMO) { p_ptr->water_breath = TRUE; |