Ejemplo n.º 1
0
        // Token: 0x06000E37 RID: 3639 RVA: 0x0003F660 File Offset: 0x0003D860
        private void DetonateMeteor(MeteorStormController.Meteor meteor)
        {
            EffectData effectData = new EffectData
            {
                origin = meteor.impactPosition
            };

            EffectManager.SpawnEffect(this.impactEffectPrefab, effectData, true);
            new BlastAttack
            {
                inflictor        = base.gameObject,
                baseDamage       = this.blastDamageCoefficient * this.ownerDamage,
                baseForce        = this.blastForce,
                canHurtAttacker  = true,
                crit             = this.isCrit,
                falloffModel     = BlastAttack.FalloffModel.Linear,
                attacker         = this.owner,
                bonusForce       = Vector3.zero,
                damageColorIndex = DamageColorIndex.Item,
                position         = meteor.impactPosition,
                procChainMask    = default(ProcChainMask),
                procCoefficient  = 1f,
                teamIndex        = TeamIndex.None,
                radius           = this.blastRadius
            }.Fire();
        }
Ejemplo n.º 2
0
        // Token: 0x06000E34 RID: 3636 RVA: 0x0003F430 File Offset: 0x0003D630
        private void FixedUpdate()
        {
            if (!NetworkServer.active)
            {
                return;
            }
            this.waveTimer -= Time.fixedDeltaTime;
            if (this.waveTimer <= 0f && this.wavesPerformed < this.waveCount)
            {
                this.wavesPerformed++;
                this.waveTimer = UnityEngine.Random.Range(this.waveMinInterval, this.waveMaxInterval);
                MeteorStormController.MeteorWave item = new MeteorStormController.MeteorWave(CharacterBody.readOnlyInstancesList.ToArray <CharacterBody>(), base.transform.position);
                this.waveList.Add(item);
            }
            for (int i = this.waveList.Count - 1; i >= 0; i--)
            {
                MeteorStormController.MeteorWave meteorWave = this.waveList[i];
                meteorWave.timer -= Time.fixedDeltaTime;
                if (meteorWave.timer <= 0f)
                {
                    meteorWave.timer = UnityEngine.Random.Range(0.05f, 1f);
                    MeteorStormController.Meteor nextMeteor = meteorWave.GetNextMeteor();
                    if (nextMeteor == null)
                    {
                        this.waveList.RemoveAt(i);
                    }
                    else if (nextMeteor.valid)
                    {
                        this.meteorList.Add(nextMeteor);
                        EffectManager.SpawnEffect(this.warningEffectPrefab, new EffectData
                        {
                            origin = nextMeteor.impactPosition,
                            scale  = this.blastRadius
                        }, true);
                    }
                }
            }
            float num  = Run.instance.time - this.impactDelay;
            float num2 = num - this.travelEffectDuration;

            for (int j = this.meteorList.Count - 1; j >= 0; j--)
            {
                MeteorStormController.Meteor meteor = this.meteorList[j];
                if (meteor.startTime < num2 && !meteor.didTravelEffect)
                {
                    this.DoMeteorEffect(meteor);
                }
                if (meteor.startTime < num)
                {
                    this.meteorList.RemoveAt(j);
                    this.DetonateMeteor(meteor);
                }
            }
            if (this.wavesPerformed == this.waveCount && this.meteorList.Count == 0)
            {
                UnityEngine.Object.Destroy(base.gameObject);
            }
        }
Ejemplo n.º 3
0
 // Token: 0x06000E36 RID: 3638 RVA: 0x0003F62A File Offset: 0x0003D82A
 private void DoMeteorEffect(MeteorStormController.Meteor meteor)
 {
     meteor.didTravelEffect = true;
     if (this.travelEffectPrefab)
     {
         EffectManager.SpawnEffect(this.travelEffectPrefab, new EffectData
         {
             origin = meteor.impactPosition
         }, true);
     }
 }
Ejemplo n.º 4
0
            // Token: 0x06000E3B RID: 3643 RVA: 0x0003F7D4 File Offset: 0x0003D9D4
            public MeteorStormController.Meteor GetNextMeteor()
            {
                if (this.currentStep >= this.targets.Length)
                {
                    return(null);
                }
                CharacterBody characterBody = this.targets[this.currentStep];

                MeteorStormController.Meteor meteor = new MeteorStormController.Meteor();
                if (characterBody && UnityEngine.Random.value < this.hitChance)
                {
                    meteor.impactPosition = characterBody.corePosition;
                    Vector3 origin       = meteor.impactPosition + Vector3.up * 6f;
                    Vector3 onUnitSphere = UnityEngine.Random.onUnitSphere;
                    onUnitSphere.y = -1f;
                    RaycastHit raycastHit;
                    if (Physics.Raycast(origin, onUnitSphere, out raycastHit, 12f, LayerIndex.world.mask, QueryTriggerInteraction.Ignore))
                    {
                        meteor.impactPosition = raycastHit.point;
                    }
                    else if (Physics.Raycast(meteor.impactPosition, Vector3.down, out raycastHit, float.PositiveInfinity, LayerIndex.world.mask, QueryTriggerInteraction.Ignore))
                    {
                        meteor.impactPosition = raycastHit.point;
                    }
                }
                else if (this.nodeGraphSpider.collectedSteps.Count != 0)
                {
                    int index = UnityEngine.Random.Range(0, this.nodeGraphSpider.collectedSteps.Count);
                    SceneInfo.instance.groundNodes.GetNodePosition(this.nodeGraphSpider.collectedSteps[index].node, out meteor.impactPosition);
                }
                else
                {
                    meteor.valid = false;
                }
                meteor.startTime = Run.instance.time;
                this.currentStep++;
                return(meteor);
            }