public virtual void DoPreSortLogic(EntitySystem Weapon, List <GameEntity> Targets, ArcenCharacterBuffer TracingBuffer, ArcenSimContext Context)
        {
            tracing = TracingBuffer != null;
            TargetSorter_Base.TracingBuffer = TracingBuffer;

            if (tracing)
            {
                TracingBuffer.Add("FindTarget:").Add(Weapon.ParentEntity.TypeData.InternalName).Add(" : ").Add(Weapon.TypeData.InternalName);
            }

            if (SniperRange == null)
            {
                SniperRange = Balance_RangeTable.Instance.GetRowByName("Sniper", false, null);
                LongRange   = Balance_RangeTable.Instance.GetRowByName("Long", false, null);
                MediumRange = Balance_RangeTable.Instance.GetRowByName("Medium", false, null);
                ShortRange  = Balance_RangeTable.Instance.GetRowByName("Short", false, null);

                ShieldDefense    = Balance_DefenseTable.Instance.GetRowByName("Shields", false, null);
                StructureDefense = Balance_DefenseTable.Instance.GetRowByName("Structure", false, null);
            }
        }
Ejemplo n.º 2
0
        public override TargetComparisonResult Compare(GameEntity Left, GameEntity Right)
        {
            TargetComparisonResult val;

            val = CompareValues(Left, Right, true, Left.GetMatches(EntityRollupType.TractorSource), Right.GetMatches(EntityRollupType.TractorSource), "TractorSource", TracingBuffer);
            if (val != TargetComparisonResult.NoPreference)
            {
                return(val);
            }

            val = CompareValues(Left, Right, true, Left.GetMatches(EntityRollupType.GravitySource), Right.GetMatches(EntityRollupType.GravitySource), "GravitySource", TracingBuffer);
            if (val != TargetComparisonResult.NoPreference)
            {
                return(val);
            }

            Balance_Range leftRange  = Left.TypeData.Computed_LongestWeaponRange;
            Balance_Range rightRange = Right.TypeData.Computed_LongestWeaponRange;

            val = CompareValues(Left, Right, true, leftRange == SniperRange, rightRange == SniperRange, "SniperRange", TracingBuffer);
            if (val != TargetComparisonResult.NoPreference)
            {
                return(val);
            }

            val = CompareValues(Left, Right, true, leftRange == LongRange, rightRange == LongRange, "LongRange", TracingBuffer);
            if (val != TargetComparisonResult.NoPreference)
            {
                return(val);
            }

            val = CompareValues(Left, Right, true, Left.GetMatches(EntityRollupType.ProjectsShield), Right.GetMatches(EntityRollupType.ProjectsShield), "ProjectsShield", TracingBuffer);
            if (val != TargetComparisonResult.NoPreference)
            {
                return(val);
            }

            return(TargetComparisonResult.NoPreference);
        }