Commit 9eebbb12858f83e7581717b6da1ef1de26225b43

Authored by dg
1 parent a6826999

added unique shaders

Refitted all damage formulas to use more explicit and generic (and bound) functions


git-svn-id: http://svn.net-core.org/repos/t-engine4@831 51575b47-30f0-44d4-a5cc-537603b46e54
Showing 31 changed files with 1097 additions and 176 deletions
... ... @@ -526,7 +526,7 @@ function _M:setupCommands()
526 526 [{"_d","ctrl"}] = function()
527 527 if config.settings.tome.cheat then
528 528 self.player:forceLevelup(50)
529   - self:changeLevel(1, "rak-shor-pride")
  529 + self:changeLevel(1, "moria")
530 530 end
531 531 end,
532 532 }
... ...
... ... @@ -493,6 +493,13 @@ function _M:combatTalentSpellDamage(t, base, max)
493 493 return (base + self:combatSpellpower()) * ((math.sqrt(self:getTalentLevel(t)) - 1) * 0.8 + 1) * mod
494 494 end
495 495
  496 +--- Gets weapon damage mult based on talent
  497 +function _M:combatTalentWeaponDamage(t, base, max, t2)
  498 + if t2 then t2 = t2 / 2 else t2 = 0 end
  499 + local diff = max - base
  500 + return base + diff * math.sqrt((self:getTalentLevel(t) + t2) / 5)
  501 +end
  502 +
496 503 --- Gets spellcrit
497 504 function _M:combatSpellCrit()
498 505 return self.combat_spellcrit + (self:getCun() - 10) * 0.3 + (self:getLck() - 50) * 0.30 + 1
... ...
  1 +uniform vec2 texSize;
  2 +uniform sampler2D tex;
  3 +uniform sampler3D noiseVol;
  4 +uniform vec4 color;
  5 +uniform float tick;
  6 +
  7 +int blursize = 2;
  8 +
  9 +void main(void)
  10 +{
  11 + float fTime0_1 = tick / 1000;
  12 + vec2 offset = 1.0/texSize;
  13 +
  14 + // Center Pixel
  15 + vec4 sample = vec4(0.0,0.0,0.0,0.0);
  16 + vec4 center = texture2D(tex, vec2(gl_TexCoord[0].st));
  17 + float factor = ((float(blursize)*2.0)+1.0);
  18 + factor = factor*factor;
  19 +
  20 + for(int i = -blursize; i <= blursize; i++)
  21 + {
  22 + for(int j = -blursize; j <= blursize; j++)
  23 + {
  24 + sample += texture2D(tex, vec2(gl_TexCoord[0].xy+vec2(float(i)*offset.x, float(j)*offset.y)));
  25 + }
  26 + }
  27 +
  28 + // keycolor trick
  29 + float a = 1.0-center.a;
  30 + // float a = 1.0-center.r;
  31 +
  32 + float delta = sample.a;
  33 + // float delta = max(max(sample.r,sample.g),sample.b)/factor;
  34 + float noise = texture3D(noiseVol, vec3(gl_TexCoord[0].xy,fTime0_1)).r;
  35 + gl_FragColor = mix(center,delta*color*noise,a);
  36 +
  37 + /*
  38 + float delta = sample.a;
  39 + // float delta = max(max(sample.r,sample.g),sample.b)/factor;
  40 + gl_FragColor = mix(center,delta*color,a);
  41 + */
  42 +
  43 + /*
  44 + gl_FragColor = mix(center,sample/factor,a);
  45 + */
  46 +}
... ...
  1 +-- ToME - Tales of Middle-Earth
  2 +-- Copyright (C) 2009, 2010 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +return {
  21 + frag = "unique_glow",
  22 + vert = nil,
  23 + args = {
  24 + color = color or {1,1,1,1},
  25 + texSize = size or {32, 32},
  26 + },
  27 + clone = false,
  28 +}
... ...
... ... @@ -31,7 +31,7 @@ newTalent{
31 31 local x, y, target = self:getTarget(tg)
32 32 if not x or not y or not target then return nil end
33 33 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
34   - local hitted = self:attackTarget(target, nil, 0.2 + self:getTalentLevel(t) / 12, true)
  34 + local hitted = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.2, 0.7), true)
35 35
36 36 if hitted then
37 37 if target:checkHit(self:combatAttackDex(), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
... ... @@ -45,7 +45,7 @@ newTalent{
45 45 end,
46 46 info = function(self, t)
47 47 return ([[You hit your target doing %d%% damage, trying to stun it instead of damaging it. If your attack hits, the target is stunned for %d turns.]]):
48   - format(100 * (0.2 + self:getTalentLevel(t) / 12), 3 + math.ceil(self:getTalentLevel(t)))
  48 + format(100 * self:combatTalentWeaponDamage(t, 0.2, 0.7), 3 + math.ceil(self:getTalentLevel(t)))
49 49 end,
50 50 }
51 51
... ... @@ -107,7 +107,7 @@ newTalent{
107 107 local x, y, target = self:getTarget(tg)
108 108 if not x or not y or not target then return nil end
109 109 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
110   - local hitted = self:attackTarget(target, nil, 0.9 + self:getTalentLevel(t) / 9, true)
  110 + local hitted = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.9, 1.4), true)
111 111
112 112 if hitted then
113 113 if target:checkHit(self:combatAttackDex(), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) then
... ... @@ -128,6 +128,6 @@ newTalent{
128 128 end,
129 129 info = function(self, t)
130 130 return ([[You hit your target doing %d%% damage. If your attack hits, the target is crippled for %d turns, losing %d%% attack and %d%% damage.]]):
131   - format(100 * (0.9 + self:getTalentLevel(t) / 9), 3 + math.ceil(self:getTalentLevel(t)), 10 + self:getTalentLevel(t) * 3, 10 + self:getTalentLevel(t) * 4)
  131 + format(100 * self:combatTalentWeaponDamage(t, 0.9, 1.4), 3 + math.ceil(self:getTalentLevel(t)), 10 + self:getTalentLevel(t) * 3, 10 + self:getTalentLevel(t) * 4)
132 132 end,
133 133 }
... ...
... ... @@ -41,7 +41,7 @@ newTalent{
41 41 local x, y, target = self:getTarget(tg)
42 42 if not x or not y or not target then return nil end
43 43 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
44   - local hitted = self:attackTarget(target, nil, 0.8 + self:getTalentLevel(t) / 10, true)
  44 + local hitted = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.8, 1.4), true)
45 45
46 46 if hitted then
47 47 local dur = 5 + math.ceil(self:getTalentLevel(t))
... ... @@ -54,7 +54,7 @@ newTalent{
54 54 info = function(self, t)
55 55 return ([[You hit your target doing %d%% damage. If your attack hits, you gain %d armour penetration for %d turns.
56 56 The APR will increase with Cunning.]]):
57   - format(100 * (0.8 + self:getTalentLevel(t) / 10), 4 + (self:getTalentLevel(t) * self:getCun()) / 20, 5 + math.ceil(self:getTalentLevel(t)))
  57 + format(100 * self:combatTalentWeaponDamage(t, 0.8, 1.4), 4 + (self:getTalentLevel(t) * self:getCun()) / 20, 5 + math.ceil(self:getTalentLevel(t)))
58 58 end,
59 59 }
60 60
... ...
... ... @@ -43,8 +43,8 @@ newTalent{
43 43 range = 20,
44 44 activate = function(self, t)
45 45 cancelChants(self)
46   - local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.12)
47   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  46 + local power = self:combatTalentSpellDamage(t, 5, 70)
  47 + local dam = self:combatTalentSpellDamage(t, 5, 25)
