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

Player tiles now reflect the currently worn equipment!

onyl for yeeks & ghouls now, more later


git-svn-id: http://svn.net-core.org/repos/t-engine4@3691 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2e7394b1
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 1 deletion
...@@ -1729,6 +1729,32 @@ function _M:checkEncumbrance() ...@@ -1729,6 +1729,32 @@ function _M:checkEncumbrance()
end end
end end
--- Update tile
function _M:updateModdableTile()
if not self.moddable_tile then return end
self:removeAllMOs()
local base = "player/"..self.moddable_tile.."/"
self.image = base.."base_shadow_01.png"
self.add_mos = {}
local add = self.add_mos
local i
i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("behind")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
add[#add+1] = {image = base.."base_01.png"}
i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("shoulder")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_BODY]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_BODY]; if i and i[1] and i[1].moddable_tile2 then add[#add+1] = {image = base..(i[1].moddable_tile2)..".png"} end
i = self.inven[self.INVEN_MAINHAND]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_OFFHAND]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_HEAD]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_FEET]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_HANDS]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
if self.x and game.level then game.level.map:updateMap(self.x, self.y) end
end
--- Call when an object is worn --- Call when an object is worn
function _M:onWear(o) function _M:onWear(o)
engine.interface.ActorInventory.onWear(self, o) engine.interface.ActorInventory.onWear(self, o)
...@@ -1741,6 +1767,8 @@ function _M:onWear(o) ...@@ -1741,6 +1767,8 @@ function _M:onWear(o)
o.talent_on_spell[i]._id = id o.talent_on_spell[i]._id = id
end end
end end
self:updateModdableTile()
end end
--- Call when an object is taken off --- Call when an object is taken off
...@@ -1754,6 +1782,8 @@ function _M:onTakeoff(o) ...@@ -1754,6 +1782,8 @@ function _M:onTakeoff(o)
self.talent_on_spell[id] = nil self.talent_on_spell[id] = nil
end end
end end
self:updateModdableTile()
end end
--- Call when an object is added --- Call when an object is added
......
...@@ -109,7 +109,7 @@ newBirthDescriptor ...@@ -109,7 +109,7 @@ newBirthDescriptor
stun_immune = 0.5, stun_immune = 0.5,
fear_immune = 1, fear_immune = 1,
global_speed = 0.8, global_speed = 0.8,
moddable_tile = true, moddable_tile = "ghoul",
}, },
experience = 1.4, experience = 1.4,
} }
......
...@@ -86,6 +86,7 @@ newBirthDescriptor ...@@ -86,6 +86,7 @@ newBirthDescriptor
life_rating=7, life_rating=7,
confusion_immune = 0.35, confusion_immune = 0.35,
max_air = 200, max_air = 200,
moddable_tile = "yeek",
}, },
experience = 0.85, experience = 0.85,
} }
...@@ -22,6 +22,7 @@ newEntity{ ...@@ -22,6 +22,7 @@ newEntity{
slot = "MAINHAND", slot = "MAINHAND",
slot_forbid = "OFFHAND", slot_forbid = "OFFHAND",
type = "weapon", subtype="battleaxe", image = resolvers.image_material("2haxe", "metal"), type = "weapon", subtype="battleaxe", image = resolvers.image_material("2haxe", "metal"),
moddable_tile = resolvers.moddable_tile("axe"),
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "/", color=colors.SLATE, display = "/", color=colors.SLATE,
encumber = 3, encumber = 3,
......
...@@ -24,6 +24,7 @@ newEntity{ ...@@ -24,6 +24,7 @@ newEntity{
type = "weapon", subtype="greatmaul", type = "weapon", subtype="greatmaul",
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "\\", color=colors.SLATE, image = resolvers.image_material("2hmace", "metal"), display = "\\", color=colors.SLATE, image = resolvers.image_material("2hmace", "metal"),
moddable_tile = resolvers.moddable_tile("mace"),
encumber = 5, encumber = 5,
rarity = 5, rarity = 5,
metallic = true, metallic = true,
......
...@@ -24,6 +24,7 @@ newEntity{ ...@@ -24,6 +24,7 @@ newEntity{
type = "weapon", subtype="greatsword", type = "weapon", subtype="greatsword",
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "/", color=colors.SLATE, image = resolvers.image_material("2hsword", "metal"), display = "/", color=colors.SLATE, image = resolvers.image_material("2hsword", "metal"),
moddable_tile = resolvers.moddable_tile("sword"),
encumber = 3, encumber = 3,
rarity = 5, rarity = 5,
combat = { talented = "sword", damrange = 1.6, physspeed = 1, sound = "actions/melee", sound_miss = "actions/melee_miss", }, combat = { talented = "sword", damrange = 1.6, physspeed = 1, sound = "actions/melee", sound_miss = "actions/melee_miss", },
......
...@@ -22,6 +22,7 @@ newEntity{ ...@@ -22,6 +22,7 @@ newEntity{
slot = "MAINHAND", slot = "MAINHAND",
slot_forbid = "OFFHAND", slot_forbid = "OFFHAND",
type = "weapon", subtype="trident", image = resolvers.image_material("trident", "sea-metal"), type = "weapon", subtype="trident", image = resolvers.image_material("trident", "sea-metal"),
moddable_tile = resolvers.moddable_tile("trident"),
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "|", color=colors.AQUAMARINE, display = "|", color=colors.AQUAMARINE,
encumber = 3, encumber = 3,
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "weapon", subtype="waraxe", type = "weapon", subtype="waraxe",
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "/", color=colors.SLATE, image = resolvers.image_material("axe", "metal"), display = "/", color=colors.SLATE, image = resolvers.image_material("axe", "metal"),
moddable_tile = resolvers.moddable_tile("axe"),
encumber = 3, encumber = 3,
rarity = 3, rarity = 3,
metallic = true, metallic = true,
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
slot_forbid = "OFFHAND", slot_forbid = "OFFHAND",
type = "weapon", subtype="longbow", type = "weapon", subtype="longbow",
display = "}", color=colors.UMBER, image = resolvers.image_material("longbow", "wood"), display = "}", color=colors.UMBER, image = resolvers.image_material("longbow", "wood"),
moddable_tile = resolvers.moddable_tile("bow"),
encumber = 4, encumber = 4,
rarity = 5, rarity = 5,
combat = { talented = "bow", sound = "actions/arrow", sound_miss = "actions/arrow",}, combat = { talented = "bow", sound = "actions/arrow", sound_miss = "actions/arrow",},
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "armor", subtype="cloak", type = "armor", subtype="cloak",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "(", color=colors.UMBER, image = resolvers.image_material("cloak", "cloth"), display = "(", color=colors.UMBER, image = resolvers.image_material("cloak", "cloth"),
moddable_tile = resolvers.moddable_tile("cloak"),
encumber = 2, encumber = 2,
rarity = 6, rarity = 6,
desc = [[A cloth coat typically worn as a loose outer garment. It is spacious enough to be worn even over bulky metal armour.]], desc = [[A cloth coat typically worn as a loose outer garment. It is spacious enough to be worn even over bulky metal armour.]],
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "armor", subtype="cloth", type = "armor", subtype="cloth",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "[", color=colors.SLATE, image = resolvers.image_material("robe", "cloth"), display = "[", color=colors.SLATE, image = resolvers.image_material("robe", "cloth"),
moddable_tile = resolvers.moddable_tile("robe"),
encumber = 2, encumber = 2,
rarity = 5, rarity = 5,
desc = [[A cloth vestment. It offers no intrinsic protection but can be enchanted.]], desc = [[A cloth vestment. It offers no intrinsic protection but can be enchanted.]],
......
...@@ -26,6 +26,7 @@ newEntity{ ...@@ -26,6 +26,7 @@ newEntity{
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "[", color=colors.SLATE, display = "[", color=colors.SLATE,
image = resolvers.image_material("hgloves", "metal"), image = resolvers.image_material("hgloves", "metal"),
moddable_tile = resolvers.moddable_tile("gauntlets"),
require = { talent = { Talents.T_ARMOUR_TRAINING }, }, require = { talent = { Talents.T_ARMOUR_TRAINING }, },
encumber = 1.5, encumber = 1.5,
rarity = 9, rarity = 9,
......
...@@ -26,6 +26,7 @@ newEntity{ ...@@ -26,6 +26,7 @@ newEntity{
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "[", color=colors.UMBER, display = "[", color=colors.UMBER,
image = resolvers.image_material("gloves", "leather"), image = resolvers.image_material("gloves", "leather"),
moddable_tile = resolvers.moddable_tile("gloves"),
encumber = 1, encumber = 1,
rarity = 9, rarity = 9,
desc = [[Light gloves which do not seriously hinder finger movements, while still protecting the hands somewhat.]], desc = [[Light gloves which do not seriously hinder finger movements, while still protecting the hands somewhat.]],
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
define_as = "BASE_HEAVY_ARMOR", define_as = "BASE_HEAVY_ARMOR",
slot = "BODY", slot = "BODY",
type = "armor", subtype="heavy", image = resolvers.image_material("mail", "metal"), type = "armor", subtype="heavy", image = resolvers.image_material("mail", "metal"),
moddable_tile = resolvers.moddable_tile("heavy"),
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "[", color=colors.SLATE, display = "[", color=colors.SLATE,
require = { talent = { {Talents.T_ARMOUR_TRAINING,2} }, }, require = { talent = { {Talents.T_ARMOUR_TRAINING,2} }, },
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
define_as = "BASE_HEAVY_BOOTS", define_as = "BASE_HEAVY_BOOTS",
slot = "FEET", slot = "FEET",
type = "armor", subtype="feet", image = resolvers.image_material("hboots", "metal"), type = "armor", subtype="feet", image = resolvers.image_material("hboots", "metal"),
moddable_tile = resolvers.moddable_tile("heavy_boots"),
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "]", color=colors.SLATE, display = "]", color=colors.SLATE,
require = { talent = { Talents.T_ARMOUR_TRAINING }, }, require = { talent = { Talents.T_ARMOUR_TRAINING }, },
......
...@@ -25,6 +25,7 @@ newEntity{ ...@@ -25,6 +25,7 @@ newEntity{
type = "armor", subtype="head", type = "armor", subtype="head",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "]", color=colors.SLATE, image = resolvers.image_material("helm", "metal"), display = "]", color=colors.SLATE, image = resolvers.image_material("helm", "metal"),
moddable_tile = resolvers.moddable_tile("helm"),
require = { talent = { Talents.T_ARMOUR_TRAINING }, }, require = { talent = { Talents.T_ARMOUR_TRAINING }, },
encumber = 3, encumber = 3,
rarity = 7, rarity = 7,
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "weapon", subtype="dagger", type = "weapon", subtype="dagger",
add_name = " (#COMBAT#)", add_name = " (#COMBAT#)",
display = "/", color=colors.WHITE, image = resolvers.image_material("knife", "metal"), display = "/", color=colors.WHITE, image = resolvers.image_material("knife", "metal"),
moddable_tile = resolvers.moddable_tile("dagger"),
encumber = 1, encumber = 1,
rarity = 5, rarity = 5,
metallic = true, metallic = true,
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "armor", subtype="feet", type = "armor", subtype="feet",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "]", color=colors.UMBER, image = resolvers.image_material("boots", "leather"), display = "]", color=colors.UMBER, image = resolvers.image_material("boots", "leather"),
moddable_tile = resolvers.moddable_tile("leather_boots"),
encumber = 2, encumber = 2,
rarity = 6, rarity = 6,
desc = [[A pair of boots made of leather.]], desc = [[A pair of boots made of leather.]],
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "armor", subtype="head", type = "armor", subtype="head",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "]", color=colors.UMBER, image = resolvers.image_material("cap", "leather"), display = "]", color=colors.UMBER, image = resolvers.image_material("cap", "leather"),
moddable_tile = resolvers.moddable_tile("leather_cap"),
encumber = 2, encumber = 2,
rarity = 6, rarity = 6,
desc = [[A cap made of leather.]], desc = [[A cap made of leather.]],
......
...@@ -23,6 +23,7 @@ newEntity{ ...@@ -23,6 +23,7 @@ newEntity{
type = "armor", subtype="light", type = "armor", subtype="light",
add_name = " (#ARMOR#)", add_name = " (#ARMOR#)",
display = "[", color=colors.SLATE, image = resolvers.image_material("leather", "leather"), display = "[", color=colors.SLATE, image = resolvers.image_material("leather", "leather"),
moddable_tile = resolvers.moddable_tile("light"),
encumber = 9, encumber = 9,
rarity = 5, rarity = 5,
desc = [[A suit of armour made of leather.]], desc = [[A suit of armour made of leather.]],
......
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