Exemple #1
0
        public void ExecCommand(uint senderPlayerID, uint heroID, int signalID, int worldPositionX, int worldPositionY, int worldPositionZ, byte bAlice = 0, byte elementType = 0, uint targetHeroID = 0)
        {
            if (this.m_useSignalButton && (this.m_formScript != null))
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(senderPlayerID);

                if (((hostPlayer != null) && (player != null)) && (hostPlayer.PlayerCamp == player.PlayerCamp))
                {
                    bool          isHostPlayer = hostPlayer == player;
                    ResSignalInfo dataByKey    = GameDataMgr.signalDatabin.GetDataByKey((long)signalID);
                    if (dataByKey == null)
                    {
                        DebugHelper.Assert(dataByKey != null, "ExecCommand signalInfo is null, check out...");
                    }
                    else
                    {
                        uint  cDTime         = this.GetCDTime(dataByKey);
                        ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                        CPlayerSignalCooldown cooldown = null;
                        this.m_playerSignalCooldowns.TryGetValue(senderPlayerID, out cooldown);
                        if (cooldown != null)
                        {
                            if (((uint)(logicFrameTick - cooldown.m_lastSignalExecuteTimestamp)) < cooldown.m_cooldownTime)
                            {
                                return;
                            }
                            cooldown.m_lastSignalExecuteTimestamp = logicFrameTick;
                            cooldown.m_cooldownTime = cDTime;
                        }
                        else
                        {
                            cooldown = new CPlayerSignalCooldown(logicFrameTick, cDTime);
                            this.m_playerSignalCooldowns.Add(senderPlayerID, cooldown);
                        }
                        if (isHostPlayer && (this.m_signalButtons != null))
                        {
                            for (int i = 0; i < this.m_signalButtons.Length; i++)
                            {
                                if (this.m_signalButtons[i] != null)
                                {
                                    this.m_signalButtons[i].StartCooldown(cDTime);
                                }
                            }
                        }
                        bool bSmall = Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

                        this.PlaySignalTipsSound(elementType, bAlice, targetHeroID);
                        bool    bUseCfgSound = elementType == 0;
                        CSignal item         = new CSignal(senderPlayerID, signalID, worldPositionX, worldPositionY, worldPositionZ, !bSmall ? this.m_signalInUIContainer_big : this.m_signalInUIContainer_small, bSmall, bUseCfgSound);
                        item.Initialize(this.m_formScript, dataByKey);
                        this.m_signals.Add(item);
                        CSignalTips tips = new CSignalTips(signalID, heroID, isHostPlayer, bAlice, elementType, targetHeroID);
                        this.Add_SignalTip(tips);
                    }
                }
            }
        }
Exemple #2
0
        public void ExecCommand(int signalID, Vector2 localPosition, Quaternion localRotation)
        {
            if (this.m_formScript == null)
            {
                return;
            }
            ResSignalInfo dataByKey = GameDataMgr.signalDatabin.GetDataByKey((long)signalID);
            bool          bSmall    = Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

            CSignal cSignal = new CSignal(signalID, localPosition, true, bSmall, true, true, localRotation);

            cSignal.Initialize(this.m_formScript, dataByKey);
            this.m_signals.Add(cSignal);
        }
