Skip to content
Snippets Groups Projects
Commit dc41ad6b authored by dg's avatar dg
Browse files

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@1905 51575b47-30f0-44d4-a5cc-537603b46e54
parent 693af79a
No related branches found
No related tags found
No related merge requests found
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
newEntity{
define_as = "BASE_POTION",
slot = "INBELT", use_no_wear=true,
type = "potion", subtype="potion",
unided_name = "potion", id_by_type = true,
display = "!", color=colors.WHITE, image="object/potion-0x0.png",
use_sound = "actions/quaff",
encumber = 0.2,
stacking = true,
acid_destroy = {{10,1}, {20,2}, {40,5}, {60,10}, {120,20}},
desc = [[Magical potions can have wildly different effects, from healing to killing you, beware! Most of them function better with a high Magic score]],
egos = "/data/general/objects/egos/potions.lua", egos_chance = resolvers.mbonus(10, 5),
}
-------------------------------------------------------
-- Healing
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of lesser healing",
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {1, 20},
rarity = 3,
cost = 3,
use_simple = { name="heal some life", use = function(self, who)
who:heal(40 + who:getMag())
game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of healing",
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {15, 35},
rarity = 4,
cost = 5,
use_simple = { name="heal a good part of your life", use = function(self, who)
who:heal(140 + who:getMag())
game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of greater healing",
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {30, 50},
rarity = 5,
cost = 7,
use_simple = { name="heal a lot", use = function(self, who)
who:heal(240 + who:getMag())
game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of full healing",
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {45, 50},
rarity = 14,
cost = 50,
use_simple = { name="fully heal", use = function(self, who)
who:heal(1000000)
game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true})
return "destroy", true
end}
}
-------------------------------------------------------
-- Curing
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of cure poison",
color = colors.LIGHT_GREEN,
level_range = {1, 50},
rarity = 7,
cost = 3,
use_simple = { name="cure poison", use = function(self, who)
local target = who
local effs = {}
local known = false
-- Go through all spell effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == "poison" then
effs[#effs+1] = {"effect", eff_id}
end
end
for i = 1, 2 + math.floor(who:getMag() / 10) do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
target:removeEffect(eff[2])
known = true
end
end
if known then
game.logSeen(who, "%s cure %s from poisons!", self:getName{no_count=true}:capitalize(), who.name)
end
return "destroy", known
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of cure disease",
color = colors.LIGHT_GREEN,
level_range = {1, 50},
rarity = 7,
cost = 3,
use_simple = { name="cure diseases", use = function(self, who)
local target = who
local effs = {}
local known = false
-- Go through all spell effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == "disease" then
effs[#effs+1] = {"effect", eff_id}
end
end
for i = 1, 2 + math.floor(who:getMag() / 10) do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
target:removeEffect(eff[2])
known = true
end
end
if known then
game.logSeen(who, "%s cure %s from diseases!", self:getName{no_count=true}:capitalize(), who.name)
end
return "destroy", known
end}
}
-------------------------------------------------------
-- Misc
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of slime mold juice",
color = colors.GREEN, image="object/potion-2x0.png",
level_range = {1, 2},
rarity = 4,
cost = 0.5,
use_simple = { name="quaff", use = function(self, who)
game.logSeen(who, "%s quaffs the slime juice. Yuck.", who.name:capitalize())
-- 1% chance of gaining slime mold powers
if rng.percent(1) then
who:learnTalentType("wild-gift/slime", true)
game.logSeen(who, "%s is transformed by the slime mold juice.", who.name:capitalize())
game.logPlayer(who, "#00FF00#You gain an affinity for the molds. You can now learn new slime talents (press G).")
end
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of speed",
color = colors.LIGHT_BLUE,
level_range = {15, 40},
rarity = 10,
cost = 1.5,
use_simple = { name="increase your speed for a while", use = function(self, who)
who:setEffect(who.EFF_SPEED, 5 + who:getMag(10), {power=1})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of invisibility",
color = colors.YELLOW,
level_range = {15, 40},
rarity = 10,
cost = 10,
use_simple = { name="become invisible for a while", use = function(self, who)
who:setEffect(who.EFF_INVISIBILITY, 5 + who:getMag(10), {power=10 + who:getMag(5)})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of see invisible",
color = colors.YELLOW,
level_range = {5, 30},
rarity = 6,
cost = 0.5,
use_simple = { name="sense invisible for a while", use = function(self, who)
who:setEffect(who.EFF_SEE_INVISIBLE, 25 + who:getMag(50), {power=10 + who:getMag(5)})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "potion of free action",
color = colors.YELLOW,
level_range = {15, 50},
rarity = 6,
cost = 7,
use_simple = { name="resist stuns, dazes and pinning", use = function(self, who)
who:setEffect(who.EFF_FREE_ACTION, 4 + math.floor(who:getMag(3)), {power=1})
return "destroy", true
end}
}
newEntity{ base = "BASE_POTION",
name = "dragon's blood",
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {30, 50},
rarity = 9,
cost = 20,
use_simple = { name="brings out the dragon in you", use = function(self, who)
who:setEffect(who.EFF_DRAGONS_FIRE, who:getWil(10) + 15, {})
return "destroy", true
end}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment