Commit c5d14297d45231904df6d262c6764b40c8fef738

Authored by dg
1 parent 10d4af87

fix


git-svn-id: http://svn.net-core.org/repos/t-engine4@4669 51575b47-30f0-44d4-a5cc-537603b46e54
@@ -69,8 +69,8 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) @@ -69,8 +69,8 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
69 end 69 end
70 70
71 if src.isTalentActive and src:isTalentActive(target.T_GESTURE_OF_GUARDING) then 71 if src.isTalentActive and src:isTalentActive(target.T_GESTURE_OF_GUARDING) then
72 - local t = src:getTalentFromId(target.T_GESTURE_OF_GUARDING)  
73 - dam = t.on_damageInflicted(target, t, type, dam, src) 72 + local t = src:getTalentFromId(src.T_GESTURE_OF_GUARDING)
  73 + dam = t.on_damageInflicted(src, t, type, dam, target)
74 end 74 end
75 75
76 -- Blast the iceblock 76 -- Blast the iceblock
@@ -148,25 +148,25 @@ newTalent{ @@ -148,25 +148,25 @@ newTalent{
148 148
149 local change = math.pow(self:getTalentLevel(t), 0.5) * 1.15 149 local change = math.pow(self:getTalentLevel(t), 0.5) * 1.15
150 if freeHands > 1 then change = change * 1.4 end 150 if freeHands > 1 then change = change * 1.4 end
151 - print("===dec by", change,change * math.min(7, distance))  
152 return change * math.min(7, distance) 151 return change * math.min(7, distance)
153 end, 152 end,
154 getIncDamageChange = function(self, t, distance) 153 getIncDamageChange = function(self, t, distance)
155 local change = -(2 + math.pow(self:getTalentLevel(t), 0.5) * 0.8) 154 local change = -(2 + math.pow(self:getTalentLevel(t), 0.5) * 0.8)
156 - print("===inc by", change,change * math.min(7, distance))  
157 return change * math.min(7, distance) 155 return change * math.min(7, distance)
158 end, 156 end,
159 on_damageReceived = function(self, t, type, dam, src) 157 on_damageReceived = function(self, t, type, dam, src)
160 if src and src.x and src.y and (self.x ~= src.x or self.y ~= src.y) and self:hasLOS(src.x, src.y) then 158 if src and src.x and src.y and (self.x ~= src.x or self.y ~= src.y) and self:hasLOS(src.x, src.y) then
161 local distance = core.fov.distance(src.x, src.y, self.x, self.y) 159 local distance = core.fov.distance(src.x, src.y, self.x, self.y)
162 - dam = dam * (100 - t.getDamageResistChange(self, t, distance) / 100) 160 + print("===dec by", t.getDamageResistChange(self, t, distance), distance)
  161 + dam = dam * (100 - t.getDamageResistChange(self, t, distance)) / 100
163 end 162 end
164 return dam 163 return dam
165 end, 164 end,
166 - on_damageInflicted = function(self, type, dam, target) 165 + on_damageInflicted = function(self, t, type, dam, target)
167 if target and target.x and target.y and (self.x ~= target.x or self.y ~= target.y) and self:hasLOS(target.x, target.y) then 166 if target and target.x and target.y and (self.x ~= target.x or self.y ~= target.y) and self:hasLOS(target.x, target.y) then
168 local distance = core.fov.distance(target.x, target.y, self.x, self.y) 167 local distance = core.fov.distance(target.x, target.y, self.x, self.y)
169 - dam = dam * (100 + t.getIncDamageChange(self, t, distance) / 100) 168 + print("===inc by", t.getIncDamageChange(self, t, distance), distance)
  169 + dam = dam * (100 + t.getIncDamageChange(self, t, distance)) / 100
170 end 170 end
171 return dam 171 return dam
172 end, 172 end,