- TriggerPainChance(Name mod, bool forcedPain)
- One exception: PainThrehold is only checked in ReactToDamage, since this function does not require checking damage amount.
- Split off all reactive functionality (pain, infighting, etc) into its own function, ReactToDamage.
- Refactored all DamageMobj's damage <= 0 values.
- Any unconditional cancellations now return -1. ReactToDamage will not be called if values < 0.
- All pain/wound/target changing allowances return 0.
NOFRICTION disables all friction effects on the thing it's set on
(including the speed cap from water/crouching), and NOFRICTIONBOUNCE
disables the "bounce off walls on an icy floor" effect on the thing
it's set on.
This did no longer sort sprites in the same position reliably since the feature to render sprites which only partially are inside a sector was added.
With this, sprites in the same position are no longer guaranteed to be added to the render list in sequence.
Fixed by adding an 'order' field to AActor which gets incremented with each spawned actor and reset when a new level is started.
The software renderer will also need a variation of this fix but its data no longer has access to the defining actor when being sorted, so a bit more work is needed here.
Unlike everything else from the IWADs this had to use the 'light' keyword in ZScript because this is merely a base class for many others and the light definitions here need to be inheritable.
Many uses of random() & value have been turned into random(0, value).
This is not only more efficient, it also ensures better random distribution because the parameter-less variant only returns values between 0 and 255.
Changed to use 32 bit and also fixed the random number call which was using the byte value variant of the access operator, effectively limiting the number of choices to 256.
Since this deletes the resolved elements one by one and needs to start at the front to ensure consistency, it is better to reverse the order so that the deletions take place at the end of the list which requires a lot less data movement.
On Total Chaos this slowed down texture setup to the point where the mod was basically unlaunchable.
The mod which prompted me to add this is "The Chosen" which is a Dehacked-based TC and repurposes many original actors for something entirely different.
The stock lights are not usable for this and would make it impossible to add a GAMEINFO lump to it because then there is no way to disable loading of lights in the startup screen.