diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua index 362ac9ff0c33aa330db5a15bcead4121bbb5b611..89a7a665f2d0b54ef2ac2ba65313350bd4daab66 100644 --- a/game/engines/default/engine/interface/ActorTalents.lua +++ b/game/engines/default/engine/interface/ActorTalents.lua @@ -1054,7 +1054,7 @@ end function _M:getTalentTarget(t) if type(t.target) == "function" then typ = t.target(self, t) - typ.talent_mode = self:getCurrentTalentMode() + if typ then typ.talent_mode = self:getCurrentTalentMode() end return typ end if t.target then t.target.talent_mode = self:getCurrentTalentMode() end -- Yes t is a global, not linked to actor, but this shouldnt matter as this will be set every time anyway diff --git a/game/modules/tome/ai/summon.lua b/game/modules/tome/ai/summon.lua index 7b0869f7a6ed126e735260945c133754039a49e2..d8c71be7f6c3197db987d880e5a16acb07c87417 100644 --- a/game/modules/tome/ai/summon.lua +++ b/game/modules/tome/ai/summon.lua @@ -23,3 +23,16 @@ newAI("summoned", function(self) return self:runAI(self.ai_real) end end) + +newAI("mirror_image", function(self) + if self:runAI(self.ai_state.ai_target or "target_simple") then + local eff = self.summoner:hasEffect(self.summoner.EFF_MIRROR_IMAGE_REAL) + if self.ai_state.use_taunt and not (eff and eff.last_talent) then + self:forceUseTalent(self.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) + else + self:useEnergy() + end + if eff then eff.last_talent = nil end + return true + end +end) diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index dea4685bd4118fdaaac27f6aee9c4cc0aa7c629b..4a8d3714ea8ea05e1f7b8abc767ed8a0afafae58 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -131,6 +131,9 @@ _M.temporary_values_conf.projectile_evasion_spread = "highest" _M.temporary_values_conf.life_leech_chance = "highest" +-- For archmages +_M.temporary_values_conf.blind_inc_damage = "highest" + -- Damage redirection takes last _M.temporary_values_conf.force_use_resist = "last" _M.temporary_values_conf.force_use_resist_percent = "last" diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index b7e990f899be4902375a7a98c83ae4ae832c6dae..504fa86f83a506f3751e4e1fa06b077a0a20e664 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -1766,7 +1766,7 @@ end --- Gets spellpower raw function _M:combatSpellpowerRaw(add) - if self.combat_precomputed_spellpower then return self.combat_precomputed_spellpower end + if self.combat_precomputed_spellpower then return self.combat_precomputed_spellpower, 1 end add = add or 0 if self.combat_generic_power then diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index a9f6d0985db894a62c210792030063bdd05866d1..4d2215a9706a34a2c32879bc155a644bc7bdad31 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -483,13 +483,13 @@ setDefaultProjector(function(src, x, y, type, dam, state) end --Dark Empathy (Reduce damage against summoner) - if src.necrotic_minion_be_nice and src.summoner == target then - dam = dam * (1 - src.necrotic_minion_be_nice) + if src.minion_be_nice and src.summoner == target then + dam = dam * (1 - src.minion_be_nice) end --Dark Empathy (Reduce damage against other minions) - if src.necrotic_minion_be_nice and target.summoner and src.summoner == target.summoner then - dam = dam * (1 - src.necrotic_minion_be_nice) + if src.minion_be_nice and target.summoner and src.summoner == target.summoner then + dam = dam * (1 - src.minion_be_nice) end -- Curse of Misfortune: Unfortunate End (chance to increase damage enough to kill) diff --git a/game/modules/tome/data/gfx/talents/mirror_images.png b/game/modules/tome/data/gfx/talents/mirror_images.png new file mode 100644 index 0000000000000000000000000000000000000000..bc3b8fdf174546693829a717960731edd0c6b6a2 Binary files /dev/null and b/game/modules/tome/data/gfx/talents/mirror_images.png differ diff --git a/game/modules/tome/data/talents/misc/inscriptions.lua b/game/modules/tome/data/talents/misc/inscriptions.lua index 01e454527c4f0a94a183b8c35189d43c2c666373..c98061b28cd4656e41e7d8b29fe93f8ea8e12c25 100644 --- a/game/modules/tome/data/talents/misc/inscriptions.lua +++ b/game/modules/tome/data/talents/misc/inscriptions.lua @@ -834,61 +834,62 @@ newInscription{ return res end, action = function(self, t) - if not self:canBe("summon") then game.logPlayer(self, "You cannot summon; you are suppressed!") return end - - -- Find all actors in radius 10 and add them to a table - local tg = {type="ball", radius=self.sight} - local grids = self:project(tg, self.x, self.y, function() end) - local tgts = {} - for x, ys in pairs(grids) do for y, _ in pairs(ys) do - local target = game.level.map(x, y, Map.ACTOR) - if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end - end end - - for _ = 1,3 do - local target = rng.tableRemove(tgts) - if target then - local tx, ty = util.findFreeGrid(target.x, target.y, 10, true, {[Map.ACTOR]=true}) - if tx then - local Talents = require "engine.interface.ActorTalents" - local NPC = require "mod.class.NPC" - local caster = self - local image = NPC.new{ - name = _t"Mirror Image", - type = "image", subtype = "image", - ai = "summoned", ai_real = nil, ai_state = { talent_in=1, }, ai_target = {actor=nil}, - desc = _t"A blurred image.", - image = caster.image, - add_mos = caster.add_mos, -- this is horribly wrong isn't it? seems to work though - shader = "shadow_simulacrum", shader_args = { color = {0.0, 0.4, 0.8}, base = 0.6, time_factor = 1500 }, - exp_worth=0, - max_life = caster.max_life, - life = caster.max_life, -- We don't want to make this only useful before you take damage - combat_armor_hardiness = caster:combatArmorHardiness(), - combat_def = caster:combatDefense(), - combat_armor = caster:combatArmor(), - size_category = caster.size_category, - resists = t.getInheritedResist(self, t), - rank = 1, - life_rating = 0, - cant_be_moved = 1, - never_move = 1, - never_anger = true, - resolvers.talents{ - [Talents.T_TAUNT]=1, -- Add the talent so the player can see it even though we cast it manually - }, - on_act = function(self) -- avoid any interaction with .. uh, anything - self:forceUseTalent(self.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) - end, - faction = caster.faction, - summoner = caster, - summon_time=t.getDur(self, t), - no_breath = 1, - remove_from_party_on_death = true, - } - - image:resolve() - game.zone:addEntity(game.level, image, "actor", tx, ty) + if not self:canBe("summon") then game.logPlayer(self, "You cannot summon; you are suppressed!") return end + + -- Find all actors in radius 10 and add them to a table + local tg = {type="ball", radius=self.sight} + local grids = self:project(tg, self.x, self.y, function() end) + local tgts = {} + for x, ys in pairs(grids) do for y, _ in pairs(ys) do + local target = game.level.map(x, y, Map.ACTOR) + if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end + end end + + for _ = 1,3 do + local target = rng.tableRemove(tgts) + if target then + local tx, ty = util.findFreeGrid(target.x, target.y, 10, true, {[Map.ACTOR]=true}) + if tx then + local Talents = require "engine.interface.ActorTalents" + local NPC = require "mod.class.NPC" + local caster = self + local image = NPC.new{ + name = _t"Mirror Image", + type = "image", subtype = "image", + ai = "summoned", ai_real = nil, ai_state = { talent_in=1, }, ai_target = {actor=nil}, + desc = _t"A blurred image.", + image = caster.image, + add_mos = table.clone(caster.add_mos, true), + shader = "shadow_simulacrum", shader_args = { color = {0.0, 0.4, 0.8}, base = 0.6, time_factor = 1500 }, + exp_worth=0, + max_life = caster.max_life, + life = caster.max_life, -- We don't want to make this only useful before you take damage + combat_armor_hardiness = caster:combatArmorHardiness(), + combat_def = caster:combatDefense(), + combat_armor = caster:combatArmor(), + size_category = caster.size_category, + resists = t.getInheritedResist(self, t), + rank = 1, + life_rating = 0, + cant_be_moved = 1, + never_move = 1, + never_anger = true, + resolvers.talents{ + [Talents.T_TAUNT]=1, -- Add the talent so the player can see it even though we cast it manually + }, + on_act = function(self) -- avoid any interaction with .. uh, anything + self:forceUseTalent(self.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) + end, + faction = caster.faction, + summoner = caster, + summon_time=t.getDur(self, t), + no_breath = 1, + remove_from_party_on_death = true, + } + + image:resolve() + game.zone:addEntity(game.level, image, "actor", tx, ty) + if game.party:hasMember(self) then game.party:addMember(image, { control=false, type="summon", @@ -896,11 +897,12 @@ newInscription{ temporary_level = true, orders = {}, }) - - image:forceUseTalent(image.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) end + + image:forceUseTalent(image.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) end end + end return true end, diff --git a/game/modules/tome/data/talents/psionic/discharge.lua b/game/modules/tome/data/talents/psionic/discharge.lua index b3cff11f6d8f11dd46d22f3ecbe23390cf99ec39..c26ed62867eb6f72e246287dd7e59516dd1cd2ed 100644 --- a/game/modules/tome/data/talents/psionic/discharge.lua +++ b/game/modules/tome/data/talents/psionic/discharge.lua @@ -183,7 +183,7 @@ newTalent{ } newTalent{ - name = "Focused Wrath", + name = "Focused Wrath", type = {"psionic/discharge", 4}, points = 5, require = psi_wil_high4, diff --git a/game/modules/tome/data/talents/spells/phantasm.lua b/game/modules/tome/data/talents/spells/phantasm.lua index 64abe00bae73ec2f1dcba9c8ccdce7095f2aca3d..3c42070b7762dc1fafb81216b59f9e66ce3c3c68 100644 --- a/game/modules/tome/data/talents/spells/phantasm.lua +++ b/game/modules/tome/data/talents/spells/phantasm.lua @@ -144,124 +144,128 @@ newTalent{ } newTalent{ - name = "Elemental Mirage", image = "talents/blur_sight.png", + name = "Mirror Image", short_name = "MIRROR_IMAGES", type = {"spell/phantasm", 4}, - mode = "sustained", require = spells_req4, points = 5, - sustain_mana = 30, + mana = 30, cooldown = 20, - tactical = { BUFF = 2 }, - no_npc_use = true, - autolearn_talent = "T_ALTER_MIRAGE", - getBonus = function(self, t) return self:combatTalentScale(t, 10, 30) end, - chooseElements = function(self, t) - local DT = DamageType - local elements = {} - for _, dtid in ipairs{DT.ARCANE, DT.FIRE, DT.LIGHTNING, DT.COLD, DT.PHYSICAL, DT.LIGHT, DT.TEMPORAL, DT.ACID, DT.NATURE, DT.BLIGHT, DT.DARKNESS} do - local dt = DT:get(dtid) - elements[#elements+1] = {name = dt.text_color..dt.name, id=dtid} - end - - local e1, e2 = nil, nil - - local res = self:talentDialog(Dialog:listPopup("Elemental Mirage", "Choose the first element:", elements, 400, 300, function(item) self:talentDialogReturn(item) end)) - if not res then return nil end - e1 = res.id - table.removeFromList(elements, res) - - local res = self:talentDialog(Dialog:listPopup("Elemental Mirage", "Choose the second element:", elements, 400, 300, function(item) self:talentDialogReturn(item) end)) - if not res then return nil end - e2 = res.id - - return e1, e2 - end, - callbackOnDealDamage = function(self, t, val, target, dead, death_note) - self.elemental_mirage_elements = self.elemental_mirage_elements or {} - if not self.elemental_mirage_elements.e1 then return end - if not death_note or not death_note.damtype then return end + tactical = { DEFEND = 3,}, + getLife = function(self, t) return math.ceil(self:combatTalentScale(t, 5, 12)) end, + on_pre_use = function(self, t) return self.in_combat and not self:hasEffect(self.EFF_MIRROR_IMAGE_REAL) end, + action = function(self, t) + if not self:canBe("summon") then game.logPlayer(self, "You cannot summon; you are suppressed!") return end - if death_note.damtype == self.elemental_mirage_elements.e1 then - if self.turn_procs.elemental_mirage1 then return end - self.turn_procs.elemental_mirage1 = true + -- Find all actors in radius 10 and add them to a table + local tg = {type="ball", radius=self.sight} + local grids = self:project(tg, self.x, self.y, function() end) + local tgts = {} + for x, ys in pairs(grids) do for y, _ in pairs(ys) do + local target = game.level.map(x, y, Map.ACTOR) + if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end + end end - local pen = nil - if self:getTalentLevel(t) >= 5 then - local ep1 = self:combatGetResistPen(self.elemental_mirage_elements.e1, true) - local ep2 = self:combatGetResistPen(self.elemental_mirage_elements.e2, true) - if ep2 < ep1 then pen = ep1 - ep2 end - end + local target = rng.tableRemove(tgts) + if not target then return end + local tx, ty = util.findFreeGrid(target.x, target.y, 10, true, {[Map.ACTOR]=true}) + if not tx then return end - self:setEffect(self.EFF_ELEMENTAL_MIRAGE2, 3, {dt=self.elemental_mirage_elements.e2, power=t.getBonus(self, t), pen=pen}) - elseif death_note.damtype == self.elemental_mirage_elements.e2 then - if self.turn_procs.elemental_mirage2 then return end - self.turn_procs.elemental_mirage2 = true + local Talents = require "engine.interface.ActorTalents" + local NPC = require "mod.class.NPC" + local image = NPC.new{ + name = ("Mirror Image (%s)"):tformat(self:getName()), + type = "image", subtype = "image", + ai = "mirror_image", ai_real = nil, ai_state = { talent_in=1, }, ai_target = {actor=nil}, + desc = _t"A blurred image.", + image = self.image, + add_mos = table.clone(self.add_mos, true), + exp_worth=0, + level_range = {self.level, self.level}, + level = self.level, + size_category = self.size_category, + global_speed = self.global_speed, + global_speed_add = self.global_speed_add, + global_speed_base = self.global_speed_base, + combat_spellspeed = self.combat_spellspeed, + combat_def = -1000, + combat_armor = 0, + max_mana = 10000, + mana = 10000, + rank = 1, + difficulty_boosted = 1, + life_rating = 0, + life_regen = 0, no_life_regen = 1, + cant_be_moved = 1, + never_move = 1, + never_anger = true, + generic_damage_penalty = 66, + inc_damage = table.clone(self.inc_damage or {}, true), + resists_pen = table.clone(self.resists_pen or {}, true), + combat_precomputed_spellpower = self:combatSpellpowerRaw(), + resolvers.talents{ + [Talents.T_TAUNT]=1, -- Add the talent so the player can see it even though we cast it manually + }, + faction = self.faction, + summoner = self, + heal = function() return 0 end, -- Cant ever heal + takeHit = function(self, value, src, death_note) -- Cant ever take more than one damage per turn per actor + if not src then return false, 0 end + if src ~= self then + if death_note.source_talent_mode ~= "active" then return false, 0 end + if self.turn_procs.mirror_image_dmg and self.turn_procs.mirror_image_dmg[src] then return false, 0 end + self.turn_procs.mirror_image_dmg = self.turn_procs.mirror_image_dmg or {} + self.turn_procs.mirror_image_dmg[src] = true + end + return mod.class.NPC.takeHit(self, 1, src, death_note) + end, + on_die = function(self) + self.summoner:removeEffect(self.summoner.EFF_MIRROR_IMAGE_REAL, true, true) + end, + spellFriendlyFire = function() return 100 end, + no_breath = 1, + remove_from_party_on_death = true, + } - local pen = nil - if self:getTalentLevel(t) >= 5 then - local ep1 = self:combatGetResistPen(self.elemental_mirage_elements.e1, true) - local ep2 = self:combatGetResistPen(self.elemental_mirage_elements.e2, true) - if ep1 < ep2 then pen = ep2 - ep1 end - end + image:resolve() + game.zone:addEntity(game.level, image, "actor", tx, ty) + image.max_life = t:_getLife(self) + image.life = t:_getLife(self) - self:setEffect(self.EFF_ELEMENTAL_MIRAGE1, 3, {dt=self.elemental_mirage_elements.e1, power=t.getBonus(self, t), pen=pen}) - end - end, - activate = function(self, t) - self.elemental_mirage_elements = self.elemental_mirage_elements or {} - local e1, e2 - if self.elemental_mirage_elements.e1 then e1, e2 = self.elemental_mirage_elements.e1, self.elemental_mirage_elements.e2 - else e1, e2 = t.chooseElements(self, t) end + -- Clone particles - game:playSoundNear(self, "talents/heal") - local ret = {} - self.elemental_mirage_elements = {e1=e1, e2=e2} - self:addShaderAura("elemental_mirage", "crystalineaura", {time_factor=500, spikeOffset=0.123123, spikeLength=1.1, spikeWidth=3, growthSpeed=5, color={255/255, 215/255, 0/255}}, "particles_images/smoothspikes.png") + local dam_bonus = self:callTalent(self.T_INVISIBILITY, "getDamPower") + image:setEffect(image.EFF_MIRROR_IMAGE_FAKE, 1, {dam=dam_bonus}) + self:setEffect(image.EFF_MIRROR_IMAGE_REAL, 1, {image=image, dam=dam_bonus}) - return ret - end, - deactivate = function(self, t, p) - self:removeShaderAura("elemental_mirage") - return true - end, - info = function(self, t) - self.elemental_mirage_elements = self.elemental_mirage_elements or {} - local DT = DamageType - local e1, e2 - if self.elemental_mirage_elements.e1 then - local dt1 = DT:get(self.elemental_mirage_elements.e1) - local dt2 = DT:get(self.elemental_mirage_elements.e2) - e1, e2 = dt1.text_color..dt1.name, dt2.text_color..dt2.name + -- Player & NPC don't work the same for this spell + if game.party:hasMember(self) then + game.party:addMember(image, { + control=false, + type="summon", + title=_t"Summon", + temporary_level = true, + orders = {}, + }) + image:forceUseTalent(image.T_TAUNT, {ignore_cd=true, no_talent_fail = true}) + image.ai_state.use_taunt = true else - e1, e2 = "not selected", "not selected" + -- Dont reveal ourself to player + image.tooltip = function(self, x, y, seen_by) + return mod.class.NPC.tooltip(self.summoner, x, y, seen_by) + end + image.ai_state.use_taunt = false end - return ([[Your mastery of both illusion and elements knows no bound. - Upon first sustaining this spell you may select two elements. You may later change them with the Alter Mirage spell, provided automatically upon learning this one. - - Any time you deal damage with one of those elements, the other gets a bonus of %d%% damage for 3 turns. - At level 5 if the target element has less resistance penetration, it gets increased to match the one of the source element. - - Current elements selected: %s#LAST# and %s]]): - tformat(t.getBonus(self, t), e1, e2) - end, -} - -newTalent{ - name = "Alter Mirage", - type = {"spell/other", 1}, - points = 5, - mana = 3, - cooldown = 3, - no_npc_use = true, - action = function(self, t) - local e1, e2 = self:callTalent(self.T_ELEMENTAL_MIRAGE, "chooseElements") - if not e1 then return end - self.elemental_mirage_elements = {e1=e1, e2=e2} return true end, info = function(self, t) - return _t[[Change your choice of elements for Elemental Mirage.]] + return ([[Create a perfect lookalike of your own form made out of pure light near a creature or yourself if no creature is present. + This image has %d life and can never take more than 1 damage per creature per turn and is immune to any non direct damage (ground effects, damage over time, ...). + Whenever you cast a spell your mirror image will try to duplicate it at the same target for 66%% less damage, if possible. If it can it will loose 1 life, if not it will instead taunt a creature to focus its attention on itself. + While the image exists you receive the damage bonus from the Invisibility spell as if you were invisible. + This spell can not be cast while a Mirror Image already exists and only in combat. + ]]) + :tformat(t.getLife(self, t)) end, } diff --git a/game/modules/tome/data/talents/spells/spells.lua b/game/modules/tome/data/talents/spells/spells.lua index bc07765fd12553e328bc6196bad49da8e23a634c..c7b9c44183d58ca4209d916eb1e0ac29034854f9 100644 --- a/game/modules/tome/data/talents/spells/spells.lua +++ b/game/modules/tome/data/talents/spells/spells.lua @@ -178,7 +178,7 @@ function necroSetupSummon(self, def, x, y, level, turns, no_control) m.inc_damage = table.clone(self.inc_damage, true) m.no_breath = 1 m.no_drops = true - m.necrotic_minion_be_nice = 1 + m.minion_be_nice = 1 if self:isTalentActive(self.T_NECROTIC_AURA) then local t = self:getTalentFromId(self.T_NECROTIC_AURA) diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index f46f20407466752bdaa44743dffc7865e4e695a5..7e9d7212212219c2f04f8c4d4e6fadd955bec278 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -4661,22 +4661,6 @@ for _, dt in ipairs{ newEffect(e) end -newEffect{ - name = "ELEMENTAL_MIRAGE1", image = "talents/blur_sight.png", - desc = _t"Elemental Mirage (First Element)", - long_desc = function(self, eff) return ("%s damage increased by %d%% and resistance penetration by %d%%."):tformat(DamageType:get(eff.dt).name, eff.power, eff.pen or 0) end, - type = "magical", - subtype = { phantasm=true,}, - status = "beneficial", - parameters = {dt=DamageType.ARCANE, power=10}, - on_gain = function(self, err) return nil, true end, - on_lose = function(self, err) return nil, true end, - activate = function(self, eff) - self:effectTemporaryValue(eff, "inc_damage", {[eff.dt] = eff.power}) - if eff.pen then self:effectTemporaryValue(eff, "resists_pen", {[eff.dt] = eff.pen}) end - end, -} - newEffect{ name = "LICH_FEAR", image = "talents/lichform.png", desc = _t"Frightening Presence", @@ -4696,22 +4680,6 @@ newEffect{ end, } -newEffect{ - name = "ELEMENTAL_MIRAGE2", image = "talents/alter_mirage.png", - desc = _t"Elemental Mirage (Second Element)", - long_desc = function(self, eff) return ("%s damage increased by %d%% and resistance penetration by %d%%."):tformat(DamageType:get(eff.dt).name, eff.power, eff.pen or 0) end, - type = "magical", - subtype = { phantasm=true,}, - status = "beneficial", - parameters = {dt=DamageType.FIRE, power=10}, - on_gain = function(self, err) return nil, true end, - on_lose = function(self, err) return nil, true end, - activate = function(self, eff) - self:effectTemporaryValue(eff, "inc_damage", {[eff.dt] = eff.power}) - if eff.pen then self:effectTemporaryValue(eff, "resists_pen", {[eff.dt] = eff.pen}) end - end, -} - newEffect{ name = "COMMANDER_OF_THE_DEAD", image = "talents/commander_of_the_dead.png", desc = _t"Commander of the Dead", diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 7dbfae454af7478d9612e28cf75f260c135dabab..b7e3f2b119a38467586deab581a9f4af4edf2db6 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -4021,7 +4021,7 @@ newEffect{ name = "DOZING", image = "talents/sleep.png", desc = _t"Dozing", long_desc = function(self, eff) return _t"The target is completely asleep, unable to act." end, - type = "other", + type = "otber", subtype = { sleep=true }, status = "detrimental", parameters = { }, @@ -4031,3 +4031,47 @@ newEffect{ deactivate = function(self, eff) end, } + +newEffect{ + name = "MIRROR_IMAGE_REAL", image = "talents/mirror_images.png", + desc = _t"Protected by a Mirror Image", + long_desc = function(self, eff) return ("Target is protected by a mirror image. Increases damage dealt to blind or dazzled creatures by %d%%"):tformat(eff.dam) end, + type = "other", + subtype = { phantasm=true }, + status = "beneficial", decrease = 0, + cancel_on_level_change = true, + parameters = { dam=10 }, + callbackOnTalentPost = function(self, eff, ab, ret, silent) + if ab.id == self.T_MIRROR_IMAGES then return end + if not ab.is_spell or ab.is_inscription then return end + if ab.mode ~= "activated" then return end + if not ret then return end + local x, y, tgt = self:getTarget() + if not tgt or not ab.requires_target then return end + if eff.image:attr("dead") or not game.level:hasEntity(eff.image) then return end + + pcall(function() -- Just in case + eff.image:forceUseTalent(ab.id, {force_level=self:getTalentLevelRaw(ab.id), ignore_cd=true, no_talent_fail=true, ignore_energy=true, force_talent_ignore_ressources=true, force_target=tgt}) + eff.image:takeHit(1, eff.image) + end) + + eff.last_talent = true + end, + activate = function(self, eff) + self:effectTemporaryValue(eff, "blind_inc_damage", eff.dam) + end, +} + +newEffect{ + name = "MIRROR_IMAGE_FAKE", image = "talents/mirror_images.png", + desc = _t"Protected by a Mirror Image", + long_desc = function(self, eff) return ("Target is protected by a mirror image. Increases damage dealt to blind or dazzled creatures by %d%%"):tformat(eff.dam) end, + type = "other", + subtype = { phantasm=true }, + status = "beneficial", decrease = 0, + cancel_on_level_change = true, + parameters = { dam=10 }, + activate = function(self, eff) + self:effectTemporaryValue(eff, "blind_inc_damage", eff.dam) + end, +}