Skip to content
Snippets Groups Projects
Commit 5cf44da9 authored by dg's avatar dg
Browse files

Effects duration is now displayed in left player pane & tooltip

git-svn-id: http://svn.net-core.org/repos/t-engine4@2141 51575b47-30f0-44d4-a5cc-537603b46e54
parent 54853a24
No related branches found
No related tags found
No related merge requests found
......@@ -559,10 +559,11 @@ function _M:tooltip(x, y, seen_by)
end
for eff_id, p in pairs(self.tmp) do
local e = self.tempeffect_def[eff_id]
local dur = p.dur + 1
if e.status == "detrimental" then
effs[#effs+1] = ("- #LIGHT_RED#%s"):format(e.desc)
effs[#effs+1] = ("- #LIGHT_RED#%s(%d)"):format(e.desc,dur)
else
effs[#effs+1] = ("- #LIGHT_GREEN#%s"):format(e.desc)
effs[#effs+1] = ("- #LIGHT_GREEN#%s(%d)"):format(e.desc,dur)
end
end
......
......@@ -176,11 +176,12 @@ function _M:display()
end
for eff_id, p in pairs(player.tmp) do
local e = player.tempeffect_def[eff_id]
local dur = p.dur + 1
local desc = e.long_desc(player, p)
if e.status == "detrimental" then
self:mouseTooltip(desc, s:drawColorStringBlended(self.font, ("#LIGHT_RED#%s"):format(e.desc), x, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(desc, s:drawColorStringBlended(self.font, ("#LIGHT_RED#%s(%d)"):format(e.desc,dur), x, h, 255, 255, 255)) h = h + self.font_h
else
self:mouseTooltip(desc, s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s"):format(e.desc), x, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(desc, s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s(%d)"):format(e.desc,dur), x, h, 255, 255, 255)) h = h + self.font_h
end
end
......
......@@ -56,7 +56,7 @@ newTalent{
getHeal = function(self, t) return self:combatTalentSpellDamage(t, 4, 30) end,
getDuration = function(self, t) return self:getTalentLevel(t) + 2 end,
action = function(self, t)
local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
local tg = {type="ball", range=self:getTalentRange(t), radius=3}
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, t.getDuration(self, t),
......
......@@ -75,12 +75,14 @@ newTalent{
requires_target = true,
no_npc_use = true,
getGolemDamage = function(self, t)
local damage = 0
if self.alchemy_golem then
local golem = getGolem(self)
return golem:combatTalentWeaponDamage(t, 0.4, 1.1)
else
return 0
if golem then
return golem:combatTalentWeaponDamage(t, 0.4, 1.1)
end
end
return damage
end,
getDazeDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
action = function(self, t)
......
......@@ -45,7 +45,7 @@ newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/in
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/golemancy-base", name = "golemancy", hide = true, description = "Learn to craft and upgrade your golem." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/golemancy", name = "golemancy", description = "Learn to craft and upgrade your golem." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/advanced-golemancy", name = "advanced-golemancy", description = "Advanced golem operations." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/fire-alchemy", name = "fire alchemy", description = "Alchemical control over fire." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/fire-alchemy", name = "fire alchemy", description = "Alchemical control over fire." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/stone-alchemy-base", name = "stone alchemy", hide = true, description = "Manipulate gems, imbue their powers into other objects." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/stone-alchemy", name = "stone alchemy", generic = true, description = "Alchemical control over stone and gems." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/staff-combat", name = "staff combat", generic = true, description = "Harness the power of magical staves." }
......
......@@ -144,6 +144,7 @@ newTalent{
getDuration = function(self, t) return 3 + self:getTalentLevel(t) end,
getRadius = function(self, t) return 2 + (self:getTalentLevel(t)/2) end,
action = function(self, t)
local radius = t.getRadius(self, t)
local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
......@@ -152,7 +153,7 @@ newTalent{
game.level.map:addEffect(self,
x, y, t.getDuration(self, t),
DamageType.PHYSICAL_STUN, t.getDamage(self, t),
t.getRadius(self, t),
radius,
5, nil,
{type="quake"},
nil, self:spellFriendlyFire()
......
......@@ -121,7 +121,7 @@ newEffect{
newEffect{
name = "BURNING",
desc = "Burning",
long_desc = function(self, eff) return ("The target is on fire, doing %0.2f fire damage per turn."):format(eff.power) end,
long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn."):format(eff.power) end,
type = "magical",
status = "detrimental",
parameters = { power=10 },
......@@ -144,7 +144,7 @@ newEffect{
newEffect{
name = "POISONED",
desc = "Poisoned",
long_desc = function(self, eff) return ("The target is poisoned, doing %0.2f nature damage per turn."):format(eff.power) end,
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn."):format(eff.power) end,
type = "poison",
status = "detrimental",
parameters = { power=10 },
......@@ -243,7 +243,7 @@ newEffect{
newEffect{
name = "BURNING_SHOCK",
desc = "Burning Shock",
long_desc = function(self, eff) return ("The target is on fire, doing %0.2f fire damage per turn and making it unable to act."):format(eff.power) end,
long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn and making it unable to act."):format(eff.power) end,
type = "magical",
status = "detrimental",
parameters = {},
......@@ -288,7 +288,7 @@ newEffect{
newEffect{
name = "SPYDRIC_POISON",
desc = "Spydric Poison",
long_desc = function(self, eff) return ("The target is poisoned, doing %0.2f nature damage per turn and preventing any movements (but can still act freely)."):format(eff.power) end,
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and preventing any movements (but can still act freely)."):format(eff.power) end,
type = "poison",
status = "detrimental",
parameters = {power=10},
......@@ -457,7 +457,7 @@ newEffect{
newEffect{
name = "SPEED",
desc = "Speed",
long_desc = function(self, eff) return ("Increases global action speed by %d%%."):format((1 / (1 - eff.power) - 1) * 100) end,
long_desc = function(self, eff) return ("Increases global action speed by %d%%."):format(eff.power * 100) end,
type = "magical",
status = "beneficial",
parameters = { power=0.1 },
......@@ -474,7 +474,7 @@ newEffect{
newEffect{
name = "SLOW",
desc = "Slow",
long_desc = function(self, eff) return ("Reduces global action speed by %d%%."):format((1 / (1 - eff.power) - 1) * 100) end,
long_desc = function(self, eff) return ("Reduces global action speed by %d%%."):format( eff.power * 100) end,
type = "magical",
status = "detrimental",
parameters = { power=0.1 },
......@@ -1052,7 +1052,7 @@ newEffect{
newEffect{
name = "MIGHTY_BLOWS",
desc = "Migth Blows",
long_desc = function(self, eff) return ("The target's combat damage rating is improved by %d."):format(eff.power) end,
long_desc = function(self, eff) return ("The target's combat damage is improved by %d."):format(eff.power) end,
type = "physical",
status = "beneficial",
parameters = { power=10 },
......@@ -1156,7 +1156,7 @@ newEffect{
newEffect{
name = "CRIPPLE",
desc = "Cripple",
long_desc = function(self, eff) return ("The target is crippled, reducing attack by %d and damage rating by %d."):format(eff.atk, eff.dam) end,
long_desc = function(self, eff) return ("The target is crippled, reducing attack by %d and damage by %d."):format(eff.atk, eff.dam) end,
type = "physical",
status = "detrimental",
parameters = { atk=10, dam=10 },
......@@ -1175,7 +1175,7 @@ newEffect{
newEffect{
name = "WILLFUL_COMBAT",
desc = "Willful Combat",
long_desc = function(self, eff) return ("The target puts all its willpower into its blows, improving damage rating by %d."):format(eff.power) end,
long_desc = function(self, eff) return ("The target puts all its willpower into its blows, improving damage by %d."):format(eff.power) end,
type = "physical",
status = "beneficial",
parameters = { power=10 },
......@@ -1419,7 +1419,7 @@ newEffect{
newEffect{
name = "ACID_SPLASH",
desc = "Acid Splash",
long_desc = function(self, eff) return ("The target has been splashed with acid, doing %0.2f acid damage per turn, reducing armour by %d and attack by %d."):format(eff.dam, eff.armor or 0, eff.atk) end,
long_desc = function(self, eff) return ("The target has been splashed with acid, taking %0.2f acid damage per turn, reducing armour by %d and attack by %d."):format(eff.dam, eff.armor or 0, eff.atk) end,
type = "magical",
status = "detrimental",
parameters = {},
......@@ -1544,7 +1544,7 @@ newEffect{
newEffect{
name = "GLOOM_SLOW",
desc = "Slowed by the gloom",
long_desc = function(self, eff) return ("The gloom reduces the target's global speed by %d%%."):format((1 / (1 - eff.power) - 1) * 100) end,
long_desc = function(self, eff) return ("The gloom reduces the target's global speed by %d%%."):format(eff.power * 100) end,
type = "mental",
status = "detrimental",
parameters = { power=0.1 },
......@@ -1670,7 +1670,7 @@ newEffect{
newEffect{
name = "DOMINATED",
desc = "Dominated",
long_desc = function(self, eff) return "The target is dominated, increasing damage done to it by its master." end,
long_desc = function(self, eff) return ("The target is dominated, increasing damage done to it by its master by %d%%."):format(eff.dominatedDamMult * 100) end,
type = "mental",
status = "detrimental",
on_gain = function(self, err) return "#F53CBE##Target# has been dominated!", "+Dominated" end,
......@@ -1838,7 +1838,7 @@ newEffect{
newEffect{
name = "BLOOD_FURY",
desc = "Bloodfury",
long_desc = function(self, eff) return ("The target's blight damage is increased by %d%%."):format(eff.power) end,
long_desc = function(self, eff) return ("The target's blight and acid damage is increased by %d%%."):format(eff.power) end,
type = "magical",
status = "beneficial",
parameters = { power=10 },
......@@ -1853,7 +1853,7 @@ newEffect{
newEffect{
name = "UNSTOPPABLE",
desc = "Unstoppable",
long_desc = function(self, eff) return "The target is unstoppable! It refuses to die." end,
long_desc = function(self, eff) return ("The target is unstoppable! It refuses to die, at the end it will heal it for %d."):format(eff.kills * eff.hp_per_kill * self.max_life / 100) end,
type = "physical",
status = "beneficial",
parameters = { hp_per_kill=2 },
......@@ -2009,7 +2009,7 @@ newEffect{
newEffect{
name = "NO_SUMMON",
desc = "Suppress Summon",
long_desc = function(self, eff) return "You cannot summon." end,
long_desc = function(self, eff) return "Your summons are suppressed by some force." end,
type = "physical",
status = "detrimental",
parameters = {},
......@@ -2127,7 +2127,7 @@ newEffect{
newEffect{
name = "CORROSIVE_WORM",
desc = "Corrosive Worm",
long_desc = function(self, eff) return ("Target is infected with a corrosive worm doing %0.2f acid damage per turn."):format(eff.dam) end,
long_desc = function(self, eff) return ("Target is infected with a corrosive worm taking %0.2f acid damage per turn."):format(eff.dam) end,
type = "magical",
status = "detrimental",
parameters = { dam=1, explosion=10 },
......@@ -2306,7 +2306,7 @@ newEffect{
newEffect{
name = "EMPOWERED_HEALING",
desc = "Empowered Healing",
long_desc = function(self, eff) return ("Increases the effectiveness of all healing the target receives."):format(eff.power) end,
long_desc = function(self, eff) return ("Increases the effectiveness of all healing the target receives by %d%%."):format(eff.power * 100) end,
type = "magical",
status = "beneficial",
parameters = { power= 0.1 },
......@@ -2321,7 +2321,7 @@ newEffect{
newEffect{
name = "PROVIDENCE",
desc = "Providence",
long_desc = function(self, eff) return "The target is under protection." end,
long_desc = function(self, eff) return ("The target is under protection also his life regeneration is boosted by %d."):format(eff.power) end,
type = "magical",
status = "beneficial",
parameters = {},
......@@ -2580,7 +2580,7 @@ newEffect{
newEffect{
name = "TOTALITY",
desc = "Totality",
long_desc = function(self, eff) return ("The target's light and darkness spell penetration has been increased by %d%%."):format(eff.power, eff.power) end,
long_desc = function(self, eff) return ("The target's light and darkness spell penetration has been increased by %d%%."):format(eff.power) end,
type = "magical",
status = "beneficial",
parameters = { power=10 },
......
......@@ -391,7 +391,7 @@ end
function _M:learnType(tt, v)
if v then
if self.actor:knowTalentType(tt) and self.actor.__increased_talent_types[tt] and self.actor.__increased_talent_types[tt] >= 1 then
self:simplePopup("Impossible", "You can only improve a category mastery twice!")
self:simplePopup("Impossible", "You can only improve a category mastery once!")
return
end
if self.actor.unused_talents_types == 0 then
......
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