Esempio n. 1
0
        public void Init(SLevelContext _levelContext)
        {
            uint levelIncomeRuleID = CLevelCfgLogicManager.GetLevelIncomeRuleID(_levelContext, this);

            this.InitIncomeRule(levelIncomeRuleID);
            this.bSoulGrow = Singleton <BattleLogic> .GetInstance().m_GameInfo.gameContext.IsSoulGrow();

            this.bPvpMode = _levelContext.isPVPMode;
            Singleton <GameEventSys> .instance.RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDead, new RefAction <DefaultGameEventParam>(this.OnActorDead));

            Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDead, new RefAction <DefaultGameEventParam>(this.OnActorDead));

            this.m_actorIncomes.Clear();
            if (this.m_originalGoldCoinInBattle > 0)
            {
                List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .GetInstance().HeroActors;

                for (int i = 0; i < heroActors.Count; i++)
                {
                    if (heroActors[i] != 0)
                    {
                        PoolObjHandle <ActorRoot> handle = heroActors[i];
                        Vector3 position = new Vector3();
                        handle.handle.ValueComponent.ChangeGoldCoinInBattle(this.m_originalGoldCoinInBattle, true, false, position);
                    }
                }
            }
        }
        public override void Fight()
        {
            base.Fight();
            this.nHpRecoveryTick = 0;
            this.nEpRecoveryTick = 0;
            DebugHelper.Assert(this.mActorValue != null, "mActorValue = null data is error");
            if (this.mActorValue != null)
            {
                VFactor hpRate = this.GetHpRate();
                DebugHelper.Assert(this.actor != null, "actor is null ? impossible...");
                if (this.actor != null)
                {
                    bool          bPVPLevel      = true;
                    SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                    if (curLvelContext != null)
                    {
                        bPVPLevel = curLvelContext.IsMobaMode();
                    }
                    this.mActorValue.AddSymbolPageAttToProp(ref this.actor.TheActorMeta, bPVPLevel);
                    IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

                    ActorServerData actorServerData = default(ActorServerData);
                    if (actorDataProvider != null && actorDataProvider.GetActorServerData(ref this.actor.TheActorMeta, ref actorServerData))
                    {
                        this.mActorValue.SetSkinProp((uint)this.actor.TheActorMeta.ConfigId, actorServerData.SkinId, true);
                    }
                }
                this.SetHpByRate(hpRate);
            }
        }
        private void initNotifyDestroyStat()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext.IsMobaMode())
            {
                return;
            }
            if (curLvelContext != null && curLvelContext.m_starDetail != null)
            {
                for (int i = 0; i < curLvelContext.m_starDetail.Length; i++)
                {
                    int iParam = curLvelContext.m_starDetail[i].iParam;
                    if (iParam != 0)
                    {
                        ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)iParam);
                        this.CondfoToDestroyStat(dataByKey.astConditions);
                    }
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("LevelConfig is null -- levelID: {0}", curLvelContext.m_mapID));
            }
        }
Esempio n. 4
0
        private void onActorStartFight(ref PoolObjHandle <ActorRoot> src)
        {
            if (!src)
            {
                return;
            }
            if (this.m_bSoulGrow && src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && src.handle.ValueComponent != null)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                if (curLvelContext != null && curLvelContext.m_birthLevelConfig > 0)
                {
                    src.handle.ValueComponent.ForceSetSoulLevel(curLvelContext.m_birthLevelConfig);
                    src.handle.ValueComponent.SetHpAndEpToInitialValue(10000, 10000);
                }
                else
                {
                    src.handle.ValueComponent.actorSoulLevel = 1;
                }
                if (CheatCommandReplayEntry.heroPerformanceTest)
                {
                    src.handle.ValueComponent.actorSoulLevel = 4;
                    Singleton <BattleLogic> .GetInstance().AutoLearnSkill(src);
                }
            }
        }
Esempio n. 5
0
        public override int TakeDamage(ref HurtDataInfo hurt)
        {
            if (this.bGodMode)
            {
                return(0);
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext != null && hurt.atker && hurt.atker.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
            {
                OrganWrapper organWrapper = hurt.atker.get_handle().AsOrgan();
                if (organWrapper != null)
                {
                    int attackCounter = organWrapper.GetAttackCounter(this.actorPtr);
                    if (attackCounter > 1)
                    {
                        int num = (attackCounter - 1) * organWrapper.cfgInfo.iContiAttakAdd;
                        if (num > organWrapper.cfgInfo.iContiAttakMax)
                        {
                            num = organWrapper.cfgInfo.iContiAttakMax;
                        }
                        hurt.adValue += num;
                    }
                }
            }
            return(base.TakeDamage(ref hurt));
        }
Esempio n. 6
0
        public bool Reset(SLevelContext levelContext, bool bMultiGame)
        {
            this.Clear();
            bool result = false;

            if (levelContext.IsMobaModeWithOutGuide())
            {
                this.CurLevelTimeDuration = levelContext.m_timeDuration;
                if (levelContext.m_addWinCondStarId != 0u)
                {
                    ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(levelContext.m_addWinCondStarId);
                    DebugHelper.Assert(dataByKey != null);
                    if (dataByKey != null)
                    {
                        this.WinnerEvaluation = this.CreateStar(dataByKey);
                        DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?");
                        result = true;
                    }
                }
                if (levelContext.m_addLoseCondStarId != 0u)
                {
                    ResEvaluateStarInfo dataByKey2 = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(levelContext.m_addLoseCondStarId);
                    DebugHelper.Assert(dataByKey2 != null);
                    if (dataByKey2 != null)
                    {
                        this.LoserEvaluation = this.CreateStar(dataByKey2);
                        DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?");
                        result = true;
                    }
                }
            }
            return(result);
        }
Esempio n. 7
0
        public virtual void PostBeginPlay()
        {
            Singleton <BattleLogic> .GetInstance().PrepareFight();

            if (!Singleton <LobbyLogic> .instance.inMultiGame)
            {
                Singleton <FrameSynchr> .GetInstance().ResetSynchr();

                bool          flag           = false;
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                if (((curLvelContext != null) && (curLvelContext.m_preDialogId > 0)) && ((hostPlayer != null) && (hostPlayer.Captain != 0)))
                {
                    flag = true;
                    MonoSingleton <DialogueProcessor> .instance.PlayDrama(curLvelContext.m_preDialogId, hostPlayer.Captain.handle.gameObject, hostPlayer.Captain.handle.gameObject, true);
                }
                if (!flag)
                {
                    Singleton <BattleLogic> .GetInstance().DoBattleStart();
                }
                else
                {
                    Singleton <BattleLogic> .GetInstance().BindFightPrepareFinListener();
                }
            }
            else if (!Singleton <GameReplayModule> .GetInstance().isReplay)
            {
                Singleton <LobbyLogic> .GetInstance().ReqStartMultiGame();
            }
            SoldierRegion.bFirstSpawnEvent = true;
        }
Esempio n. 8
0
        public bool Reset(int LevelID)
        {
            this.Clear();
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            DebugHelper.Assert(curLvelContext != null);
            if (curLvelContext == null)
            {
                return(false);
            }
            for (int i = 0; i < curLvelContext.m_starDetail.Length; i++)
            {
                ResDT_IntParamArrayNode node = curLvelContext.m_starDetail[i];
                if (node.iParam == 0)
                {
                    break;
                }
                this.AddStarEvaluation(node.iParam);
            }
            if (curLvelContext.m_loseCondition != 0)
            {
                ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)curLvelContext.m_loseCondition);
                DebugHelper.Assert(dataByKey != null);
                if (dataByKey == null)
                {
                    return(false);
                }
                this.FailureEvaluation = this.CreateStar(dataByKey, 0);
                DebugHelper.Assert(this.FailureEvaluation != null, "我擦,怎会没有?");
            }
            Singleton <EventRouter> .instance.BroadCastEvent(EventID.StarSystemInitialized);

            return(true);
        }
