public void onActorDead(ref GameDeadEventParam prm)
 {
     if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp)
     {
         int num = -1;
         while (++num < this.heroHeads.Length)
         {
             PlayerHead playerHead = this.heroHeads[num];
             if (playerHead.MyHero && playerHead.MyHero == prm.src)
             {
                 playerHead.OnMyHeroDead();
                 break;
             }
         }
         if (num < this.heroHeads.Length && !Singleton <BattleLogic> .instance.GetCurLvelContext().IsMobaMode() && ActorHelper.IsCaptainActor(ref prm.src))
         {
             int num2 = -1;
             while (++num2 < this.heroHeads.Length)
             {
                 if (num2 != num && this.heroHeads[num2].MyHero && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState)
                 {
                     this.pickHeroHead(this.heroHeads[num2]);
                     break;
                 }
             }
         }
     }
 }
示例#2
0
 public void onActorDead(ref DefaultGameEventParam prm)
 {
     if ((prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp))
     {
         int index = -1;
         while (++index < this.heroHeads.Length)
         {
             PlayerHead head = this.heroHeads[index];
             if ((head.MyHero != 0) && (head.MyHero == prm.src))
             {
                 head.OnMyHeroDead();
                 break;
             }
         }
         if (((index < this.heroHeads.Length) && !Singleton <BattleLogic> .instance.GetCurLvelContext().isPVPMode) && ActorHelper.IsCaptainActor(ref prm.src))
         {
             int num2 = -1;
             while (++num2 < this.heroHeads.Length)
             {
                 if ((num2 != index) && ((this.heroHeads[num2].MyHero != 0) && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState))
                 {
                     this.pickHeroHead(this.heroHeads[num2]);
                     break;
                 }
             }
         }
     }
 }
示例#3
0
 public void OnActorRevive(ref DefaultGameEventParam prm)
 {
     if ((prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp))
     {
         for (int i = 0; i < this.heroHeads.Length; i++)
         {
             PlayerHead head = this.heroHeads[i];
             if ((head.MyHero != 0) && (head.MyHero == prm.src))
             {
                 head.OnMyHeroRevive();
                 break;
             }
         }
     }
 }
示例#4
0
 public void OnHeroSoulLvlChange(PoolObjHandle <ActorRoot> hero, int level)
 {
     if (hero != 0)
     {
         for (int i = 0; i < this.heroHeads.Length; i++)
         {
             PlayerHead head = this.heroHeads[i];
             if ((head.MyHero != 0) && (head.MyHero == hero))
             {
                 head.OnHeroSoulLvlChange(level);
                 break;
             }
         }
     }
 }
示例#5
0
 public void OnHeroHpChange(PoolObjHandle <ActorRoot> hero, int curVal, int maxVal)
 {
     if (hero != 0)
     {
         for (int i = 0; i < this.heroHeads.Length; i++)
         {
             PlayerHead head = this.heroHeads[i];
             if ((head.MyHero != 0) && (head.MyHero == hero))
             {
                 head.OnHeroHpChange(curVal, maxVal);
                 break;
             }
         }
     }
 }
示例#6
0
        private void onClickHead(CUIEvent evt)
        {
            PlayerHead component = evt.m_srcWidget.GetComponent <PlayerHead>();

            if (component.state == PlayerHead.HeadState.ReviveReady)
            {
                if (component.MyHero.handle.ActorControl.CanRevive)
                {
                    component.MyHero.handle.ActorControl.Revive(false);
                }
            }
            else
            {
                this.pickHeroHead(component);
            }
        }
 public void OnHeroHpChange(PoolObjHandle <ActorRoot> hero, int curVal, int maxVal)
 {
     if (!hero)
     {
         return;
     }
     for (int i = 0; i < this.heroHeads.Length; i++)
     {
         PlayerHead playerHead = this.heroHeads[i];
         if (playerHead.MyHero && playerHead.MyHero == hero)
         {
             playerHead.OnHeroHpChange(curVal, maxVal);
             break;
         }
     }
 }
示例#8
0
 public void pickHeroHead(PlayerHead ph)
 {
     if ((((ph.MyHero.handle != null) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null)) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle != null)) && (ph.MyHero != Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain))
     {
         for (int i = 0; i < this.heroHeads.Length; i++)
         {
             PlayerHead head = this.heroHeads[i];
             if ((null == head) || (head.MyHero == 0))
             {
                 break;
             }
             head.SetPicked(ph == head);
         }
         FrameCommand <SwitchCaptainCommand> command = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>();
         command.cmdData.ObjectID = ph.MyHero.handle.ObjID;
         command.Send();
     }
 }
        public void pickHeroHead(PlayerHead ph)
        {
            if (ph.MyHero.handle == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer() == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle == null)
            {
                return;
            }
            if (ph.MyHero == Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain)
            {
                return;
            }
            for (int i = 0; i < this.heroHeads.Length; i++)
            {
                PlayerHead playerHead = this.heroHeads[i];
                if (null == playerHead || !playerHead.MyHero)
                {
                    break;
                }
                playerHead.SetPicked(ph == playerHead);
            }
            FrameCommand <SwitchCaptainCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>();

            frameCommand.cmdData.ObjectID = ph.MyHero.handle.ObjID;
            frameCommand.Send();
        }