ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Thu Nov 23, 2017 3:21 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 10, 2017 2:17 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2258
not sure if the line in here which is

Code:
if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end


should be

Code:
if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam.dam) end


Code:
if type(dam) == "number" then
            if dam > 0 then
               dr = math.min(dam, fa)
               print("[ATTACK]\ttarget on_melee_hit:", dam, typ, "vs", fa)
               dam = dam - dr
               if dam > 0 then   DT.projector(target, self.x, self.y, typ, dam) end
               if dr > 0 and pct > 0 then
                  dr = math.floor(dr*pct/100)
                  if dr > 0 then
                     print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected")
                     DT.projector(self, target.x, target.y, typ, dr)
                  end
               end
            end
         elseif dam.dam and dam.dam > 0 then
            dr = math.min(dam.dam, fa)
            print("[ATTACK]\ttarget on_melee_hit:", dam.dam, typ, "vs", fa)
            if dr > 0 then dam = table.clone(dam); dam.dam = dam.dam - dr end
            if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end
            if dr > 0 and pct > 0 then
               dr = math.floor(dr*pct/100)
               if dr > 0 then
                  print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected")
                  dam.dam = dr -- only change dam
                  DT.projector(self, target.x, target.y, typ, dam)
               end
            end
         end


can a table, in this case, dam, be passed to the default projector? I don't think so...

I picked this up working on my addon Verbose.

_________________
MADNESS rocks


Top
 Profile  
 
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: No registered users and 8 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