Ahli / sc2xml

11 stars 1 forks source link

Planetary has blind spots while Blinded Cloud is active (will not defend itself against zerglings) #159

Open Joshua-Leibold opened 3 months ago

Joshua-Leibold commented 3 months ago

Pig mentioned he learned about this from Lambo's stream: https://x.com/x5_PiG/status/1807550540064420114

Basically, surround a planetary that is being blinding clouded with hostile zerglings. The planetary will eventually leave some zerglings alone and not attack them.

I think it's caused by the Planetary being a structure and therefore it has its radius auto-generated according to its stamped footprint which can result in "rounding errors". Something like: Zergling's range is calculated from the zergling to the footprint, but the Planetary's range is not calculated from the footprint to the ling but from the Planetary's radius to the ling, which differs

The "dirtiest" solution is to simply increase the range of the Planetary during Blinding Cloud by a "near-melee" value like 0.05 (this was the smallest number I went before I stopped testing and it seems to work, could potentially go lower)

There are many ways to do this but the way I went about it was by simply adding another switch case to the existing switch effect for Blinding Cloud which applies a Planetary-specific behaviour that reduces range by -5.95 instead of 20 (its normal range is 6).

<!-- Effects-->
<CEffectSwitch id="BlindingCloudSwitch">
    <CaseArray index="0" Validator="IsPlanetaryFortress" Effect="BlindingCloudPlanetaryAB"/>
    <CaseArray Validator="IsStructure" Effect="BlindingCloudStructureSet"/>
</CEffectSwitch>

<CEffectApplyBehavior id="BlindingCloudPlanetaryAB">
    <ValidatorArray index="0" value="IsPlanetaryFortress"/>
    <EditorCategories value="Race:Zerg"/>
    <Behavior value="BlindingCloudPlanetary"/>
</CEffectApplyBehavior>

<!-- Behaviours-->
<CBehaviorBuff id="BlindingCloudPlanetary">
    <Alignment value="Negative"/>
    <InfoIcon value="Assets\Textures\btn-ability-zerg-blindingcloud.dds"/>
    <EditorCategories value="Race:Zerg,AbilityorEffectType:Units"/>
    <TimeScaleSource Value="Global"/>
    <Duration value="0.625"/>
    <Modification WeaponRange="-5.95" DetectArc="0" RadarArc="0"/>
</CBehaviorBuff>