added invulnerable state and fixed sword damage problem