Forcing specific weapon by range #1407
Open
+92
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ForceWeapon.InRange
forces specified a list of weapons to be used once the target is within theirRange
. The first weapon in the listed order satisfied will be selected.ForceWeapon.InRange.Overrides
overrides the range when decides which weapon to use. Value from position matching the position fromForceWeapon.InRange
is used if found, or the weapon's ownRange
if not found or set to a value below 0. Specifically, if a position hasForceWeapon.InRange
set to -1 andForceWeapon.InRange.Overrides
set to a positive value, it'll use default weapon selection logic once satisfied.ForceWeapon.InRange.ApplyRangeModifiers
is set to true, any applicable weapon range modifiers from the firer are applied to the decision range.In
rulesmd.ini
:An example:
when the target distance is less than 1: use primary.
when the target distance is between 1 and 2: use secondary.
when the target distance is between 2 and 3: use primary.
when the target distance is between 3 and 4: use default weapon selection rule.
when the target distance is between 4 and secondary's range: use secondary.
when the target distance is greater than secondary's range: use default weapon selection rule.
This pattern can natually support WeaponX as well.