ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Mon Sep 28, 2020 3:50 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Aug 24, 2019 4:11 pm 

Joined: Sat Sep 29, 2018 3:43 am
Posts: 177
   name = "Virulent Disease",
   type = {"corruption/plague", 1},
   require = corrs_req1,
   points = 5,
   vim = 8,
   cooldown = 3,
   random_ego = "attack",
   tactical = { ATTACK = {BLIGHT = 2} },
   requires_target = true,
   no_energy = true,
   --getTargetDiseases = getTargetDiseases,
   target = function(self, t) return {type="hit", range=self:getTalentRange(t), talent=t} end,
   range = function(self, t) return 5 end, -- Instant cast should not do thousands of damage at long range.  This is still too powerful, though
   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

      local diseases = {{self.EFF_WEAKNESS_DISEASE, "str"}, {self.EFF_ROTTING_DISEASE, "con"}, {self.EFF_DECREPITUDE_DISEASE, "dex"}}
      local disease = rng.table(diseases)

      -- Try to rot !
      self:project(tg, x, y, function(px, py)
         local target =, py, engine.Map.ACTOR)
         if not target then return end
         if target:canBe("disease") then
            local str, dex, con = not target:hasEffect(self.EFF_WEAKNESS_DISEASE) and target:getStr() or 0, not target:hasEffect(self.EFF_DECREPITUDE_DISEASE) and target:getDex() or 0, not target:hasEffect(self.EFF_ROTTING_DISEASE) and target:getCon() or 0

            if str >= dex and str >= con then
               disease = {self.EFF_WEAKNESS_DISEASE, "str"}
            elseif dex >= str and dex >= con then
               disease = {self.EFF_DECREPITUDE_DISEASE, "dex"}
            elseif con > 0 then
               disease = {self.EFF_ROTTING_DISEASE, "con"}

            target:setEffect(disease[1], 6, {src=self, dam=self:spellCrit(7 + self:combatTalentSpellDamage(t, 6, 45)), [disease[2]]=self:combatTalentSpellDamage(t, 5, 35), apply_power=self:combatSpellpower()})
            game.logSeen(target, "%s resists the disease!",
         end, py, 1, "circle", {oversize=0.7, a=200, limit_life=8, appear=8, speed=-2, img="disease_circle", radius=0})
      game:playSoundNear(self, "talents/slime")

      return true
   info = function(self, t)
      return ([[Fires a bolt of pure filth, diseasing your target with a disease doing %0.2f blight damage per turn for 6 turns, and reducing one of its physical stats (strength, constitution, dexterity) by %d. The three diseases can stack.
      Virulent Disease will always try to apply a disease the target does not currently have, and also one that will have the most debilitating effect for the target.
      The effect will increase with your Spellpower.]]):
      format(damDesc(self, DamageType.BLIGHT, 7 + self:combatTalentSpellDamage(t, 6, 65)), self:combatTalentSpellDamage(t, 5, 35))

The tooltip says that the damage is 7 + self:combatTalentSpellDamage(t, 6, 65), while the actual damage applied is 7 + self:combatTalentSpellDamage(t, 6, 45) (before crit).

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group