48 48 game:playSoundNear(self, "talents/spell_generic2")
49 49 local ret = {
50 50 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
... ... @@ -65,7 +65,7 @@ newTalent{
65 65 return ([[Chant the glory of the sun, granting you %d physical and spell resistance.
66 66 In addition it surrounds you with a shield of light, damaging anything that attacks you for %0.2f light damage.
67 67 You may only have one Chant active at once.
68   - The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.12), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  68 + The resistance and damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 70), self:combatTalentSpellDamage(t, 5, 25))
69 69 end,
70 70 }
71 71
... ... @@ -83,8 +83,8 @@ newTalent{
83 83 range = 20,
84 84 activate = function(self, t)
85 85 cancelChants(self)
86   - local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
87   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  86 + local power = self:combatTalentSpellDamage(t, 5, 35)
  87 + local dam = self:combatTalentSpellDamage(t, 5, 25)
88 88 game:playSoundNear(self, "talents/spell_generic2")
89 89 local ret = {
90 90 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
... ... @@ -103,7 +103,7 @@ newTalent{
103 103 return ([[Chant the glory of the sun, granting you %d%% physical damage resistance.
104 104 In addition it surrounds you with a shield of light, damaging anything that attacks you for %0.2f light damage.
105 105 You may only have one Chant active at once.
106   - The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  106 + The resistance and damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 35), self:combatTalentSpellDamage(t, 5, 25))
107 107 end,
108 108 }
109 109
... ... @@ -121,8 +121,8 @@ newTalent{
121 121 range = 20,
122 122 activate = function(self, t)
123 123 cancelChants(self)
124   - local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
125   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  124 + local power = self:combatTalentSpellDamage(t, 5, 35)
  125 + local dam = self:combatTalentSpellDamage(t, 5, 25)
126 126 game:playSoundNear(self, "talents/spell_generic2")
127 127 local ret = {
128 128 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
... ... @@ -146,7 +146,7 @@ newTalent{
146 146 return ([[Chant the glory of the sun, granting you %d%% elemental resistances.
147 147 In addition it surrounds you with a shield of light, damaging anything that attacks you for %0.2f light damage.
148 148 You may only have one Chant active at once.
149   - The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  149 + The resistance and damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 35), self:combatTalentSpellDamage(t, 5, 25))
150 150 end,
151 151 }
152 152
... ... @@ -164,8 +164,8 @@ newTalent{
164 164 range = 20,
165 165 activate = function(self, t)
166 166 cancelChants(self)
167   - local power = 10 + self:getTalentLevel(t) * self:combatSpellpower(0.10)
168   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  167 + local power = self:combatTalentSpellDamage(t, 10, 50)
  168 + local dam = self:combatTalentSpellDamage(t, 5, 25)
169 169 game:playSoundNear(self, "talents/spell_generic2")
170 170 local ret = {
171 171 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
... ... @@ -184,6 +184,6 @@ newTalent{
184 184 return ([[Chant the glory of the sun, granting you %d%% more light damage.
185 185 In addition it surrounds you with a shield of light, damaging anything that attacks you for %0.2f light damage.
186 186 You may only have one Chant active at once.
187   - The damage will increase with the Magic stat]]):format(10 + self:getTalentLevel(t) * self:combatSpellpower(0.10), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  187 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 50), self:combatTalentSpellDamage(t, 5, 25))
188 188 end,
189 189 }
... ...
... ... @@ -98,7 +98,7 @@ newTalent{
98 98 local _ _, x, y = self:canProject(tg, x, y)
99 99 local target = game.level.map(x, y, Map.ACTOR)
100 100 if target then
101   - self:attackTarget(target, nil, 1.1 + self:getTalentLevel(t) / 7, true)
  101 + self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 1.1, 1.9), true)
102 102 else
103 103 return
104 104 end
... ... @@ -107,7 +107,7 @@ newTalent{
107 107 info = function(self, t)
108 108 return ([[In a pure display of power you project a melee attack up to a range of %d, doing %d%% damage.
109 109 The range will increase with the Strength stat]]):
110   - format(self:getTalentRange(t), 100 * (1.1 + self:getTalentLevel(t) / 7))
  110 + format(self:getTalentRange(t), 100 * self:combatTalentWeaponDamage(t, 1.1, 1.9))
111 111 end,
112 112 }
113 113
... ... @@ -127,11 +127,11 @@ newTalent{
127 127 local x, y, target = self:getTarget(tg)
128 128 if not x or not y or not target then return nil end
129 129 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
130   - self:attackTarget(target, DamageType.LIGHT, 1.1 + self:getTalentLevel(t) / 7, true)
  130 + self:attackTarget(target, DamageType.LIGHT, self:combatTalentWeaponDamage(t, 1.1, 1.9), true)
131 131 return true
132 132 end,
133 133 info = function(self, t)
134 134 return ([[Concentrate the power of the sun in a single blow doing %d%% light damage.]]):
135   - format(100 * (1.1 + self:getTalentLevel(t) / 7))
  135 + format(100 * self:combatTalentWeaponDamage(t, 1.1, 1.9))
136 136 end,
137 137 }
... ...
... ... @@ -77,7 +77,7 @@ newTalent{
77 77 cooldown = 20,
78 78 positive = -10,
79 79 action = function(self, t)
80   - local dam = 15 + self:combatSpellpower(0.37) * self:getTalentLevel(t)
  80 + local dam = self:combatTalentSpellDamage(t, 20, 150)
81 81 local trap = Trap.new{
82 82 name = "glyph of explosion",
83 83 type = "elemental", id_by_type=true, unided_name = "trap",
... ... @@ -116,7 +116,7 @@ newTalent{
116 116 info = function(self, t)
117 117 return ([[You bind light in a glyph on the floor, the first target passing by will be hit by a blast of light doing %0.2f damage.
118 118 The glyph lasts for %d turns.
119   - The damage will increase with the Magic stat]]):format(15 + self:combatSpellpower(0.37) * self:getTalentLevel(t), 2 + self:getTalentLevel(t))
  119 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 20, 150), 2 + self:getTalentLevel(t))
120 120 end,
121 121 }
122 122
... ...
... ... @@ -43,8 +43,8 @@ newTalent{
43 43 range = 20,
44 44 activate = function(self, t)
45 45 cancelHymns(self)
46   - local power = 10 + self:getTalentLevel(t) * self:combatSpellpower(0.10)
47   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  46 + local power = self:combatTalentSpellDamage(t, 10, 50)
  47 + local dam = self:combatTalentSpellDamage(t, 5, 25)
48 48 game:playSoundNear(self, "talents/spell_generic2")
49 49 local ret = {
50 50 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.DARKNESS]=dam}),
... ... @@ -63,7 +63,7 @@ newTalent{
63 63 return ([[Chant the glory of the moon, granting you %d%% more darkness damage.
64 64 In addition it surrounds you with a shield of shadows, damaging anything that attacks you for %0.2f darkness damage.
65 65 You may only have one Hymn active at once.
66   - The damage will increase with the Magic stat]]):format(10 + self:getTalentLevel(t) * self:combatSpellpower(0.10), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  66 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 50), self:combatTalentSpellDamage(t, 5, 25))
67 67 end,
68 68 }
69 69
... ... @@ -81,8 +81,10 @@ newTalent{
81 81 range = 20,
82 82 activate = function(self, t)
83 83 cancelHymns(self)
  84 + local dam = self:combatTalentSpellDamage(t, 5, 25)
84 85 game:playSoundNear(self, "talents/spell_generic2")
85 86 local ret = {
  87 + onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.DARKNESS]=dam}),
86 88 infravision = self:addTemporaryValue("infravision", math.floor(5 + self:getTalentLevel(t))),
87 89 particle = self:addParticles(Particles.new("darkness_shield", 1))
88 90 }
... ... @@ -90,14 +92,15 @@ newTalent{
90 92 end,
91 93 deactivate = function(self, t, p)
92 94 self:removeParticles(p.particle)
  95 + self:removeTemporaryValue("on_melee_hit", p.onhit)
93 96 self:removeTemporaryValue("infravision", p.infravision)
94 97 return true
95 98 end,
96 99 info = function(self, t)
97 100 return ([[Chant the glory of the moon, granting you infravision up to %d grids.
98   - In addition it surrounds you with a shield of darkness, damaging anything that attacks you for %0.2f light damage.
  101 + In addition it surrounds you with a shield of darkness, damaging anything that attacks you for %0.2f darkness damage.
99 102 You may only have one Hymn active at once.
100   - The resistance and damage will increase with the Magic stat]]):format(math.floor(5 + self:getTalentLevel(t)), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  103 + The resistance and damage will increase with the Magic stat]]):format(math.floor(5 + self:getTalentLevel(t)), self:combatTalentSpellDamage(t, 5, 25))
101 104 end,
102 105 }
103 106
... ... @@ -115,8 +118,7 @@ newTalent{
115 118 range = 20,
116 119 activate = function(self, t)
117 120 cancelHymns(self)
118   - local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
119   - local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
  121 + local dam = self:combatTalentSpellDamage(t, 5, 25)
120 122 game:playSoundNear(self, "talents/spell_generic2")
121 123 local ret = {
122 124 onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.DARKNESS]=dam}),
... ... @@ -139,7 +141,7 @@ newTalent{
139 141 return ([[Chant the glory of the moon, granting you %d%% stun, blindness and confusion resistances.
140 142 In addition it surrounds you with a shield of darkness, damaging anything that attacks you for %0.2f light damage.
141 143 You may only have one Hymn active at once.
142   - The damage will increase with the Magic stat]]):format(100 * (0.2 + self:getTalentLevel(t) / 10), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
  144 + The damage will increase with the Magic stat]]):format(100 * (0.2 + self:getTalentLevel(t) / 10), self:combatTalentSpellDamage(t, 5, 25))
