VeryFoobar: Tome 2.3.5 introduces error in lib/scpt/corrupt.lua

The BALROG_FORM corruption should only give the bonuses when in Balrog form, but now the ImFire,ImElec,ImAcid,ResDark,ResChaos bonuses are given immediately on getting the corruption.

The bonuses are already given through mimicry:

scpt/mimic.lua:

...
        ["calc"] =      function ()
                        player.modify_stat(A_STR, 5 + player.mimic_level / 5)
                        player.modify_stat(A_INT, player.mimic_level / 10)
                        player.modify_stat(A_WIS, - ( 5 + player.mimic_level / 10))
                        player.modify_stat(A_DEX, player.mimic_level / 10)
                        player.modify_stat(A_CON, 5 + player.mimic_level / 5)
                        player.modify_stat(A_CHR, - ( 5 + player.mimic_level / 10))

                        player.immune_fire = TRUE
                        player.immune_elec = TRUE
                        player.immune_acid = TRUE
                        player.resist_pois = TRUE
                        player.resist_dark = TRUE
                        player.resist_chaos = TRUE
...

But now lib/scpt/corrupt.lua gives the bonuses too, through HOOK_CALC_BONUS:

CORRUPT_BALROG_FORM = add_corruption
{
        ["color"]       = TERM_YELLOW,
        ["name"]        = "Balrog Form",
        ["get_text"]    = "You feel the might of a Balrog inside you.",
        ["lose_text"]   = "The presence of the Balrog seems to abandon you.",
        ["desc"]        =
        {
                          "  Allows you to turn into a Balrog at will",
                          "  You need Balrog Wings, Balrog Aura and Balrog Strength to activate it"
        },
        ["depends"]     =
        {
                        [CORRUPT_BALROG_AURA] = TRUE,
                        [CORRUPT_BALROG_WINGS] = TRUE,
                        [CORRUPT_BALROG_STRENGTH] = TRUE
        },
        ["hooks"]       =
        {
                [HOOK_CALC_BONUS] = function()
                        player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ACID)
                        player.xtra_f2 = bor(player.xtra_f2, TR2_IM_FIRE)
                        player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ELEC)
                        player.xtra_f2 = bor(player.xtra_f2, TR2_RES_DARK)
                        player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CHAOS)

BugReport914 (last edited 2008-06-26 03:24:13 by VeryFoobar)