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

Two handed weapons say so in their descriptions

Most town stores respect their town factions now


git-svn-id: http://svn.net-core.org/repos/t-engine4@2708 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4c68bc5c
No related branches found
No related tags found
No related merge requests found
......@@ -220,6 +220,8 @@ function _M:getTextualDesc()
local desc = tstring{}
desc:add(("Type: %s / %s"):format(self.type or "unknown", self.subtype or "unknown"), true)
if self.slot_forbid == "OFFHAND" then desc:add("It must be held with both hands.", true) end
desc:add(true)
-- Stop here if unided
if not self:isIdentified() then return desc end
......
......@@ -19,15 +19,16 @@
-- defineTile section
defineTile("D", "DEEP_BELLOW")
defineTile("3", "WEAPON_STORE")
defineTile("#", "HARDWALL")
defineTile("5", "RUNIC_STORE")
defineTile("&", {"CRYSTAL_WALL","CRYSTAL_WALL2","CRYSTAL_WALL3","CRYSTAL_WALL4","CRYSTAL_WALL5","CRYSTAL_WALL6","CRYSTAL_WALL7","CRYSTAL_WALL8","CRYSTAL_WALL9","CRYSTAL_WALL10","CRYSTAL_WALL11","CRYSTAL_WALL12","CRYSTAL_WALL13","CRYSTAL_WALL14","CRYSTAL_WALL15","CRYSTAL_WALL16","CRYSTAL_WALL17","CRYSTAL_WALL18","CRYSTAL_WALL19","CRYSTAL_WALL20",})
defineTile("9", "GEM_STORE")
defineTile("<", "UP_WILDERNESS")
defineTile(".", "OLD_FLOOR")
defineTile("R", "ESCAPE_REKNOR")
defineTile("2", "ARMOR_STORE")
defineTile("3", "WEAPON_STORE")
defineTile("5", "RUNIC_STORE")
defineTile("9", "GEM_STORE")
-- addSpot section
......
......@@ -39,6 +39,7 @@ defineTile("'", "DOOR")
defineTile('1', "HARDWALL", nil, nil, "TRAINER")
defineTile('2', "HARDWALL", nil, nil, "WEAPON_STORE")
defineTile('3', "HARDWALL", nil, nil, "ARMOR_STORE")
defineTile('4', "HARDWALL", nil, nil, "HERBALIST")
defineTile('9', "HARDWALL", nil, nil, "LIBRARY")
startx = 24
......@@ -127,7 +128,7 @@ return [[
~~~~~~ttt......#:#._.#:#......=??!!??????=...###tt
~~~~~tttt......###._.###.....==??????????==..###tt
~~~~~ttt..........._.........=????????????=..###tt
~~~~tttt........._____.......=????????????==.+#ttt
~~~~tttt........._____.......=????????????==.4#ttt
~~~tttt.........._ttt_....___=??????????!??=...ttt
~~~ttttt........._ttt_..___..=?????????!???=...ttt
~~...ttt.........________....==???!???????==...ttt
......
......@@ -42,3 +42,9 @@ newEntity{ base = "BASE_STORE", define_as = "TRAINER",
display='1', color=colors.UMBER,
resolvers.chatfeature("zigur-trainer", "zigur"),
}
newEntity{ base = "BASE_STORE", define_as = "HERBALIST",
name="Herbalist",
display='4', color=colors.GREEN,
resolvers.store("POTION", "zigur"),
}
-- 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
require "engine.class"
local Dialog = require "engine.ui.Dialog"
local List = require "engine.ui.List"
local Faction = require "engine.Faction"
local GetQuantity = require "engine.dialogs.GetQuantity"
module(..., package.seeall, class.inherit(Dialog))
function _M:init()
self:generateList()
Dialog.init(self, "Alter Faction", 1, 1)
local list = List.new{width=400, height=500, list=self.list, fct=function(item) self:use(item) end}
self:loadUI{
{left=0, top=0, ui=list},
}
self:setupUI(true, true)
self.key:addCommands{ __TEXTINPUT = function(c)
for i = list.sel + 1, #self.list do
local v = self.list[i]
if v.name:sub(1, 1):lower() == c:lower() then list:select(i) return end
end
for i = 1, list.sel do
local v = self.list[i]
if v.name:sub(1, 1):lower() == c:lower() then list:select(i) return end
end
end}
self.key:addBinds{ EXIT = function() game:unregisterDialog(self) end, }
end
function _M:use(item)
if not item then return end
game:unregisterDialog(self)
Dialog:listPopup("Alter: "..item.def.name, "Alter to which state:", {{name="friendly"}, {name="neutral"}, {name="hostile"}}, 300, 150, function(sel)
if not sel then return end
if sel.name == "friendly" then Faction:setFactionReaction(game.player.faction, item.def.short_name, 100, true)
elseif sel.name == "neutral" then Faction:setFactionReaction(game.player.faction, item.def.short_name, 0, true)
elseif sel.name == "hostile" then Faction:setFactionReaction(game.player.faction, item.def.short_name, -100, true)
end
end)
end
function _M:generateList()
local list = {}
for s, def in pairs(Faction.factions) do
list[#list+1] = {name=def.name, def=def}
end
table.sort(list, function(a,b) return a.name < b.name end)
local chars = {}
for i, v in ipairs(list) do
v.name = v.name
chars[self:makeKeyChar(i)] = i
end
list.chars = chars
self.list = list
end
......@@ -103,6 +103,7 @@ function _M:generateList()
list[#list+1] = {name="Grant/Alter Quests", dialog="GrantQuest"}
list[#list+1] = {name="Summon Creature", dialog="SummonCreature"}
list[#list+1] = {name="Create Item", dialog="CreateItem"}
list[#list+1] = {name="Alter Faction", dialog="AlterFaction"}
local chars = {}
for i, v in ipairs(list) do
......
......@@ -184,7 +184,7 @@ function resolvers.calc.store(t, e)
e.block_move = function(self, x, y, who, act, couldpass)
if who and who.player and act then
if self.store_faction and who:reactionToward({faction=self.store_faction}) < 0 then return end
if self.store_faction and who:reactionToward({faction=self.store_faction}) < 0 then return true end
self.store:loadup(game.level, game.zone)
self.store:interact(who)
end
......@@ -208,7 +208,7 @@ function resolvers.calc.chatfeature(t, e)
e.block_move = function(self, x, y, who, act, couldpass)
if who and who.player and act then
if self.chat_faction and who:reactionToward({faction=self.chat_faction}) < 0 then return end
if self.chat_faction and who:reactionToward({faction=self.chat_faction}) < 0 then return true end
local Chat = require("engine.Chat")
local chat = Chat.new(self.chat, self, who)
chat:invoke()
......
......@@ -118,6 +118,11 @@
<property name="display" value="1"/>
</properties>
</tile>
<tile id="22">
<properties>
<property name="display" value="4"/>
</properties>
</tile>
<tile id="24">
<properties>
<property name="display" value="9"/>
......@@ -136,7 +141,7 @@
</tileset>
<layer name="Terrain" width="50" height="50">
<data encoding="base64" compression="zlib">
eJzt2DtOA0EMBuCljUSVA0TiElw3LQfgLqSAmpYKpUOR1pJlje3f43kFiGQBYVj5W48nXo7bth07x/OA6G2IOg57jHAcwJCOCwv0GqirR/5aDhmHZ8kYLkBo67P3JOqwrnnL58EIxPHkBGoZ7fhk71Ou2kuz0L1AHfIM0Rx03Sv7vuTg4RksS8RROgstx+3nk/K+5qDXyx6WRduflkM7060+lw6rn9FacAe31DgiZ8kJXBcxcEvEgdZC5i+jh4Ms35vdHzUGcvC/Kzm4MeLgfSP7BHVE6qE5SjVCHbL3EYf2+9p9Ze2xUp9b5xUZoo5oIPsq2yPeZ3uLObDWgZy/6IzSYq6NnleaJzJj9XDMjJb7KhrIjB8x/FbHKAvl/b5//apweM8fjyxG1SeTP+JYyVL7f4ZWnujMXGNAnmszltJ84/W2XI8YEAe3ZO8h4uA1RA1RR8TiOT4MR7QWNY7auvTsDdQx8zzu6Rhp+XdgjtUsqGO2xfNkHat4Io6VLVGHZ+llOhci64h4WnlLDm7JOFqZMg7aY60cWf+9O8jytrBD7h9rnTdLznJQ7tSHloWvm93nVm7SUgr5nLKyo+Tx5qYVHEieaFiGUX3eyiJrdO+OFnPiX3W8DnL8AHvdPBE=
eJzt2DtOA0EMBuCljUSVA0TiElw3LQfgLqSAmg5RpkOR1pJlje3f43kFiGQBYVj5W48nXo7bth07x/OA6G2IOg57jHAcwJCOCwv0GqirR/5aDhmHZ8kYLkBo67P3JOqwrnnL58EIxPHkBGoZ7fhk71Ou2kuz0L1AHfIM0Rx03Sv7vuTg4RksS8RROgstx+3nk/K+5qDXyx6WRduflkM7060+lw6rn9FacAe31DgiZ8kJXBcxcEvEgdZC5i+jh4MsX5vdHzUGcvC/Kzm4MeLgfSP7BHVE6qE5SjVCHbL3EYf2+9p9Ze2xUp9b5xUZoo5oIPsq2yPeZ3uLObDWgZy/6IzSYq6NnleaJzJj9XDMjJb7KhrIjB8x/FbHKAvl/b5//a5weM8fjyxG1SeTP+JYyVL7f4ZWnujMXGNAnmszltJ84/W2XI8YEAe3ZO8h4uA1RA1RR8TiOT4MR7QWNY7auvTsDdQx8zzu6Rhp+XdgjtUsqGO2xfNkHat4Io6VLVGHZ+llOhci64h4WnlLDm7JOFqZMg7aY60cWf+9O8jytrBD7h9rnTdLznJQ7tSHloWvm93nVm7SUgr5nLKyo+Tx5qYVHEieaFiGUX3eyiJrdO+OFnPiX3W8DnL8AI2uPAk=
</data>
</layer>
<objectgroup name="addSpot" width="50" height="50">
......
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