luciensadi / AwakeMUD

The Community Edition fork of the 'Awakened Worlds' Shadowrun 3 MUD codebase.
Other
55 stars 31 forks source link

Changes to initiative handling #682

Closed jdevnull closed 1 year ago

jdevnull commented 1 year ago
  1. Prevent actions for zero/negative init even when not flagged PRF_SEE_TIPS.

    • NPCs were attacking with negative initiative because they're not flagged PRF_SEE_TIPS
  2. Don't let new combatants replace the head of the combat list.

    • Because of the global combat list, and because the global initiative re-roll happens when the head of the list reaches 0 init, re-ordering the list for new combatants can cause already-engaged characters to experience arbitrary length out-of-initiative states throughout the duration of their fight. This prevents that by keeping the original head of the combat list while re-ordering the rest. The tradeoff is that new combatants may reach the global init re-roll while still having some remaining init.

Khai

jdevnull commented 1 year ago

Ok, the idea now is that, because the global re-roll happens when the head of the list reaches 0 initiative, we just keep the original head while re-ordering the rest of the list whenever a new combatant is added. This should prevent arbitrarily long strings of out-of-initiative messages, with the trade-off that new combatants may encounter the global re-roll early (i.e., while still having some init remaining).

luciensadi commented 1 year ago

I'll test it out on my end-- thanks for submitting!