143 145 end,
144 146 }
145 147
... ... @@ -180,7 +182,7 @@ newTalent{
180 182 local a, id = rng.table(tgts)
181 183 table.remove(tgts, id)
182 184
183   - self:project(tg, a.x, a.y, DamageType.DARKNESS, rng.avg(1, self:spellCrit(20 + self:combatSpellpower(0.2) * self:getTalentLevel(t)), 3))
  185 + self:project(tg, a.x, a.y, DamageType.DARKNESS, rng.avg(1, self:spellCrit(self:combatTalentSpellDamage(t, 7, 80)), 3))
184 186 game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(a.x-self.x), math.abs(a.y-self.y)), "shadow_beam", {tx=a.x-self.x, ty=a.y-self.y})
185 187 game:playSoundNear(self, "talents/spell_generic")
186 188 end
... ... @@ -202,6 +204,6 @@ newTalent{
202 204 return ([[Conjures a shroud of dancing shadows with a radius of 5 that follows you as long as this spell is active.
203 205 Each turn a random shadow beam will hit up to %d of your foes for 1 to %0.2f damage.
204 206 This powerful spell will continuously drain negative energy while active.
205   - The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), 20 + self:combatSpellpower(0.2) * self:getTalentLevel(t))
  207 + The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), self:combatTalentSpellDamage(t, 7, 80))
206 208 end,
207 209 }
... ...
... ... @@ -28,13 +28,13 @@ newTalent{
28 28 HEAL = 10,
29 29 },
30 30 action = function(self, t)
31   - self:heal(self:spellCrit(20 + self:combatSpellpower(0.5) * self:getTalentLevel(t)), self)
  31 + self:heal(self:spellCrit(self:combatTalentSpellDamage(t, 20, 240)), self)
32 32 game:playSoundNear(self, "talents/heal")
33 33 return true
34 34 end,
35 35 info = function(self, t)
36 36 return ([[An invigorating ray of sun shines on you, healing your body for %d life.
37   - The life healed will increase with the Magic stat]]):format(20 + self:combatSpellpower(0.5) * self:getTalentLevel(t))
  37 + The life healed will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 20, 240))
38 38 end,
39 39 }
40 40
... ... @@ -51,7 +51,7 @@ newTalent{
51 51 action = function(self, t)
52 52 local duration = self:getTalentLevel(t) + 2
53 53 local radius = 3
54   - local dam = 5 + self:combatSpellpower(0.20) * self:getTalentLevel(t)
  54 + local dam = self:combatTalentSpellDamage(t, 4, 20)
55 55 local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
56 56 -- Add a lasting map effect
57 57 game.level.map:addEffect(self,
... ... @@ -67,7 +67,7 @@ newTalent{
67 67 end,
68 68 info = function(self, t)
69 69 return ([[A magical zone of sunlight appears around you, healing all that stand within.
70   - The life healed will increase with the Magic stat]]):format(5 + self:combatSpellpower(0.20) * self:getTalentLevel(t))
  70 + The life healed will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 4, 20))
71 71 end,
72 72 }
73 73
... ... @@ -79,12 +79,12 @@ newTalent{
79 79 positive = -20,
80 80 cooldown = 60,
81 81 action = function(self, t)
82   - self:setEffect(self.EFF_DAMAGE_SHIELD, 10, {power=(10 + self:getMag(30)) * self:getTalentLevel(t)})
  82 + self:setEffect(self.EFF_DAMAGE_SHIELD, 10, {power=self:combatTalentSpellDamage(t, 30, 170)})
83 83 game:playSoundNear(self, "talents/heal")
84 84 return true
85 85 end,
86 86 info = function(self, t)
87   - return ([[A protective shield forms around you, negating %d damage.]]):format((10 + self:getMag(30)) * self:getTalentLevel(t))
  87 + return ([[A protective shield forms around you, negating %d damage.]]):format(self:combatTalentSpellDamage(t, 30, 170))
88 88 end,
89 89 }
90 90
... ...
... ... @@ -33,7 +33,7 @@ newTalent{
33 33 local tg = {type="beam", range=self:getTalentRange(t), talent=t}
34 34 local x, y = self:getTarget(tg)
35 35 if not x or not y then return nil end
36   - self:project(tg, x, y, DamageType.DARKNESS, self:spellCrit(14 + self:combatSpellpower(0.5) * self:getTalentLevel(t)))
  36 + self:project(tg, x, y, DamageType.DARKNESS, self:spellCrit(self:combatTalentSpellDamage(t, 14, 230)))
37 37 local _ _, x, y = self:canProject(tg, x, y)
38 38 game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(x-self.x), math.abs(y-self.y)), "shadow_beam", {tx=x-self.x, ty=y-self.y})
39 39 game:playSoundNear(self, "talents/flame")
... ... @@ -41,7 +41,7 @@ newTalent{
41 41 end,
42 42 info = function(self, t)
43 43 return ([[Calls the power of the Moon into a beam of shadows doing %0.2f damage.
44   - The damage will increase with the Magic stat]]):format(14 + self:combatSpellpower(0.5) * self:getTalentLevel(t))
  44 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 14, 230))
