There is a comment above the function indicating that it should be aligned with hero ammo breakage, but this wasn't the case. One big difference is that any monster-thrown or -shot object would be deleted unconditionally if it hit another monster trapped in a pit. I don't know why that was in there, but it's not present in hero ammo breakage chances, and it meant that a monster could sling the Mines luckstone at the hero, hit a monster in the pit, and permanently lock the hero out of getting the luckstone (as just happened to a player during the current tournament). This pulls the hero breakage rules out into their own function and uses that for monster breakage as well, to make sure they are aligned. I also refactored drop_throw a bit to reduce the number of separate variables tracking whether the object was deleted (was create, objgone, and retvalu), and changed its (and ohitmon's) type to boolean.
136 KiB
136 KiB