예제 #1
0
 protected override void DoAction()
 {
     this.status = ChainSpiritAction.EStatus.ES_Effect;
     this.startTimestamp = this.MinLiftTime;
     this.nextActor = base.variables.skillTarget;
     Vector3 vector = Vector3.zero;
     base.variables.skillCaster.transform.position = new Vector3(vector.x, vector.y + this.YOffset,vector.z);
     if (this.nextActor == null)
     {
         this.nextActor = base.variables.skillCaster;
     }
 }
예제 #2
0
 protected override void OnDespawned()
 {
     base.OnDespawned();
     for (int i = 0; i < this.missileList.Count; i++)
     {
         if (this.missileList[i] != null && this.missileList[i].lightning != null)
         {
             UnityEngine.Object.Destroy(this.missileList[i].lightning.gameObject);
         }
     }
     this.oldActorList.Clear();
     this.missileList.Clear();
     this.nextActor = null;
     this.startTimestamp = 0f;
     this.status = ChainSpiritAction.EStatus.ES_None;
     this.timer = 0f;
 }
예제 #3
0
 protected override void UpdateAction(float elapse)
 {
     this.startTimestamp -= elapse;
     if (this.status == ChainSpiritAction.EStatus.ES_Destroy)
     {
         if (this.startTimestamp <= 0f)
         {
             base.Finish();
         }
         return;
     }
     this.UpdateLighting(elapse);
     if (this.status == ChainSpiritAction.EStatus.ES_None)
     {
         this.status = ChainSpiritAction.EStatus.ES_Finish;
         this.timer = 0f;
         return;
     }
     for (int i = 0; i < this.oldActorList.Count; i++)
     {
         if (this.oldActorList[i] != null && this.oldActorList[i].actor != null && !this.oldActorList[i].actor.IsDead)
         {
             this.oldActorList[i].timer -= elapse;
             if (this.oldActorList[i].timer <= 0f)
             {
                 this.DoEffectOnTarget(this.oldActorList[i].actor);
             }
         }
     }
     if (this.timer > 0f)
     {
         this.timer -= elapse;
     }
     ChainSpiritAction.EStatus eStatus = this.status;
     if (eStatus != ChainSpiritAction.EStatus.ES_Effect)
     {
         if (eStatus == ChainSpiritAction.EStatus.ES_Finish)
         {
             if (this.timer <= 0f)
             {
                 this.oldActorList.Clear();
                 for (int j = 0; j < this.missileList.Count; j++)
                 {
                     if (this.missileList[j] != null && this.missileList[j].lightning != null)
                     {
                         UnityEngine.Object.Destroy(this.missileList[j].lightning.gameObject);
                     }
                 }
                 this.missileList.Clear();
                 this.status = ChainSpiritAction.EStatus.ES_Destroy;
             }
         }
     }
     else
     {
         if (base.variables == null || base.variables.skillCaster == null)
         {
             this.status = ChainSpiritAction.EStatus.ES_Finish;
             this.timer = 0f;
             return;
         }
         if (base.variables.skillCaster.IsDead)
         {
             this.DoFinish();
             return;
         }
         if (this.timer <= 0f)
         {
             if (this.nextActor != null)
             {
                 ChainSpiritAction.TargetData targetData = new ChainSpiritAction.TargetData();
                 targetData.actor = this.nextActor;
                 targetData.timer = 0.1f;
                 this.oldActorList.Add(targetData);
             }
             this.nextActor = this.GetNextTarget();
             if (this.nextActor == null)
             {
                 this.DoFinish();
                 return;
             }
             this.timer = 0.1f;
         }
     }
 }
예제 #4
0
 private void OnSpawned()
 {
     this.oldActorList.Clear();
     this.missileList.Clear();
     this.nextActor = null;
     this.startTimestamp = 0f;
     this.status = ChainSpiritAction.EStatus.ES_None;
     this.timer = 0f;
 }
예제 #5
0
 private void DoFinish()
 {
     if (this.status != ChainSpiritAction.EStatus.ES_Effect)
     {
         return;
     }
     this.status = ChainSpiritAction.EStatus.ES_Finish;
     this.timer = this.MissileDeleteDelay * 2f + this.MissileInterval;
     this.nextActor = null;
 }