45 45 end,
46 46 }
47 47
... ... @@ -59,12 +59,12 @@ newTalent{
59 59 action = function(self, t)
60 60 local duration = self:getTalentLevel(t) + 2
61 61 local radius = 3
62   - local dam = 4 + self:combatSpellpower(0.12) * self:getTalentLevel(t)
  62 + local dam = self:combatTalentSpellDamage(t, 4, 50)
63 63 local tg = {type="ball", range=self:getTalentRange(t), radius=radius, friendlyfire=self:spellFriendlyFire()}
64 64 local x, y = self:getTarget(tg)
65 65 if not x or not y then return nil end
66 66 local _ _, x, y = self:canProject(tg, x, y)
67   - local grids = self:project(tg, x, y, DamageType.DARKNESS, self:spellCrit(5 + self:combatSpellpower(0.22) * self:getTalentLevel(t)), {type="shadow"})
  67 + local grids = self:project(tg, x, y, DamageType.DARKNESS, self:spellCrit(self:combatTalentSpellDamage(t, 5, 120)), {type="shadow"})
68 68 -- Add a lasting map effect
69 69 game.level.map:addEffect(self,
70 70 x, y, duration,
... ... @@ -84,8 +84,8 @@ newTalent{
84 84 return ([[Invokes a blast of shadows dealing %0.2f darkness damage and leaving a field that does %0.2f darkness damage per turn for %d turns..
85 85 The damage will increase with the Magic stat]]):
86 86 format(
87   - 5 + self:combatSpellpower(0.22) * self:getTalentLevel(t),
88   - 4 + self:combatSpellpower(0.12) * self:getTalentLevel(t),
  87 + self:combatTalentSpellDamage(t, 5, 120),
  88 + self:combatTalentSpellDamage(t, 4, 50),
89 89 self:getTalentLevel(t) + 2
90 90 )
91 91 end,
... ... @@ -117,8 +117,8 @@ newTalent{
117 117 It also regenerates both your negative and positive energies.
118 118 The damage will increase with the Magic stat]]):
119 119 format(
120   - 10 + self:combatSpellpower(0.2) * self:getTalentLevel(t),
121   - 10 + self:combatSpellpower(0.2) * self:getTalentLevel(t),
  120 + self:combatTalentSpellDamage(t, 10, 100),
  121 + self:combatTalentSpellDamage(t, 10, 100),
122 122 self:getTalentRange(t)
123 123 )
124 124 end,
... ... @@ -139,7 +139,7 @@ newTalent{
139 139 local tg = {type="ball", range=self:getTalentRange(t), radius=1 + math.floor(self:getTalentLevelRaw(t) / 3), friendlyfire=self:spellFriendlyFire(), talent=t}
140 140 local x, y = self:getTarget(tg)
141 141 if not x or not y then return nil end
142   - local grids = self:project(tg, x, y, DamageType.DARKSTUN, self:spellCrit(28 + self:combatSpellpower(0.5) * self:getTalentLevel(t)))
  142 + local grids = self:project(tg, x, y, DamageType.DARKSTUN, self:spellCrit(self:combatTalentSpellDamage(t, 28, 170)))
143 143
144 144 local _ _, x, y = self:canProject(tg, x, y)
145 145 game.level.map:particleEmitter(x, y, tg.radius, "shadow_flash", {radius=tg.radius, grids=grids, tx=x, ty=y})
... ... @@ -148,6 +148,6 @@ newTalent{
148 148 end,
149 149 info = function(self, t)
150 150 return ([[A star falls onto the target, stunning all and doing %0.2f darkness damage.
151   - The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), 28 + self:combatSpellpower(0.5) * self:getTalentLevel(t))
  151 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 28, 170))
152 152 end,
153 153 }
... ...
... ... @@ -33,13 +33,13 @@ newTalent{
33 33 local tg = {type="hit", range=self:getTalentRange(t), talent=t}
34 34 local x, y = self:getTarget(tg)
35 35 if not x or not y then return nil end
36   - self:project(tg, x, y, DamageType.LIGHT, self:spellCrit(6 + self:combatSpellpower(0.3) * self:getTalentLevel(t)), {type="light"})
  36 + self:project(tg, x, y, DamageType.LIGHT, self:spellCrit(self:combatTalentSpellDamage(t, 6, 160)), {type="light"})
37 37
38 38 local _ _, x, y = self:canProject(tg, x, y)
39 39 -- Add a lasting map effect
40 40 game.level.map:addEffect(self,
41 41 x, y, 4,
42   - DamageType.LIGHT, 6 + self:combatSpellpower(0.3) * self:getTalentLevel(t),
  42 + DamageType.LIGHT, self:combatTalentSpellDamage(t, 6, 80),
43 43 0,
44 44 5, nil,
45 45 {type="light_zone"},
... ... @@ -51,7 +51,7 @@ newTalent{
51 51 end,
52 52 info = function(self, t)
53 53 return ([[Calls the power of the Sun into a searing light doing %0.2f damage and leaving a spot on the ground for 4 turns doing %0.2f damage.
54   - The damage will increase with the Magic stat]]):format(6 + self:combatSpellpower(0.3) * self:getTalentLevel(t), 6 + self:combatSpellpower(0.3) * self:getTalentLevel(t))
  54 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 6, 160), self:combatTalentSpellDamage(t, 6, 80))
55 55 end,
56 56 }
57 57
... ... @@ -72,7 +72,7 @@ newTalent{
72 72 tg.friendlyfire = false
73 73 local grids = self:project(tg, self.x, self.y, DamageType.BLIND, 3 + self:getTalentLevel(t))
74 74 if self:getTalentLevel(t) then
75   - self:project(tg, self.x, self.y, DamageType.LIGHT, 4 + self:combatSpellpower(0.15) * self:getTalentLevel(t))
  75 + self:project(tg, self.x, self.y, DamageType.LIGHT, self:combatTalentSpellDamage(t, 4, 80))
76 76 end
77 77 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})
78 78 game:playSoundNear(self, "talents/flame")
... ... @@ -83,7 +83,7 @@ newTalent{
83 83 At level 3 it will start dealing %0.2f light damage.
84 84 The damage will increase with the Magic stat]]):
85 85 format(
86   - 4 + self:combatSpellpower(0.15) * self:getTalentLevel(t)
  86 + self:combatTalentSpellDamage(t, 4, 80)
87 87 )
88 88 end,
89 89 }
... ... @@ -103,7 +103,7 @@ newTalent{
103 103 local tg = {type="beam", range=self:getTalentRange(t), talent=t}
104 104 local x, y = self:getTarget(tg)
105 105 if not x or not y then return nil end
106   - self:project(tg, x, y, DamageType.FIRE, self:spellCrit(10 + self:combatSpellpower(0.4) * self:getTalentLevel(t)))
  106 + self:project(tg, x, y, DamageType.FIRE, self:spellCrit(self:combatTalentSpellDamage(t, 10, 200)))
107 107 local _ _, x, y = self:canProject(tg, x, y)
108 108 game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(x-self.x), math.abs(y-self.y)), "light_beam", {tx=x-self.x, ty=y-self.y})
109 109
... ... @@ -113,7 +113,7 @@ newTalent{
113 113 info = function(self, t)
114 114 return ([[Fire a beam of sun flames at your foes, burning all those in line for %0.2f fire damage.
115 115 The damage will increase with the Magic stat]]):
116   - format(10 + self:combatSpellpower(0.4) * self:getTalentLevel(t))
  116 + format(self:combatTalentSpellDamage(t, 10, 200))
117 117 end,
118 118 }
119 119
... ... @@ -130,7 +130,7 @@ newTalent{
130 130 range = 3,
131 131 action = function(self, t)
132 132 local tg = {type="ball", range=0, radius=3, friendlyfire=false, talent=t}
133   - local grids = self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(10 + self:combatSpellpower(0.27) * self:getTalentLevel(t)))
  133 + local grids = self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(self:combatTalentSpellDamage(t, 10, 160)))
