diff --git a/game/engines/default/engine/ui/Button.lua b/game/engines/default/engine/ui/Button.lua index 5d51e52c61335192cd43ef8b176a086b0770edca..c790d4828fcacf675593c1e1cb3272f3b0104840 100644 --- a/game/engines/default/engine/ui/Button.lua +++ b/game/engines/default/engine/ui/Button.lua @@ -74,12 +74,21 @@ function _M:display(x, y, nb_keyframes, ox, oy) if self.focused then if button == 1 and mx > ox and mx < ox+self.w and my > oy and my < oy+self.h then self:drawFrame(self.frame, x, y, 0, 1, 0, 1) + elseif self.glow then + local v = self.glow + (1 - self.glow) * (1 + math.cos(core.game.getTime() / 300)) / 2 + self:drawFrame(self.frame, x, y, v*0.8, v, 0, 1) else self:drawFrame(self.frame_sel, x, y) end else - self:drawFrame(self.frame, x, y) - if self.focus_decay then + if self.glow then + local v = self.glow + (1 - self.glow) * (1 + math.cos(core.game.getTime() / 300)) / 2 + self:drawFrame(self.frame, x, y, v*0.8, v, 0, 1) + else + self:drawFrame(self.frame, x, y) + end + + if self.focus_decay and not self.glow then self:drawFrame(self.frame_sel, x, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d) self.focus_decay = self.focus_decay - nb_keyframes if self.focus_decay <= 0 then self.focus_decay = nil end diff --git a/game/modules/tome/class/interface/TooltipsData.lua b/game/modules/tome/class/interface/TooltipsData.lua index 657b5f1adf17cac9695cff5329d6cebbabcb006c..0216752c1c3e17d77191aa11c2430f43faae1435 100644 --- a/game/modules/tome/class/interface/TooltipsData.lua +++ b/game/modules/tome/class/interface/TooltipsData.lua @@ -273,7 +273,7 @@ The lower it is the faster it is. ]] TOOLTIP_MINDPOWER = [[#GOLD#Mindpower#LAST# Your mindpower value represents how powerful your mental abilities are. -In addition, when you use mental abilities inflict temporary detrimental effects, every five points of mindpower counteracts a single turn of duration reduction granted by the enemy's saving throws. +In addition, when your mental abilities inflict temporary detrimental effects, every five points of mindpower counteracts a single turn of duration reduction granted by the enemy's saving throws.In addition, when your mental abilities inflict temporary detrimental effects, every five points of mindpower counteracts a single turn of duration reduction granted by the enemy's saving throws. ]] ------------------------------------------------------------- diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 7d7c18c48f5b242e61d314eb0f07a15917e1db38..06f146bb953f8afd95289b291ce70763a16e43c2 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -35,9 +35,12 @@ newBirthDescriptor{ }, descriptor_choices = { - world = + difficulty = { Tutorial = "disallow", + }, + world = + { ["Maj'Eyal"] = "allow", Infinite = "allow", Arena = "allow", @@ -90,7 +93,7 @@ newBirthDescriptor{ newBirthDescriptor{ type = "difficulty", name = "Tutorial", - selection_default = not profile.mod.allow_build.tutorial_done, + never_show = true, desc = { "#GOLD##{bold}#Tutorial mode", @@ -154,7 +157,7 @@ newBirthDescriptor{ newBirthDescriptor{ type = "difficulty", name = "Normal", - selection_default = profile.mod.allow_build.tutorial_done, + selection_default = true, desc = { "#GOLD##{bold}#Adventure mode#WHITE##{normal}#", diff --git a/game/modules/tome/data/birth/races/tutorial.lua b/game/modules/tome/data/birth/races/tutorial.lua index 7b26b53faf6de8f2b725806c0c79a68bcf3d98f6..08e12e2343a4ac6cc7f5284c4f09d9260eb4035c 100644 --- a/game/modules/tome/data/birth/races/tutorial.lua +++ b/game/modules/tome/data/birth/races/tutorial.lua @@ -45,7 +45,24 @@ newBirthDescriptor{ newBirthDescriptor { type = "subrace", - name = "Tutorial Human", + name = "Tutorial Basic", + desc = { + "A Human hailing from the northern town of Derth. A common kind of man, unremarkable in all respects.", + }, + copy = { + default_wilderness = {1, 1, "wilderness"}, + starting_zone = "tutorial", + starting_quest = "tutorial", + starting_intro = "tutorial", + moddable_tile = "human_#sex#", + moddable_tile_base = "base_cornac_01.png", + }, +} + +newBirthDescriptor +{ + type = "subrace", + name = "Tutorial Stats", desc = { "A Human hailing from the northern town of Derth. A common kind of man, unremarkable in all respects.", }, diff --git a/game/modules/tome/data/texts/tutorial/stats/stats9.lua b/game/modules/tome/data/texts/tutorial/stats/stats9.lua index aec4188880eee6aaceb68a7a96e4c0713c223791..f9d658e9c62a6d96103a880a88edd7d805e8cddd 100644 --- a/game/modules/tome/data/texts/tutorial/stats/stats9.lua +++ b/game/modules/tome/data/texts/tutorial/stats/stats9.lua @@ -18,7 +18,7 @@ -- darkgod@te4.org return [[ -Now you know the basics: what these seven #GOLD#combat stats#WHITE# mean and when they're used. It's time to look at some numbers. +Now you know the basics: what these eight #GOLD#combat stats#WHITE# mean and when they're used. It's time to look at some numbers. Head north to the stairs, and descend into the #GOLD#Dungeon of Adventurer Enlightenment.#WHITE# ]] diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua index 6a3bb317c8154b758121d5a1747b43fdd1e13d8c..572bad082dee1eba202b74e9b11d2f2e70610bac 100644 --- a/game/modules/tome/dialogs/Birther.lua +++ b/game/modules/tome/dialogs/Birther.lua @@ -63,6 +63,7 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h) self.c_premade = Button.new{text="Load premade", fct=function() self:loadPremadeUI() end} self.c_tile = Button.new{text="Select custom tile", fct=function() self:selectTile() end} self.c_cancel = Button.new{text="Cancel", fct=function() self:atEnd("quit") end} + self.c_tut = Button.new{text="Tutorial", fct=function() self:tutorial() end} self.c_name = Textbox.new{title="Name: ", text=(not config.settings.cheat and game.player_name == "player") and "" or game.player_name, chars=30, max_len=50, fct=function() if config.settings.cheat then self:makeDefault() end @@ -135,6 +136,7 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h) {left=self.c_difficulty_text, top=self.c_campaign, ui=self.c_difficulty}, {left=self.c_difficulty, top=self.c_campaign, ui=self.c_permadeath_text}, {left=self.c_permadeath_text, top=self.c_campaign, ui=self.c_permadeath}, + {right=0, top=self.c_name, ui=self.c_tut}, -- Lists {left=0, top=self.c_permadeath, ui=self.c_race}, @@ -162,6 +164,11 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h) for i, item in ipairs(self.c_permadeath.c_list.list) do if self.default_permadeath == item.id then self.c_permadeath.c_list.sel = i break end end self:setFocus(self.c_campaign) self:setFocus(self.c_name) + + if not profile.mod.allow_build.tutorial_done then + self:setFocus(self.c_tut) + self.c_tut.glow = 0.70 + end end function _M:checkNew(fct) @@ -279,6 +286,37 @@ function _M:makeDefault() self:atEnd("created") end +--- Run one of the tutorials +function _M:tutorial() + local run = function(t) + self:setDescriptor("sex", "Female") + self:setDescriptor("world", "Maj'Eyal") + self:setDescriptor("difficulty", "Tutorial") + self:setDescriptor("permadeath", "Adventure") + self:setDescriptor("race", "Tutorial Human") + self:setDescriptor("subrace", "Tutorial "..t) + self:setDescriptor("class", "Tutorial Adventurer") + self:setDescriptor("subclass", "Tutorial Adventurer") + self:atEnd("created") + end + + local d = Dialog.new("Tutorials", 170, 100) + local basic = Button.new{text="Basic Gameplay", fct=function() run("Basic") d.key:triggerVirtual("EXIT") end} + local stats = Button.new{text="Advanced Stats", fct=function() run("Stats") d.key:triggerVirtual("EXIT") end} + local cancel = Button.new{text="Cancel", fct=function() d.key:triggerVirtual("EXIT") end} + local sep = Separator.new{dir="vertical", size=150} + + d:loadUI{ + {hcenter=0, top=0, ui=basic}, + {hcenter=0, top=basic.h, ui=stats}, + {hcenter=0, bottom=cancel.h, ui=sep}, + {hcenter=0, bottom=0, ui=cancel}, + } + d:setupUI(false, true) + d.key:addBind("EXIT", function() game:unregisterDialog(d) end) + game:registerDialog(d) +end + function _M:randomBirth() -- Random sex local sex = rng.percent(50) @@ -527,7 +565,7 @@ function _M:isDescriptorAllowed(d, ignore_type) end -- Check it is allowed - return allowed + return allowed and not d.never_show end function _M:getLock(d)