Exemple #1
0
    /// <summary>
    /// 11级的时候偷偷复制一次冒险队伍,方便玩家PVP
    /// </summary>
    public void copyPveArmyTOPvp()
    {
        int num = PlayerPrefs.GetInt(UserManager.Instance.self.uid + PlayerPrefsComm.COPY_ARMY, 0);

        if (num == 0 && UserManager.Instance.self.getUserLevel() >= COPY_ARMY_LEVEL && UserManager.Instance.self.getUserLevel() < (COPY_ARMY_LEVEL + 4))
        {
            Army arenaArmy = getArmy(ArmyManager.PVP_TEAMID);
            if (arenaArmy.state == 0)
            {
                int count = 0;
                for (int i = 0; i < arenaArmy.players.Length; i++)
                {
                    if (arenaArmy.players [i] != "0")
                    {
                        count++;
                        if (count > 1)
                        {
                            break;
                        }
                    }
                }
                if (count <= 1)
                {
                    for (int i = 0; i < arenaArmy.alternate.Length; i++)
                    {
                        if (arenaArmy.alternate [i] != "0")
                        {
                            count++;
                            if (count > 1)
                            {
                                break;
                            }
                        }
                    }
                }
                if (count <= 1)
                {
                    List <string> oldCards  = getAllArmyCardsExceptMining();       //改变队伍前的卡片上阵情况
                    List <string> oldBeasts = getFightBeasts();                    //改变队伍前的召唤兽情况
                    Army          temp      = getArmy(ArmyManager.PVE_TEAMID);     //获得队伍一的配置
                    arenaArmy.formationID = temp.formationID;
                    arenaArmy.beastid     = temp.beastid;
                    arenaArmy.players     = temp.players;
                    arenaArmy.alternate   = temp.alternate;
                    ArmyUpdateFPort port = FPortManager.Instance.getFPort("ArmyUpdateFPort") as ArmyUpdateFPort;
                    port.access(new Army[] { arenaArmy }, () => {
                        updateBackChangeState(oldCards, oldBeasts, TYPE_1);
                        PlayerPrefs.SetInt(UserManager.Instance.self.uid + PlayerPrefsComm.COPY_ARMY, 1);
                        PlayerPrefs.Save();
                    });
                }
            }
        }
    }
Exemple #2
0
 //初始化用户完成,处理不分数据效验和更新
 private void initUserOk()
 {
     SetLoginProgress(1, false);
     //校验阵形
     if (ArmyManager.Instance.checkFormation())
     {
         Army[] list = new Army[3];
         list[0] = ArmyManager.Instance.getArmy(1);
         list[1] = ArmyManager.Instance.getArmy(2);
         list[2] = ArmyManager.Instance.getArmy(3);
         ArmyUpdateFPort port = FPortManager.Instance.getFPort <ArmyUpdateFPort>();
         port.access(list, getArenaFinal);
     }
     else
     {
         getArenaFinal();
     }
 }
    private void saveArmy()
    {
        //相同直接关闭窗口不保存
        if (ArmyManager.Instance.compareArmy(savingArmy, oldArmy))
        {
            saveArmyCallBack();
            return;
        }
        List <string> oldCards  = ArmyManager.Instance.getAllArmyCardsExceptMining(); //改变队伍前的卡片上阵情况
        List <string> oldBeasts = ArmyManager.Instance.getFightBeasts();              //改变队伍前的召唤兽情况

        Army[] arr = new Army[1] {
            savingArmy
        };
        ArmyUpdateFPort port = FPortManager.Instance.getFPort("ArmyUpdateFPort") as ArmyUpdateFPort;

        port.access(arr, () => {
            saveArmyCallBack();
            ArmyManager.Instance.updateBackChangeState(oldCards, oldBeasts, 1);
        });
    }
Exemple #4
0
 public bool saveGuildFightArmy(CallBack callBack)
 {
     Army[] arr = getSaveGuildFightArmys();
     if (arr.Length > 0)
     {
         List <string>   oldCards  = getAllArmyCardsExceptMining(); //改变队伍前的卡片上阵情况
         List <string>   oldBeasts = getFightBeasts();              //改变队伍前的召唤兽情况
         ArmyUpdateFPort port      = FPortManager.Instance.getFPort("ArmyUpdateFPort") as ArmyUpdateFPort;
         port.access(arr, () => {
             updateArmy(6, ArmyManager.Instance.EditArmy6);
             recalculateAllArmyIds();
             updateBackChangeState(oldCards, oldBeasts, TYPE_1);
             IncreaseManagerment.Instance.clearData(IncreaseManagerment.TYPE_CARD);
             if (callBack != null)
             {
                 callBack();
             }
         });
         return(true);
     }
     return(false);
 }