before tavi could fully register that the attack was happening , the creature ripped the spider 's head from its body , and the rest of it collapsed to the surface of the croach , its legs twitching and flailing .