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: Select all
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
Code: Select all
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