Authored by Chris Davidson
1 parent d730ade6

Fix Tentacle Grab using old Grapple code and revise a bit

Showing with 14 additions and 11 deletions
 ... ... @@ -528,7 +528,7 @@ newTalent{ 528 528 requires_target = true, 529 529 target = function(self, t) return {type="bolt", range=self:getTalentRange(t), talent=t} end, 530 530 getDamage = function(self, t) return self:combatTalentMindDamage(t, 5, 70) end, 531 - getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 3, 7)) end, 531 + getDuration = function(self, t) return 5 end, 532 532 action = function(self, t) 533 533 local tg = self:getTalentTarget(t) 534 534 local x, y = self:getTarget(tg) ... ... @@ -537,7 +537,6 @@ newTalent{ 537 537 local crit = self:mindCrit(1) 538 538 539 539 if target:canBe("pin") and self:checkHit(self:combatMindpower(), target:combatPhysicalResist()) then 540 - target:setEffect(target.EFF_GRAPPLED, t.getDuration(self, t), {src=self, power=t.getDamage(self, t)/2 * crit}) 541 540 self:project(tg, x, y, function(px, py) 542 541 543 542 target:pull(self.x, self.y, tg.range) ... ... @@ -558,7 +557,7 @@ newTalent{ 558 557 info = function(self, t) 559 558 local damage = t.getDamage(self, t) 560 559 local duration = t.getDuration(self, t) 561 - return ([[Grab a target and drag it to your side, holding it down and strangling it for %d turns. 560 + return ([[Grab a target and drag it to your side, holding it in place and silencing non-undead and creatures that need to breathe for %d turns. 562 561 The grab will also deal %0.2f slime damage per turn. 563 562 The damage will increase with your Mindpower.]]): 564 563 format(duration, damDesc(self, DamageType.SLIME, damage)) ... ...
 ... ... @@ -1469,19 +1469,24 @@ newEffect{ 1469 1469 desc = "Crushing Hold", 1470 1470 long_desc = function(self, eff) return ("The target is being crushed and suffers %d damage each turn"):format(eff.power) end, 1471 1471 type = "physical", 1472 - subtype = { grapple=true }, 1472 + subtype = { grapple=true, pin=true }, 1473 1473 status = "detrimental", 1474 1474 parameters = { power=1 }, 1475 1475 on_gain = function(self, err) return "#Target# is being crushed.", "+Crushing Hold" end, 1476 1476 on_lose = function(self, err) return "#Target# has escaped the crushing hold.", "-Crushing Hold" end, 1477 1477 on_timeout = function(self, eff) 1478 - local p = self:hasEffect(self.EFF_GRAPPLED) 1479 - if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) > 1 or eff.src.dead or not game.level:hasEntity(eff.src) or not (p and p.src == eff.src) then 1478 + if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) > 1 or eff.src.dead or not game.level:hasEntity(eff.src) then 1480 1479 self:removeEffect(self.EFF_CRUSHING_HOLD) 1480 + elseif eff.damtype then 1481 + local type = eff.damtype 1482 + DamageType:get(DamageType[type]).projector(eff.src or self, self.x, self.y, DamageType[type], eff.power) 1481 1483 else 1482 1484 DamageType:get(DamageType.PHYSICAL).projector(eff.src or self, self.x, self.y, DamageType.PHYSICAL, eff.power) 1483 1485 end 1484 1486 end, 1487 + activate = function(self, eff) 1488 + self:effectTemporaryValue(eff, "never_move", 1) 1489 + end, 1485 1490 } 1486 1491 1487 1492 newEffect{ ... ... @@ -1489,14 +1494,13 @@ newEffect{ 1489 1494 desc = "Strangle Hold", 1490 1495 long_desc = function(self, eff) return ("The target is being strangled and may not cast spells and suffers %d damage each turn."):format(eff.power) end, 1491 1496 type = "physical", 1492 - subtype = { grapple=true, silence=true }, 1497 + subtype = { grapple=true, pin=true, silence=true }, 1493 1498 status = "detrimental", 1494 1499 parameters = { power=1 }, 1495 1500 on_gain = function(self, err) return "#Target# is being strangled.", "+Strangle Hold" end, 1496 1501 on_lose = function(self, err) return "#Target# has escaped the strangle hold.", "-Strangle Hold" end, 1497 1502 on_timeout = function(self, eff) 1498 - local p = self:hasEffect(self.EFF_GRAPPLED) 1499 - if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) > 1 or eff.src.dead or not game.level:hasEntity(eff.src) or not (p and p.src == eff.src) then 1503 + if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) > 1 or eff.src.dead or not game.level:hasEntity(eff.src) then 1500 1504 self:removeEffect(self.EFF_STRANGLE_HOLD) 1501 1505 elseif eff.damtype then 1502 1506 local type = eff.damtype ... ... @@ -1506,10 +1510,10 @@ newEffect{ 1506 1510 end 1507 1511 end, 1508 1512 activate = function(self, eff) 1509 - eff.tmpid = self:addTemporaryValue("silence", 1) 1513 + self:effectTemporaryValue(eff, "silence", 1) 1514 + self:effectTemporaryValue(eff, "never_move", 1) 1510 1515 end, 1511 1516 deactivate = function(self, eff) 1512 - self:removeTemporaryValue("silence", eff.tmpid) 1513 1517 end, 1514 1518 } 1515 1519 ... ...