diff --git a/game/modules/tome/class/uiset/Minimalist.lua b/game/modules/tome/class/uiset/Minimalist.lua index 37ab1e4ff7b6ea07fa9f9f7da569a47d99a594d3..231ed7f8f0bae427d1347bf4527dda886621e6e3 100644 --- a/game/modules/tome/class/uiset/Minimalist.lua +++ b/game/modules/tome/class/uiset/Minimalist.lua @@ -1164,7 +1164,7 @@ function _M:handleEffect(player, eff_id, e, p, x, y, hs, bx, by, is_first, scale txt.fw, txt.fh = font:size(dur) end if e.charges then - local font = e.decrease > 0 or e.charges_smallfont and self.buff_font_smallmed or self.buff_font + local font = (e.decrease > 0 or e.charges_smallfont) and self.buff_font_smallmed or self.buff_font txt2 = font:draw(charges, 40, colors.WHITE.r, colors.WHITE.g, colors.WHITE.b, true)[1] txt2.fw, txt2.fh = font:size(charges) diff --git a/game/modules/tome/data/talents/spells/phantasm2.lua b/game/modules/tome/data/talents/spells/phantasm2.lua deleted file mode 100644 index e0ddd88f8fd1577bcba21d0bac28942a73895a53..0000000000000000000000000000000000000000 --- a/game/modules/tome/data/talents/spells/phantasm2.lua +++ /dev/null @@ -1,175 +0,0 @@ --- ToME - Tales of Maj'Eyal --- Copyright (C) 2009 - 2019 Nicolas Casalini --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see <http://www.gnu.org/licenses/>. --- --- Nicolas Casalini "DarkGod" --- darkgod@te4.org -MAKE ME! -newTalent{ - name = "Illuminate", short_name = "ILLUMINATE2", - type = {"spell/phantasm2",1}, - require = spells_req1, - random_ego = "utility", - points = 5, - mana = 5, - cooldown = 14, - range = 0, - radius = function(self, t) return math.floor(self:combatTalentScale(t, 6, 10)) end, - tactical = { DISABLE = function(self, t, aitarget) - if self:getTalentLevel(t) >= 3 and not aitarget:attr("blind") then - return 2 - end - return 0 - end, - ATTACKAREA = 2, - }, - getDamage = function(self, t) return self:combatTalentSpellDamage(t, 28, 210) end, - getBlindPower = function(self, t) if self:getTalentLevel(t) >= 5 then return 4 else return 3 end end, - requires_target = true, - target = function(self, t) return {type="ball", range=self:getTalentRange(t), selffire=false, radius=self:getTalentRadius(t), talent=t} end, - action = function(self, t) - local tg = self:getTalentTarget(t) - game.level.map:particleEmitter(self.x, self.y, tg.radius, "sunburst", {radius=tg.radius, grids=grids, tx=self.x, ty=self.y, max_alpha=80}) - if self:getTalentLevel(t) >= 3 then - self:project(tg, self.x, self.y, DamageType.BLIND, t.getBlindPower(self, t)) - end - self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(t.getDamage(self, t))) - tg.selffire = true - self:project(tg, self.x, self.y, DamageType.LITE, 1) - game:playSoundNear(self, "talents/heal") - return true - end, - info = function(self, t) - local radius = self:getTalentRadius(t) - local turn = t.getBlindPower(self, t) - local dam = t.getDamage(self, t) - return ([[Creates a globe of pure light within a radius of %d that illuminates the area and deals %0.2f light damage. - At level 3, it also blinds all who see it (except the caster) for %d turns.]]): - format(radius, damDesc(self, DamageType.LIGHT, dam), turn) - end, -} - -newTalent{ - name = "Phantasmal Shield", short_name = "PHANTASMAL_SHIELD2", - type = {"spell/phantasm2", 2}, - mode = "sustained", - require = spells_req2, - points = 5, - sustain_mana = 30, - cooldown = 10, - tactical = { BUFF = 2 }, - getDefense = function(self, t) return self:combatScale(self:getTalentLevel(t)*self:combatSpellpower(), 0, 0, 28.6, 267, 0.75) end, - activate = function(self, t) - game:playSoundNear(self, "talents/heal") - return { - particle = self:addParticles(Particles.new("phantasm_shield", 1)), - def = self:addTemporaryValue("combat_def", t.getDefense(self, t)), - } - end, - deactivate = function(self, t, p) - self:removeParticles(p.particle) - self:removeTemporaryValue("combat_def", p.def) - return true - end, - info = function(self, t) - local defence = t.getDefense(self, t) - return ([[The caster's image blurs, granting a %d bonus to Defense. - The bonus will increase with your Spellpower.]]): - format(defence) - end, -} - -newTalent{ - name = "Invisibility", short_name = "INVISIBILITY2", - type = {"spell/phantasm2", 3}, - mode = "sustained", - require = spells_req3, - points = 5, - sustain_mana = 20, - cooldown = 10, - tactical = { BUFF = 2 }, - getDamage = function(self, t) return self:combatTalentSpellDamage(t, 1, 80) end, - activate = function(self, t) - game:playSoundNear(self, "talents/heal") - return { - particle = self:addParticles(Particles.new("phantasm_shield", 1)), - onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=t.getDamage(self, t)}), - evasion = self:addTemporaryValue("evasion", 10), - - } - end, - deactivate = function(self, t, p) - self:removeParticles(p.particle) - self:removeTemporaryValue("on_melee_hit", p.onhit) - self:removeTemporaryValue("evasion", p.evasion) - - return true - end, - info = function(self, t) - local damage = t.getDamage(self, t) - return ([[The caster is surrounded by a phantasmal shield granting 10%% chance to evade weapon attacks. If hit in melee, the shield will deal %d light damage to the attacker. - The damage will increase with your Spellpower.]]): - format(damDesc(self, DamageType.LIGHT, damage)) - end, -} - -newTalent{ - name = "Elemental Mirage", - type = {"spell/phantasm2", 4}, - mode = "sustained", - require = spells_req4, - points = 5, - sustain_mana = 150, - cooldown = 30, - tactical = { ESCAPE = 2, DEFEND = 2 }, - getInvisibilityPower = function(self, t) return self:combatTalentSpellDamage(t, 10, 50) end, - activate = function(self, t) - game:playSoundNear(self, "talents/heal") - local ret = { - invisible = self:addTemporaryValue("invisible", t.getInvisibilityPower(self, t)), - invisible_damage_penalty = self:addTemporaryValue("invisible_damage_penalty", 0.7), - drain = self:addTemporaryValue("mana_regen", -2), - } - if not self.shader then - ret.set_shader = true - self.shader = "invis_edge" - self:removeAllMOs() - game.level.map:updateMap(self.x, self.y) - end - self:resetCanSeeCacheOf() - return ret - end, - deactivate = function(self, t, p) - if p.set_shader then - self.shader = nil - self:removeAllMOs() - game.level.map:updateMap(self.x, self.y) - end - self:removeTemporaryValue("invisible", p.invisible) - self:removeTemporaryValue("invisible_damage_penalty", p.invisible_damage_penalty) - self:removeTemporaryValue("mana_regen", p.drain) - self:resetCanSeeCacheOf() - return true - end, - info = function(self, t) - local invisi = t.getInvisibilityPower(self, t) - return ([[The caster fades from sight, granting %d bonus to invisibility. - Beware -- you should take off your light, or you will still be easily spotted. - As you become invisible, you fade out of phase with reality. All your damage is reduced by 70%%. - This powerful spell constantly drains your mana (2 per turn) while active. - The invisibility bonus will increase with your Spellpower.]]): - format(invisi) - end, -} diff --git a/game/modules/tome/data/talents/spells/wildfire.lua b/game/modules/tome/data/talents/spells/wildfire.lua index b91626a01843bb491b9dc347fc33d284b9be107a..00014a9c69880b9b6236b38ea5f75c68b462547e 100644 --- a/game/modules/tome/data/talents/spells/wildfire.lua +++ b/game/modules/tome/data/talents/spells/wildfire.lua @@ -99,13 +99,46 @@ newTalent{ name = "Cleansing Flames", type = {"spell/wildfire",3}, require = spells_req_high3, - mode = "passive", + mana = 20, + cooldown = 20, + tactical = { CURE = function(self, t, aitarget) + local nb = 0 + for eff_id, p in pairs(self.tmp) do + local e = self.tempeffect_def[eff_id] + if e.type == "magical" and e.status == "detrimental" then nb = nb + 1 end + end + return nb + end, + DISABLE = function(self, t, aitarget) + local nb = 0 + for eff_id, p in pairs(aitarget.tmp) do + local e = self.tempeffect_def[eff_id] + if e.type == "magical" and e.status == "beneficial" then nb = nb + 1 end + end + for tid, act in pairs(aitarget.sustain_talents) do + if act then + local talent = aitarget:getTalentFromId(tid) + if talent.is_spell then nb = nb + 1 end + end + end + return nb^0.5 + end}, points = 5, + getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 55) end, + getDur = function(self, t) return math.ceil(self:combatTalentScale(t, 6, 15)) end, getChance = function(self, t) return self:getTalentLevelRaw(t) * 10 end, + on_pre_use = function(self, t) return game.level and self.x and game.level.map:hasEffectType(self.x, self.y, DamageType.INFERNO) end, + action = function(self, t) + self:setEffect(self.EFF_CLEANSING_FLAMES, t:_getDur(self), {chance=t:_getChance(self)}) + end, info = function(self, t) - return ([[When your Burning Wake talent is active, your Inferno and Burning Wake effects have a %d%% chance, each turn, to remove a status effect (physical or magical) from the targets. + local damage = t.getDamage(self, t) + return ([[When you stand in your Burning Wake or Inferno ground effect, you can self immolate to trigger Cleansing Flames for %d turns. + While the effect lasts you will take %0.2f fire damage per turn. + Each turn there is a %d%% chance for any creature taking damage from Burning Wake, Inferno or Cleansing Flames to remove a status effect (physical or magical). If the target is hostile, it will remove a beneficial effect. - If the target is friendly, it will remove a detrimental effect (but still burn).]]):tformat(t.getChance(self, t)) + If the target is friendly, it will remove a detrimental effect.]]): + tformat(t:_getDur(self), damDesc(self, DamageType.FIRE, damage), t.getChance(self, t)) end, } diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index 48201121c942c63073ea2e8bb498ccfd2be593a3..f46f20407466752bdaa44743dffc7865e4e695a5 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -5247,3 +5247,22 @@ newEffect{ end end, } + +newEffect{ + name = "CLEANSING_FLAMES", image = "talents/cleansing_flames.png", + desc = _t"Cleansing Flames", + long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn and %d%% chance per turn of removing a physical or magical effect from all targets affected by Inferno, Burning Wake or Cleansing Flames."):tformat(eff.power, eff.chance) end, + charges = function(self, eff) return (math.floor(eff.power)) end, + type = "magical", + subtype = { fire=true, cleanse=true }, + status = "beneficial", + parameters = { power=10 }, + on_gain = function(self, err) return _t"#Target# bathes in cleansing flames!", true end, + on_lose = function(self, err) return _t"#Target# stops burning.", true end, + activate = function(self, eff) + self:effectTemporaryValue(eff, "cleansing_flames", eff.chance) + end, + on_timeout = function(self, eff) + DamageType:get(DamageType.FIRE).projector(self, self.x, self.y, DamageType.FIRE, eff.power) + end, +}