Exemple #3
0
        public void ExecCommand(PoolObjHandle <ActorRoot> followActor, uint senderPlayerID, uint heroID, int signalID, byte bAlice = 0, byte elementType = 0, uint targetObjID = 0u, uint targetHeroID = 0u)
        {
            if (!this.m_useSignalButton || this.m_formScript == null)
            {
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(senderPlayerID);

            if (hostPlayer == null || player == null)
            {
                return;
            }
            if (hostPlayer.PlayerCamp != player.PlayerCamp)
            {
                return;
            }
            bool          flag      = hostPlayer == player;
            ResSignalInfo dataByKey = GameDataMgr.signalDatabin.GetDataByKey((long)signalID);

            if (dataByKey == null)
            {
                DebugHelper.Assert(dataByKey != null, "ExecCommand signalInfo is null, check out...");
                return;
            }
            uint  cDTime         = this.GetCDTime(dataByKey);
            ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

            SignalPanel.CPlayerSignalCooldown cPlayerSignalCooldown = null;
            this.m_playerSignalCooldowns.TryGetValue(senderPlayerID, ref cPlayerSignalCooldown);
            if (cPlayerSignalCooldown != null)
            {
                if ((uint)(logicFrameTick - cPlayerSignalCooldown.m_lastSignalExecuteTimestamp) < cPlayerSignalCooldown.m_cooldownTime)
                {
                    return;
                }
                cPlayerSignalCooldown.m_lastSignalExecuteTimestamp = logicFrameTick;
                cPlayerSignalCooldown.m_cooldownTime = cDTime;
            }
            else
            {
                cPlayerSignalCooldown = new SignalPanel.CPlayerSignalCooldown(logicFrameTick, cDTime);
                this.m_playerSignalCooldowns.Add(senderPlayerID, cPlayerSignalCooldown);
            }
            if (flag && this.m_signalButtons != null)
            {
                for (int i = 0; i < this.m_signalButtons.Length; i++)
                {
                    if (this.m_signalButtons[i] != null)
                    {
                        this.m_signalButtons[i].StartCooldown(cDTime);
                    }
                }
            }
            bool bSmall = Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

            this.PlaySignalTipsSound(elementType, bAlice, targetHeroID);
            bool bUseCfgSound = elementType == 0;

            if (followActor && followActor.handle.Visible)
            {
                CSignal cSignal = new CSignal(followActor, signalID, true, bSmall, bUseCfgSound);
                cSignal.Initialize(this.m_formScript, dataByKey);
                this.m_signals.Add(cSignal);
            }
            CSignalTips obj = new CSignalTips(signalID, heroID, flag, bAlice, elementType, targetHeroID);

            this.Add_SignalTip(obj);
        }
Exemple #4
0
        public void ExecCommand(uint playerID, uint heroID, int signalID, int worldPositionX, int worldPositionY, int worldPositionZ, byte bAlice = 0, byte elementType = 0, uint targetObjID = 0, uint targetHeroID = 0)
        {
            if (this.m_useSignalButton && (this.m_formScript != null))
            {
                uint          cooldownTime = 0x1388;
                ResSignalInfo dataByKey    = GameDataMgr.signalDatabin.GetDataByKey(signalID);
                if (dataByKey == null)
                {
                    DebugHelper.Assert(dataByKey != null, "ExecCommand signalInfo is null, check out...");
                }
                else
                {
                    if (dataByKey != null)
                    {
                        cooldownTime = (uint)(dataByKey.bCooldownTime * 0x3e8);
                    }
                    if (Singleton <BattleLogic> .GetInstance().GetCurLvelContext().iLevelID == CBattleGuideManager.GuideLevelID5v5)
                    {
                        cooldownTime = 0x7d0;
                    }
                    ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                    CPlayerSignalCooldown cooldown = null;
                    this.m_playerSignalCooldowns.TryGetValue(playerID, out cooldown);
                    if (cooldown != null)
                    {
                        if (((uint)(logicFrameTick - cooldown.m_lastSignalExecuteTimestamp)) < cooldown.m_cooldownTime)
                        {
                            return;
                        }
                        cooldown.m_lastSignalExecuteTimestamp = logicFrameTick;
                        cooldown.m_cooldownTime = cooldownTime;
                    }
                    else
                    {
                        cooldown = new CPlayerSignalCooldown(logicFrameTick, cooldownTime);
                        this.m_playerSignalCooldowns.Add(playerID, cooldown);
                    }
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(playerID);

                    if (((hostPlayer != null) && (player != null)) && (hostPlayer.PlayerCamp == player.PlayerCamp))
                    {
                        uint num4;
                        if ((hostPlayer == player) && (this.m_signalButtons != null))
                        {
                            for (int i = 0; i < this.m_signalButtons.Length; i++)
                            {
                                if (this.m_signalButtons[i] != null)
                                {
                                    this.m_signalButtons[i].StartCooldown(cooldownTime);
                                }
                            }
                        }
                        bool bSmall = Singleton <CBattleSystem> .instance.GetMinimapSys().CurMapType() == MinimapSys.EMapType.Mini;

                        uint num5 = 0;
                        if (targetObjID == 0)
                        {
                            num4 = playerID;
                            num5 = heroID;
                        }
                        else
                        {
                            num4 = targetObjID;
                            num5 = targetHeroID;
                        }
                        this.PlaySignalTipsSound(elementType, bAlice, targetHeroID);
                        bool    bFollow      = elementType == 3;
                        bool    bUseCfgSound = elementType == 0;
                        CSignal item         = new CSignal(num4, signalID, num5, worldPositionX, worldPositionY, worldPositionZ, !bSmall ? this.m_signalInUIContainer_big : this.m_signalInUIContainer_small, this.m_signalSrcHeroNameContainer, bSmall, bFollow, bUseCfgSound, (MinimapSys.ElementType)elementType);
                        item.Initialize(this.m_formScript);
                        this.m_signals.Add(item);
                        CSignalTips tips = new CSignalTips(signalID, heroID, hostPlayer == player, bAlice, elementType, targetHeroID);
                        this.Add_SignalTip(tips);
                    }
                }
            }
        }