Data/Effects/Search Area

(Editor Screenshot) Needs pic of high templar psi storm splat

* Validators in the effects applied are used in combination with the Search - Search Filters to determine valid targets
* The Damage effect has it's own search fields so it is not necessary to combine searches with damage effects to create splash damage

### Known Bug

* "Self Required" as a target filter is broken. Attempts to uncheck all filters, but include Caster with the "Include" field has failed as well. The only method possible to counter this is to have the follow up effect validated by "TargetIsSelf" which should be availlable in the core files validators (or else just create a Filter Validator that is located at Target, with the "Self" filter set as required). This bug is currently being reported to Blizzard, but still unfixed.

## Example Usage

### Changeling - Disguise (Search)

The Search Area used by the changeling for determining what unit to morph into. The search applies the Changeling - Disguise (Switch Based On Unit Target Type) switch effect to the target unit. This Switch effect uses one of several Unit Compare Field type validators to determine the race of the target before using a Set effect containing an Issue Order and Modify Unit effects on the caster to morph into the appropriate unit and change the team colour to the target of the switch effect.

#### URL

As the Changeling is already in the editor, no URL is needed

### High Templar - Psi Storm (Search)

The Search Area effect periodically applied by the Create Persistent effect cast by the Psi Storm ability. It uses a Apply Behavior effect to apply a Buff called High Templar - Psionic Storm that does initial and periodic Damage effects to any units within the search area.

#### URL

As the High templar and the Psi Storm ability are already in the editor, no URL is needed

## Fields Description

### (None): Extra Radius Bonus

Radius bonus granted to the effect's search radius (all arrays) by accumulators.

### (None): Un Creep

When on, the search effect will exclude Creeps in its search radius.

### Effect - Recycle Count

* If the requested number of units aren't found, this many units will be "recycled" and enumerated repeatedly until the requirements are met.

### Effect - Response Flags

* Determines how units respond when hit by this effect if they can (set by the Behavior - Response field under the Units data type)
* Acquire makes the unit acquire the caster
* Flee makes the unit run from the caster

### Effect - Validators

* The validators that need to return true for the effect to take place

### Search - Area

Multiple arrays can be set in this field.

* Note that if each search effect array has the same radius, the index order will pick the first one that passes from its validator (or no validation). If a validator blocks it, then the next search array will be used, and so on if validators are negating them, until complete failure if need be. It is not possible to use multiple arrays as a Set effect in hope of executing them all, it is rather like a case type of selection.
* "Chance" is not considered as a valid reason for skipping to the next array. When the effect can run, but misses cause of chance, it is still considered chosen as final.

#### Arc

* Determines the arc for search area scanned by this effect
* A 90 degree arc means that the area searched to 45 degrees either side of the direction the effect impacts
* Needs to be set for each region searched

#### Effect

* The effect performed on each target
* Needs to be set for each region searched

#### Maximum Count

* Determines how many targets can be targeted by the effect in the specified array
* Setting to -1 allows the search to target infinite targets

#### Radius

* Determines the radius for the area searched
* Needs to be set for each region searched

#### Radius Bonus

* Increases the Search Radius by this amount for every consecutive execution of this effect from a the same effect tree. Casting an ability a second time starts over this generating radius.

### Search - Exclude - Effect

* A previous effect in the same branch of the effect tree as this effect used as a frame of reference for determining the Source, Target, Outer etc. of the Search - Exclude - Value

### Search - Exclude - Value

* Unit(s) that are excluded from the search
* Caster Unit: Casts the effect on the casting unit
* Outer Unit: Casts the effect on a unit that is not Target, Source, Caster, or Origin
* Source Unit: Casts the effect on the most recent unit targeted or created by a previous effect in the effect tree
* Target Unit: Can cast the effect at the target unit unless specified otherwise by the Search - Exclude - Effect field
* Unit Origin: (Unknown)
* Unknown: (Unknown)

### Search - Include - Effect

* A previous effect in the same branch of the effect tree as this effect used as a frame of reference for determining the Source, Target, Outer etc. of the Search - Include - Value

### Search - Include - Value

