// Token: 0x06001EE2 RID: 7906 RVA: 0x00085C4C File Offset: 0x00083E4C
        private static void InitializeProjectile(ProjectileController projectileController, FireProjectileInfo fireProjectileInfo)
        {
            GameObject                 gameObject = projectileController.gameObject;
            ProjectileDamage           component  = gameObject.GetComponent <ProjectileDamage>();
            TeamFilter                 component2 = gameObject.GetComponent <TeamFilter>();
            ProjectileNetworkTransform component3 = gameObject.GetComponent <ProjectileNetworkTransform>();
            ProjectileTargetComponent  component4 = gameObject.GetComponent <ProjectileTargetComponent>();
            ProjectileSimple           component5 = gameObject.GetComponent <ProjectileSimple>();

            projectileController.Networkowner  = fireProjectileInfo.owner;
            projectileController.procChainMask = fireProjectileInfo.procChainMask;
            if (component2)
            {
                component2.teamIndex = TeamComponent.GetObjectTeam(fireProjectileInfo.owner);
            }
            if (component3)
            {
                component3.SetValuesFromTransform();
            }
            if (component4)
            {
                component4.target = (fireProjectileInfo.target ? fireProjectileInfo.target.transform : null);
            }
            if (fireProjectileInfo.useSpeedOverride && component5)
            {
                component5.velocity = fireProjectileInfo.speedOverride;
            }
            if (fireProjectileInfo.useFuseOverride)
            {
                ProjectileImpactExplosion component6 = gameObject.GetComponent <ProjectileImpactExplosion>();
                if (component6)
                {
                    component6.lifetime = fireProjectileInfo.fuseOverride;
                }
                ProjectileFuse component7 = gameObject.GetComponent <ProjectileFuse>();
                if (component7)
                {
                    component7.fuse = fireProjectileInfo.fuseOverride;
                }
            }
            if (component)
            {
                component.damage           = fireProjectileInfo.damage;
                component.force            = fireProjectileInfo.force;
                component.crit             = fireProjectileInfo.crit;
                component.damageColorIndex = fireProjectileInfo.damageColorIndex;
            }
        }
Example #2
0
        // Token: 0x06001E1E RID: 7710 RVA: 0x0008DCF8 File Offset: 0x0008BEF8
        private void SearchForTarget()
        {
            this.bullseyeSearch.teamMaskFilter = TeamMask.allButNeutral;
            this.bullseyeSearch.teamMaskFilter.RemoveTeam(this.teamFilter.teamIndex);
            this.bullseyeSearch.filterByLoS       = this.testLoS;
            this.bullseyeSearch.searchOrigin      = this.transform.position;
            this.bullseyeSearch.searchDirection   = this.transform.forward;
            this.bullseyeSearch.maxDistanceFilter = this.lookRange;
            this.bullseyeSearch.sortMode          = BullseyeSearch.SortMode.DistanceAndAngle;
            this.bullseyeSearch.maxAngleFilter    = this.lookCone;
            this.bullseyeSearch.RefreshCandidates();
            IEnumerable <HurtBox> source = this.bullseyeSearch.GetResults();

            if (this.ignoreAir)
            {
                source = from v in source
                         where v.healthComponent.GetComponent <CharacterMotor>()
                         select v;
            }
            ProjectileTargetComponent projectileTargetComponent = this.targetComponent;
            HurtBox hurtBox = source.FirstOrDefault <HurtBox>();

            projectileTargetComponent.target = ((hurtBox != null) ? hurtBox.transform : null);
        }