134 134
135 135 game.level.map:particleEmitter(self.x, self.y, tg.radius, "sunburst", {radius=tg.radius, grids=grids, tx=self.x, ty=self.y})
136 136
... ... @@ -139,6 +139,6 @@ newTalent{
139 139 end,
140 140 info = function(self, t)
141 141 return ([[Conjures a furious burst of sunlight, dealing %0.2f light damage to all those around you in a radius of 4.
142   - The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), 10 + self:combatSpellpower(0.27) * self:getTalentLevel(t))
  142 + The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), self:combatTalentSpellDamage(t, 10, 160))
143 143 end,
144 144 }
... ...
... ... @@ -90,7 +90,7 @@ newTalent{
90 90 local x, y, target = self:getTarget(tg)
91 91 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
92 92 self.combat_apr = self.combat_apr + 1000
93   - self:attackTarget(target, DamageType.ACID, 1 + self:getTalentLevel(t) / 3, true)
  93 + self:attackTarget(target, DamageType.ACID, self:combatTalentWeaponDamage(t, 1, 1.8), true)
94 94 self.combat_apr = self.combat_apr - 1000
95 95 return true
96 96 end,
... ... @@ -113,7 +113,7 @@ newTalent{
113 113 if not x or not y or not target then return nil end
114 114 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
115 115 self.combat_apr = self.combat_apr + 1000
116   - self:attackTarget(target, DamageType.BLIND, 0.8 + self:getTalentLevel(t) / 10, true)
  116 + self:attackTarget(target, DamageType.BLIND, self:combatTalentWeaponDamage(t, 0.8, 1.4), true)
117 117 self.combat_apr = self.combat_apr - 1000
118 118 return true
119 119 end,
... ... @@ -156,7 +156,7 @@ newTalent{
156 156 local x, y, target = self:getTarget(tg)
157 157 if not x or not y or not target then return nil end
158 158 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
159   - local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
  159 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.5, 1), true)
160 160
161 161 -- Try to stun !
162 162 if hit then
... ... @@ -170,7 +170,7 @@ newTalent{
170 170 return true
171 171 end,
172 172 info = function(self, t)
173   - return ([[Hits the target doing %d%% damage, if the attack hits, the target is stunned.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
  173 + return ([[Hits the target doing %d%% damage, if the attack hits, the target is stunned.]]):format(100 * self:combatTalentWeaponDamage(t, 0.5, 1))
174 174 end,
175 175 }
176 176
... ... @@ -186,7 +186,7 @@ newTalent{
186 186 local x, y, target = self:getTarget(tg)
187 187 if not x or not y or not target then return nil end
188 188 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
189   - local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
  189 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.5, 1), true)
190 190
191 191 -- Try to stun !
192 192 if hit then
... ... @@ -200,7 +200,7 @@ newTalent{
200 200 return true
201 201 end,
202 202 info = function(self, t)
203   - return ([[Hits the target doing %d%% damage, if the attack hits, the target is constricted.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
  203 + return ([[Hits the target doing %d%% damage, if the attack hits, the target is constricted.]]):format(100 * self:combatTalentWeaponDamage(t, 0.5, 1))
204 204 end,
205 205 }
206 206
... ... @@ -216,7 +216,7 @@ newTalent{
216 216 local x, y, target = self:getTarget(tg)
217 217 if not x or not y or not target then return nil end
218 218 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
219   - local hit = self:attackTarget(target, nil, 1.5 + self:getTalentLevel(t) / 10, true)
  219 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 1.5, 2), true)
220 220
221 221 -- Try to knockback !
222 222 if hit then
... ... @@ -230,7 +230,7 @@ newTalent{
230 230 return true
231 231 end,
232 232 info = function(self, t)
233   - return ([[Hits the target with your weapon doing %d%% damage, if the attack hits, the target is knocked back.]]):format(100 * (1.5 + self:getTalentLevel(t) / 10))
  233 + return ([[Hits the target with your weapon doing %d%% damage, if the attack hits, the target is knocked back.]]):format(100 * self:combatTalentWeaponDamage(t, 1.5, 2))
234 234 end,
235 235 }
236 236
... ... @@ -309,7 +309,7 @@ newTalent{
309 309 local x, y, target = self:getTarget(tg)
310 310 if not x or not y or not target then return nil end
311 311 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
312   - local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
  312 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.5, 1), true)
313 313
314 314 -- Try to rot !
315 315 if hit then
... ... @@ -323,7 +323,7 @@ newTalent{
323 323 return true
324 324 end,
325 325 info = function(self, t)
326   - return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
  326 + return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * self:combatTalentWeaponDamage(t, 0.5, 1))
327 327 end,
328 328 }
329 329
... ... @@ -338,7 +338,7 @@ newTalent{
338 338 local x, y, target = self:getTarget(tg)
339 339 if not x or not y or not target then return nil end
340 340 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
341   - local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
  341 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.5, 1), true)
342 342
343 343 -- Try to rot !
344 344 if hit then
... ... @@ -352,7 +352,7 @@ newTalent{
352 352 return true
353 353 end,
354 354 info = function(self, t)
355   - return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
  355 + return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * self:combatTalentWeaponDamage(t, 0.5, 1))
356 356 end,
357 357 }
358 358
... ... @@ -367,7 +367,7 @@ newTalent{
367 367 local x, y, target = self:getTarget(tg)
368 368 if not x or not y or not target then return nil end
369 369 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
370   - local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
  370 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.5, 1), true)
371 371
372 372 -- Try to rot !
373 373 if hit then
... ... @@ -381,7 +381,7 @@ newTalent{
381 381 return true
382 382 end,
383 383 info = function(self, t)
384   - return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
  384 + return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * self:combatTalentWeaponDamage(t, 0.5, 1))
385 385 end,
386 386 }
387 387
... ... @@ -441,7 +441,7 @@ newTalent{
441 441 local x, y, target = self:getTarget(tg)
442 442 if not x or not y or not target then return nil end
443 443 if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
444   - local hit = self:attackTarget(target, nil, 0.8 + self:getTalentLevel(t) / 7, true)
  444 + local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 0.8, 1.4), true)