Esempio n. 9
0
        public void Startup()
        {
            if (MTileHandlerHelper.Instance != null)
            {
                MTileHandlerHelper.Instance.UpdateLogic();
            }
            ListView <SoldierRegion> .Enumerator enumerator = this.soldierAreas.GetEnumerator();
            while (enumerator.MoveNext())
            {
                enumerator.Current.Startup();
            }
            ListView <CommonSpawnGroup> .Enumerator enumerator2 = this.commonSpawnGroups.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                enumerator2.Current.Startup();
            }
            ListView <SpawnGroup> .Enumerator enumerator3 = this.spawnGroups.GetEnumerator();
            while (enumerator3.MoveNext())
            {
                enumerator3.Current.Startup();
            }
            ListView <AreaEventTrigger> .Enumerator enumerator4 = this.triggerList.GetEnumerator();
            while (enumerator4.MoveNext())
            {
                enumerator4.Current.Startup();
            }
            ListView <DynamicChannel> .Enumerator enumerator5 = this.channelList.GetEnumerator();
            while (enumerator5.MoveNext())
            {
                enumerator5.Current.Startup();
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            this.ClearSoldierActivateTimers();
            if (((curLvelContext != null) && curLvelContext.isPVPLevel) && (curLvelContext.isPVPMode && (curLvelContext.GameType != COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)))
            {
                ResDT_LevelCommonInfo info = CLevelCfgLogicManager.FindLevelConfigMultiGame(curLvelContext.iLevelID);
                if (info != null)
                {
                    this.SoldierActivateDelay       = info.iSoldierActivateDelay;
                    this.SoldierActivateCountDelay1 = info.iSoldierActivateCountDelay1;
                    this.SoldierActivateCountDelay2 = info.iSoldierActivateCountDelay2;
                }
                this.WelcomeDelaySeq = Singleton <CTimerManager> .instance.AddTimer(500, 1, new CTimer.OnTimeUpHandler(this.OnWelcomeDelay), true);
            }
            if (this.SoldierActivateDelay > 0)
            {
                this.SoldierActivateDelaySeq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateDelay, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateDelay), true);
            }
            if (this.SoldierActivateCountDelay1 > 0)
            {
                this.SoldierActivateCountDelay1Seq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateCountDelay1, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay1), true);
            }
            if (this.SoldierActivateCountDelay2 > 0)
            {
                this.SoldierActivateCountDelay2Seq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateCountDelay2, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay2), true);
            }
        }
Esempio n. 10
0
        private void onFightPrepare(ref DefaultGameEventParam prm)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            DebugHelper.Assert(curLvelContext != null, "Battle Level Context is NULL!!");
            if ((curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE) && (curLvelContext.iLevelID == AdvanceGuideLevelID))
            {
                if (< > f__am$cache13 == null)
                {
Esempio n. 11
0
        private void OnFightPrepare(ref DefaultGameEventParam prm)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null && (curLvelContext.IsGameTypeBurning() || curLvelContext.IsGameTypeArena()))
            {
                Singleton <CUILoadingSystem> .GetInstance().HideLoading();
            }
        }
Esempio n. 12
0
        public bool ShouldStatInThisGameMode()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (!curLvelContext.IsMobaModeWithOutGuide())
            {
                return(false);
            }
            return(curLvelContext.m_pvpPlayerNum == 10);
        }
        private bool CheckDifficulty()
        {
            if (this.Difficulty == 0)
            {
                return(true);
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            return(curLvelContext.m_levelDifficulty >= this.Difficulty);
        }
Esempio n. 14
0
 public static int QueryMainActorFakeSightRadius()
 {
     Horizon.fakeSightRadius = 0;
     SLevelContext curLvelContext = Singleton<BattleLogic>.GetInstance().GetCurLvelContext();
     if (curLvelContext != null)
     {
         Horizon.fakeSightRadius = curLvelContext.m_fakeSightRange;
     }
     return Horizon.fakeSightRadius;
 }
Esempio n. 15
0
        public void InitVisible()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if ((((curLvelContext != null) && (curLvelContext.horizonEnableMethod != Horizon.EnableMethod.DisableAll)) && (this.TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .instance.hostPlayerCamp)) && (((this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) || (this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)) || (this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)))
            {
                this.Visible            = false;
                this._bInitVisibleDelay = 8;
            }
        }
