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

Added belts and related egos

git-svn-id: http://svn.net-core.org/repos/t-engine4@1276 51575b47-30f0-44d4-a5cc-537603b46e54
parent 86ec493a
No related branches found
No related tags found
No related merge requests found
......@@ -308,7 +308,11 @@ function _M:wearObject(o, replace, vocal)
if vocal then game.logSeen(self, "%s is not wearable.", o:getName{do_color=true}) end
return false
end
print("wear slot", inven)
if not self.inven[inven] then
if vocal then game.logSeen(self, "%s can not wear %s.", self.name, o:getName{do_color=true}) end
return false
end
local ok, err = self:canWearObject(o)
if not ok then
if vocal then game.logSeen(self, "%s can not wear: %s (%s).", self.name:capitalize(), o:getName{do_color=true}, err) end
......
......@@ -41,7 +41,7 @@ newBirthDescriptor{
},
talents = {},
experience = 1.0,
body = { INVEN = 1000, QS_MAINHAND = 1, QS_OFFHAND = 1, MAINHAND = 1, OFFHAND = 1, FINGER = 2, NECK = 1, LITE = 1, BODY = 1, HEAD = 1, CLOAK = 1, HANDS = 1, FEET = 1, TOOL = 1, QUIVER = 1, MOUNT = 1 },
body = { INVEN = 1000, QS_MAINHAND = 1, QS_OFFHAND = 1, MAINHAND = 1, OFFHAND = 1, FINGER = 2, NECK = 1, LITE = 1, BODY = 1, HEAD = 1, CLOAK = 1, HANDS = 1, BELT = 1, FEET = 1, TOOL = 1, QUIVER = 1, MOUNT = 1 },
copy = {
-- Mages are unheard of at first, nobody but them regenerates mana
......@@ -59,6 +59,16 @@ newBirthDescriptor{
{type="potion", subtype="potion", name="potion of lesser healing", ego_chance=-1000},
{type="potion", subtype="potion", name="potion of cure poison", ego_chance=-1000},
{type="potion", subtype="potion", name="potion of cure poison", ego_chance=-1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
{type="armor", subtype="belt", ego_chance=1000},
},
resolvers.generic(function(e)
e.hotkey[9] = {"inventory", "potion of lesser healing"}
......
-- ToME - Tales of Middle-Earth
-- 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
local Stats = require "engine.interface.ActorStats"
local DamageType = require "engine.DamageType"
load("/data/general/objects/egos/charged-defensive.lua")
newEntity{
name = " of carrying", suffix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 5,
cost = 6,
wielder = {
max_encumber = resolvers.mbonus_material(50, 10, function(e, v) return v * 0.4, v end),
},
}
newEntity{
name = " of shielding", suffix=true, instant_resolve=true,
level_range = {20, 50},
rarity = 10,
cost = 40,
wielder = {
combat_def = resolvers.mbonus_material(10, 5, function(e, v) return v * 1, v end),
},
max_power = 120, power_regen = 1,
use_power = { name = "create a temporary shield that absorbs damage", power = 100, use = function(self, who)
local power = 100 + who:getMag(120)
who:setEffect(who.EFF_DAMAGE_SHIELD, 10, {power=power})
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
end}
}
newEntity{
name = "slotted ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 1,
cost = 6,
belt_slots = resolvers.mbonus_material(6, 3, function(e, v) return v * 1 end),
on_wear = function(self, who)
who.inven[who.INVEN_INBELT] = {max=self.belt_slots, worn=false, id=who.INVEN_INBELT}
end,
on_cantakeoff = function(self, who)
if #who:getInven(who.INVEN_INBELT) > 0 then
game.logPlayer(who, "You can not remove %s while it still carries items.", self:getName{do_color=true})
return false
end
end,
on_takeoff = function(self, who)
who.inven[who.INVEN_INBELT] = nil
end,
}
-- ToME - Tales of Middle-Earth
-- 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_LEATHER_BELT",
slot = "BELT",
type = "armor", subtype="belt",
display = "(", color=colors.UMBER, image = resolvers.image_material("belt", "leather"),
encumber = 1,
rarity = 6,
desc = [[A belt that goes around your waist.]],
egos = "/data/general/objects/egos/belt.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
}
newEntity{ base = "BASE_LEATHER_BELT",
name = "rough leather belt",
level_range = {1, 20},
cost = 1,
material_level = 1,
}
newEntity{ base = "BASE_LEATHER_BELT",
name = "hardened leather belt",
level_range = {20, 40},
cost = 2,
material_level = 3,
}
newEntity{ base = "BASE_LEATHER_BELT",
name = "drakeskin leather belt",
level_range = {40, 50},
cost = 4,
material_level = 5,
}
......@@ -71,6 +71,7 @@ loadIfNot("/data/general/objects/heavy-boots.lua")
loadIfNot("/data/general/objects/gloves.lua")
loadIfNot("/data/general/objects/gauntlets.lua")
loadIfNot("/data/general/objects/cloak.lua")
loadIfNot("/data/general/objects/leather-belt.lua")
-- Mounts
loadIfNot("/data/general/objects/mounts.lua")
......
......@@ -19,6 +19,7 @@
newEntity{
define_as = "BASE_POTION",
slot = "INBELT",
type = "potion", subtype="potion",
unided_name = "potion", id_by_type = true,
display = "!", color=colors.WHITE, image="object/potion-0x0.png",
......
......@@ -19,6 +19,7 @@
newEntity{
define_as = "BASE_SCROLL",
slot = "INBELT",
type = "scroll", subtype="scroll",
unided_name = "scroll", id_by_type = true,
display = "?", color=colors.WHITE, image="object/scroll.png",
......
......@@ -73,6 +73,7 @@ ActorInventory:defineInventory("BELT", "Around waist", true, "Belts are worn aro
ActorInventory:defineInventory("HANDS", "On hands", true, "Various gloves can be worn on your hands.")
ActorInventory:defineInventory("FEET", "On feet", true, "Sandals or boots can be worn on your feet.")
ActorInventory:defineInventory("TOOL", "Tool", true, "This is your readied tool, always available immediately.")
ActorInventory:defineInventory("INBELT", "In your belt", true, "Put small objects in your belt.")
ActorInventory:defineInventory("QUIVER", "Quiver", true, "Your readied ammo.")
ActorInventory:defineInventory("MOUNT", "Mount", false, "Your mount.")
......
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