445 445
446 446 -- Try to stun !
447 447 if hit then
... ... @@ -455,7 +455,7 @@ newTalent{
455 455 return true
456 456 end,
457 457 info = function(self, t)
458   - return ([[Hits the target doing %d%% damage; if the attack hits, the target is pinned to the ground.]]):format(100 * (0.8 + self:getTalentLevel(t) / 7))
  458 + return ([[Hits the target doing %d%% damage; if the attack hits, the target is pinned to the ground.]]):format(100 * self:combatTalentWeaponDamage(t, 0.8, 1.4))
459 459 end,
460 460 }
461 461
... ...
... ... @@ -25,8 +25,9 @@ newTalent{
25 25 sustain_mana = 50,
26 26 points = 5,
27 27 cooldown = 30,
  28 + spellpower_increase = { 5, 9, 13, 16, 18 },
28 29 activate = function(self, t)
29   - local power = 5 * self:getTalentLevelRaw(t)
  30 + local power = t.spellpower_increase[self:getTalentLevelRaw(t)]
30 31 game:playSoundNear(self, "talents/arcane")
31 32 return {
32 33 power = self:addTemporaryValue("combat_spellpower", power),
... ... @@ -39,7 +40,7 @@ newTalent{
39 40 return true
40 41 end,
41 42 info = function(self, t)
42   - return ([[Your mastery of magic allows you to enter a deep concentration state, increasing your spellpower by %d.]]):format(5 * self:getTalentLevelRaw(t))
  43 + return ([[Your mastery of magic allows you to enter a deep concentration state, increasing your spellpower by %d.]]):format(t.spellpower_increase[self:getTalentLevelRaw(t)])
43 44 end,
44 45 }
45 46
... ... @@ -60,7 +61,7 @@ newTalent{
60 61 if self:getTalentLevel(t) >= 3 then tg.type = "beam" end
61 62 local x, y = self:getTarget(tg)
62 63 if not x or not y then return nil end
63   - self:project(tg, x, y, DamageType.ARCANE, self:spellCrit(20 + self:combatSpellpower(0.5) * self:getTalentLevel(t)), nil)
  64 + self:project(tg, x, y, DamageType.ARCANE, self:spellCrit(self:combatTalentSpellDamage(t, 20, 230)), nil)
64 65 local _ _, x, y = self:canProject(tg, x, y)
65 66 if tg.type == "beam" then
66 67 game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(x-self.x), math.abs(y-self.y)), "mana_beam", {tx=x-self.x, ty=y-self.y})
... ... @@ -73,7 +74,7 @@ newTalent{
73 74 info = function(self, t)
74 75 return ([[Conjures up mana into a powerful bolt doing %0.2f arcane damage.
75 76 At level 3 it becomes a beam.
76   - The damage will increase with the Magic stat]]):format(20 + self:combatSpellpower(0.5) * self:getTalentLevel(t))
  77 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 20, 230))
77 78 end,
78 79 }
79 80
... ... @@ -89,14 +90,14 @@ newTalent{
89 90 },
90 91 action = function(self, t)
91 92 if not self:hasEffect(self.EFF_MANAFLOW) then
92   - self:setEffect(self.EFF_MANAFLOW, 10, {power=5+self:combatSpellpower(0.06) * self:getTalentLevel(t)})
  93 + self:setEffect(self.EFF_MANAFLOW, 10, {power=self:combatTalentSpellDamage(t, 10, 20)})
93 94 game:playSoundNear(self, "talents/arcane")
94 95 end
95 96 return true
96 97 end,
97 98 info = function(self, t)
98 99 return ([[Engulf yourself in a surge of mana, quickly restoring %d mana every turns for 10 turns.
99   - The mana restored will increase with the Magic stat]]):format(5 + self:combatSpellpower(0.06) * self:getTalentLevel(t))
  100 + The mana restored will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 20))
100 101 end,
101 102 }
102 103
... ...
... ... @@ -127,7 +127,7 @@ newTalent{
127 127 if not tx or not ty or not target then return nil end
128 128
129 129 local dur = util.bound(10 + math.floor(self:getTalentLevel(t) * 3), 10, 25)
130   - local power = 50 + self:combatSpellpower(0.4) * self:getTalentLevel(t)
  130 + local power = self:combatTalentSpellDamage(t, 20, 210)
131 131 local chance = 20 + self:getTalentLevel(t) * 5
132 132 self:setEffect(self.EFF_DISPLACEMENT_SHIELD, dur, {power=power, target=target, chance=chance})
133 133 game:playSoundNear(self, "talents/teleport")
... ... @@ -137,7 +137,7 @@ newTalent{
137 137 return ([[This intricate spell erects a space distortion around the caster that is linked to another one around a target.
138 138 Any time the caster should take damage there is a %d%% chance that it will instead be warped by the shield and hit the designated target.
139 139 Once the maximum damage (%d) is absorbed, the time runs out (%d turns), or the target dies, the shield will crumble.
140   - The duration and max absorption will increase with the Magic stat]]):format(20 + self:getTalentLevel(t) * 5, 50 + self:combatSpellpower(0.4) * self:getTalentLevel(t), util.bound(10 + math.floor(self:getTalentLevel(t) * 3), 10, 25))
  140 + The duration and max absorption will increase with the Magic stat]]):format(20 + self:getTalentLevel(t) * 5, self:combatTalentSpellDamage(t, 20, 210), util.bound(10 + math.floor(self:getTalentLevel(t) * 3), 10, 25))
141 141 end,
142 142 }
143 143
... ...
... ... @@ -32,7 +32,7 @@ newTalent{
32 32 },
33 33 activate = function(self, t)
34 34 game:playSoundNear(self, "talents/earth")
35   - local power = 4 + self:combatSpellpower(0.03) * self:getTalentLevel(t)
  35 + local power = self:combatTalentSpellDamage(t, 10, 20)
36 36 return {
37 37 armor = self:addTemporaryValue("combat_armor", power),
38 38 particle = self:addParticles(Particles.new("stone_skin", 1)),
... ... @@ -45,7 +45,7 @@ newTalent{
45 45 end,
46 46 info = function(self, t)
47 47 return ([[The caster's skin grows as hard as stone, granting %d bonus to armor.
48   - The bonus to armor will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.03) * self:getTalentLevel(t))
  48 + The bonus to armor will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 20))
49 49 end,
50 50 }
51 51
... ... @@ -88,7 +88,7 @@ newTalent{
88 88 local tg = {type="bolt", range=self:getTalentRange(t), talent=t}
89 89 local x, y = self:getTarget(tg)
90 90 if not x or not y then return nil end
91   - self:project(tg, x, y, DamageType.SPELLKNOCKBACK, self:spellCrit(8 + self:combatSpellpower(0.15) * self:getTalentLevel(t)))
  91 + self:project(tg, x, y, DamageType.SPELLKNOCKBACK, self:spellCrit(self:combatTalentSpellDamage(t, 8, 170)))
92 92 game:playSoundNear(self, "talents/earth")
93 93 return true
94 94 end,
... ...
... ... @@ -31,8 +31,8 @@ newTalent{
31 31 activate = function(self, t)
32 32 game:playSoundNear(self, "talents/fire")
33 33 return {
34   - dam = self:addTemporaryValue("melee_project", {[DamageType.FIRE] = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)}),
35   - per = self:addTemporaryValue("inc_damage", {[DamageType.FIRE] = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.05)}),
  34 + dam = self:addTemporaryValue("melee_project", {[DamageType.FIRE] = self:combatTalentSpellDamage(t, 5, 20)}),
  35 + per = self:addTemporaryValue("inc_damage", {[DamageType.FIRE] = self:combatTalentSpellDamage(t, 5, 14)}),
36 36 }
37 37 end,
38 38 deactivate = function(self, t, p)
... ... @@ -42,7 +42,7 @@ newTalent{
42 42 end,
43 43 info = function(self, t)
44 44 return ([[Engulfs your hands (and weapons) in a sheath of fire, dealing %d fire damage per melee attack and increasing all fire damage by %d%%.]]):
45   - format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.05))
  45 + format(self:combatTalentSpellDamage(t, 5, 20), self:combatTalentSpellDamage(t, 5, 14))
