コード例 #1
0
ファイル: WorldBossScene.cs プロジェクト: floatyears/Decrypt
 public override void Destroy()
 {
     if (this.totalDamage > 0L)
     {
         MC2S_DoBossDamage mC2S_DoBossDamage = new MC2S_DoBossDamage();
         mC2S_DoBossDamage.Slot = Globals.Instance.Player.WorldBossSystem.CurSlot;
         mC2S_DoBossDamage.ResultKey = this.actorMgr.Key;
         mC2S_DoBossDamage.Damage = this.totalDamage;
         mC2S_DoBossDamage.Count = this.totalCount;
         mC2S_DoBossDamage.RecvStartTime = this.actorMgr.RecvStartTime;
         mC2S_DoBossDamage.SendResultTime = Globals.Instance.Player.GetTimeStamp();
         Globals.Instance.CliSession.SendPacket(618, mC2S_DoBossDamage);
     }
     this.actorMgr.BuildCombatLog(this.isBossDead);
     MC2S_CombatLog mC2S_CombatLog = new MC2S_CombatLog();
     mC2S_CombatLog.Type = 0;
     mC2S_CombatLog.Log = this.actorMgr.GetCombatLog();
     Globals.Instance.CliSession.SendPacket(649, mC2S_CombatLog);
     if (this.uiDead != null)
     {
         UnityEngine.Object.Destroy(this.uiDead);
         this.uiDead = null;
     }
     this.actorMgr.ForceShowBossActor = false;
     Globals.Instance.CliSession.ShowReconnect(false);
     Globals.Instance.CliSession.Unregister(1502, new ClientSession.MsgHandler(this.HandleDisconnect));
     LocalPlayer expr_140 = Globals.Instance.Player;
     expr_140.DataInitEvent = (LocalPlayer.DataInitCallback)Delegate.Remove(expr_140.DataInitEvent, new LocalPlayer.DataInitCallback(this.OnDataInitEvent));
     WorldBossSubSystem expr_170 = Globals.Instance.Player.WorldBossSystem;
     expr_170.DoDamageFailEvent = (WorldBossSubSystem.VoidCallback)Delegate.Remove(expr_170.DoDamageFailEvent, new WorldBossSubSystem.VoidCallback(this.OnDoDamageFail));
     WorldBossSubSystem expr_1A0 = Globals.Instance.Player.WorldBossSystem;
     expr_1A0.DoBossDamageEvent = (WorldBossSubSystem.DoBossDamageCallback)Delegate.Remove(expr_1A0.DoBossDamageEvent, new WorldBossSubSystem.DoBossDamageCallback(this.OnDoBossDamageEvent));
     WorldBossSubSystem expr_1D0 = Globals.Instance.Player.WorldBossSystem;
     expr_1D0.BossDeadEvent = (WorldBossSubSystem.BossDeadCallback)Delegate.Remove(expr_1D0.BossDeadEvent, new WorldBossSubSystem.BossDeadCallback(this.OnBossDeadEvent));
 }
コード例 #2
0
ファイル: WorldBossScene.cs プロジェクト: floatyears/Decrypt
 public override void Update(float elapse)
 {
     if (!this.hpFlag && this.bossActor != null && this.bossActor.MaxHP != 0L)
     {
         BossData curBossData = Globals.Instance.Player.WorldBossSystem.GetCurBossData();
         if (curBossData != null)
         {
             this.bossActor.ResetMaxHP(curBossData.MaxHP);
             this.bossActor.CurHP = (long)((float)this.bossActor.MaxHP * curBossData.HealthPct);
             this.bossActor.AiCtrler.Locked = true;
             this.hpFlag = true;
         }
     }
     switch (this.status)
     {
     case 2:
         if (this.combatTimer > 0f)
         {
             this.combatTimer -= elapse;
         }
         if (this.isBossDead || Globals.Instance.Player.WorldBossSystem.WorldBossIsOver())
         {
             this.actorMgr.LockAllActorAI();
             GameAnalytics.OnFailScene(Globals.Instance.SenceMgr.sceneInfo, GameAnalytics.ESceneFailed.Timeup);
             Globals.Instance.SenceMgr.CloseScene();
             GameUIManager.mInstance.ChangeSession<GUIWorldBossVictoryScene>(null, false, false);
             this.status = 5;
             return;
         }
         this.sendDamageTimer += elapse;
         if (this.sendDamageTimer >= 10f && Time.frameCount > this.sendDamageFrame)
         {
             if (this.totalDamage > 0L)
             {
                 MC2S_DoBossDamage mC2S_DoBossDamage = new MC2S_DoBossDamage();
                 mC2S_DoBossDamage.Slot = Globals.Instance.Player.WorldBossSystem.CurSlot;
                 mC2S_DoBossDamage.ResultKey = this.actorMgr.Key;
                 mC2S_DoBossDamage.Damage = this.totalDamage;
                 mC2S_DoBossDamage.Count = this.totalCount;
                 mC2S_DoBossDamage.RecvStartTime = this.actorMgr.RecvStartTime;
                 mC2S_DoBossDamage.SendResultTime = Globals.Instance.Player.GetTimeStamp();
                 if (Globals.Instance.CliSession.SendPacket(618, mC2S_DoBossDamage))
                 {
                     this.sendDamageTimer = 0f;
                     this.sendDamageFrame = Time.frameCount + 150;
                     this.totalDamage = 0L;
                     this.totalCount = 0;
                 }
             }
             else
             {
                 this.sendDamageTimer = 0f;
                 this.sendDamageFrame = Time.frameCount + 150;
             }
         }
         break;
     case 4:
         if (this.timeStamp > 0f && Time.time >= this.timeStamp)
         {
             this.timeStamp = -1f;
             this.ShowDeadUI();
             this.status = 2;
         }
         break;
     }
 }