diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index cc868dc4222dd01907bba24e60406afb12b4d4db..7e91d6d3722c512685d709facd9a9109cdba313f 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -1564,7 +1564,7 @@ function _M:equilibriumChance(eq) end --- Paradox check -function _M:paradoxChance(pa) +function _M:paradoxFailChance(pa) --check for Paradox Mastery if self:knowTalent(self.T_PARADOX_MASTERY) and self:isTalentActive(self.T_PARADOX_MASTERY) then modifier = self:getWil() * (1 + (self:getTalentLevel(self.T_PARADOX_MASTERY)/10) or 0 ) @@ -1574,7 +1574,7 @@ function _M:paradoxChance(pa) --print("[Paradox] Will modifier: ", modifier, "::", self:getParadox()) local chance = math.pow (((self:getParadox() - modifier)/200), 2)*((100 + self:combatFatigue()) / 100) --print("[Paradox] Fail chance: ", chance, "::", self:getParadox()) - return rng.percent(100 - chance * 100), 100 - chance * 100 + return rng.percent(chance) end --- Called before a talent is used @@ -1672,8 +1672,14 @@ function _M:preUseTalent(ab, silent, fake) -- Paradox is special, it has no max, but the higher it is the higher the chance of something bad happening if (ab.paradox or ab.sustain_paradox) and not fake then - -- Check anomalies first - if not game.zone.no_anomalies and not self:attr("no_paradox_fail") and rng.percent(math.pow((self:getParadox()/400), 4)) then + -- Check failure first + if not self:attr("no_paradox_fail") and self:paradoxFailChance(ab.paradox or ab.sustain_paradox) then + if not silent then game.logPlayer(self, "You fail to use %s due to your paradox!", ab.name) end + self:incParadox(ab.paradox or ab.paradox_sustain / 10) + self:useEnergy() + return false + -- Now Check Anomalies + elseif not game.zone.no_anomalies and not self:attr("no_paradox_fail") and rng.percent(math.pow((self:getParadox()/400), 4)) then -- Random anomaly self:incParadox(ab.paradox or ab.paradox_sustain / 2) local ts = {} @@ -1684,12 +1690,6 @@ function _M:preUseTalent(ab, silent, fake) self:forceUseTalent(rng.table(ts), {ignore_energy=true}) self:useEnergy() return false - -- Now check failure - elseif not self:attr("no_paradox_fail") and self:paradoxChance(ab.paradox or ab.sustain_paradox) then - if not silent then game.logPlayer(self, "You fail to use %s due to your paradox!", ab.name) end - self:incParadox(ab.paradox or ab.paradox_sustain / 10) - self:useEnergy() - return false end end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 4caf86150ecd34ef98fa2f7897da8d60cb52d4fc..a6367ab9773c5db237905cef03a0efd564047e21 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -642,9 +642,11 @@ newDamageType{ -- Generic spell knockback vs. physresist. Uses a more generic resist message newDamageType{ name = "repulsion", type = "REPULSION", - projector = function(src, x, y, type, dam) + projector = function(src, x, y, type, dam, tmp) local target = game.level.map(x, y, Map.ACTOR) - if target and not target:attr("never_move") then + tmp = tmp or {} + if target and not target:attr("never_move") and not tmp[target] then + tmp[target] = true if target:checkHit(src:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 15) and target:canBe("knockback") then target:knockback(src.x, src.y, 2) game.logSeen(target, "%s is knocked back!", target.name:capitalize()) diff --git a/game/modules/tome/data/general/npcs/all.lua b/game/modules/tome/data/general/npcs/all.lua index f4ddb03631fc97d71bc88733b1f743ded11e5d9b..809312c7a6c96b17a6cd18fcf23d533bda09316f 100644 --- a/game/modules/tome/data/general/npcs/all.lua +++ b/game/modules/tome/data/general/npcs/all.lua @@ -37,6 +37,7 @@ loadIfNot("/data/general/npcs/ghost.lua") loadIfNot("/data/general/npcs/ghoul.lua") --loadIfNot("/data/general/npcs/gwelgoroth.lua") loadIfNot("/data/general/npcs/horror.lua") +--loadIfNot("/data/general/npcs/horror-corrupted.lua") loadIfNot("/data/general/npcs/jelly.lua") loadIfNot("/data/general/npcs/minor-demon.lua") loadIfNot("/data/general/npcs/major-demon.lua") diff --git a/game/modules/tome/data/general/objects/boss-artifacts.lua b/game/modules/tome/data/general/objects/boss-artifacts.lua index 4e3b7666c2cddca2e71ce334ff27b0c9056f8ce1..07b7552ad612e082b2dbba0308fb664a3f3bce6c 100644 --- a/game/modules/tome/data/general/objects/boss-artifacts.lua +++ b/game/modules/tome/data/general/objects/boss-artifacts.lua @@ -829,7 +829,7 @@ newEntity{ base = "BASE_WAND", define_as = "ROD_OF_ANNULMENT", local tids = {} for tid, lev in pairs(target.talents) do local t = target:getTalentFromId(tid) - if not target.talents_cd[tid] and t.mode == "activated" then tids[#tids+1] = t end + if not target.talents_cd[tid] and t.mode == "activated" and not t.innate then tids[#tids+1] = t end end for i = 1, 3 do local t = rng.tableRemove(tids) diff --git a/game/modules/tome/data/talents/chronomancy/anomalies.lua b/game/modules/tome/data/talents/chronomancy/anomalies.lua index e0646d4b58ed7a83fd4ca4f5051e3a88e0f19d7d..e37b73def5e18fab0c34bae6b416cdf670287c67 100644 --- a/game/modules/tome/data/talents/chronomancy/anomalies.lua +++ b/game/modules/tome/data/talents/chronomancy/anomalies.lua @@ -550,7 +550,7 @@ newTalent{ local tids = {} for tid, lev in pairs(target.talents) do local t = target:getTalentFromId(tid) - if not target.talents_cd[tid] and t.mode == "activated" then tids[#tids+1] = t end + if not target.talents_cd[tid] and t.mode == "activated" and not t.innate then tids[#tids+1] = t end end for i = 1, t.getTalentCount(self, t) do local power = t.getPower(self, t) diff --git a/game/modules/tome/data/talents/chronomancy/gravity.lua b/game/modules/tome/data/talents/chronomancy/gravity.lua index 8183526690af8755bcecff75dbff84742307f7ae..e2975f77970bcd754eca18a7be480acd634e1b3b 100644 --- a/game/modules/tome/data/talents/chronomancy/gravity.lua +++ b/game/modules/tome/data/talents/chronomancy/gravity.lua @@ -62,6 +62,7 @@ newTalent{ local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) if not x or not y then return nil end + local _ _, x, y = self:canProject(tg, x, y) x, y = checkBackfire(self, x, y) local grids = self:project(tg, x, y, function(px, py) local target = game.level.map(px, py, Map.ACTOR) @@ -74,7 +75,6 @@ newTalent{ end) self:project (tg, x, y, DamageType.PHYSICAL, self:spellCrit(t.getDamage(self, t))) - local _ _, x, y = self:canProject(tg, x, y) game.level.map:particleEmitter(x, y, tg.radius, "gravity_spike", {radius=tg.radius, grids=grids, tx=x, ty=y}) game:playSoundNear(self, "talents/earth") return true diff --git a/game/modules/tome/data/talents/chronomancy/spacetime-weaving.lua b/game/modules/tome/data/talents/chronomancy/spacetime-weaving.lua index 01688625471455cfb20fa82cff0fa02b8d39ed0b..6670a515703a83de8a30d54204a2d405f68a1f32 100644 --- a/game/modules/tome/data/talents/chronomancy/spacetime-weaving.lua +++ b/game/modules/tome/data/talents/chronomancy/spacetime-weaving.lua @@ -30,7 +30,8 @@ newTalent{ getAnomaly = function(self, t) return 6 - (self:getTalentLevelRaw(self.T_STATIC_HISTORY) or 0) end, action = function(self, t) -- open dialog to get desired paradox - local q = engine.dialogs.GetQuantity.new("Retuning the fabric of spacetime...", "What's your desired paradox level?", math.floor(self.paradox), nil, function(qty) + local q = engine.dialogs.GetQuantity.new("Retuning the fabric of spacetime...", + "What's your desired paradox level?", math.floor(self.paradox), nil, function(qty) -- get reduction amount and find duration amount = qty - self.paradox @@ -49,7 +50,7 @@ newTalent{ end, info = function(self, t) local chance = t.getAnomaly(self, t) - return ([[Retunes your Paradox towards the desired level. You will be dazed while tuning and each turn your Paradox will increase or decrease by an amount equal to your Willpower stat. + return ([[Retunes your Paradox towards the desired level and informs you of failure, anomaly, and backfire chances when you finish tuning. You will be dazed while tuning and each turn your Paradox will increase or decrease by an amount equal to your Willpower stat. Each turn you have a %d%% chance of triggering a temporal anomaly which will end the tuning process.]]): format(chance) end, diff --git a/game/modules/tome/data/talents/chronomancy/speed-control.lua b/game/modules/tome/data/talents/chronomancy/speed-control.lua index 2a455741d47884775fc1442bc437682433e7b7da..29dcace6be0aa5f73bcbe40e03e2fe84ed6b2200 100644 --- a/game/modules/tome/data/talents/chronomancy/speed-control.lua +++ b/game/modules/tome/data/talents/chronomancy/speed-control.lua @@ -68,10 +68,10 @@ newTalent{ local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) if not x or not y then return nil end + local _ _, x, y = self:canProject(tg, x, y) x, y = checkBackfire(self, x, y) local grids = self:project(tg, x, y, DamageType.STOP, t.getDuration(self, t)) - local _ _, x, y = self:canProject(tg, x, y) game.level.map:particleEmitter(x, y, tg.radius, "temporal_flash", {radius=tg.radius, tx=x, ty=y}) game:playSoundNear(self, "talents/tidalwave") return true diff --git a/game/modules/tome/data/talents/misc/misc.lua b/game/modules/tome/data/talents/misc/misc.lua index 385307dff6a738fff7a18106722c057878e866df..0214f310574d816a6d6a7aad9459cb7ff3d252ed 100644 --- a/game/modules/tome/data/talents/misc/misc.lua +++ b/game/modules/tome/data/talents/misc/misc.lua @@ -34,6 +34,7 @@ newTalent{ type = {"base/class", 1}, no_energy = "fake", hide = true, + innate = true, points = 1, range = 1, message = false, diff --git a/game/modules/tome/data/talents/techniques/archery.lua b/game/modules/tome/data/talents/techniques/archery.lua index 615222fffcaded8dd35efc5f11809544ad61f9ac..a0a7db4b72bbc6f590a6bce1b38bc18ca4e682be 100644 --- a/game/modules/tome/data/talents/techniques/archery.lua +++ b/game/modules/tome/data/talents/techniques/archery.lua @@ -23,6 +23,7 @@ newTalent{ type = {"technique/archery-base", 1}, no_energy = "fake", hide = true, + innate = true, points = 1, range = archery_range, message = "@Source@ shoots!", diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua index 8272dee3e14c00babf58cabc55fd4fa2a313a477..89aa90aaa44b4bc0fd75294606a153aca880a4cd 100644 --- a/game/modules/tome/data/timed_effects.lua +++ b/game/modules/tome/data/timed_effects.lua @@ -3407,7 +3407,16 @@ newEffect{ eff.tmpid = self:addTemporaryValue("dazed", 1) end, deactivate = function(self, eff) + if self:knowTalent(self.T_PARADOX_MASTERY) and self:isTalentActive(self.T_PARADOX_MASTERY) then + modifier = self:getWil() * (1 + (self:getTalentLevel(self.T_PARADOX_MASTERY)/10) or 0 ) + else + modifier = self:getWil() + end + local failure = math.pow(((self:getParadox() - modifier)/200), 2)*((100 + self:combatFatigue()) / 100) + local anomaly = math.pow((self:getParadox()/400), 4) + local backfire = math.pow (((self:getParadox() - modifier)/300), 3)*((100 + self:combatFatigue()) / 100) self:removeTemporaryValue("dazed", eff.tmpid) + game.logPlayer(self, "Your current failure chance is %d%%, your current anomoly chance is %d%%, and your current backfire chance is %d%%.", failure, anomaly, backfire) end, }