46 46 end,
47 47 }
48 48
... ... @@ -56,11 +56,11 @@ newTalent{
56 56 range = 20,
57 57 action = function(self, t)
58 58 game:playSoundNear(self, "talents/spell_generic")
59   - self:setEffect(self.EFF_EARTHEN_BARRIER, 10, {power=10 + self:getTalentLevel(t) * self:combatSpellpower(0.08)})
  59 + self:setEffect(self.EFF_EARTHEN_BARRIER, 10, {power=self:combatTalentSpellDamage(t, 10, 60)})
60 60 return true
61 61 end,
62 62 info = function(self, t)
63   - return ([[Hardens your skin with the power of earth, reducing physical damage taken by %d%%.]]):format(10 + self:getTalentLevel(t) * self:combatSpellpower(0.08))
  63 + return ([[Hardens your skin with the power of earth, reducing physical damage taken by %d%%.]]):format(self:combatTalentSpellDamage(t, 10, 60))
64 64 end,
65 65 }
66 66
... ... @@ -78,8 +78,8 @@ newTalent{
78 78 activate = function(self, t)
79 79 game:playSoundNear(self, "talents/ice")
80 80 return {
81   - dam = self:addTemporaryValue("melee_project", {[DamageType.ICE] = 3 + self:getTalentLevel(t) * self:combatSpellpower(0.05)}),
82   - per = self:addTemporaryValue("inc_damage", {[DamageType.COLD] = 4 + self:getTalentLevel(t) * self:combatSpellpower(0.04)}),
  81 + dam = self:addTemporaryValue("melee_project", {[DamageType.ICE] = self:combatTalentSpellDamage(t, 3, 15)}),
  82 + per = self:addTemporaryValue("inc_damage", {[DamageType.COLD] = self:combatTalentSpellDamage(t, 5, 14)}),
83 83 }
84 84 end,
85 85 deactivate = function(self, t, p)
... ... @@ -89,7 +89,7 @@ newTalent{
89 89 end,
90 90 info = function(self, t)
91 91 return ([[Engulfs your hands (and weapons) in a sheath of ice, dealing %d ice damage per melee attack and increasing all cold damage by %d%%.]]):
92   - format(3 + self:getTalentLevel(t) * self:combatSpellpower(0.05), 4 + self:getTalentLevel(t) * self:combatSpellpower(0.04))
  92 + format(self:combatTalentSpellDamage(t, 3, 15), self:combatTalentSpellDamage(t, 5, 14))
93 93 end,
94 94 }
95 95
... ... @@ -106,7 +106,7 @@ newTalent{
106 106 },
107 107 activate = function(self, t)
108 108 game:playSoundNear(self, "talents/spell_generic")
109   - local power = math.floor(2 + self:getTalentLevel(t) * self:combatSpellpower(0.06))
  109 + local power = math.floor(self:combatTalentSpellDamage(t, 2, 18))
110 110 return {
111 111 stats = self:addTemporaryValue("inc_stats", {
112 112 [self.STAT_STR] = power,
... ... @@ -124,6 +124,6 @@ newTalent{
124 124 end,
125 125 info = function(self, t)
126 126 return ([[You concentrate on your inner self, increasing your stats each by %d.]]):
127   - format(2 + self:getTalentLevel(t) * self:combatSpellpower(0.06))
  127 + format(self:combatTalentSpellDamage(t, 2, 18))
128 128 end,
129 129 }
... ...
... ... @@ -28,13 +28,13 @@ newTalent{
28 28 HEAL = 10,
29 29 },
30 30 action = function(self, t)
31   - self:setEffect(self.EFF_REGENERATION, 10, {power=5 + self:combatSpellpower(0.07) * self:getTalentLevel(t)})
  31 + self:setEffect(self.EFF_REGENERATION, 10, {power=self:combatTalentSpellDamage(t, 5, 25)})
32 32 game:playSoundNear(self, "talents/heal")
33 33 return true
34 34 end,
35 35 info = function(self, t)
36 36 return ([[Call upon the forces of nature to regenerate your body for %d life every turn for 10 turns.
37   - The life healed will increase with the Magic stat]]):format(5 + self:combatSpellpower(0.07) * self:getTalentLevel(t))
  37 + The life healed will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 25))
38 38 end,
39 39 }
40 40
... ... @@ -49,13 +49,13 @@ newTalent{
49 49 HEAL = 10,
50 50 },
51 51 action = function(self, t)
52   - self:heal(self:spellCrit(10 + self:combatSpellpower(0.5) * self:getTalentLevel(t)), self)
  52 + self:heal(self:spellCrit(self:combatTalentSpellDamage(t, 40, 220)), self)
53 53 game:playSoundNear(self, "talents/heal")
54 54 return true
55 55 end,
56 56 info = function(self, t)
57 57 return ([[Call upon the forces of nature to heal your body for %d life.
58   - The life healed will increase with the Magic stat]]):format(10 + self:combatSpellpower(0.5) * self:getTalentLevel(t))
  58 + The life healed will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 40, 220))
59 59 end,
60 60 }
61 61
... ...
... ... @@ -53,7 +53,7 @@ newTalent{
53 53 DEFEND = 10,
54 54 },
55 55 activate = function(self, t)
56   - local power = 4 + self:combatSpellpower(0.04) * self:getTalentLevel(t)
  56 + local power = self:combatTalentSpellDamage(t, 4, 30)
57 57 game:playSoundNear(self, "talents/heal")
58 58 return {
59 59 particle = self:addParticles(Particles.new("phantasm_shield", 1)),
... ... @@ -67,7 +67,7 @@ newTalent{
67 67 end,
68 68 info = function(self, t)
69 69 return ([[The caster's image blurs, making them harder to hit, granting %d bonus to defense.
70   - The bonus will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.04) * self:getTalentLevel(t))
  70 + The bonus will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 4, 30))
71 71 end,
72 72 }
73 73
... ... @@ -83,7 +83,7 @@ newTalent{
83 83 DEFEND = 10,
84 84 },
85 85 activate = function(self, t)
86   - local power = 10 + self:combatSpellpower(0.06) * self:getTalentLevel(t)
  86 + local power = self:combatTalentSpellDamage(t, 10, 170)
87 87 game:playSoundNear(self, "talents/heal")
88 88 return {
89 89 particle = self:addParticles(Particles.new("phantasm_shield", 1)),
... ... @@ -97,7 +97,7 @@ newTalent{
97 97 end,
98 98 info = function(self, t)
99 99 return ([[The caster surrounds themselves with a phantasmal shield. If hit in melee the shield will deal %d arcane damage to the attacker.
100   - The damage will increase with the Magic stat]]):format(10 + self:combatSpellpower(0.06) * self:getTalentLevel(t))
  100 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 170))
