diff --git a/game/engine/dialogs/ShowEquipInven.lua b/game/engine/dialogs/ShowEquipInven.lua index 05139d9fed25372d4e66079f86934fd7864da450..125e15945b32ddc8306e0f7c73ca1ab65b33fee8 100644 --- a/game/engine/dialogs/ShowEquipInven.lua +++ b/game/engine/dialogs/ShowEquipInven.lua @@ -26,6 +26,7 @@ function _M:init(title, actor, filter, action) self.action = action self.filter = filter self.actor = actor + engine.Dialog.init(self, title or "Inventory", game.w * 0.8, game.h * 0.8, nil, nil, nil, core.display.newFont("/data/font/VeraMono.ttf", 12)) self:generateList() diff --git a/game/engine/interface/WorldAchievements.lua b/game/engine/interface/WorldAchievements.lua index 3ca457629eeff72bbf4f2a63be6b2dd24c8623f6..c489d85b40c85c682f38b6c14411d9dd9648d458 100644 --- a/game/engine/interface/WorldAchievements.lua +++ b/game/engine/interface/WorldAchievements.lua @@ -56,6 +56,7 @@ end function _M:loadAchievements() self.achieved = {} + self.playerachieved = {} for k, e in pairs(profile.mod) do if k:find('^achievement%.') then @@ -71,13 +72,33 @@ function _M:getAchievementFromId(id) return self.achiev_defs[id] end + +--- Gain Personal achievement for player only +-- @ +-- @param id the achivement to gain +-- @param src who did it +function _M:gainPersonalAchievement(silent, id, src, ...) + local a = self.achiev_defs[id] + if src.resolveSource then src = src:resolveSource() end + + src.achievements = src.achievements or {} + if src.achievements[id] then return end + + src.achievements[id] = {turn=game.turn, when=os.date("%Y-%m-%d %H:%M:%S")} + if not silent then + game.log("#LIGHT_GREEN#Personal New Achievement: %s!", a.name) + Dialog:simplePopup("Personal New Achievement: #LIGHT_GREEN#"..a.name, a.desc) + end +end + --- Gain an achievement -- @param id the achivement to gain -- @param src who did it function _M:gainAchievement(id, src, ...) local a = self.achiev_defs[id] if not a then error("Unknown achievement "..id) return end - if self.achieved[id] then return end + + if self.achieved[id] and self.playerachieved[id] then return end if a.can_gain then local data = nil @@ -97,9 +118,11 @@ function _M:gainAchievement(id, src, ...) if not a.can_gain(data, src, ...) then return end end + if self.achieved[id] then self:gainPersonalAchievement(false, id, src, ...) return end + self:gainPersonalAchievement(true, id, src, ...) + self.achieved[id] = {turn=game.turn, who=self:achievementWho(src), when=os.date("%Y-%m-%d %H:%M:%S")} profile:saveModuleProfile("achievement."..id, self.achieved[id]) - game.log("#LIGHT_GREEN#New Achievement: %s!", a.name) Dialog:simplePopup("New Achievement: #LIGHT_GREEN#"..a.name, a.desc) end diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index cc4993eea27c5ed1cca158d314bf9e7d28cc719c..293e21ae360e1ee5e6f3a421e335a223e8ca1570 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -154,10 +154,7 @@ end --- Gets the full textual desc of the object without the name and requirements function _M:getTextualDesc() - local desc = {} - if self.encumber then - desc[#desc+1] = ("#67AD00#%0.2f Encumbrance."):format(self.encumber) - end + local desc = {} desc[#desc+1] = ("Type: %s / %s"):format(self.type, self.subtype) @@ -315,6 +312,10 @@ function _M:getDesc() if reqs then desc[#desc+1] = reqs end + + if self.encumber then + desc[#desc+1] = ("#67AD00#%0.2f Encumbrance."):format(self.encumber) + end local textdesc = table.concat(self:getTextualDesc(), "\n") diff --git a/game/modules/tome/data/birth/classes/warrior.lua b/game/modules/tome/data/birth/classes/warrior.lua index 6da3664a6f75b7f62a5e9657bc4ebf316f3e5f95..09fb0403751d7e408eceb7c6b7c0cfae89056454 100644 --- a/game/modules/tome/data/birth/classes/warrior.lua +++ b/game/modules/tome/data/birth/classes/warrior.lua @@ -49,7 +49,7 @@ newBirthDescriptor{ }, stats = { str=5, con=2, dex=2, }, talents_types = { - ["technique/archery-training"]={false, 0.9}, + ["technique/archery-training"]={false, 0.1}, ["technique/shield-offense"]={true, 0.3}, ["technique/shield-defense"]={true, 0.3}, ["technique/2hweapon-offense"]={false, -0.1}, @@ -84,7 +84,7 @@ newBirthDescriptor{ }, stats = { str=5, con=3, dex=1, }, talents_types = { - ["technique/archery-training"]={false, 0.9}, + ["technique/archery-training"]={false, 0.1}, ["technique/shield-defense"]={false, -0.1}, ["technique/2hweapon-offense"]={true, 0.3}, ["technique/2hweapon-cripple"]={true, 0.3}, diff --git a/game/modules/tome/data/general/objects/quest-artifacts.lua b/game/modules/tome/data/general/objects/quest-artifacts.lua index d28b5261ec28d47c3ca696f0eb6289629a7d09ff..69e8a51bbb3692f414eaeed4fd052abaaae3f887 100644 --- a/game/modules/tome/data/general/objects/quest-artifacts.lua +++ b/game/modules/tome/data/general/objects/quest-artifacts.lua @@ -94,3 +94,81 @@ If used near a portal it could probably activate it.]], end end, } + +-------------------- The four orbs of command + +-- Rak'shor Pride +newEntity{ define_as = "ORB_UNDEATH", + unique = true, quest=true, + type = "jewelry", subtype="orb", + unided_name = "orb of command", + name = "Orb of Undeath (Orb of Command)", + level_range = {50, 50}, + display = "*", color=colors.VIOLET, + encumber = 1, + desc = [[Dark visions fill you mind as you lift the orb. It is cold to the touch.]], + + on_drop = function(self, who) + if who == game.player then + game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName()) + return true + end + end, +} + +-- Gorbat Pride +newEntity{ define_as = "ORB_DRAGON", + unique = true, quest=true, + type = "jewelry", subtype="orb", + unided_name = "orb of command", + name = "Dragon Orb (Orb of Command)", + level_range = {50, 50}, + display = "*", color=colors.VIOLET, + encumber = 1, + desc = [[This orb is warm to the touch.]], + + on_drop = function(self, who) + if who == game.player then + game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName()) + return true + end + end, +} + +-- Vor Pride +newEntity{ define_as = "ORB_ELEMENTS", + unique = true, quest=true, + type = "jewelry", subtype="orb", + unided_name = "orb of command", + name = "Elemental Orb (Orb of Command)", + level_range = {50, 50}, + display = "*", color=colors.VIOLET, + encumber = 1, + desc = [[Flames swirl on the icy surface of this orb.]], + + on_drop = function(self, who) + if who == game.player then + game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName()) + return true + end + end, +} + +-- Grushnak Pride +newEntity{ define_as = "ORB_DESTRUCTION", + unique = true, quest=true, + type = "jewelry", subtype="orb", + unided_name = "orb of command", + name = "Orb of Destruction (Orb of Command)", + level_range = {50, 50}, + display = "*", color=colors.VIOLET, + encumber = 1, + desc = [[Visions of death and destruction fill your mind as you lift this orb.]], + + on_drop = function(self, who) + if who == game.player then + game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName()) + return true + end + end, +} diff --git a/game/modules/tome/data/quests/orb-command.lua b/game/modules/tome/data/quests/orb-command.lua new file mode 100644 index 0000000000000000000000000000000000000000..98d77106fdecaf394830d1af4f0dfb93e80bb902 --- /dev/null +++ b/game/modules/tome/data/quests/orb-command.lua @@ -0,0 +1,28 @@ +-- 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 + +name = "The Orbs of Command" +desc = function(self, who) + local desc = {} + desc[#desc+1] = "You have found an orb of command that seems to be used to open the shield protecting the High Peek." + desc[#desc+1] = "There seems to be a total of four of them, the more you have the weaker the shield will be." + + end + return table.concat(desc, "\n") +end diff --git a/game/modules/tome/data/talents/spells/staff-combat.lua b/game/modules/tome/data/talents/spells/staff-combat.lua index ab59f2aa4fa25cd41e6cd632988ada74c47a4d4e..18581a18802b6a643c10bf5c2475e7087c7c2b2c 100644 --- a/game/modules/tome/data/talents/spells/staff-combat.lua +++ b/game/modules/tome/data/talents/spells/staff-combat.lua @@ -38,6 +38,10 @@ newTalent{ local tg = {type="bolt", range=self:getTalentRange(t), talent=t} local x, y, target = self:getTarget(tg) if not x or not y or not target then return nil end + local _ _, x, y = self:canProject(tg, x, y) + target = game.level.map(x, y, Map.ACTOR) + if not x or not y or not target then return nil end + self.combat_apr = self.combat_apr + 10000 self.combat_atk = self.combat_atk + 10000 local speed, hit = self:attackTargetWith(target, weapon.combat, nil, self:combatTalentWeaponDamage(t, 0.4, 1.1)) diff --git a/game/modules/tome/data/talents/techniques/archery.lua b/game/modules/tome/data/talents/techniques/archery.lua index 3d3de58d0cb942e81554c54364cdf5be52f1582c..8e8a46a519e03df5e007ac4f0425a722122d97f9 100644 --- a/game/modules/tome/data/talents/techniques/archery.lua +++ b/game/modules/tome/data/talents/techniques/archery.lua @@ -262,6 +262,6 @@ newTalent{ return energy ~= self.energy.value end, info = function(self, t) - return ([[You fire multiple shots at the area, doing %d%% damage and stunning your targets for %d turns.]]):format(self:combatTalentWeaponDamage(t, 0.5, 1.5), 2 + self:getTalentLevelRaw(t)) + return ([[You fire multiple shots at the area, doing %d%% damage and stunning your targets for %d turns.]]):format(self:combatTalentWeaponDamage(t, 0.5, 1.5), 2 + self:getTalentLevelRaw(t) * 100) end, } diff --git a/game/modules/tome/data/zones/rak-shor-pride/npcs.lua b/game/modules/tome/data/zones/rak-shor-pride/npcs.lua index 0870e083b362ad16b97e8c4b5482aad5ea9e88e2..62e9151169ac98c182961dd12671f8022624912d 100644 --- a/game/modules/tome/data/zones/rak-shor-pride/npcs.lua +++ b/game/modules/tome/data/zones/rak-shor-pride/npcs.lua @@ -50,6 +50,7 @@ newEntity{ base="BASE_NPC_ORC_RAK_SHOR", define_as = "RAK_SHOR", {type="weapon", subtype="staff", ego_change=100, autoreq=true}, {type="armor", subtype="cloth", defined="BLACK_ROBE", autoreq=true}, }, + resolvers.drops{chance=100, nb=1, {defined="ORB_UNDEATH"} }, resolvers.drops{chance=100, nb=5, {ego_chance=100} }, summon = { diff --git a/game/modules/tome/dialogs/CharacterSheet.lua b/game/modules/tome/dialogs/CharacterSheet.lua index 4907ef82964ffca726eac3561dbbec34cd83b721..3ee95ec605b3a7c044986d8d7e0b2ecd2b7f9de5 100644 --- a/game/modules/tome/dialogs/CharacterSheet.lua +++ b/game/modules/tome/dialogs/CharacterSheet.lua @@ -399,6 +399,14 @@ function _M:dump() end end + nl() + nl(" [Player Achievments]") + nl() + for id, data in pairs(self.actor.achievements) do + local a = world:getAchievementFromId(id) + nl(("%s Was Achieved for %s At %s"):format(a.name,a.desc,data.when)) + end + nl() nl(" [Character Inventory]") nl() diff --git a/ideas/zones.ods b/ideas/zones.ods index 81d934bd87d7de66260bbaae496dfa4ca82d5615..806e039b7f2029fab060a7d2f911382417fa4d08 100644 Binary files a/ideas/zones.ods and b/ideas/zones.ods differ