fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Cycle expansion

Open Kestrellius opened this issue 1 year ago • 0 comments

Overhaul to the "cycle" weapon flag. Establishes the following firing pattern options for weapons:

  1. STANDARD: fires all bank firepoints simultaneously. Retail behavior.
  2. CYCLE FORWARD: fires $shots firepoints at a time, starting at firepoint 0 and incrementing from there. Same behavior as old "cycle" flag.
  3. CYCLE REVERSE: same as cycle-forward, but backwards.
  4. RANDOM EXHAUSTIVE: fires each firepoint in the bank once, in a random order, $shots at a time, then starts over.
  5. RANDOM NONREPEATING: fires $shots randomly-selected firepoints at a time, with the restriction that the same firepoint will never fire twice in a row (unless that's unavoidable because $shots is greater than number-of-firepoints/2).
  6. RANDOM REPEATING: fires $shots randomly-selected firepoints at a time, no restrictions.

The "cycle" flag still exists and functions (sets weapon to use CYCLE FORWARD), but should probably be deprecated. A "cycle multishot" optional parameter is added, which allows weapons using non-standard firing patterns to exhibit shotgun behavior.

On a ship that has the "dynamic primary linking" flag, any combination of firing patterns can be listed as allowed for that ship. A new control allows the player to cycle through firing patterns, same as how an existing one allows cycling through fire rates. By default, only CYCLE FORWARD is allowed, preserving the existing dyn-primary-linking behavior.

If firepoints are rendered on the HUD, the brightening of the next firepoints to fire works correctly, even for random patterns. Unfortunately, there is no HUD element indicating which pattern is active. That should probably be fixed, but is outside the scope of this PR.

Kestrellius avatar Sep 23 '24 02:09 Kestrellius