Line 804 says:
IF RND(8) THEN (item hit enemy, enemy took damage)
ELSE (item dropped on the floor)
The game randomly spits a whole number from 0 to 7, if it's nonzero your throw is a hit. If it's 0 your throw misses the monster and item drops on floor.