diff --git a/game/modules/tome/ai/target.lua b/game/modules/tome/ai/target.lua index cb99870021867cab9b4e24b5ee1caa5d3f3a6509..aca05b6a74a131ea27aa0896c7d2a6b6cda34604 100644 --- a/game/modules/tome/ai/target.lua +++ b/game/modules/tome/ai/target.lua @@ -54,6 +54,7 @@ end) -- Target the player if within sense radius newAI("target_player_radius", function(self) + if not game.player.x then return end if self.ai_target.actor and not self.ai_target.actor.dead and rng.percent(90) then return true end if core.fov.distance(self.x, self.y, game.player.x, game.player.y) < self.ai_state.sense_radius then @@ -66,7 +67,7 @@ end) newAI("target_simple_or_player_radius", function(self) if self:runAI("target_simple") then return true end - if core.fov.distance(self.x, self.y, game.player.x, game.player.y) < self.ai_state.sense_radius then + if game.player.x and core.fov.distance(self.x, self.y, game.player.x, game.player.y) < self.ai_state.sense_radius then self.ai_target.actor = game.player return true end diff --git a/game/modules/tome/data/chats/last-hope-elder.lua b/game/modules/tome/data/chats/last-hope-elder.lua index 45e93c91b9018f04f10e0ad98bb4d8e691e7fed3..f7f22ac0fa024d277d21fa83d1230244d66cd417 100644 --- a/game/modules/tome/data/chats/last-hope-elder.lua +++ b/game/modules/tome/data/chats/last-hope-elder.lua @@ -31,9 +31,9 @@ newChat{ id="found_staff", The staff you describe reminds me of an artifact of great power from ancient times. May I see it?]], answers = { {"Here it is. #LIGHT_GREEN#*Tell him the encounter with the orcs*#LAST# You should keep it. I can feel its power and it would be safer if it were guarded by the armies of the kingdom.", - jump="given_staff", cond=function(npc, player) return player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "survived-ukruk") end}, + jump="given_staff", cond=function(npc, player) return player:findInAllInventories("Staff of Absorption") and player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "survived-ukruk") end}, {"I am afraid I lost it. #LIGHT_GREEN#*Tell him about the encounter with the orcs*", - jump="lost_staff", cond=function(npc, player) return player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "ambush-finish") end}, + jump="lost_staff", cond=function(npc, player) return player:findInAllInventories("Staff of Absorption") and player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "ambush-finish") end}, } } diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index ca71a9121ddffe0900c4f8ae8f604a46e6f290ae..a131eca5151824baac0f409166985521ecfe7998 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -417,7 +417,7 @@ newDamageType{ if criticals then dam = src:mindCrit(dam) end - if crossTierChance and rng.change(crossTierChance) then + if crossTierChance and rng.chance(crossTierChance) then target:crossTierEffect(target.EFF_BRAINLOCKED, src:combatMindpower()) end return DamageType.defaultProjector(src, x, y, type, dam) diff --git a/game/modules/tome/data/talents/cursed/cursed-aura.lua b/game/modules/tome/data/talents/cursed/cursed-aura.lua index 2bb04ed576b7e407aef157c0c82d7c018c82cd6e..b1496f576e9cd3673a6d795858ba0309c236055e 100644 --- a/game/modules/tome/data/talents/cursed/cursed-aura.lua +++ b/game/modules/tome/data/talents/cursed/cursed-aura.lua @@ -32,7 +32,7 @@ newTalent{ cooldown = 0, no_energy = true, no_npc_use = true, - no_unlearn_last = true, + --no_unlearn_last = true, -- list of all curses getCurses = function(self, t) return { self.EFF_CURSE_OF_CORPSES, self.EFF_CURSE_OF_MADNESS, self.EFF_CURSE_OF_MISFORTUNE, self.EFF_CURSE_OF_NIGHTMARES, self.EFF_CURSE_OF_SHROUDS } @@ -109,6 +109,7 @@ newTalent{ on_onTakeOff = function(self, t, o) t.updateCurses(self, t) end, + -- chooses whether the player accepts the cursed aura tree when a cursable item is found..only offered once for Afflicted classes chooseCursedAuraTree = function(self, t) local choose = false @@ -224,6 +225,10 @@ newTalent{ t.curseFloor(self, t, self.x, self.y) t.updateCurses(self, t) end, + on_unlearn = function(self, t) + -- turn off cursed aura (which gets disabled, but does not turn off) + t.setCursedAura(self, t, nil) + end, on_pre_use = function(self, t, silent) return self:getTalentLevelRaw(t) >= 5 end, diff --git a/game/modules/tome/data/talents/psionic/focus.lua b/game/modules/tome/data/talents/psionic/focus.lua index d80b3f181e2f2226e9e2e28851b8a84e8a507b1a..a662f2b575599de5dc70eba623ae3f7b6e833ae3 100644 --- a/game/modules/tome/data/talents/psionic/focus.lua +++ b/game/modules/tome/data/talents/psionic/focus.lua @@ -36,6 +36,7 @@ newTalent{ psi = 10, tactical = { ATTACK = function(self, t, target) local val = { PHYSICAL = 2} + local gem_level = getGemLevel(self) if gem_level > 0 and not target.dead and self:knowTalent(self.T_CONDUIT) and self:isTalentActive(self.T_CONDUIT) then local c = self:getTalentFromId(self.T_CONDUIT) local auras = self:isTalentActive(c.id) diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 11097f1e08025f11ed0873bcd7c5a664b55fb90b..27827e66e410866844fddd21fa920bea265a47e3 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -774,7 +774,7 @@ newEffect{ cancel_on_level_change = true, parameters = {}, getMindResistChange = function(level) return -level * 3 end, - getConfusionImmuneChange = function(level) return -level * 4 end, + getConfusionImmuneChange = function(level) return -level * 0.04 end, getCombatCriticalPowerChange = function(level) return level * 3 end, getOffHandMultChange = function(level) return level * 4 end, getLckChange = function(eff, level) @@ -796,7 +796,7 @@ newEffect{ #CRIMSON#Level 3: %sConspirator: When you are confused, any foe that hits you or that you hit in melee becomes confused. #CRIMSON#Level 4: %sMania: Any time you take more than %d%% damage during a single turn, the remaining cooldown of one of your talents is reduced by 1.]]):format( level, self.cursed_aura == self.EFF_CURSE_OF_MADNESS and ", Cursed Aura" or "", - def.getMindResistChange(level), def.getConfusionImmuneChange(level), + def.getMindResistChange(level), def.getConfusionImmuneChange(level) * 100, bonusLevel >= 1 and "#WHITE#" or "#GREY#", def.getCombatCriticalPowerChange(math.max(level, 1)), def.getOffHandMultChange(math.max(level, 1)), bonusLevel >= 2 and "#WHITE#" or "#GREY#", def.getLckChange(eff, math.max(level, 2)), def.getDexChange(math.max(level, 2)), bonusLevel >= 3 and "#WHITE#" or "#GREY#",