Esempio n. 16
0
        public void Startup()
        {
            if (MTileHandlerHelper.Instance != null)
            {
                MTileHandlerHelper.Instance.UpdateLogic();
            }
            SoldierWave.ms_updatedFrameNum = 0u;
            ListView <SoldierRegion> .Enumerator enumerator = this.soldierAreas.GetEnumerator();
            while (enumerator.MoveNext())
            {
                enumerator.get_Current().Startup();
            }
            ListView <CommonSpawnGroup> .Enumerator enumerator2 = this.commonSpawnGroups.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                enumerator2.get_Current().Startup();
            }
            ListView <SpawnGroup> .Enumerator enumerator3 = this.spawnGroups.GetEnumerator();
            while (enumerator3.MoveNext())
            {
                enumerator3.get_Current().Startup();
            }
            ListView <AreaEventTrigger> .Enumerator enumerator4 = this.triggerList.GetEnumerator();
            while (enumerator4.MoveNext())
            {
                enumerator4.get_Current().Startup();
            }
            ListView <DynamicChannel> .Enumerator enumerator5 = this.channelList.GetEnumerator();
            while (enumerator5.MoveNext())
            {
                enumerator5.get_Current().Startup();
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            this.ClearSoldierActivateTimers();
            if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide())
            {
                this.SoldierActivateDelay       = curLvelContext.m_soldierActivateDelay;
                this.SoldierActivateCountDelay1 = curLvelContext.m_soldierActivateCountDelay1;
                this.SoldierActivateCountDelay2 = curLvelContext.m_soldierActivateCountDelay2;
                this.WelcomeDelaySeq            = Singleton <CTimerManager> .get_instance().AddTimer(500, 1, new CTimer.OnTimeUpHandler(this.OnWelcomeDelay), true);
            }
            if (this.SoldierActivateDelay > 0)
            {
                this.SoldierActivateDelaySeq = Singleton <CTimerManager> .get_instance().AddTimer(this.SoldierActivateDelay, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateDelay), true);
            }
            if (this.SoldierActivateCountDelay1 > 0)
            {
                this.SoldierActivateCountDelay1Seq = Singleton <CTimerManager> .get_instance().AddTimer(this.SoldierActivateCountDelay1, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay1), true);
            }
            if (this.SoldierActivateCountDelay2 > 0)
            {
                this.SoldierActivateCountDelay2Seq = Singleton <CTimerManager> .get_instance().AddTimer(this.SoldierActivateCountDelay2, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay2), true);
            }
        }
Esempio n. 17
0
        public bool ShouldStatInThisGameMode()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (!curLvelContext.isPVPLevel)
            {
                return(false);
            }
            ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(curLvelContext.iLevelID);

            return((dataByKey != null) && (dataByKey.stLevelCommonInfo.bMaxAcntNum == 10));
        }
		public void StartFight()
		{
			SLevelContext curLvelContext = Singleton<BattleLogic>.GetInstance().GetCurLvelContext();
			if (curLvelContext != null && Singleton<WinLoseByStarSys>.instance.Reset(curLvelContext, false))
			{
				WinLoseByStarSys instance = Singleton<WinLoseByStarSys>.instance;
				instance.OnEvaluationChanged = (OnEvaluationChangedDelegate)Delegate.Combine(instance.OnEvaluationChanged, new OnEvaluationChangedDelegate(BattleLogic.OnWinStarSysChanged));
				WinLoseByStarSys instance2 = Singleton<WinLoseByStarSys>.instance;
				instance2.OnFailureEvaluationChanged = (OnEvaluationChangedDelegate)Delegate.Combine(instance2.OnFailureEvaluationChanged, new OnEvaluationChangedDelegate(BattleLogic.OnLoseStarSysChanged));
				Singleton<WinLoseByStarSys>.instance.Start();
			}
		}
