diff --git a/game/engines/default/engine/Tooltip.lua b/game/engines/default/engine/Tooltip.lua index 0841f075cebbbabe828feb502137dc71d3b872f7..fa4526babe0007d78e5e90ed5e08ff2c4279cc18 100644 --- a/game/engines/default/engine/Tooltip.lua +++ b/game/engines/default/engine/Tooltip.lua @@ -191,8 +191,6 @@ function _M:displayAtMap(tmx, tmy, mx, my, text) end if not self.empty then --- mx = mx - self.w / 2 + game.level.map.tile_w / 2 --- my = my - self.h local x1, x2, y1, y2 = util.getval(self.tooltip_bound_x1), util.getval(self.tooltip_bound_x2), util.getval(self.tooltip_bound_y1), util.getval(self.tooltip_bound_y2) if mx < x1 then mx = x1 end if my < y1 then my = y1 end diff --git a/game/engines/default/engine/interface/GameTargeting.lua b/game/engines/default/engine/interface/GameTargeting.lua index 96623816ae3a15b70f23ab024f693842f0783ce3..6dd8accbf7a891ad93d787758ecbb6868134e7d1 100644 --- a/game/engines/default/engine/interface/GameTargeting.lua +++ b/game/engines/default/engine/interface/GameTargeting.lua @@ -72,6 +72,12 @@ function _M:targetDisplayTooltip(dx, dy) end end +--- Forces the tooltip to pop with the given text +function _M:tooltipDisplayAtMap(x, y, text) + self.tooltip:displayAtMap(nil, nil, x, y, text) + self.tooltip_x = {} +end + --- Enter/leave targeting mode -- This is the "meat" of this interface, do not expect to understand it easily, it mixes some nasty stuff -- This require the Game to have both a "key" field (this is the default) and a "normal_key" field<br/> diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 4dadd821377c40c37d9544284debedcb438a8e57..93dfbdea237e5487642f98449a02ac2d20ce50fb 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -111,7 +111,6 @@ function _M:run() self.calendar = Calendar.new("/data/calendar_allied.lua", "Today is the %s %s of the %s year of the Age of Ascendancy of Maj'Eyal.\nThe time is %02d:%02d.", 122, 167, 11) self.player_display = PlayerDisplay.new(0, 200, 200, self.h - 200, {30,30,0}, font_mono, size_mono) --- self.flash = LogFlasher.new(0, 0, self.w, 20, nil, font, size, {255,255,255}, {0,0,0}) self.map_h_stop = self.h - 52 self.logdisplay = LogDisplay.new(216, self.map_h_stop - font_h * config.settings.tome.log_lines -16, (self.w - 216) / 2, font_h * config.settings.tome.log_lines, nil, font, size, nil, nil) self.logdisplay.resizeToLines = function() self.logdisplay:resize(216, self.map_h_stop - font_h * config.settings.tome.log_lines -16, (self.w - 216) / 2, font_h * config.settings.tome.log_lines) end @@ -150,8 +149,6 @@ function _M:run() self.logSeen = function(e, style, ...) if e and e.x and e.y and self.level.map.seens(e.x, e.y) then self.log(style, ...) end end self.logPlayer = function(e, style, ...) if e == self.player or e == self.party then self.log(style, ...) end end --- self.log(self.flash.GOOD, "Welcome to #00FF00#Tales of Maj'Eyal!") - -- List of stuff to do on tick end self.on_tick_end = {} @@ -832,9 +829,6 @@ end function _M:displayDelayedLogDamage() for src, tgts in pairs(self.delayed_log_damage) do for target, dams in pairs(tgts) do --- local flash = game.flash.NEUTRAL --- if target == game.player then flash = game.flash.BAD end --- if src == game.player then flash = game.flash.GOOD end if #dams.descs > 1 then game.logSeen(target, "%s hits %s for %s damage (total %0.2f).", src.name:capitalize(), target.name, table.concat(dams.descs, ", "), dams.total) else @@ -983,10 +977,6 @@ function _M:display(nb_keyframes) end -- We display the player's interface --- self.flash:toScreen(nb_keyframe) --- if self.show_userchat then profile.chat:toScreen() --- else self.logdisplay:toScreen() --- end profile.chat:toScreen() self.logdisplay:toScreen() @@ -1321,7 +1311,6 @@ function _M:setupCommands() end, LOOK_AROUND = function() --- self.flash:empty(true) self.log("Looking around... (direction keys to select interesting things, shift+direction keys to move freely)") local co = coroutine.create(function() self.player:getTarget{type="hit", no_restrict=true, range=2000} end) local ok, err = coroutine.resume(co) @@ -1380,12 +1369,12 @@ function _M:setupMouse(reset) -- Use hotkeys with mouse self.mouse:registerZone(self.hotkeys_display.display_x, self.hotkeys_display.display_y, self.w, self.h, function(button, mx, my, xrel, yrel, bx, by, event) if self.show_npc_list then return end - if event == "button" and button == "left" and self.zone and self.zone.wilderness then return end + if event == "button" and button == "left" and ((self.zone and self.zone.wilderness) or (self.key ~= self.normal_key)) then return end self.hotkeys_display:onMouse(button, mx, my, event == "button", function(text) text = text:toTString() text:add(true, "---", true, {"font","italic"}, {"color","GOLD"}, "Left click to use", true, "Right click to configure", true, "Press 'm' to setup", {"color","LAST"}, {"font","normal"}) - self.tooltip:displayAtMap(nil, nil, self.w, self.h, text) + self:tooltipDisplayAtMap(self.w, self.h, text) end, function(i, hk) if button == "right" and hk[1] == "talent" then @@ -1747,16 +1736,16 @@ end function _M:mouseIcon(bx, by) if bx < _talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "Display talents\nToggle with #{bold}##GOLD#[tab]#LAST##{normal}#") + self:tooltipDisplayAtMap(self.w, self.h, "Display talents\nToggle with #{bold}##GOLD#[tab]#LAST##{normal}#") elseif bx < 2*_talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "Display creatures\nToggle with #{bold}##GOLD#[tab]#LAST##{normal}#") + self:tooltipDisplayAtMap(self.w, self.h, "Display creatures\nToggle with #{bold}##GOLD#[tab]#LAST##{normal}#") elseif bx < 3*_talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "#{bold}##GOLD#I#LAST##{normal}#nventory") + self:tooltipDisplayAtMap(self.w, self.h, "#{bold}##GOLD#I#LAST##{normal}#nventory") elseif bx < 4*_talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "#{bold}##GOLD#C#LAST##{normal}#haracter Sheet") + self:tooltipDisplayAtMap(self.w, self.h, "#{bold}##GOLD#C#LAST##{normal}#haracter Sheet") elseif bx < 5*_talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "Main menu (#{bold}##GOLD#Esc#LAST##{normal}#)") + self:tooltipDisplayAtMap(self.w, self.h, "Main menu (#{bold}##GOLD#Esc#LAST##{normal}#)") elseif bx < 6*_talents_icon_w then - self.tooltip:displayAtMap(nil, nil, self.w, self.h, "Show message/chat log (#{bold}##GOLD#ctrl+m#LAST##{normal}#)") + self:tooltipDisplayAtMap(self.w, self.h, "Show message/chat log (#{bold}##GOLD#ctrl+m#LAST##{normal}#)") end end diff --git a/game/modules/tome/class/PlayerDisplay.lua b/game/modules/tome/class/PlayerDisplay.lua index fbda939201d144cad14ab91b6ba37ad0412bf828..1f10fd1c7968900cd77817c7987104b5691106ed 100644 --- a/game/modules/tome/class/PlayerDisplay.lua +++ b/game/modules/tome/class/PlayerDisplay.lua @@ -61,7 +61,7 @@ end function _M:mouseTooltip(text, w, h, x, y, click) self.mouse:registerZone(x, y, w, h, function(button, mx, my, xrel, yrel, bx, by, event) - game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) + game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, text) if click and event == "button" and button == "left" then click() end diff --git a/game/modules/tome/data/chats/alchemist-derth.lua b/game/modules/tome/data/chats/alchemist-derth.lua index c66ce435989a0974a03dc9d3b15486e0a63b016a..01df9b6279bdefb3af128b7f9d60df133ccde175 100644 --- a/game/modules/tome/data/chats/alchemist-derth.lua +++ b/game/modules/tome/data/chats/alchemist-derth.lua @@ -108,8 +108,8 @@ local function empty_handed(npc, player, n) -- n is the index of the elixir we'r and q:isCompleted(e[n].full) --... and yet the elixir is already made (poached!) end ---Make the alchemist's reaction to your turn-in vary depending on whether he lost. -local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) +--Make the alchemist's reaction to your turn-in vary depending on whether he lost. +local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) if lose == true then return ([[Pfaugh. You're too late. %s has already finished. But I suppose it doesn't do any harm to take these and give you your undeserved reward.]]):format(other_alch) else @@ -161,9 +161,9 @@ newChat{ id="competition", newChat{ id="choice", text = [[Excellent. Now then, I've three elixirs I'm working on. I'll burden you with only one at a time, since I've learned the hard way about the hazards of overloading an adventurer's brain. Here are your options: the elixir of the fox, which makes you as nimble and cunning as a fox; the elixir of avoidance, which sharpens your natural inclinations to get out of the way of incoming harm; or the elixir of precision, which grants intuitive understanding of an enemy's most sensitive spots. Which would you like to aid me with?]], answers = { - {"The "..e[1].name..".", jump="list", + {"The "..e[1].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[1].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -171,12 +171,12 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[2].name..".", jump="list", + {"The "..e[2].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[2].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -184,12 +184,12 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[3].name..".", jump="list", + {"The "..e[3].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[3].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -197,7 +197,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -248,7 +248,7 @@ Ah, you again.]], q:on_turnin(player, alch_picked, e_picked, false) end, }, - + -- If the final elixir: {"I've returned with the ingredients for the "..e[1].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 1) end, @@ -259,7 +259,7 @@ Ah, you again.]], {"I've returned with the ingredients for the "..e[3].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 3) end, }, - + -- If the elixir got made while you were out: {"I've returned with the ingredients for the "..e[1].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 1) end, @@ -270,10 +270,10 @@ Ah, you again.]], {"I've returned with the ingredients for the "..e[3].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 3) end, }, - + --Don't let player work on multiple elixirs for the same alchemist. --See comments in more_aid function above for all the gory detail - {"I've come to offer more aid.", jump="choice", + {"I've come to offer more aid.", jump="choice", cond = function(npc, player) return more_aid(npc, player) end, }, {"[leave]"}, @@ -286,23 +286,23 @@ newChat{ id="complete", answers = { {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, -- {"Sorry, it seems I lack some stuff. I will be back."}, @@ -316,23 +316,23 @@ Wonderful, absolutely wonderful! The final step! Here, let me have those!]], answers = { {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, --{"Sorry, it seems I lack some stuff. I will be back."}, @@ -344,7 +344,7 @@ newChat{ id="complete2", text = [[Wait here while I perform my art. I'll have your reward within the hour.]], answers = { {"[Wait]", jump="complete3"}, - + } } @@ -353,7 +353,7 @@ newChat{ id="totally-complete2", text = [[A final wait for you, my good adventurer, and then I shall return with both your rewards! Haha, complete at last!]], answers = { {"[Wait]", jump="totally-complete3"}, - + } } @@ -362,7 +362,7 @@ newChat{ id="complete3", text = [[#LIGHT_GREEN#*The alchemist finally returns and hands you a small vial of fine glass.*#WHITE# Enjoy your reward.]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -394,7 +394,7 @@ newChat{ id="totally-complete3", text = [[#LIGHT_GREEN#*The alchemist finally returns with a vial and a green gem.*#WHITE# Enjoy the fruits of your labors, adventurer. I know I will. To show my appreciation, I shall name my firstborn after... er, what was your name, then? Haha, I jest. Oh, I do go on when I'm giddy. Fare you well.]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -425,7 +425,7 @@ Enjoy the fruits of your labors, adventurer. I know I will. To show my appreciat q:reward(player, final_reward) q:update_needed_ingredients(player) q:winner_is(player, alchemist_num) - player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) + player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) end }, } @@ -444,7 +444,7 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[2].name..".", jump="list", @@ -457,7 +457,7 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[3].name..".", jump="list", @@ -470,7 +470,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -491,7 +491,7 @@ newChat{ id="poached", {"Hrmph.", cond = function(npc, player) return empty_handed(npc, player, 1) end, action = function(npc, player) - q:remove_ingredients(player, e[1].short_name, 1) + q:remove_ingredients(player, e[1].short_name, 1) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:update_needed_ingredients(player) end, diff --git a/game/modules/tome/data/chats/alchemist-elvala.lua b/game/modules/tome/data/chats/alchemist-elvala.lua index fefbb6e1cdfed0acddb62dd7a7596f6dc18dc0f6..8cbeed0cab202cc2169164e1a32fcecd0175c90e 100644 --- a/game/modules/tome/data/chats/alchemist-elvala.lua +++ b/game/modules/tome/data/chats/alchemist-elvala.lua @@ -108,8 +108,8 @@ local function empty_handed(npc, player, n) -- n is the index of the elixir we'r and q:isCompleted(e[n].full) --... and yet the elixir is already made (poached!) end ---Make the alchemist's reaction to your turn-in vary depending on whether he lost. -local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) +--Make the alchemist's reaction to your turn-in vary depending on whether he lost. +local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) if lose == true then return ([[Too late! Argh, too late. %s has already finished. I'll make the elixir and reward you as promised, but only because the Brotherhood breaks the fingers of non-member alchemists who rook people. Members, on the other hand...]]):format(other_alch) else @@ -162,9 +162,9 @@ newChat{ id="competition", newChat{ id="choice", text = [[Three elixirs I need. I'll show you the ingredients to one at a time. Are you interested in the Elixir of Mysticism, the Elixir of the Savior, or the Elixir of Mastery?]], answers = { - {"The "..e[1].name..".", jump="list", + {"The "..e[1].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[1].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -172,12 +172,12 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[2].name..".", jump="list", + {"The "..e[2].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[2].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -185,12 +185,12 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[3].name..".", jump="list", + {"The "..e[3].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[3].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -198,7 +198,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -249,7 +249,7 @@ Do I know you?]], q:on_turnin(player, alch_picked, e_picked, false) end, }, - + -- If the final elixir: {"I've returned with the ingredients for the "..e[1].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 1) end, @@ -260,7 +260,7 @@ Do I know you?]], {"I've returned with the ingredients for the "..e[3].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 3) end, }, - + -- If the elixir got made while you were out: {"I've returned with the ingredients for the "..e[1].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 1) end, @@ -271,10 +271,10 @@ Do I know you?]], {"I've returned with the ingredients for the "..e[3].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 3) end, }, - + --Don't let player work on multiple elixirs for the same alchemist. --See comments in more_aid function above for all the gory detail - {"I've come to offer more aid.", jump="choice", + {"I've come to offer more aid.", jump="choice", cond = function(npc, player) return more_aid(npc, player) end, }, {"[leave]"}, @@ -287,23 +287,23 @@ newChat{ id="complete", answers = { {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, -- {"Sorry, it seems I lack some stuff. I will be back."}, @@ -317,23 +317,23 @@ Exceptional work, lackey! The final elixir awaits! Oh, yes. Membership will be m answers = { {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, --{"Sorry, it seems I lack some stuff. I will be back."}, @@ -345,7 +345,7 @@ newChat{ id="complete2", text = [[Contain your impatience while I prepare these. I'll have the elixir within the hour.]], answers = { {"[Wait]", jump="complete3"}, - + } } @@ -354,7 +354,7 @@ newChat{ id="totally-complete2", text = [[Perfection. Wait here.]], answers = { {"[Wait]", jump="totally-complete3"}, - + } } @@ -363,7 +363,7 @@ newChat{ id="complete3", text = [[#LIGHT_GREEN#*The elf finally returns and tosses you a small vial of fine glass.*#WHITE# Side effects may include some slight mental imbalances.]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -395,7 +395,7 @@ newChat{ id="totally-complete3", text = [[#LIGHT_GREEN#*The alchemist finally returns with two vials.*#WHITE# I have no idea who you are, but I'm pretty sure that I'm supposed to give these to somebody as a reward. If some adventurer kills you and takes them, then apparently you're not the fellow I'm looking for.]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -426,7 +426,7 @@ I have no idea who you are, but I'm pretty sure that I'm supposed to give these q:reward(player, final_reward) q:update_needed_ingredients(player) q:winner_is(player, alchemist_num) - player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) + player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) end }, } @@ -445,7 +445,7 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[2].name..".", jump="list", @@ -458,7 +458,7 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[3].name..".", jump="list", @@ -471,7 +471,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -492,7 +492,7 @@ newChat{ id="poached", {"Hrmph.", cond = function(npc, player) return empty_handed(npc, player, 1) end, action = function(npc, player) - q:remove_ingredients(player, e[1].short_name, 1) + q:remove_ingredients(player, e[1].short_name, 1) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:update_needed_ingredients(player) end, diff --git a/game/modules/tome/data/chats/alchemist-hermit.lua b/game/modules/tome/data/chats/alchemist-hermit.lua index 6d1e6ba6db9724ce4245c1868936d451e2f11126..8e058150b3b536ef89084d90fcd4d448705585dc 100644 --- a/game/modules/tome/data/chats/alchemist-hermit.lua +++ b/game/modules/tome/data/chats/alchemist-hermit.lua @@ -111,8 +111,8 @@ local function empty_handed(npc, player, n) -- n is the index of the elixir we'r and q:isCompleted(e[n].full) --... and yet the elixir is already made (poached!) end ---Make the alchemist's reaction to your turn-in vary depending on whether he lost. -local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) +--Make the alchemist's reaction to your turn-in vary depending on whether he lost. +local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) if lose == true then return ([[SON OF A RITCH! YOU SHOW UP TEN MINUTES AFTER I GET THE NEWS THAT SOME JACKASS ALREADY FINISHED THE ELIXIRS AND IS GETTING ACCEPTED BY THE BROTHERHOOD. WHAT THE HELL TOOK YOU SO LONG? MIRVENIA'S MAMMARIES, I'LL TAKE THESE AND MAKE YOU YOUR REWARD, BUT ONLY BECAUSE A CURSE WILL KILL ME IF I DON'T. AND IF IT TASTES LIKE PISS, THAT'S YOUR IMAGINATION, I'M SURE.]]) else @@ -166,9 +166,9 @@ newChat{ id="choice", text = [[#LIGHT_GREEN#*He hands you a slip of paper with the names and properties of some elixirs on it.*#WHITE# THE INGREDIENTS TO THESE SUCKERS ARE SORT OF A TRADE SECRET, SO I'LL TELL YOU ABOUT ONE AND WE'LL SEE HOW THAT GOES. OH, AND I'LL MAKE ENOUGH FOR YOU TO HAVE A SWIG WHEN I'M DONE, SO GOOD FOR YOU. WHICH ONE WILL IT BE? JUST POINT AT THE DAMNED LIST. I HAVEN'T HEARD A THING YOU'VE SAID YET. I HOPE TO HELL YOU'RE NOT STANDING THERE TRYING TO SELL ME SOMETHING.]], answers = { - {"[Indicate the "..e[1].name..".]", jump="list", + {"[Indicate the "..e[1].name..".]", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[1].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -176,12 +176,12 @@ THE INGREDIENTS TO THESE SUCKERS ARE SORT OF A TRADE SECRET, SO I'LL TELL YOU AB local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"[Indicate the "..e[2].name..".]", jump="list", + {"[Indicate the "..e[2].name..".]", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[2].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -189,12 +189,12 @@ THE INGREDIENTS TO THESE SUCKERS ARE SORT OF A TRADE SECRET, SO I'LL TELL YOU AB local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"[Indicate the "..e[3].name..".]", jump="list", + {"[Indicate the "..e[3].name..".]", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[3].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -202,7 +202,7 @@ THE INGREDIENTS TO THESE SUCKERS ARE SORT OF A TRADE SECRET, SO I'LL TELL YOU AB local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -253,7 +253,7 @@ I LIVE WAY THE HELL OUT HERE FOR A REASON, YOU PIECE OF... OH. IT'S YOU.]], q:on_turnin(player, alch_picked, e_picked, false) end, }, - + -- If the final elixir: {"I'VE RETURNED WITH THE INGREDIENTS FOR THE "..e[1].cap_name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 1) end, @@ -264,7 +264,7 @@ I LIVE WAY THE HELL OUT HERE FOR A REASON, YOU PIECE OF... OH. IT'S YOU.]], {"I'VE RETURNED WITH THE INGREDIENTS FOR THE "..e[3].cap_name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 3) end, }, - + -- If the elixir got made while you were out: {"I'VE RETURNED WITH THE INGREDIENTS FOR THE "..e[1].cap_name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 1) end, @@ -275,10 +275,10 @@ I LIVE WAY THE HELL OUT HERE FOR A REASON, YOU PIECE OF... OH. IT'S YOU.]], {"I'VE RETURNED WITH THE INGREDIENTS FOR THE "..e[3].cap_name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 3) end, }, - + --Don't let player work on multiple elixirs for the same alchemist. --See comments in more_aid function above for all the gory detail - {"I'VE COME TO OFFER MORE AID.", jump="choice", + {"I'VE COME TO OFFER MORE AID.", jump="choice", cond = function(npc, player) return more_aid(npc, player) end, }, {"[leave]"}, @@ -291,23 +291,23 @@ newChat{ id="complete", answers = { {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, -- {"Sorry, it seems I lack some stuff. I will be back."}, @@ -321,23 +321,23 @@ GOOD WORK, WHOEVER YOU ARE. ALL OF MAJ'EYAL OWES YOU THEIR THANKS, EXCEPT FOR ME answers = { {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, --{"Sorry, it seems I lack some stuff. I will be back."}, @@ -349,7 +349,7 @@ newChat{ id="complete2", text = [[WAIT HERE. THERE'S A GOOD CHANCE YOU'LL GET BLOWN INTO ADVENTURER KIBBLE IF YOU STEP INSIDE THIS BUILDING. MY ROBE OF MAD ALCHEMIST PROTECTION IS THE ONLY REASON I'M NOT VAPOUR.]], answers = { {"[Wait]", jump="complete3"}, - + } } @@ -358,7 +358,7 @@ newChat{ id="totally-complete2", text = [[GIVE ME AN HOUR, AND THINK UNPLEASANT THOUGHTS ABOUT THE BROTHERHOOD. IF ANYTHING EXPLODES, COME RESCUE ME, EVEN IF IT LOOKS LIKE THE BUILDING IS AN INFERNO OF POISONOUS SMOKE AND POLKA-DOT FLAMES.]], answers = { {"[Wait]", jump="totally-complete3"}, - + } } @@ -367,7 +367,7 @@ newChat{ id="complete3", text = [[#LIGHT_GREEN#*Disaster fails to occur. The halfling finally returns and hands you a small vial of sooty glass.*#WHITE# ENJOY, AND COME BACK ANY TIME IF YOU'RE INTERESTED IN SIMILAR WORK. I HAVEN'T WON YET. THE LONGER YOU WAIT, THE MORE LIKELY IT IS THAT YOU'LL RETURN TO A SMOKING CRATER AND ONE TRULY IRATE HALFLING.]], answers = { - {"THANK YOU. I'LL BE OFF.", + {"THANK YOU. I'LL BE OFF.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -399,7 +399,7 @@ newChat{ id="totally-complete3", text = [[#LIGHT_GREEN#*The halfling finally returns with a vial and a small pouch.*#WHITE# YOUR DOSE OF THE ELIXIR, AS WELL AS SOMETHING ELSE. THIS INFUSION IS RARE AS HELL, SO DON'T GO WASTING IT.]], answers = { - {"THANK YOU. I'LL BE OFF.", + {"THANK YOU. I'LL BE OFF.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -430,7 +430,7 @@ YOUR DOSE OF THE ELIXIR, AS WELL AS SOMETHING ELSE. THIS INFUSION IS RARE AS HEL q:reward(player, final_reward) q:update_needed_ingredients(player) q:winner_is(player, alchemist_num) - player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) + player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) end }, } @@ -449,7 +449,7 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[Indicate the "..e[2].name..".]", jump="list", @@ -462,7 +462,7 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[Indicate the "..e[3].name..".]", jump="list", @@ -475,7 +475,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -496,7 +496,7 @@ newChat{ id="poached", {"Hrmph.", cond = function(npc, player) return empty_handed(npc, player, 1) end, action = function(npc, player) - q:remove_ingredients(player, e[1].short_name, 1) + q:remove_ingredients(player, e[1].short_name, 1) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:update_needed_ingredients(player) end, diff --git a/game/modules/tome/data/chats/alchemist-last-hope.lua b/game/modules/tome/data/chats/alchemist-last-hope.lua index 33706454cd312f2f876914a1643a31f60b5ed4de..4302f975f8763d4cfedc8ae3cb7de3c7c950a9b2 100644 --- a/game/modules/tome/data/chats/alchemist-last-hope.lua +++ b/game/modules/tome/data/chats/alchemist-last-hope.lua @@ -108,8 +108,8 @@ local function empty_handed(npc, player, n) -- n is the index of the elixir we'r and q:isCompleted(e[n].full) --... and yet the elixir is already made (poached!) end ---Make the alchemist's reaction to your turn-in vary depending on whether he lost. -local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) +--Make the alchemist's reaction to your turn-in vary depending on whether he lost. +local function alchemist_reaction_complete(npc, player, lose, other_alch, other_elixir) if lose == true then return ([[Damn it all. You're too late. %s has already finished. But I suppose you did your best, so I'll take these and keep my end of the bargian.]]):format(other_alch) else @@ -161,9 +161,9 @@ newChat{ id="competition", newChat{ id="choice", text = [[One last thing. There's a few other fellows angling for the same slot in the Brotherhood that I am. They're not going to be sitting on their hands while we're at work here, so best move quick-like. Now, which of these do you want to help me with first: the Brew of Brawn, the Brew of Stoneskin, or the Brew of Foundations? Or Elixirs, rather. Not Brews. Best get in the habit now, I suppose.]], answers = { - {"The "..e[1].name..".", jump="list", + {"The "..e[1].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[1].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -171,12 +171,12 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[2].name..".", jump="list", + {"The "..e[2].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[2].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -184,12 +184,12 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, - {"The "..e[3].name..".", jump="list", + {"The "..e[3].name..".", jump="list", cond = function(npc, player) return not game.player:hasQuest("brotherhood-of-alchemists"):isCompleted(e[3].full) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].start) game.player:hasQuest("brotherhood-of-alchemists"):update_needed_ingredients(player) end, @@ -197,7 +197,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -248,7 +248,7 @@ Aha, my favorite adventurer.]], q:on_turnin(player, alch_picked, e_picked, false) end, }, - + -- If the final elixir: {"I've returned with the ingredients for the "..e[1].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 1) end, @@ -259,7 +259,7 @@ Aha, my favorite adventurer.]], {"I've returned with the ingredients for the "..e[3].name..".", jump="totally-complete", cond = function(npc, player) return turn_in_final(npc, player, 3) end, }, - + -- If the elixir got made while you were out: {"I've returned with the ingredients for the "..e[1].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 1) end, @@ -270,10 +270,10 @@ Aha, my favorite adventurer.]], {"I've returned with the ingredients for the "..e[3].name..".", jump="poached", cond = function(npc, player) return turn_in_poached(npc, player, 3) end, }, - + --Don't let player work on multiple elixirs for the same alchemist. --See comments in more_aid function above for all the gory detail - {"I've come to offer more aid.", jump="choice", + {"I've come to offer more aid.", jump="choice", cond = function(npc, player) return more_aid(npc, player) end, }, {"[leave]"}, @@ -286,23 +286,23 @@ newChat{ id="complete", answers = { {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits.]", jump="complete2", + {"[Give him the monster bits.]", jump="complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, -- {"Sorry, it seems I lack some stuff. I will be back."}, @@ -316,23 +316,23 @@ Ha ha! This is the last one! Stire and Marus and that damned hermit can suck on answers = { {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 1) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:remove_ingredients(player, e[1].short_name, 1) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 2) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[2].almost) - q:remove_ingredients(player, e[2].short_name, 2) + q:remove_ingredients(player, e[2].short_name, 2) end }, - {"[Give him the monster bits]", jump="totally-complete2", + {"[Give him the monster bits]", jump="totally-complete2", cond = function(npc, player) return give_bits(npc, player, 3) end, - action = function(npc, player) + action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[3].almost) - q:remove_ingredients(player, e[3].short_name, 3) + q:remove_ingredients(player, e[3].short_name, 3) end }, --{"Sorry, it seems I lack some stuff. I will be back."}, @@ -344,7 +344,7 @@ newChat{ id="complete2", text = [[Give me an hour or so to make with the alchemy. Don't go anywhere.]], answers = { {"[Wait]", jump="complete3"}, - + } } @@ -353,7 +353,7 @@ newChat{ id="totally-complete2", text = [[I'd invite you inside while you wait, but the she-dwarf's in there, and I've grown fond of you.]], answers = { {"[Wait]", jump="totally-complete3"}, - + } } @@ -362,7 +362,7 @@ newChat{ id="complete3", text = [[#LIGHT_GREEN#*The dwarf finally returns with a vial.*#WHITE# Tastes like Urh'Rok's own piss, but it gets the job done.]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -394,7 +394,7 @@ newChat{ id="totally-complete3", text = [[#LIGHT_GREEN#*The dwarf finally returns with a vial and a small pouch.*#WHITE# I put a bit of the good stuff in this one, though it won't do you any favors tomorrow morning. And careful with that Taint of Telepathy, especially if the wife answers the door the next time you knock. Har!]], answers = { - {"Thank you. I'll be off.", + {"Thank you. I'll be off.", cond = function(npc, player) return q and q:isCompleted(e[1].almost) and not q:isCompleted(e[1].full) end, action = function(npc, player) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].full) @@ -425,7 +425,7 @@ I put a bit of the good stuff in this one, though it won't do you any favors tom q:reward(player, final_reward) q:update_needed_ingredients(player) q:winner_is(player, alchemist_num) - player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) + player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.DONE) end }, } @@ -444,7 +444,7 @@ newChat{ id="choice", local o = art_list[e[1].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[2].name..".", jump="list", @@ -457,7 +457,7 @@ newChat{ id="choice", local o = art_list[e[2].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"The "..e[3].name..".", jump="list", @@ -470,7 +470,7 @@ newChat{ id="choice", local o = art_list[e[3].id] o:identify(true) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, tostring(o:getDesc())) + game:tooltipDisplayAtMap(game.w, game.h, tostring(o:getDesc())) end, }, {"[leave]"}, @@ -491,7 +491,7 @@ newChat{ id="poached", {"Hrmph.", cond = function(npc, player) return empty_handed(npc, player, 1) end, action = function(npc, player) - q:remove_ingredients(player, e[1].short_name, 1) + q:remove_ingredients(player, e[1].short_name, 1) player:setQuestStatus("brotherhood-of-alchemists", engine.Quest.COMPLETED, e[1].almost) q:update_needed_ingredients(player) end, diff --git a/game/modules/tome/data/chats/escort-quest.lua b/game/modules/tome/data/chats/escort-quest.lua index 8283c62967ea071e3e929a067f5c31ce18d94d17..fc0d88fd0d6c01f33d4b2ae8493db259fe118155 100644 --- a/game/modules/tome/data/chats/escort-quest.lua +++ b/game/modules/tome/data/chats/escort-quest.lua @@ -203,7 +203,7 @@ local function generate_rewards() on_select=function(npc, player) game.tooltip_x, game.tooltip_y = 1, 1 local TooltipsData = require("mod.class.interface.TooltipsData") - game.tooltip:displayAtMap(nil, nil, game.w, game.h, TooltipsData["TOOLTIP_"..npc.stats_def[i].short_name:upper()]) + game:tooltipDisplayAtMap(game.w, game.h, TooltipsData["TOOLTIP_"..npc.stats_def[i].short_name:upper()]) end, } end end @@ -221,7 +221,7 @@ local function generate_rewards() on_select=function(npc, player) game.tooltip_x, game.tooltip_y = 1, 1 local TooltipsData = require("mod.class.interface.TooltipsData") - game.tooltip:displayAtMap(nil, nil, game.w, game.h, TooltipsData["TOOLTIP_"..saves_tooltips[save]:upper().."_SAVE"]) + game:tooltipDisplayAtMap(game.w, game.h, TooltipsData["TOOLTIP_"..saves_tooltips[save]:upper().."_SAVE"]) end, } end @@ -243,7 +243,7 @@ local function generate_rewards() action=doit, on_select=function(npc, player) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1))) + game:tooltipDisplayAtMap(game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1))) end, } end @@ -263,7 +263,7 @@ local function generate_rewards() action=doit, on_select=function(npc, player) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, "#GOLD#"..(cat:capitalize().." / "..tt_def.name:capitalize()).."#LAST#\n"..tt_def.description) + game:tooltipDisplayAtMap(game.w, game.h, "#GOLD#"..(cat:capitalize().." / "..tt_def.name:capitalize()).."#LAST#\n"..tt_def.description) end, } end end diff --git a/game/modules/tome/data/chats/player-inscription.lua b/game/modules/tome/data/chats/player-inscription.lua index b5c6b2231500ebd7282d80a06c12a0d911be0a5b..f271e5b5b8ec89e4c19f3eb6590baf0902126565 100644 --- a/game/modules/tome/data/chats/player-inscription.lua +++ b/game/modules/tome/data/chats/player-inscription.lua @@ -34,7 +34,7 @@ for i = 1, player.max_inscriptions do player:removeObject(inven, item) end, on_select=function(npc, player) game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1))) + game:tooltipDisplayAtMap(game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1))) end, } end end diff --git a/game/modules/tome/dialogs/CharacterSheet.lua b/game/modules/tome/dialogs/CharacterSheet.lua index c591467494dc9dbab77f976ed0d25853c0aa4af0..254c724a43d02301ec67bb8c02c9590a75371128 100644 --- a/game/modules/tome/dialogs/CharacterSheet.lua +++ b/game/modules/tome/dialogs/CharacterSheet.lua @@ -147,14 +147,14 @@ end function _M:mouseTooltip(text, _, _, _, w, h, x, y) self:mouseZones({ - { x=x, y=y+self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) end}, + { x=x, y=y+self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, text) end}, }, true) end function _M:mouseLink(link, text, _, _, _, w, h, x, y) self:mouseZones({ { x=x, y=y, w=w, h=h, fct=function(button) - game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) + game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, text) if button == "left" then util.browserOpenUrl(link) end diff --git a/game/modules/tome/dialogs/LevelupDialog.lua b/game/modules/tome/dialogs/LevelupDialog.lua index 96665d4202901f760b0324e225c4e99cd306b199..0d1cc91fb341799883c3e59049141738324bd63f 100644 --- a/game/modules/tome/dialogs/LevelupDialog.lua +++ b/game/modules/tome/dialogs/LevelupDialog.lua @@ -953,7 +953,7 @@ end function _M:mouseTooltip(text, _, _, _, w, h, x, y) self:mouseZones({ - { x=x, y=y + self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) end}, + { x=x, y=y + self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, text) end}, }, true) end diff --git a/game/modules/tome/dialogs/ShowChatLog.lua b/game/modules/tome/dialogs/ShowChatLog.lua index 322cadf16b09d7f93374211b59aca86e7de58e8c..9b27cd108e4cee775da27e2ea2debe3052d02ef1 100644 --- a/game/modules/tome/dialogs/ShowChatLog.lua +++ b/game/modules/tome/dialogs/ShowChatLog.lua @@ -98,8 +98,7 @@ function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event) if item.dh and by >= item.dh then citem = self.dlist[i].src break end end if citem and citem.extra_data and citem.extra_data.mode == "tooltip" then - game.tooltip_x, game.tooltip_y = 1, 1 - game.tooltip:displayAtMap(nil, nil, game.w, game.h, citem.extra_data.tooltip) + game:tooltipDisplayAtMap(game.w, game.h, citem.extra_data.tooltip) else game.tooltip_x, game.tooltip_y = nil, nil end diff --git a/game/modules/tome/dialogs/ShowEquipInven.lua b/game/modules/tome/dialogs/ShowEquipInven.lua index d7aa2fa25af175f7f81eb4b22b5ac10557d31c73..78ab6f924dd8a6f017e71e13cb103d7e7b51fec0 100644 --- a/game/modules/tome/dialogs/ShowEquipInven.lua +++ b/game/modules/tome/dialogs/ShowEquipInven.lua @@ -28,8 +28,7 @@ function _M:init(...) -- Add tooltips self.on_select = function(item) if item.last_display_x and item.object then - game.tooltip_x, game.tooltip_y = {}, 1 - game.tooltip:displayAtMap(nil, nil, item.last_display_x, item.last_display_y, item.object:getDesc({do_color=true}, self.actor:getInven(item.object:wornInven()))) + game:tooltipDisplayAtMap(item.last_display_x, item.last_display_y, item.object:getDesc({do_color=true}, self.actor:getInven(item.object:wornInven()))) end end self.on_drag = function(item) self:onDrag(item) end diff --git a/game/modules/tome/dialogs/ShowStore.lua b/game/modules/tome/dialogs/ShowStore.lua index 27595367cb989206667f857813b83c3148f7949c..64ff5962f4da00e8061f409a9aaac33e155353d7 100644 --- a/game/modules/tome/dialogs/ShowStore.lua +++ b/game/modules/tome/dialogs/ShowStore.lua @@ -28,8 +28,7 @@ function _M:init(...) -- Add tooltips self.on_select = function(item) if item.last_display_x and item.object then - game.tooltip_x, game.tooltip_y = {}, 1 - game.tooltip:displayAtMap(nil, nil, item.last_display_x, item.last_display_y, item.object:getDesc({do_color=true}, game.player:getInven(item.object:wornInven()))) + game:tooltipDisplayAtMap(item.last_display_x, item.last_display_y, item.object:getDesc({do_color=true}, game.player:getInven(item.object:wornInven()))) end end self.key.any_key = function(sym)