// Token: 0x06001E6B RID: 7787 RVA: 0x0008F888 File Offset: 0x0008DA88
        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>();
            MissileController          component4 = gameObject.GetComponent <MissileController>();
            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;
            }
        }
 // Token: 0x06001E7C RID: 7804 RVA: 0x0008390C File Offset: 0x00081B0C
 private void Update()
 {
     this.timer          += Time.deltaTime;
     this.nextSpawnTimer += Time.deltaTime;
     if (this.timer >= this.duration)
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
     if (this.nextSpawnTimer >= this.duration / (float)this.count)
     {
         this.nextSpawnTimer -= this.duration / (float)this.count;
         GameObject           gameObject = UnityEngine.Object.Instantiate <GameObject>(this.childProjectilePrefab, base.transform.position, Util.QuaternionSafeLookRotation(base.transform.forward));
         ProjectileController component  = gameObject.GetComponent <ProjectileController>();
         if (component)
         {
             component.procChainMask   = this.projectileController.procChainMask;
             component.procCoefficient = this.projectileController.procCoefficient * this.childProcCoefficient;
             component.Networkowner    = this.projectileController.owner;
         }
         gameObject.GetComponent <TeamFilter>().teamIndex = base.GetComponent <TeamFilter>().teamIndex;
         ProjectileDamage component2 = gameObject.GetComponent <ProjectileDamage>();
         if (component2)
         {
             component2.damage           = this.projectileDamage.damage * this.childDamageCoefficient;
             component2.crit             = this.projectileDamage.crit;
             component2.force            = this.projectileDamage.force;
             component2.damageColorIndex = this.projectileDamage.damageColorIndex;
         }
         if (!this.ignoreParentForChainController)
         {
             ChainController component3 = gameObject.GetComponent <ChainController>();
             if (component3)
             {
                 component3.pastTargetList.Add(base.transform.parent);
             }
         }
         NetworkServer.Spawn(gameObject);
     }
 }
Beispiel #3
0
        // Token: 0x06001E47 RID: 7751 RVA: 0x0008EBE0 File Offset: 0x0008CDE0
        private void FireChild(Vector3 direction)
        {
            GameObject           gameObject = UnityEngine.Object.Instantiate <GameObject>(this.childrenProjectilePrefab, base.transform.position, Util.QuaternionSafeLookRotation(direction));
            ProjectileController component  = gameObject.GetComponent <ProjectileController>();

            if (component)
            {
                component.procChainMask   = this.projectileController.procChainMask;
                component.procCoefficient = this.projectileController.procCoefficient;
                component.Networkowner    = this.projectileController.owner;
            }
            gameObject.GetComponent <TeamFilter>().teamIndex = base.GetComponent <TeamFilter>().teamIndex;
            ProjectileDamage component2 = gameObject.GetComponent <ProjectileDamage>();

            if (component2)
            {
                component2.damage           = this.projectileDamage.damage * this.childrenDamageCoefficient;
                component2.crit             = this.projectileDamage.crit;
                component2.force            = this.projectileDamage.force;
                component2.damageColorIndex = this.projectileDamage.damageColorIndex;
            }
            NetworkServer.Spawn(gameObject);
        }