summaryrefslogtreecommitdiff
path: root/lib/scpt
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-12 18:30:39 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-13 08:01:24 +0200
commit6d8f14307f6e9ad22c7b34ad7a7058537cb6b738 (patch)
treef1e43c74f21dc3915a70b41e07c2e783cf713074 /lib/scpt
parentafbec09fcf9a57ecb401267f7a4e23b270853e2c (diff)
Lua: Move "Nature" spell functions to C
Diffstat (limited to 'lib/scpt')
-rw-r--r--lib/scpt/s_nature.lua59
1 files changed, 10 insertions, 49 deletions
diff --git a/lib/scpt/s_nature.lua b/lib/scpt/s_nature.lua
index e71a89bf..d47dbe8f 100644
--- a/lib/scpt/s_nature.lua
+++ b/lib/scpt/s_nature.lua
@@ -9,13 +9,8 @@ GROWTREE = add_spell
["mana_max"] = 30,
["fail"] = 35,
["inertia"] = { 5, 50 },
- ["spell"] = function()
- grow_trees(2 + get_level(GROWTREE, 7))
- return TRUE
- end,
- ["info"] = function()
- return "rad "..(2 + get_level(GROWTREE, 7))
- end,
+ ["spell"] = function() return nature_grow_trees() end,
+ ["info"] = function() return nature_grow_trees_info() end,
["desc"] = {
"Makes trees grow extremely quickly around you",
}
@@ -39,12 +34,8 @@ HEALING = add_spell
["max_level"] = { 20, 40 },
},
},
- ["spell"] = function()
- return hp_player(player.mhp * (15 + get_level(HEALING, 35)) / 100)
- end,
- ["info"] = function()
- return "heal "..(15 + get_level(HEALING, 35)).."% = "..(player.mhp * (15 + get_level(HEALING, 35)) / 100).."hp"
- end,
+ ["spell"] = function() return nature_healing() end,
+ ["info"] = function() return nature_healing_info() end,
["desc"] = {
"Heals a percent of hitpoints",
}
@@ -69,29 +60,8 @@ RECOVERY = add_spell
},
},
["inertia"] = { 2, 100 },
- ["spell"] = function()
- local obvious
- obvious = set_poisoned(player.poisoned / 2)
- if get_level(RECOVERY, 50) >= 5 then
- obvious = is_obvious(set_poisoned(0), obvious)
- obvious = is_obvious(set_cut(0), obvious)
- end
- if get_level(RECOVERY, 50) >= 10 then
- obvious = is_obvious(do_res_stat(A_STR, TRUE), obvious)
- obvious = is_obvious(do_res_stat(A_CON, TRUE), obvious)
- obvious = is_obvious(do_res_stat(A_DEX, TRUE), obvious)
- obvious = is_obvious(do_res_stat(A_WIS, TRUE), obvious)
- obvious = is_obvious(do_res_stat(A_INT, TRUE), obvious)
- obvious = is_obvious(do_res_stat(A_CHR, TRUE), obvious)
- end
- if get_level(RECOVERY, 50) >= 15 then
- obvious = is_obvious(restore_level(), obvious)
- end
- return obvious
- end,
- ["info"] = function()
- return ""
- end,
+ ["spell"] = function() return nature_recovery() end,
+ ["info"] = function() return nature_recovery_info() end,
["desc"] = {
"Reduces the length of time that you are poisoned",
"At level 5 it cures poison and cuts",
@@ -109,12 +79,8 @@ REGENERATION = add_spell
["mana_max"] = 55,
["fail"] = 70,
["inertia"] = { 4, 40 },
- ["spell"] = function()
- if player.tim_regen == 0 then return set_tim_regen(randint(10) + 5 + get_level(REGENERATION, 50), 300 + get_level(REGENERATION, 700)) end
- end,
- ["info"] = function()
- return "dur "..(5 + get_level(REGENERATION, 50)).."+d10 power "..(300 + get_level(REGENERATION, 700))
- end,
+ ["spell"] = function() return nature_regeneration() end,
+ ["info"] = function() return nature_regeneration_info() end,
["desc"] = {
"Increases your body's regeneration rate",
}
@@ -139,13 +105,8 @@ SUMMONANNIMAL = add_spell
["max_level"] = { 15, 45 },
},
},
- ["spell"] = function()
- summon_specific_level = 25 + get_level(SUMMONANNIMAL, 50)
- return summon_monster(player.py, player.px, dun_level, TRUE, SUMMON_ANIMAL)
- end,
- ["info"] = function()
- return "level "..(25 + get_level(SUMMONANNIMAL, 50))
- end,
+ ["spell"] = function() return nature_summon_animal() end,
+ ["info"] = function() return nature_summon_animal_info() end,
["desc"] = {
"Summons a leveled animal to your aid",
}