ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sat Sep 22, 2018 7:17 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Mar 14, 2018 10:45 pm 
Offline
Thalore

Joined: Thu Jul 27, 2006 2:50 am
Posts: 157
It's been mentioned a few times recently that alchemists really can't use arcane amplification drone once they've leveled alchemist protection, as it prevents you from dealing damage to friendly targets - of which the Arcane Amplification Drone is one, due to being a summon.

There were a few ways I thought about doing this. Changing the AAD to be unfriendly seemed like a possibility, until I realized that would probably make it damage you - and I couldn't quite figure out how to do it anyways (I think I could work it out, but not sure how to give proper credit and xp to the player).

The other possibility was to add a check in throw bomb's action function to check for if a target is an AAD, and set it to always deal damage. This would be inverse behavior of how it deals with golems or friendly npcs.

This is the golem behavior code :
Code:
if self.alchemy_golem then
         golem = game.level:hasEntity(self.alchemy_golem) and self.alchemy_golem or nil
      end
[...]
local grids = self:project(tg, x, y, function(tx, ty)
         local d = dam
         local target = game.level.map(tx, ty, Map.ACTOR)
         -- Protect yourself
         if tx == self.x and ty == self.y then
            d = dam * (1 - prot)
         -- Protect the golem
         elseif golem and tx == golem.x and ty == golem.y then
            d = dam * (1 - prot)
            if self:isTalentActive(self.T_FROST_INFUSION) and self:knowTalent(self.T_ICE_ARMOUR) then
               self:callTalent(self.T_ICE_ARMOUR, "applyEffect", golem)
            elseif self:isTalentActive(self.T_ACID_INFUSION) and self:knowTalent(self.T_CAUSTIC_GOLEM) then
               self:callTalent(self.T_CAUSTIC_GOLEM, "applyEffect", golem)
            elseif self:isTalentActive(self.T_LIGHTNING_INFUSION) and self:knowTalent(self.T_DYNAMIC_RECHARGE) then
               self:callTalent(self.T_DYNAMIC_RECHARGE, "applyEffect", golem)
            end
         else -- reduced damage to friendly npcs (could make random chance like friendlyfire instead)
            if target and self:reactionToward(target) >= 0 then d = dam * (1 - prot) end
         end
      if d <= 0 then return end


I'm not certain at all how to translate the AAD into similar behavior as the golem, but this is my initial attempt (it loads but doesn't change any behavior as far as I can tell). I'm well aware that it's almost certainly not "self.arcane_amplification_drone", but am unsure what to actually use or where to look for an example.

Code:
if self.arcane_amplification_drone then
      drone = gamel.level:hasEntity(self.arcane_amplification_drone) and self.arcane_amplification_drone or nil
      end
[....]
      local grids = self:project(tg, x, y, function(tx, ty)
         local d = dam
         local target = game.level.map(tx, ty, Map.ACTOR)
         -- Protect yourself
         if tx == self.x and ty == self.y then
            d = dam * (1 - prot)
         -- Protect the golem
         elseif golem and tx == golem.x and ty == golem.y then
            d = dam * (1 - prot)
            if self:isTalentActive(self.T_FROST_INFUSION) and self:knowTalent(self.T_ICE_ARMOUR) then
               self:callTalent(self.T_ICE_ARMOUR, "applyEffect", golem)
            elseif self:isTalentActive(self.T_ACID_INFUSION) and self:knowTalent(self.T_CAUSTIC_GOLEM) then
               self:callTalent(self.T_CAUSTIC_GOLEM, "applyEffect", golem)
            elseif self:isTalentActive(self.T_LIGHTNING_INFUSION) and self:knowTalent(self.T_DYNAMIC_RECHARGE) then
               self:callTalent(self.T_DYNAMIC_RECHARGE, "applyEffect", golem)
            end
         else -- reduced damage to friendly npcs (could make random chance like friendlyfire instead)
            if target and self:reactionToward(target) >= 0 then d = dam * (1 - prot) end
         end
         if drone and tx == drone.x and ty == drone.y then d = dam end

         if d <= 0 then return end


Top
 Profile  
 
PostPosted: Thu Mar 15, 2018 12:32 am 
Offline
Thalore

Joined: Mon Feb 13, 2017 4:43 pm
Posts: 143
Try this:
Code:
else -- reduced damage to friendly npcs (could make random chance like friendlyfire instead)
    if target and self:reactionToward(target) >= 0 and not target:knowTalent(target.T_ARCANE_AMPLIFICATION_DRONE_EFFECT) then d = dam * (1 - prot) end
end

Basically, we just check if a friendly target knows the talent the drone is born with (the one that does the stuff that the drone does) and if it knows it, we don't protect it.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2018 1:59 am 
Offline
Thalore

Joined: Thu Jul 27, 2006 2:50 am
Posts: 157
Erenion wrote:
Try this:
Code:
else -- reduced damage to friendly npcs (could make random chance like friendlyfire instead)
    if target and self:reactionToward(target) >= 0 and not target:knowTalent(target.T_ARCANE_AMPLIFICATION_DRONE_EFFECT) then d = dam * (1 - prot) end
end

Basically, we just check if a friendly target knows the talent the drone is born with (the one that does the stuff that the drone does) and if it knows it, we don't protect it.

Thanks, that does it perfectly. Unfortunately the AAD hits the golem, but I think that's alright for now. I think I can fix it, but not sure if it should be fixed (I'm assuming it hits other minions so for consistencies sake I'll probably keep it).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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