Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Sarven Brawl and electrocute


When I use electrocute in Sarven Brawl, it seems to stop my loop entirely for a bit, before before casting Chain Lightning and continuing. What is going on? Is it my code?

    yak = self.findNearest(self.findByType("sand-yak"))    
    enemy = self.findNearest(removeByType(self.findEnemies(), "sand-yak"))
        elif self.canCast("chain-lightning"):
            if yak:
                if self.distanceTo(yak) < 10:
                    self.cast("chain-lightning", enemy)
        elif self.isReady("bash"):


Are you talking about Electrocute (steel ring) or Chain-lightning? Because your comment mentions both in a confusing way…


I mean that when I cast electrocute with the Steel Ring, my hero casts it, then stands there for a bit and does nothing, besides building archers when I have enough gold, then casts chain-lightning and jumps back into action.


Is there a yak nearby when this happens? (because if you can do chain lightning and there is a yak near by you will never bash or attack.)

As a side question what is the point of “shield + attack/bash/cleave” at best this would be shield for a tiny amount of time . . . time which would allow the opponent to hit you instead of you killing them first.


No, I am in the center canyon when this happens, and no yaks ever spawn there.

Would they really? I find that without the shield, we hit each other at the same time at best.


I’ll go run your code and see what I can see. :smile:

(that could depend on your weapon)
Hmm, so then the question becomes do they actually do less damage if you do a “single” shield action.


Sorry, I partially misspoke earlier: if you canCast chain-lightning you will never do bash/attack.

The canCast is actually the problem in your code.

You never cast chain lightning unless there is a distant yak. No yak == no chain-lightning . . . Good thing you are probably wearing the silly twilight glasses…

I had a hard time getting pauses that I couldn’t blame on other things. Mainly, the “canCast” since I can’t see yaks from the center, my hero does nothing except summon, cleave, and zap until I get around a corner and can see yaks, then I get to chain and can start attacking. Once I fixed the canCast logic the only pauses I got were because I couldn’t see any enemies.

You should probably have have a canElectrocute(enemy) on your if isReady-electrocute (though this shouldn’t really matter on this level).

(shield: if melee enemy far away shield does nothing for you. Just so we are clear, I believe shield is a waste if not used “continuously”, but then I usually write my code in clojure where shield is somehow totally worthless period. So maybe I’m biased…) :smile:

Question - why do you care about yaks if you are using chain-lightning but not if you are cleaving?


The cleave was just there because I haven’t gotten around to editing it out yet. I’m using a non-cleaving weapon, anyhow. Plus, Chain Lightning has a range of twenty-five, so I’m in more danger of hitting a Sand Yak by accident with it than with cleave.

EDIT: Oh, that’s my problem! I just realized I was wearing Kithgard Worker’s Glasses, and therefore couldn’t see through walls. Fail on my part.