* Unit(s) that are included in the search
* Caster Unit: Casts the effect on the casting unit
* Outer Unit: Casts the effect on a unit that is not Target, Source, Caster, or Origin
* Source Unit: Casts the effect on the most recent unit targeted or created by a previous effect in the effect tree
* Target Unit: Can cast the effect at the target unit unless specified otherwise by the Search - Include - Effect field
* Unit Origin: (Unknown)
* Unknown: (Unknown)

### Search - Maximum Count

The total maximum number of units able to be targeted over all areas searched (all arrays).

* There is no difference between this field and the maximum count from the Area field, except that this one here works more like a generic limit for all arrays, in case this is more logic built this way.

### Search - Minimum Count

* Minimum number of potential targets required over all areas rearched for this effect to take place

### Search - Minimum Count Error

* The alert played from the Alerts data type when the effect fails to find enough valid targets

### Search - Search Filters

* The filters for determining what target attributes the search can target

### Search - Search Flags

* Call For Help: Causes enemy units hit by the attack to recruit nearby units to help kill their attacker.
* Center At Launch: Causes the Launch Location to be used as Center Point for the Search Area, if the area is a cone (arc <360) it will point towards the Impact Location. This is mainly used when Launch Location and Impact location are only used for an angle direction, while requesting the search to always start from launch unit, no matter what. Ex: a unit weapon's uses a turret, and shoots fire in a cone. You want the search to aknowledge the right angle of the caster vs target (by setting Impact location as Target Unit), but you dont want the search to start from the target unit point and search beyond.
* Extend By Unit Radius: Increases the Search Area radius by an amount equal to the Radius of the Launch Unit (Unit Data).
* Offset Area By Angle: Makes the angle local to the forwards direction of the unit as opposed to the map grid. This flag doesn't match well with **Center at Launch** flag when doing "Flame Thrower" types of searches.
* Offset By Unit Radius: Offsets the Search Area epicenter, forcing it to avoid anything inside the Launch Unit's Radius (Unit Data). Even if this search effect has a radius of 0, this will still allow to hit any units on that touches the ring radius of the launch unit.
* Same Cliff Level: Makes the search area only affects targets that are on the same cliff level

### Target - Impact Location - Effect

* A previous effect in the same branch of the effect tree as this effect used as a frame of reference for determining the Source, Target, Outer etc. of the Target - Impact Location - Value

### Target - Impact Location - Value

* Where the center of the search area is
* Caster Point casts the effect at the location of where the casting unit is
* Caster Unit casts the effect on the casting unit
* Caster Unit/Point can cast the effect on either the casting unit or it's location
* Origin Point (Unknown)
* Origin Unit (Unknown)
* Origin Unit Or Point (Unknown)
* Outer Point casts the effect at the location of where the outer unit is.
* Outer Unit that is not Target, Source, Caster, or Origin.
* Outer Unit/Point can cast the effect on either the outer unit or it's location.
* Source Point casts the effect at the point of the effect casting this effect wjich can be a different location from the caster
* Source Unit casts the effect on the unit targeted or created by a previous effect in the effect tree
* Source Unit/Point casts the effect at either a point of unit that was the target of a previous effect in the effect tree
* Target Point can cast the effect at the target point
* Target Unit can cast the effect at the target unit
* Target Unit/Point can cast the effect at either the target unit or point
* Unknown (Unknown)

### Target - Launch Location - Effect

* A previous effect in the same branch of the effect tree as this effect used as a frame of reference for determining the Source, Target, Outer etc. of the Target - Launch Location - Value

### Target - Launch Location - Value

* Where the effect is launched from to determine direction when using area search by angle. This does not indicate where the search will impact, but rather, just where the eye of the search will look at if not doing a 360° search.

### Target - Target Sorts - Request Count

* How many targets to pick after all potential targets went through the sorting filters

### Target - Target Sorts - Request Percentage

* What percentage of targets to pick after all potential targets went through the sorting filters

### Target - Target Sorts - Sorts

* The target sorts from the Target Sorts data type used for prioritizing potential targets
* Each array is checked, however, no further match will be found if one of the arrays locks on a single target unit. Ex: If the first Target sort checks for the unit with smallest life percentage (TS LifeFraction) and found it, putting a "Random" TS as a second array will check all random units among that one and only unit found at first, which resolves to no further matching unit. However, if all units have full life (so life equal), they will all be selected by the first array, then the second array (Random) will pick one of them randomly.