Saturday 3 March 2012

Manathrust


Note: Still a work in progress.  Currently complete up to "action".  

newTalent{
 name = "Manathrust",
 type = {"spell/arcane", 2},
 require = spells_req2,
 points = 5,
 random_ego = "attack",
 mana = 10,
 cooldown = 3,
 tactical = { ATTACK = { ARCANE = 2 } },
 range = 10,
 direct_hit = function(self, t) 
  if self:getTalentLevel(t) >= 3 then 
   return true 
  else 
   return false 
  end 
 end,
 direct_hit = function(self, t) if self:getTalentLevel(t) >= 3 then return true else return false end end,
 reflectable = true,
 proj_speed = 20, 
 requires_target = true,
 target = function(self, t)
  local tg = {type="bolt" "hit" "beam" "ball" "cone", range=self:getTalentRange(t), talent=t, radius=1, selffire=true, friendlyfire=true, block_path=???, block_radius=???}
  if self:getTalentLevel(t) >= 3 then tg.type = "beam" end
  return tg
 end,
 getDamage = function(self, t) return self:combatTalentSpellDamage(t, 20, 230, nil) end,
 action = function(self, t)
  local tg = self:getTalentTarget(t)
  local x, y = self:getTarget(tg)
  if not x or not y then return nil end
  self:project(tg, x, y, DamageType.ARCANE, self:spellCrit(t.getDamage(self, t)), nil)
  local _ _, x, y = self:canProject(tg, x, y)
  if tg.type == "beam" then
   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})
  else
   game.level.map:particleEmitter(x, y, 1, "manathrust")
  end
  game:playSoundNear(self, "talents/arcane")
  return true
 end,
 info = function(self, t)
  local damage = t.getDamage(self, t)
  return ([[Conjures up mana into a powerful bolt doing %0.2f arcane damage.
  At level 3 it becomes a beam.
  The damage will increase with your Spellpower.]]):
  format(damDesc(self, DamageType.ARCANE, damage))
 end,
}