Esempio n. 19
0
        public override void Revive(bool auto)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            bool flag = (curLvelContext != null) && curLvelContext.isPVPMode;

            if (flag == auto)
            {
                this.autoRevived = auto;
                base.Revive(auto);
            }
        }
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            bool   flag   = (curLvelContext != null) && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (((player != null) && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt))) && ((player.Captain != 0) && (player.Captain.handle.ValueComponent != null)))
            {
                player.Captain.handle.ValueComponent.ChangeGoldCoinInBattle((int)this.m_addValue, true, true, new Vector3(), false);
            }
        }
Esempio n. 21
0
 public void Reset(SLevelContext InLevelContext, int InMaxCount)
 {
     this.StopDrop();
     this.maxDropCount = InMaxCount;
     this.DropStrategy = this.Factory.Create((int)InLevelContext.m_pveLevelType) as ITreasureChestStrategy;
     DebugHelper.Assert(this.DropStrategy != null, "no game type support you say a j8!");
     if (this.DropStrategy != null)
     {
         this.DropStrategy.Initialize(this.maxDropCount);
         this.DropStrategy.OnDropTreasure += new OnDropTreasureChestDelegate(this.OnDrop);
     }
 }
Esempio n. 22
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool   flag   = curLvelContext != null && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)))
            {
                CheatCommandBattleEntry.ProcessCheat(this.CheatType, ref player.Captain);
            }
        }
Esempio n. 23
0
        public override void Revive(bool auto)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool flag = curLvelContext != null && curLvelContext.IsMobaMode();

            if (flag == auto)
            {
                this.autoRevived = auto;
                base.Revive(auto);
            }
        }
Esempio n. 24
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            bool   flag   = (curLvelContext != null) && curLvelContext.isPVPLevel;
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (((player != null) && (player.Captain != 0)) && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)))
            {
                player.Captain.handle.bOneKiller = this.IsSuperKiller != 0;
            }
        }
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool   flag   = curLvelContext != null && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && player.Captain && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)))
            {
                player.Captain.get_handle().bOneKiller = ((int)this.IsSuperKiller != 0);
            }
        }
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool   flag   = curLvelContext != null && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)) && player.Captain && player.Captain.get_handle().ValueComponent != null)
            {
                player.Captain.get_handle().ValueComponent.ChangeGoldCoinInBattle((int)this.m_addValue, true, true, default(Vector3), false, default(PoolObjHandle <ActorRoot>));
            }
        }
Esempio n. 27
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool   flag   = curLvelContext != null && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)) && player.Captain && player.Captain.get_handle().ActorControl is HeroWrapper)
            {
                HeroWrapper heroWrapper = (HeroWrapper)player.Captain.get_handle().ActorControl;
                heroWrapper.bGodMode = ((int)this.IsGodMode != 0);
            }
        }
Esempio n. 28
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            bool   flag   = (curLvelContext != null) && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (((player != null) && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt))) && ((player.Captain != 0) && (player.Captain.handle.ActorControl is HeroWrapper)))
            {
                HeroWrapper actorControl = (HeroWrapper)player.Captain.handle.ActorControl;
                actorControl.bGodMode = this.IsGodMode != 0;
            }
        }
        public static uint GetLevelIncomeRuleID(SLevelContext _levelContext, IncomeControl inControl)
        {
            IncomeControl.m_isExpCompensate      = false;
            inControl.m_originalGoldCoinInBattle = 0;
            IncomeControl.m_compensateRateList.Clear();
            uint soulID = _levelContext.m_soulID;

            if (_levelContext.IsMobaMode())
            {
                inControl.InitExpCompensateInfo(_levelContext.m_isOpenExpCompensate, ref _levelContext.m_expCompensateInfo);
                inControl.m_originalGoldCoinInBattle = _levelContext.m_originalGoldCoinInBattle;
            }
            return(soulID);
        }
Esempio n. 30
0
        public void InitVisible()
        {
            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                this.Visible = true;
                return;
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.m_horizonEnableMethod != Horizon.EnableMethod.DisableAll && this.TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .get_instance().hostPlayerCamp&& (this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster || this.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ))
            {
                this.Visible            = false;
                this._bInitVisibleDelay = 8;
            }
        }