Add Target Filtering Options to AttachEffect System #1975
Merged
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.
Overview
This PR introduces three new filtering parameters to the AttachEffect system, providing granular control over which units can receive specific attached effects.
New Features
1.
AffectTypesPenetratesForceShield.2.
IgnoreTypesAffectTypes.3.
AffectTargetsFiltering Logic
The system applies filters in the following order:
All checks must pass for the effect to be applied.
Description
AffectTypes, if set to a non-empty list, restricts the effect to only be applicable on the specific unit types listed. If this is not set or empty, no whitelist filtering occurs. This check has the highest priority.IgnoreTypes, if set to a non-empty list, prevents the effect from being applied to any of the specific unit types listed. If this is not set or empty, no blacklist filtering occurs. This check is performed afterAffectTypes.AffectTargets, if set to a non-empty list, restricts the effect to only be applicable on units belonging to the specified target categories (e.g., infantry, units, aircraft, buildings). This check is performed after both type-based filters.Usage
[SOMEATTACHEFFECT]
AffectTypes=E1,HTNK,YAPOWR ; List of TechnoTypes
IgnoreTypes=E2,APOC,YATECH ; List of TechnoTypes
AffectTargets=all ; List of TechnoType Enumeration (none|infantry|units|aircraft|buildings|all)
概述
本PR为AttachEffect加入了三个参数,用来判断哪些科技类型能被附加上该AE。
新功能
1.
AffectTypesPenetratesForceShield之后进行判定。2.
IgnoreTypesAffectTypes之后进行判定。3.
AffectTargetsall,即全部类型。过滤逻辑
按以下顺序应用过滤器:
必须通过所有检查才能将AE应用于该科技类型。
描述
AffectTypes,如果设置为非空列表,则限制效果仅适用于列出的特定科技类型。如果不设置或为空,则不进行白名单过滤。此检查具有最高优先级。IgnoreTypes,如果设置为非空列表,将阻止效果应用于列出的任何特定科技类型。如果不设置或为空,则不进行黑名单过滤。该检查在AffectTypes之后执行。AffectTargets,如果设置为非空列表,限制效果只适用于属于指定目标类别的科技类型(例如,步兵,单位,飞机,建筑)。此检查在两个基于类型的筛选器之后执行。