Ejemplo n.º 1
0
        //暂未使用,需要保留防止后面重新启用
        static public void PK(long uid, string targetName, System.Action <EB.Sparx.Response> OnInvitePK)
        {
            if (AllianceUtil.GetIsInTransferDart("ID_PLAYER_NO_BLANK"))
            {
                return;
            }

            if (GetIsRedName(uid))
            {
                int aid = GetAidByUid(uid);
                if (aid > 0 && AllianceUtil.GetIsInAlliance(uid))
                {
                    MessageTemplateManager.ShowMessage(902095);
                    return;
                }
            }
            SocialIntactManager.Instance.InvitePVP(uid, OnInvitePK);
        }
Ejemplo n.º 2
0
        static public void PK(long uid)
        {
            if (AllianceUtil.GetIsInTransferDart("ID_PLAYER_NO_BLANK"))
            {
                return;
            }

            if (GetIsRedName(uid))
            {
                int aid = GetAidByUid(uid);
                if (aid > 0 && AllianceUtil.GetIsInAlliance(uid))
                {
                    MessageTemplateManager.ShowMessage(902095);
                    return;
                }
            }
            SocialIntactManager.Instance.SocialCombat(uid, (resp) =>
            {
                DataLookupsCache.Instance.CacheData(resp.hashtable);
            });
        }
Ejemplo n.º 3
0
        //点击立马交互处理函数
        private void OnImmediatelyIntactFunc(GameObject player, GameObject interactable)
        {
            //if (SceneLogicManager.isCampaign())return;
            //在这里区分 玩家之间交互, 玩家与NPC之间的交互
            if (interactable == null)//点击地面
            {
                FusionAudio.PostEvent("UI/MainView/ShowSelfSelection", true);
            }
            else if (interactable.GetComponent <PlayerController>() != null)
            {
                FusionAudio.PostEvent("UI/MainView/ShowSelfSelection", true);
                if (interactable != null)
                {
                    //目标可被点击
                    long   uid = interactable.GetComponent <PlayerController>().playerUid;
                    string playerName;

                    if (GetIsTargetInFightState(uid) || GetIsTargetInDartState(uid))
                    {
                        //目标是否处于战斗等不可交互状态
                        MessageTemplateManager.ShowMessage(902069);
                        return;
                    }
                    else if (GetIsRedName(uid.ToString(), out playerName))
                    {
                        //目标是否是可被攻击的(红名玩家)
                        if (BalanceResourceUtil.GetUserLevel() < AlliancesManager.Instance.DartConfig.AttackRedNameLevelLimit)
                        {
                            //目标当前等级过高不可被攻击
                            Hashtable h = Johny.HashtablePool.Claim();
                            h.Add("0", AlliancesManager.Instance.DartConfig.AttackRedNameLevelLimit);
                            MessageTemplateManager.ShowMessage(902096, h, null);
                        }
                        else
                        {
                            //目标可被攻击
                            int aid = 0;
                            DataLookupsCache.Instance.SearchIntByID("mainlands.pl." + uid + ".aid", out aid);
                            if (aid > 0 && AllianceUtil.GetIsInAlliance(uid))
                            {
                                //不可攻击同军团玩家
                                MessageTemplateManager.ShowMessage(902095);
                            }
                            else
                            {
                                //是否要发起攻击
                                MessageTemplateManager.ShowMessage(902058, playerName, delegate(int result)
                                {
                                    if (result == 0)
                                    {
                                        if (!LegionModel.GetInstance().isJoinedLegion)
                                        {
                                            MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_NOT_JOIN_ALLIANCE")));
                                            return;
                                        }
                                        string pn;
                                        if (GetIsRedName(AllianceUtil.GetLocalUid().ToString(), out pn))
                                        {
                                            MessageTemplateManager.ShowMessage(902103);
                                        }
                                        else
                                        {
                                            AlliancesManager.Instance.AttackRedName(uid);
                                        }
                                    }
                                });
                            }
                        }
                        return;
                    }
                    DataLookupsCache.Instance.SetCache("intact.player", uid, true);

                    if (UIStack.Instance.GetBackStackCount() > 1)
                    {
                        EB.Debug.LogWarning("Don't Open OtherPlayerInfoView");
                        EB.Debug.Log(UIStack.Instance.GetBackStackItem());
                        return;
                    }
                    EB.Debug.Log(UIStack.Instance.GetBackStackItem());
                    GlobalMenuManager.Instance.Open("OtherPlayerInfoView");

                    //if (null != PlayerIntactUI.Instance)
                    //	PlayerIntactUI.Instance.Uid = uid;
                }
            }
            else
            {
                if (IsGhost(interactable))
                {
                    FusionAudio.PostEvent("SFX_CombatView_BattleStart");
                }
            }
        }