diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 7e8a724e46751c6200032fb0b29f6f59ef339dc1..4605ac262c526637311bb703cd6952f52e8da6c5 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -353,15 +353,28 @@ function _M:postUseTalent(ab, ret) end -- Cancel stealth! - if ab.id ~= self.T_STEALTH and self:isTalentActive(self.T_STEALTH) then + if ab.id ~= self.T_STEALTH then self:breakStealth() end + + return true +end + +--- Breaks stealth if active +function _M:breakStealth() + if self:isTalentActive(self.T_STEALTH) then + local chance = 0 + if self:knowTalent(self.T_UNSEEN_ACTIONS) then + chance = 10 + self:getTalentLevel(self.T_UNSEEN_ACTIONS) * 9 + end + + -- Do not break stealth + if rng.percent(chance) then return end + local old = self.energy.value self.energy.value = 100000 self:useTalent(self.T_STEALTH) self.energy.value = old self.changed = true end - - return true end --- Return the full description of a talent diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 7cb76f7b857615f38b9fe7f05121cedb153b508c..d3922ab3961ca150a5dfe66262ec91f344eca220 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -260,6 +260,7 @@ function _M:playerUseItem(object, item) self:useEnergy() end end + self:breakStealth() end if object and item then return use_fct(object, item) end diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 781cf3d144fa37b2870e98fed72647c157f271c5..b740d215b3bbbf8d329c73ed693f91c4988332e3 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -89,13 +89,7 @@ function _M:attackTarget(target, damtype, mult, noenergy) end -- Cancel stealth! - if self:isTalentActive(self.T_STEALTH) then - local old = self.energy.value - self.energy.value = 100000 - self:useTalent(self.T_STEALTH) - self.energy.value = old - self.changed = true - end + self:breakStealth() return hit end diff --git a/game/modules/tome/data/talents/cunning/stealth.lua b/game/modules/tome/data/talents/cunning/stealth.lua index 21c84df0e613e255422a8552f986ae15fdc430de..8c8a81c0646d0cf2dbb0544269a268769c77395f 100644 --- a/game/modules/tome/data/talents/cunning/stealth.lua +++ b/game/modules/tome/data/talents/cunning/stealth.lua @@ -42,7 +42,7 @@ newTalent{ newTalent{ name = "Shadowstrike", - type = {"cunning/stealth", 1}, + type = {"cunning/stealth", 2}, mode = "passive", points = 5, require = { stat = { cun=18 }, }, @@ -51,3 +51,15 @@ newTalent{ Shadowstrikes do %.02f%% damage than a normal hit.]]):format((2 + self:getTalentLevel(t) / 5) * 100) end, } + +newTalent{ + name = "Unseen Actions", + type = {"cunning/stealth", 3}, + mode = "passive", + points = 5, + require = { stat = { cun=18 }, }, + info = function(self, t) + return ([[When you perform an action from stealth (attacking, using objects, ...) you have %d%% chances to not break stealth.]]): + format(10 + self:getTalentLevel(t) * 9) + end, +} diff --git a/game/modules/tome/data/talents/misc/random.lua b/game/modules/tome/data/talents/misc/random.lua index 87afcb77c9089d6534518a80f8e26876003dcd74..ef3c7b5fb00704e935a55f941b33e19e46d3ace9 100644 --- a/game/modules/tome/data/talents/misc/random.lua +++ b/game/modules/tome/data/talents/misc/random.lua @@ -72,12 +72,12 @@ newTalent{ local tg = {type="bolt", range=self:getTalentRange(t)} local x, y = self:getTarget(tg) if not x or not y then return nil end - self:project(tg, x, y, DamageType.SLIME, 20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, {type="slime"}) + self:project(tg, x, y, DamageType.SLIME, 20 + (self:getDex() * self:getTalentLevel(t)) * 0.3, {type="slime"}) return true end, info = function(self, t) return ([[Spit slime at your target doing %0.2f nature damage and slowing it down for 3 turns. - The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3) + The damage will increase with the Dexterity stat]]):format(20 + (self:getDex() * self:getTalentLevel(t)) * 0.3) end, } @@ -107,7 +107,6 @@ newTalent{ end, info = function(self, t) return ([[You extend slimy roots into the ground, follow them and re-appear somewhere else in a range of %d. - The process is quite a strain on your body and you will be stunned for %d turns. - The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7)) + The process is quite a strain on your body and you will be stunned for %d turns.]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7)) end, } diff --git a/ideas/cunning.ods b/ideas/cunning.ods index 24bf3e185f6822db83fd7cea59519b8519a8dfd3..0411623c72475e5a4ed26d111dfcf24da91629ff 100644 Binary files a/ideas/cunning.ods and b/ideas/cunning.ods differ diff --git a/ideas/gifts.ods b/ideas/gifts.ods index 7644b1dc773d57163957e1abdd81a67e13242e4d..28fe0fd247a4ec278013825de9b396c82331bd3b 100644 Binary files a/ideas/gifts.ods and b/ideas/gifts.ods differ