Full fly knockback
Verified against the spelunky.ai port v0.1.13 on .
Full fly knockback is a quirk of Spelunky Classic in which a Tomb Lord's fly knocks any monster back at full strength, where a heavy one should get half.
A Tomb Lord's flies hurt monsters as well as the player, and knock them back. The code means a heavy monster to be knocked back half as far, but every monster is heavy, and the lines after the halving set the full knockback again, so every monster the flies hit, a Caveman or a Hawkman, is sent flying.
What happens
#A Tomb Lord spits its flies at the player, and a caveman stands between them. The first fly to hit it knocks it back at the fly's 4 pixels a step and 4 up, and the next at 5 [1].
Why
#When a fly touches a monster other than a Tomb Lord, it picks the knockback by whether the monster is heavy, then sets the light one again for both:
if (other.type != "Tomb Lord")
{
if (other.heavy)
{
other.xVel = xVel*0.5;
other.yVel = -2;
}
else
{
other.xVel = xVel;
other.yVel = -4;
}
other.xVel = xVel;
other.yVel = -4;objects/oFly/collision_oEnemy.gml:1-14, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).Every monster is heavy: the monsters' shared create event sets heavy, and none of them clears it
[2]. So the heavy branch is the one that runs, and the two lines after it
undo it: every monster a fly hits gets the fly's own speed, 3 to 5 pixels a step, and 4 pixels a step up
[3]. The fly then takes 2 of its hit points and stuns it
[4].
Reproducing it
#Stand in front of a Tomb Lord with a Caveman or a Hawkman between you, so its flies hit the monster first. It happens in the Temple wherever the three meet. The replay of the clip stages it: the player stands on a pillar in the Tomb Lord's line, and a caveman stands below, between them. The first fly to hit the caveman (frame 272) knocks it back at 4 pixels a step and 4 up, not 2 and 2, and takes 2 of its 3 hit points; the next (279) at 5 and 4 up [5].
In the port
#The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs [3], and the oracle's fingerprint of the replay pins both knockbacks. No option turns it off.
FAQ
#- What happens when a Tomb Lord's fly hits another monster in Spelunky Classic?
It takes 2 of the monster's hit points, stuns it, and knocks it back the way the fly was going, at the fly's speed, 3 to 5 pixels a step, and 4 pixels a step up. Only another Tomb Lord is left alone.
- Why doesn't a heavy monster resist the flies' knockback?
The code gives a heavy monster half the push and half the lift, and then sets the full push and lift again for every monster, whatever it just set. As every monster is heavy, the lighter knockback never sticks.
- Where do the flies hit monsters in Spelunky Classic?
In the Temple, where a Tomb Lord spitting at the player can hit a Caveman or a Hawkman standing between them.
See also
#References
#- Clip quirks/fly-full-knockback
objects/oEnemy/create.gml:15- Quirk 1 (docs/quirks.md)
objects/oFly/collision_oEnemy.gml:16-26- Replay
fidelity/replays/enemy-tomb-lord-fly-knockback.txt