Commit 5c02fa899bfb3f8a7bc50793779604abbf6f0477

Authored by Chris Davidson
1 parent 91e971d6

Fix some Bone talent bugs/issues

... ... @@ -87,21 +87,23 @@ newTalent{
87 87 if target:canBe("pin") then
88 88 target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()})
89 89 else
90   - game.logSeen(target, "%s resists the bone!", target.name:capitalize())
  90 + game.logSeen(target, "%s resists the pin!", target.name:capitalize())
91 91 end
92 92 else
93   - local tg = {type="cone", cone_angle=25, range=0, radius=8, friendlyfire=false}
  93 + local tg = {type="cone", cone_angle=90, range=0, radius=6, friendlyfire=false}
94 94
95 95 local grids = {}
96 96 self:project(tg, x, y, function(px, py)
97   - if core.fov.distance(target.x, target.y, px, py) > 2 then grids[#grids+1] = {px, py} end
  97 + if game.level.map(tx, ty, engine.Map.ACTOR) then return end
  98 + grids[#grids+1] = {px, py, core.fov.distance(self.x, self.y, px, py)}
98 99 end)
  100 + table.sort(grids, function(a, b) return a[3] > b[3] end )
99 101
100 102 DamageType:get(DamageType.PHYSICAL).projector(self, target.x, target.y, DamageType.PHYSICAL, dam)
101 103 if target:canBe("pin") then
102 104 target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()})
103 105 else
104   - game.logSeen(target, "%s resists the bone!", target.name:capitalize())
  106 + game.logSeen(target, "%s resists the pin!", target.name:capitalize())
105 107 end
106 108
107 109 local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0))
... ... @@ -109,16 +111,16 @@ newTalent{
109 111 game.logSeen(target, "%s resists being teleported by Bone Grab!", target.name:capitalize())
110 112 return true
111 113 end
112   - local spot = rng.table(grids)
113   - if not spot then return end
114   - target:teleportRandom(spot[1], spot[2], 0)
  114 +
  115 + if #grids <= 0 then return end
  116 + target:teleportRandom(grids[1][1], grids[1][2], 0)
115 117 end
116 118 end)
117 119 game:playSoundNear(self, "talents/arcane")
118 120 return true
119 121 end,
120 122 info = function(self, t)
121   - return ([[Grab a target and teleport it to your side or if adjacent to a random location at least 3 spaces away from you, pinning it there with a bone rising from the ground for %d turns.
  123 + return ([[Grab a target and teleport it to your side or if adjacent up to 6 spaces away from you, pinning it there with a bone rising from the ground for %d turns.
122 124 The bone will also deal %0.2f physical damage.
123 125 The damage will increase with your Spellpower.]]):
124 126 format(t.getDuration(self, t), damDesc(self, DamageType.PHYSICAL, t.getDamage(self, t)))
... ... @@ -141,26 +143,25 @@ newTalent{
141 143 if ab.no_energy then return end
142 144 if self.turn_procs.bone_spike then return end
143 145 self.turn_procs.bone_spike = true
144   - game:onTickEnd(function()
145   - local tg = self:getTalentTarget(t)
146   - local dam = t.getDamage(self, t)
147   - local did_crit = false
148   - self:project(tg, self.x, self.y, function(px, py)
149   - local target = game.level.map(px, py, engine.Map.ACTOR)
150   - if not target then return end
151   - local nb = #target:effectsFilter({status="detrimental", type="magical"})
152   - if nb and nb < 3 then return end
  146 +
  147 + local tg = self:getTalentTarget(t)
  148 + local dam = t.getDamage(self, t)
  149 + local did_crit = false
  150 + self:project(tg, self.x, self.y, function(px, py)
  151 + local target = game.level.map(px, py, engine.Map.ACTOR)
  152 + if not target then return end
  153 + local nb = #target:effectsFilter({status="detrimental", type="magical"})
  154 + if nb and nb < 3 then return end
153 155
154   - -- Make sure crit is only calculated once, but do it here so we don't trigger a crit if there are no targets
155   - if did_crit == false then
156   - dam = self:spellCrit(dam)
157   - did_crit = true
158   - end
  156 + -- Make sure crit is only calculated once, but do it here so we don't trigger a crit if there are no targets
  157 + if did_crit == false then
  158 + dam = self:spellCrit(dam)
  159 + did_crit = true
  160 + end
159 161
160   - self:project({type="beam", range=10, selffire=false, friendlyfire=false, talent=t}, target.x, target.y, DamageType.PHYSICAL, dam)
161   - local _ _, _, _, x, y = self:canProject(tg, x, y)
162   - game.level.map:particleEmitter(self.x, self.y, 10, "bone_spear", {speed=0.2, tx=target.x - self.x, ty=target.y - self.y})
163   - end)
  162 + self:projectSource({type="beam", range=10, selffire=false, friendlyfire=false, talent=t}, target.x, target.y, DamageType.PHYSICAL, dam, nil, t)
  163 + local _ _, _, _, x, y = self:canProject(tg, x, y)
  164 + game.level.map:particleEmitter(self.x, self.y, 10, "bone_spear", {speed=0.2, tx=target.x - self.x, ty=target.y - self.y})
164 165 end)
165 166 end,
166 167 info = function(self, t)
... ... @@ -264,7 +265,7 @@ newTalent{
264 265 return true
265 266 end,
266 267 info = function(self, t)
267   - return ([[Bone shields start circling around you. They will each fully absorb one attack.
  268 + return ([[Bone shields start circling around you. They will each fully absorb one instance of damage.
268 269 %d shield(s) will be generated when first activated.
269 270 Then every %d turns a new one will be created if not full.
270 271 This will only trigger on hits over %d damage based on Spellpower.]]):
... ...