Hi all!

First post here.
dt is the elapsed time in second since the last call of the function (event). I imagine it's an abbrevation for "delta time", or time difference between frames. The pattern you see,
fire = fire - dt * (getPetPower() + 1)
if (fire < 0) ...
fire = 3
is a method of triggering the fire event at a consistent rate. It reduces the variable by (dt) each frame, which, again is the delay in seconds since the last update. getPetPower() defaults to 0 (no pet powerup), so the normal rate is that fireDelay decreases by (0 + 1) per second. In case the pet is buffed, the reduction will be multiplied by the power-up level. So a +1 pet will attack twice as often (removing 2 from fireDelay per second) and a theoretical +2 pet will attack thrice as fast et cetera.
The variable "lungeDelay" is the rate, in seconds, between target acquisions for the pet.
Lunge is a fencing manoeuvre, that of thrusting your blade forward while bending one leg and extending the other. Errol Flynn, ho!

The differing values between initialization (top of file) and game loop is not important. The init value will only be used once (per summoning of pet? Per game? Unsure, this depend upon how Alec has implemented the lua script engine. I'm guessing every summon, to keep script bloat down.)
So in other words, it's the maximum time it takes for the pet to go from passive to aggressive. I say maximum, because the way the pets are coded, an enemy could come within sight when there is only a split second left of the lungeDelay cycle, so it will react almost immediately. In practiality the pet can react in anything between 0.01 seconds and the full duration of lungeDelay.
--
Truth is, because of this lungeDelay, the pets' individual attack speeds are almost insignificant.
Looking at the different pets from a technical standpoint, it's very hard to draw any solid conclusions of which pet is better. The actual damage values seem to be hidden inside the game code, as specific kinds of "shots" that are created to emulate the attacks. I couldn't find the values Alpha mentions, but I will assume these are correct for now.

For example, the Nautilus pet is the only (well, in theory, unless they're stacked on top of eachother in which case the piranha would also) one that can damage multiple enemies with its charging attack. On the other hand, the Blaster pet will deliver a more sustained and focused damage. Then again, the piranha is the only one that will heal you by devouring your enemies.
However. The piranha is the only offensive pet
that does not reset its lungeDelay after a successful series of attacks. Unlike the others, it does not wait 3 seconds between each attack cycle. It's also the only pet that by design will pursue the same target until either Naija or the enemy is dead. In my opinion, along with the heals received from it eating the enemies, makes it the by far most efficient damage pet to have. The Blaster, by comparison, while doing more damage per attack, has a large chance of swapping target, altogether missing with its projectiles and does not contribute with any synergetic effects like heals. Not surprisingly, the Nautilus does rank lowest, considering its very situational attack (a straight line) and low damage per hit, along with the high lungeDelay.
Words, words!

Not sure what came out of that, but I think I made up my own mind on pets atleast.
- T
Edit:
Wanted to make a little clarification on the "not changing targets" clause for the piranha;
It does, in theory, change target, but seeing how it's a "melee" pet, it will remain very close to the original target and reacquire the same enemy every lunge cycle. Unless it's a very fast enemy.
