From 62e385cb769000cfefa052b1ab3e155314e7ac37 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Thu, 5 Apr 2012 23:42:13 +0200 Subject: Lua: Move HOOK_CALC_BONUS corruption code to C --- lib/scpt/corrupt.lua | 63 ---------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'lib/scpt/corrupt.lua') diff --git a/lib/scpt/corrupt.lua b/lib/scpt/corrupt.lua index 550f8bc0..1435df6e 100644 --- a/lib/scpt/corrupt.lua +++ b/lib/scpt/corrupt.lua @@ -14,10 +14,6 @@ CORRUPT_BALROG_AURA = add_corruption }, ["hooks"] = { - [HOOK_CALC_BONUS] = function() - player.xtra_f3 = bor(player.xtra_f3, TR3_SH_FIRE) - player.xtra_f3 = bor(player.xtra_f3, TR3_LITE1) - end, [HOOK_READ] = function(obj) if magik(5) == TRUE then msg_print("Your demon aura burns the scroll before you read it!") @@ -40,14 +36,6 @@ CORRUPT_BALROG_WINGS = add_corruption " Creates ugly, but working, wings allowing you to fly", " But it reduces charisma by 4 and dexterity by 2" }, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - player.xtra_f4 = bor(player.xtra_f4, TR4_FLY) - player.modify_stat(A_CHR, -4) - player.modify_stat(A_DEX, -2) - end, - }, } CORRUPT_BALROG_STRENGTH = add_corruption @@ -61,15 +49,6 @@ CORRUPT_BALROG_STRENGTH = add_corruption " Provides 3 strength and 1 constitution", " But it reduces charisma by 1 and dexterity by 3" }, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - player.modify_stat(A_STR, 3) - player.modify_stat(A_CON, 1) - player.modify_stat(A_DEX, -3) - player.modify_stat(A_CHR, -1) - end, - }, } CORRUPT_BALROG_FORM = add_corruption @@ -110,13 +89,6 @@ CORRUPT_DEMON_SPIRIT = add_corruption " Increases your intelligence by 1", " But reduce your charisma by 2", }, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - player.modify_stat(A_INT, 1) - player.modify_stat(A_CHR, -2) - end, - }, } CORRUPT_DEMON_HIDE = add_corruption @@ -131,15 +103,6 @@ CORRUPT_DEMON_HIDE = add_corruption " Provides immunity to fire at level 40", " But reduces speed by your level / 7", }, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - player.to_a = player.to_a + player.lev - player.dis_to_a = player.dis_to_a + player.lev - player.pspeed = player.pspeed - (player.lev / 7) - if player.lev >= 40 then player.xtra_f2 = bor(player.xtra_f2, TR2_IM_FIRE) end - end, - }, } CORRUPT_DEMON_BREATH = add_corruption @@ -186,15 +149,6 @@ CORRUPT_DEMON_REALM = add_corruption [CORRUPT_DEMON_HIDE] = TRUE, [CORRUPT_DEMON_BREATH] = TRUE }, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - -- 1500 may seem a lot, but people are rather unlikely to get the corruption very soon - -- due to the dependencies - if s_info[SKILL_DAEMON + 1].mod == 0 then s_info[SKILL_DAEMON + 1].mod = 1500 end - s_info[SKILL_DAEMON + 1].hidden = FALSE; - end, - }, } @@ -215,9 +169,6 @@ CORRUPT_RANDOM_TELEPORT = add_corruption -- No oppose field, it will be automatically set when we declare the anti-telep corruption to oppose us ["hooks"] = { - [HOOK_CALC_BONUS] = function() - player.xtra_f3 = bor(player.xtra_f3, TR3_TELEPORT) - end, [HOOK_PROCESS_WORLD] = function() if rand_int(300) == 1 then if magik(70) == TRUE then @@ -257,11 +208,6 @@ CORRUPT_ANTI_TELEPORT = add_corruption [HOOK_CALC_POWERS] = function() player.add_power(POWER_COR_SPACE_TIME) end, - [HOOK_CALC_BONUS] = function() - if player.corrupt_anti_teleport_stopped == FALSE then - player.resist_continuum = TRUE - end - end, [HOOK_PROCESS_WORLD] = function() if player.corrupt_anti_teleport_stopped == TRUE then local amt = player.msp + player.csp @@ -300,13 +246,6 @@ CORRUPT_TROLL_BLOOD = add_corruption return not nil end end, - ["hooks"] = - { - [HOOK_CALC_BONUS] = function() - player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN, TR3_AGGRAVATE) - player.xtra_esp = bor(player.xtra_esp, ESP_TROLL) - end, - }, } -- The vampire corruption set @@ -426,8 +365,6 @@ CORRUPT_ = add_corruption }, ["hooks"] = { - [HOOK_CALC_BONUS] = function() - end, }, } ]] -- cgit v1.2.3