101 101 end,
102 102 }
103 103
... ... @@ -113,7 +113,7 @@ newTalent{
113 113 DEFEND = 10,
114 114 },
115 115 activate = function(self, t)
116   - local power = 4 + self:combatSpellpower(0.04) * self:getTalentLevel(t)
  116 + local power = self:combatTalentSpellDamage(t, 10, 30)
117 117 game:playSoundNear(self, "talents/heal")
118 118 return {
119 119 invisible = self:addTemporaryValue("invisible", power),
... ... @@ -129,6 +129,6 @@ newTalent{
129 129 return ([[The caster fades from sight, granting %d bonus to invisibility.
130 130 Beware, you should take off your light, otherwise you will still be easily spotted.
131 131 This powerful spell constantly drains your mana while active.
132   - The bonus will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.04) * self:getTalentLevel(t))
  132 + The bonus will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 30))
133 133 end,
134 134 }
... ...
... ... @@ -109,7 +109,7 @@ newTalent{
109 109 range = 20,
110 110 action = function(self, t)
111 111 local dur = util.bound(5 + math.floor(self:getTalentLevel(t)), 5, 15)
112   - local power = 50 + self:combatSpellpower(0.5) * self:getTalentLevel(t)
  112 + local power = self:combatTalentSpellDamage(t, 50, 170)
113 113 self:setEffect(self.EFF_TIME_SHIELD, dur, {power=power})
114 114 game:playSoundNear(self, "talents/spell_generic")
115 115 return true
... ... @@ -117,6 +117,6 @@ newTalent{
117 117 info = function(self, t)
118 118 return ([[This intricate spell erects a time shield around the caster, preventing any incoming damage and sending it forward in time.
119 119 Once either the maximum damage (%d) is absorbed, or the time runs out (%d turns), the stored damage will return as self-damage over time (5 turns).
120   - The duration and max absorption will increase with the Magic stat]]):format(50 + self:combatSpellpower(0.5) * self:getTalentLevel(t), util.bound(5 + math.floor(self:getTalentLevel(t)), 5, 15))
  120 + The duration and max absorption will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 50, 170), util.bound(5 + math.floor(self:getTalentLevel(t)), 5, 15))
121 121 end,
122 122 }
... ...
... ... @@ -31,7 +31,7 @@ newTalent{
31 31 action = function(self, t)
32 32 local duration = self:getTalentLevel(t) + 2
33 33 local radius = 3
34   - local dam = 4 + self:combatSpellpower(0.17) * self:getTalentLevel(t)
  34 + local dam = self:combatTalentSpellDamage(t, 4, 70)
35 35 local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
36 36 local x, y = self:getTarget(tg)
37 37 if not x or not y then return nil end
... ... @@ -50,7 +50,7 @@ newTalent{
50 50 end,
51 51 info = function(self, t)
52 52 return ([[Corrosive fumes rises from the ground doing %0.2f acid damage in a radius of 3 each turn for %d turns.
53   - The damage and duration will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.17) * self:getTalentLevel(t), self:getTalentLevel(t) + 2)
  53 + The damage and duration will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 4, 70), self:getTalentLevel(t) + 2)
54 54 end,
55 55 }
56 56
... ... @@ -70,14 +70,14 @@ newTalent{
70 70 local tg = {type="hit", range=self:getTalentRange(t), talent=t}
71 71 local x, y = self:getTarget(tg)
72 72 if not x or not y then return nil end
73   - self:project(tg, x, y, DamageType.COLD, self:spellCrit(12 + self:combatSpellpower(0.25) * self:getTalentLevel(t)), {type="freeze"})
  73 + self:project(tg, x, y, DamageType.COLD, self:spellCrit(self:combatTalentSpellDamage(t, 12, 160)), {type="freeze"})
74 74 self:project(tg, x, y, DamageType.FREEZE, 3 + math.floor(self:getTalentLevel(t) / 3))
75 75 game:playSoundNear(self, "talents/ice")
76 76 return true
77 77 end,
78 78 info = function(self, t)
79 79 return ([[Condenses ambient water on a target, freezing it for a short while and damaging it for %0.2f.
80   - The damage will increase with the Magic stat]]):format(12 + self:combatSpellpower(0.25) * self:getTalentLevel(t))
  80 + The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 12, 160))
81 81 end,
82 82 }
83 83
... ... @@ -94,7 +94,7 @@ newTalent{
94 94 action = function(self, t)
95 95 local duration = 5 + self:combatSpellpower(0.01) * self:getTalentLevel(t)
96 96 local radius = 1
97   - local dam = 5 + self:combatSpellpower(0.2) * self:getTalentLevel(t)
  97 + local dam = self:combatTalentSpellDamage(t, 5, 90)
98 98 -- Add a lasting map effect
99 99 game.level.map:addEffect(self,
100 100 self.x, self.y, duration,
... ... @@ -112,7 +112,7 @@ newTalent{
112 112 end,
113 113 info = function(self, t)
114 114 return ([[A wall of water rushes out from the caster doing %0.2f cold damage and knocking back targets each turn for %d turns.
115   - The damage and duration will increase with the Magic stat]]):format(5 + self:combatSpellpower(0.2) * self:getTalentLevel(t), 5 + self:combatSpellpower(0.01) * self:getTalentLevel(t))
  115 + The damage and duration will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 90), 5 + self:combatSpellpower(0.01) * self:getTalentLevel(t))
116 116 end,
117 117 }
118 118
... ... @@ -129,7 +129,7 @@ newTalent{
129 129 action = function(self, t)
130 130 local duration = 5 + self:combatSpellpower(0.05) + self:getTalentLevel(t)
131 131 local radius = 3
132   - local dam = 5 + self:combatSpellpower(0.15) * self:getTalentLevel(t)
  132 + local dam = self:combatTalentSpellDamage(t, 5, 90)
133 133 -- Add a lasting map effect
134 134 game.level.map:addEffect(self,
135 135 self.x, self.y, duration,
... ... @@ -150,6 +150,6 @@ newTalent{
150 150 info = function(self, t)
151 151 return ([[A furious ice storm rages around the caster doing %0.2f cold damage in a radius of 3 each turn for %d turns.
152 152 It has 25%% chance to freeze damaged targets.
153   - The damage and duration will increase with the Magic stat]]):format(5 + self:combatSpellpower(0.15) * self:getTalentLevel(t), 5 + self:combatSpellpower(0.05) + self:getTalentLevel(t))
  153 + The damage and duration will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 5, 90), 5 + self:combatSpellpower(0.05) + self:getTalentLevel(t))
154 154 end,
155 155 }
... ...
... ... @@ -71,14 +71,14 @@ newTalent{
71 71 local x, y = self.x + i, self.y + j
72 72 if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
73 73 local target = game.level.map(x, y, Map.ACTOR)
74   - self:attackTargetWith(target, weapon.combat, nil, 1.4 + self:getTalentLevel(t) / 8)
  74 + self:attackTargetWith(target, weapon.combat, nil, self:combatTalentWeaponDamage(t, 1.4, 2.1))
75 75 end
76 76 end end </