Skip to content
Snippets Groups Projects
Commit 2d777c0a authored by dg's avatar dg
Browse files

Fixed mind damage cross tier effects

Cursed Touch unlearn TL 5 now works
Curse of Madness correctly reduces confusion


git-svn-id: http://svn.net-core.org/repos/t-engine4@4673 51575b47-30f0-44d4-a5cc-537603b46e54
parent bcf587b2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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},
}
}
......
......@@ -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)
......
......@@ -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,
......
......@@ -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)
......
......@@ -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#",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment