Commit e6ed63e8d1fa29afd50bfd12cd227446bc37afc7

Authored by dg
1 parent 62d23b78

Can not set traps over traps


git-svn-id: http://svn.net-core.org/repos/t-engine4@2644 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -193,6 +193,7 @@ newTalent{
193 193 local x, y, target = self:getTarget(tg)
194 194 if not x or not y then return nil end
195 195 local _ _, x, y = self:canProject(tg, x, y)
  196 + if game.level.map(x, y, Map.TRAP) then game.logPlayer(self, "You somehow fail to set the trap.") return nil end
196 197
197 198 local dam = 30 + self:getCun() * 0.8 * self:getTalentLevel(self.T_TRAP_MASTERY)
198 199
... ... @@ -252,6 +253,7 @@ newTalent{
252 253 local x, y, target = self:getTarget(tg)
253 254 if not x or not y then return nil end
254 255 local _ _, x, y = self:canProject(tg, x, y)
  256 + if game.level.map(x, y, Map.TRAP) then game.logPlayer(self, "You somehow fail to set the trap.") return nil end
255 257
256 258 local dam = (40 + self:getCun() * 0.7 * self:getTalentLevel(self.T_TRAP_MASTERY)) / 5
257 259
... ... @@ -316,6 +318,7 @@ newTalent{
316 318 local x, y, target = self:getTarget(tg)
317 319 if not x or not y then return nil end
318 320 local _ _, x, y = self:canProject(tg, x, y)
  321 + if game.level.map(x, y, Map.TRAP) then game.logPlayer(self, "You somehow fail to set the trap.") return nil end
319 322
320 323
321 324 local Trap = require "mod.class.Trap"
... ... @@ -386,7 +389,7 @@ newTalent{
386 389 local x, y, target = self:getTarget(tg)
387 390 if not x or not y then return nil end
388 391 local _ _, x, y = self:canProject(tg, x, y)
389   -
  392 + if game.level.map(x, y, Map.TRAP) then game.logPlayer(self, "You somehow fail to set the trap.") return nil end
390 393
391 394 local Trap = require "mod.class.Trap"
392 395 local t = Trap.new{
... ... @@ -448,6 +451,7 @@ newTalent{
448 451 local x, y, target = self:getTarget(tg)
449 452 if not x or not y then return nil end
450 453 local _ _, x, y = self:canProject(tg, x, y)
  454 + if game.level.map(x, y, Map.TRAP) then game.logPlayer(self, "You somehow fail to set the trap.") return nil end
451 455
452 456 local dam = 20 + self:getCun() * 0.7 * self:getTalentLevel(self.T_TRAP_MASTERY)
453 457
... ...