Mr Wonko gave a really good answer, but I thought I'd just explain in short: if ( function() ) {//stuff} means function() is called, evaluated and returns a value to the if statement it was called from, if the value is 1 or greater, then it excutes the stuff in {} otherwise the value is false and the stuff in brackets is skipped. The activeDefense() stuff is very similar. If the condition is !activeDefense() it would require that activeDefense return a value of false in order to execute. I've always thought ! a function is a bit confusing, and have preferred to say something like if (activeDefense == false). But that's just me.