Exemplo n.º 1
0
 public void FireAttackDataEffects(AttackResult attackResult)
 {
     if ((attackResult.attackEffectPattern != null) && ((attackResult.hitEffectPattern == AttackResult.HitEffectPattern.Normal) || (attackResult.hitEffectPattern == AttackResult.HitEffectPattern.OnlyAttack)))
     {
         AttackPattern.ActAttackEffects(attackResult.attackEffectPattern, this.avatar, attackResult.hitCollision.hitPoint, attackResult.hitCollision.hitDir);
     }
     if (attackResult.attackCameraShake != null)
     {
         AttackPattern.ActCameraShake(attackResult.attackCameraShake);
     }
 }
Exemplo n.º 2
0
        public override void Core()
        {
            base.Core();
            this._Timer += Time.deltaTime * base.entity.TimeScale;
            if (this._state != ArsenalState.None)
            {
                if (this._state == ArsenalState.Charge)
                {
                    if (this._chargeIndex < this._cannonList.Count)
                    {
                        CannonInfo cannon = this._cannonList[this._chargeIndex];
                        if (this._Timer >= cannon.delay)
                        {
                            Vector3 initDir = (Vector3)(Quaternion.FromToRotation(Vector3.forward, base.entity.transform.forward) * cannon.localForward);
                            Vector3 initPos = base.entity.XZPosition + (Quaternion.FromToRotation(Vector3.forward, base.entity.transform.forward) * cannon.localPosition);
                            cannon.position      = initPos;
                            cannon.forward       = initDir.normalized;
                            cannon.cannonEffects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.CannonEffects, initPos, initDir, Vector3.one, base.entity);

                            this.UpdateEffects(cannon.cannonEffects, initPos, initDir);
                            cannon.chargeEffects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ChargeEffects, initPos, initDir, Vector3.one, base.entity);

                            this.UpdateEffects(cannon.chargeEffects, initPos, initDir);
                            Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.HintEffects, this.GetTargetPosition(cannon), Vector3.forward, Vector3.one, base.entity);

                            this._chargeIndex++;
                        }
                    }
                    if (this._Timer > this.config.ChargeTime)
                    {
                        this._state      = ArsenalState.Fire;
                        this._Timer      = 0f;
                        this._shakeTimer = this.config.FireIntervial;
                    }
                }
                else if (this._state == ArsenalState.Fire)
                {
                    for (int i = 0; i < this._cannonList.Count; i++)
                    {
                        CannonInfo info2 = this._cannonList[i];
                        info2.fireTimer -= Time.deltaTime * base.entity.TimeScale;
                        if (info2.fireTimer <= 0f)
                        {
                            List <MonoEffect> list = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ShootEffects, info2.position, info2.forward, Vector3.one, base.entity);

                            this.UpdateEffects(list, info2.position, info2.forward);
                            Vector2 vector3 = (Vector2)(UnityEngine.Random.insideUnitCircle * this.config.ExplodeRadius);
                            Vector3 vector4 = new Vector3(vector3.x, 0f, vector3.y);
                            Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ExplodeEffects, this.GetTargetPosition(info2) + vector4, Vector3.forward, Vector3.one, base.entity);

                            this.CreateExplode(this.GetTargetPosition(info2));
                            info2.fireTimer = this.config.FireIntervial;
                        }
                    }
                    this._shakeTimer -= Time.deltaTime * base.entity.TimeScale;
                    if (this._shakeTimer <= 0f)
                    {
                        ConfigMonsterAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(this._monster.config, this.config.ShakeAnimEventID);
                        if (event2.CameraShake != null)
                        {
                            AttackPattern.ActCameraShake(event2.CameraShake);
                        }
                        this._shakeTimer = this.config.FireIntervial;
                    }
                    if (this._Timer > this.config.FireTime)
                    {
                        this._state = ArsenalState.Disappear;
                        this._Timer = 0f;
                    }
                }
                else if (this._Timer > this.config.ClearTime)
                {
                    this._state = ArsenalState.None;
                    this.ClearCannons();
                }
            }
        }