예제 #1
0
 /** 挑战 */
 public void challenge()
 {
     /** 不在公会战战斗期间 */
     if (!GuildFightSampleManager.Instance().isFightTime())
     {
         UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_39"));
         UiManager.Instance.BackToWindow <GuildFightMainWindow> ();
         return;
     }
     /** 行动力不足 */
     if (UserManager.Instance.self.guildFightPower < challengeSample.getExpends())
     {
         goToGetPower();
         return;
     }
     //判断队伍6(公会战队伍)是否存在
     if (ArmyManager.Instance.getArmy(6) == null)
     {
         GetGuildFightTeamFPort fport = FPortManager.Instance.getFPort <GetGuildFightTeamFPort> ();
         fport.access(sendChallengeMsg);
     }
     else
     {
         sendChallengeMsg();
     }
 }
예제 #2
0
    private void updateUI()
    {
        data = GuildManagerment.Instance.guildFightInfo;
        updateBaseInfo();
        updatePower();
        switch (data.state)
        {
        case NOTOPEN:
            showNoOpenUI();
            break;

        case GROUPING:
            showGroupingUI();
            break;

        case FIGHTING:
            showFightingUI();
            break;

        case NOTJOIN:
            showNoJoinUI();
            break;

        case CLEARING:
            showClearingUI();
            break;
        }
        if (GuildFightSampleManager.Instance().isFightTime())
        {
            startTimer();
        }
    }
예제 #3
0
    /** 显示战斗中的界面 */
    private void showFightingUI()
    {
        if (!isAwakeformHide && data.areas.Count == 1 && !GuildFightSampleManager.Instance().isGuildFightOver())
        {
            MessageWindow.ShowAlert(Language("GuildArea_46"));
        }
        //buttonRevive.gameObject.SetActive (data.isDead);
        //buttonRevive.disableButton (!data.isDead);
//		if (!data.isDead) {
//			buttonRevive.textLabel.effectColor = new Color (0.22f, 0.22f, 0.22f);
//		} else {
//			buttonRevive.textLabel.effectColor = new Color (0.67f, 0.05f, 0.075f);
//		}
        buttonRank.gameObject.SetActive(true);
        buttonGetPower.disableButton(!data.get_power);
        buttonRule.gameObject.SetActive(true);
        notOpenGroup.SetActive(false);
        areaGroup.SetActive(true);
        GuildAreaPreInfo [] preArray = new GuildAreaPreInfo[data.areas.Count];
        data.areas.CopyTo(preArray);
        SetKit.sort(preArray, new GuildAreaPreCompareWithWarNum());
        List <GuildAreaPreInfo> list = new List <GuildAreaPreInfo> ();

        list.AddRange(preArray);
        for (int i = 0; i < data.areas.Count; i++)
        {
            data.areas [i].rank = list.IndexOf(data.areas [i]) + 1;
            areaItems [i].initUI(data.areas [i], data.curBlood, data.maxBlood);
        }
        initSmallMan();
        showTips();
    }
예제 #4
0
 /// <summary>
 /// 初始化计时器
 /// </summary>
 private void initTimer()
 {
     if (!GuildFightSampleManager.Instance().isFightTime() && !GuildFightSampleManager.Instance().isGuildFightOver())
     {
         startTimer();
     }
 }
예제 #5
0
    public void SendRivive(CallBack callback)
    {
        /** 公会战复活消耗模版 */
        GuildFightReviveSample reviveSample = GuildFightSampleManager.Instance().getSampleBySid <GuildFightReviveSample> (GuildFightSampleManager.REVIVE_COST);

        /** 行动力不足 */
        if (UserManager.Instance.self.guildFightPower < reviveSample.cost)
        {
            goToGetPower();
            return;
        }
        MessageWindow.ShowConfirm(LanguageConfigManager.Instance.getLanguage("GuildArea_90"), (msg) => {
            if (msg.msgEvent == msg_event.dialogOK)
            {
                GuildAreaReviveFPort port = FPortManager.Instance.getFPort <GuildAreaReviveFPort> ();
                port.access(() => {
                    UserManager.Instance.self.guildFightPower -= reviveSample.cost;
                    EffectManager.Instance.CreateActionCast(reviveSample.expendDes, ActionCastCtrl.GUILD_FIGHT_TYPE);
                    GuildManagerment.Instance.guildFightInfo.isDead = false;
                    UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_66"));
                    ArmyManager.Instance.setArmyState(ArmyManager.PVP_GUILD, 0);
                    isReviveBack = true;
                    if (callback != null)
                    {
                        callback();
                    }
                });
            }
        });
    }
예제 #6
0
    /// <summary>
    /// 祝福
    /// </summary>
    private void wish()
    {
        /** 不在时间范围内 */
        if (!GuildFightSampleManager.Instance().isActivityBuffTime())
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_35"));
            MaskWindow.UnlockUI();
            return;
        }
        /** 行动力不足 */
        if (UserManager.Instance.self.guildFightPower < wishSample.getExpends())
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_06"));
            MaskWindow.UnlockUI();
            return;
        }
        string des = wishSample.getUseBuffDes(1);

        MessageWindow.ShowConfirm(des, (msg) =>
        {
            if (msg.msgEvent == msg_event.dialogOK)
            {
                GuildActiveAreaBuffFport port = FPortManager.Instance.getFPort("GuildActiveAreaBuffFport") as GuildActiveAreaBuffFport;
                port.access(1, wishSample.getExpends(), wishCallBack);
            }
        });
    }
예제 #7
0
 /** 显示分组中的界面 */
 private void showGroupingUI()
 {
     buttonRank.gameObject.SetActive(true);
     buttonGetPower.disableButton(true);
     buttonRule.gameObject.SetActive(true);
     notOpenGroup.SetActive(false);
     areaGroup.SetActive(true);
     groupingGroup.SetActive(true);
     groupingLabel.text = Language("GuildArea_43", GuildFightSampleManager.Instance().getGuildFightOpenTime());
 }
예제 #8
0
    /// <summary>
    /// 更新的得分bar
    /// </summary>
    public void updateBar()
    {
        //int max = GuildFightSampleManager.Instance().getMaxScore();
        int my  = getGuildScore();
        int max = GuildFightSampleManager.Instance().getNextScore(my);

        scoreBarCtrl.updateValue(my, max);
        scoreBarLabel.text = my + "/" + max;
        nowLabel.text      = GuildFightSampleManager.Instance().getJudgeString(my) + LanguageConfigManager.Instance.getLanguage("GuildArea_96");
        nextLabel.text     = GuildFightSampleManager.Instance().getJudgeString(max) + LanguageConfigManager.Instance.getLanguage("GuildArea_96");
    }
예제 #9
0
    private CallBack back;    //窗口关闭回调

    protected override void begin()
    {
        base.begin();
        everyDayTaskedNum.text = TaskManagerment.Instance.getEveryDayTaskedNum().ToString();
        mainLineTaskedNum.text = TaskManagerment.Instance.getMainLineTaskedNum().ToString();
        guild    = GuildManagerment.Instance.getGuild();
        instance = GuildFightSampleManager.Instance();
        updateGuildPve();
        guildPveDesc.text = Language("task04", instance.getTaskPowerBySid(GuildFightSampleManager.TASK_POWER).ToString());
        MaskWindow.UnlockUI();
    }
예제 #10
0
    private void updateEffect()
    {
        if (buildSid == 5 && GuildFightSampleManager.Instance().isGuildFightAndFrontFiveMin())
        {
            leffectPoint.SetActive(true);
        }

        else
        {
            leffectPoint.SetActive(false);
        }
    }
예제 #11
0
 private void updateTime()
 {
     if (GuildFightSampleManager.Instance().getLastFightOpenTime() == 0)
     {
         timer.stop();
         timer          = null;
         timeLabel.text = "";
         updateUI(uid, server, guildName, selfCurbo, selfMaxBo);
     }
     else
     {
         timeLabel.text = LanguageConfigManager.Instance.getLanguage("GuildArea_36", GuildFightSampleManager.Instance().getLastFightOpenTimeString());
     }
 }
예제 #12
0
 protected override void begin()
 {
     base.begin();
     if (GuildManagerment.Instance.isReviveBack && data != null)
     {
         updateReviveUI();
     }
     if (!GuildManagerment.Instance.isCanJoinGuildFight())
     {
         buttonTeam.gameObject.SetActive(false);
     }
     guildName.text  = LanguageConfigManager.Instance.getLanguage("Guild_112") + UserManager.Instance.self.guildName;
     reviveSample    = GuildFightSampleManager.Instance().getSampleBySid <GuildFightReviveSample> (GuildFightSampleManager.REVIVE_COST);
     conditionSample = GuildFightSampleManager.Instance().getSampleBySid <GuildFightJoinConditionSample> (GuildFightSampleManager.JOIN_CONDITION);
     getFightInfo();
     updateTime();
     UiManager.Instance.backGround.switchBackGround("guildFight");
     MaskWindow.UnlockUI();
 }
예제 #13
0
 public void updateUI(string uid, string server, string guildName, float curBoll, float MaxBoll)
 {
     this.uid       = uid;
     this.server    = server;
     this.guildName = guildName;
     this.selfCurbo = curBoll;
     this.selfMaxBo = MaxBoll;
     setTitle(Language("GuildArea_56", guildName + "." + server));
     inspireSample   = GuildFightSampleManager.Instance().getSampleBySid <GuildBuffSample> (GuildFightSampleManager.INSPIRE_SID);
     wishSample      = GuildFightSampleManager.Instance().getSampleBySid <GuildBuffSample> (GuildFightSampleManager.WISH_SID);
     challengeSample = GuildFightSampleManager.Instance().getSampleBySid <GuildFightChallengeSample> (GuildFightSampleManager.CHALLENGE_SID);
     if (uid == GuildManagerment.Instance.getGuild().uid)
     {
         type = SELF;
     }
     else
     {
         type = OTHER;
         bloodCtrl.updateValue(selfCurbo, selfMaxBo);
     }
     getAreaInfo(uid, server);
 }
예제 #14
0
 private void onClickReceiveButton(GameObject go)
 {
     if (isDrawPrizes())
     {
         Guild guild = GuildManagerment.Instance.getGuild();
         GuildFightSampleManager instance = GuildFightSampleManager.Instance();
         if (mSample.taskType == 1 && guild != null && instance.isOverPower() && instance.isGuildFightOpen() && !TaskManagerment.Instance.isTips)
         {
             UiManager.Instance.openDialogWindow <GuildFightPowerTipWindow>((win) => {
                 win.initWindow(UserManager.Instance.self.guildFightPower, instance.getTaskPowerBySid(GuildFightSampleManager.TASK_POWER), overTask);
             });
         }
         else
         {
             overTask(null);
         }
     }
     else
     {
         noDrawPrize();
     }
 }
예제 #15
0
 private void updateTime()
 {
     if (GuildFightSampleManager.Instance().getFightTimeDelay() == 0)
     {
         if (timer != null)
         {
             timer.stop();
             timer = null;
         }
         setTitle(Language("GuildArea_13"));
         titleTimeLabel.gameObject.SetActive(false);
     }
     else
     {
         System.DateTime date = System.DateTime.Parse("00:00:00");
         date = date.AddSeconds(GuildFightSampleManager.Instance().getFightTimeDelay());
         string time = date.ToString("HH:mm:ss");
         setTitle(Language("GuildArea_57", time));
         titleTimeLabel.text = Language("GuildArea_84", time);
         titleTimeLabel.gameObject.SetActive(true);
     }
 }
예제 #16
0
 private void showTips()
 {
     if (!GuildFightSampleManager.Instance().isGuildFightOpen())
     {
         tips.gameObject.SetActive(false);
         return;
     }
     if (!GuildFightSampleManager.Instance().isShowTipsTime())
     {
         tips.gameObject.SetActive(false);
         return;
     }
     tips.gameObject.SetActive(true);
     tipsLabel.text = GuildFightSampleManager.Instance().getTips();
     if (GuildFightSampleManager.Instance().isGuildFightOver())
     {
         overTipsLabel.text = Language("GuildArea_63");
         downTipsLabel.text = "";
         tipsLabel.text     = tipsLabel.text.Replace("%1", data.getMyRank().ToString());
         tipsLabel.text     = tipsLabel.text.Replace("%2", getGuildScore().ToString());
         tipsLabel.text     = tipsLabel.text.Replace("%3", GuildFightSampleManager.Instance().getJudgeString(getGuildScore()));
     }
 }
예제 #17
0
 public void initializeInfo(GuildArea _data)
 {
     this.data = _data;
     if (this.data == null)
     {
         buttonWish.disableButton(true);
         buttonWish.textLabel.effectColor = new Color(0.22f, 0.22f, 0.22f);
         buttonInspire.disableButton(true);
         buttonInspire.textLabel.effectColor = new Color(0.22f, 0.22f, 0.22f);
     }
     else
     {
         buttonWish.disableButton(false);
         buttonInspire.disableButton(false);
     }
     inspireSample       = GuildFightSampleManager.Instance().getSampleBySid <GuildBuffSample>(GuildFightSampleManager.INSPIRE_SID);
     wishSample          = GuildFightSampleManager.Instance().getSampleBySid <GuildBuffSample>(GuildFightSampleManager.WISH_SID);
     inspireXiaohao.text = LanguageConfigManager.Instance.getLanguage("GuildArea_97", inspireSample.getExpends().ToString());
     inspireJiangli.text = inspireSample.getRewardDesString();
     inspireXiaoguo.text = LanguageConfigManager.Instance.getLanguage("GuildArea_99") + "+" + ((data == null ? 0 : data.inspireNum) * inspireSample.getEffect()[0]) + "%" + "[3A9663]+" + inspireSample.getEffect()[0] + "%[-]";
     wishXiaohao.text    = LanguageConfigManager.Instance.getLanguage("GuildArea_97", wishSample.getExpends().ToString());
     wishJiangli.text    = inspireSample.getRewardDesString();
     wishXiaoguo.text    = LanguageConfigManager.Instance.getLanguage("GuildArea_98") + "+" + ((data == null ? 0 : data.wishNum) * wishSample.getEffect()[0]) + "%" + "[3A9663]+" + wishSample.getEffect()[0] + "%[-]";
 }
예제 #18
0
 public override void buttonEventBase(GameObject gameObj)
 {
     base.buttonEventBase(gameObj);
     if (gameObj.name == "buttonHelp")
     {
         UiManager.Instance.openDialogWindow <GeneralDesWindow> ((win) => {
             win.initialize(LanguageConfigManager.Instance.getLanguage("GuildArea_15"), LanguageConfigManager.Instance.getLanguage("GuildArea_11"), null);
         });
     }
     else if (gameObj.name == "ButtonRank")
     {
         UiManager.Instance.openWindow <GuildAreaHurtRankWindow> ();
     }
     else if (gameObj.name == "close")
     {
         this.finishWindow();
     }
     else if (gameObj.name == "ButtonGetPower")
     {
         /** 行动力已满 */
         if (UserManager.Instance.self.isGuildFightPowerMax())
         {
             UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_23"));
             MaskWindow.UnlockUI();
             return;
         }
         /** 领取后行动力超出 */
         else if (UserManager.Instance.self.guildFightPower + GuildFightSampleManager.Instance().getPowerNum() > UserManager.Instance.self.guildFightPowerMax)
         {
             string des = Language("GuildArea_47");
             MessageWindow.ShowConfirm(des, (msg) => {
                 if (msg.msgEvent == msg_event.dialogOK)
                 {
                     GuildGetWarPowerFport port = FPortManager.Instance.getFPort("GuildGetWarPowerFport") as GuildGetWarPowerFport;
                     port.access((power) => {
                         int addPower = power - UserManager.Instance.self.guildFightPower;
                         UserManager.Instance.self.guildFightPower = power;
                         data.get_power = false;
                         buttonGetPower.disableButton(!data.get_power);
                         updatePower();
                         UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_34", addPower.ToString()));
                     });
                 }
             });
             MaskWindow.UnlockUI();
             return;
         }
         /** 领取行动值 */
         else
         {
             GuildGetWarPowerFport port = FPortManager.Instance.getFPort("GuildGetWarPowerFport") as GuildGetWarPowerFport;
             port.access((power) => {
                 int addPower = power - UserManager.Instance.self.guildFightPower;
                 UserManager.Instance.self.guildFightPower = power;
                 data.get_power = false;
                 buttonGetPower.disableButton(!data.get_power);
                 updatePower();
                 UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_34", addPower.ToString()));
             });
         }
     }
     else if (gameObj.name == "ButtonAward")
     {
         UiManager.Instance.openDialogWindow <GuildFightAwardShowWindow> ();
     }
     else if (gameObj.name == "noticeButton")
     {
         if (GuildManagerment.Instance.getGuild().job == GuildJobType.JOB_PRESIDENT || GuildManagerment.Instance.getGuild().job == GuildJobType.JOB_VICE_PRESIDENT)
         {
             UiManager.Instance.openDialogWindow <GuildNoticeEditWindow> ((win) => {
                 win.updateInput();
             });
         }
         else
         {
             MaskWindow.UnlockUI();
         }
     }
     else if (gameObj.name == "chatButton")
     {
         UiManager.Instance.openWindow <ChatWindow> ((win) => {
             win.initChatWindow(ChatManagerment.Instance.sendType - 1);
         });
         if (MainWindow.sort > ChatManagerment.Instance.getAllChat().Count)
         {
             ++MainWindow.sort;
         }
         else
         {
             MainWindow.sort = ChatManagerment.Instance.getAllChat().Count;
         }
     }
     else if (gameObj.name == "buttonInfo")             // 详情
     {
         tweenerMessageState = false;
         tweenMessage.gameObject.SetActive(true);
         tweenerMessageState = true;
         tweenerMessageGroupIn(tweenMessage);
     }
     else if (gameObj.name == "buttonCloseInfo")             // 关闭详情
     {
         tweenerMessageState = false;
         tweenerMessageGroupOut(tweenMessage);
     }
     /** 复活 */
     else if (gameObj.name == "ButtonRevive")
     {
         //SendRivive ();
     }
     else if (gameObj.name == "ButtonCourage")
     {
         if (data.state == NOTOPEN)
         {
             UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_35"));
         }
         else
         {
             /** 入会不满1天 */
             if (!GuildManagerment.Instance.isCanJoinGuildFight())
             {
                 UiManager.Instance.createMessageLintWindow(Language("GuildArea_41"));
                 return;
             }
             if (data.areas.Count > 0)
             {
                 foreach (GuildAreaPreInfo info in data.areas)
                 {
                     if (info.uid == UserManager.Instance.self.guildId)
                     {
                         GuildGetAreaFPort port = FPortManager.Instance.getFPort("GuildGetAreaFPort") as GuildGetAreaFPort;
                         port.access(info.uid, info.server, (guildAreaData) => {
                             UiManager.Instance.openDialogWindow <GuildFightCourageWindow> ((win) => {
                                 win.initializeInfo(guildAreaData);
                             });
                         });
                         return;
                     }
                 }
             }
             else
             {
                 MaskWindow.UnlockUI();
             }
         }
     }
     else if (gameObj.name == "ButtonIntegralRank")
     {
         UiManager.Instance.openDialogWindow <GuildFightClassWindow> ((win) => {
             win.Intialize();
         });
     }
     else if (gameObj.name == "ButtonTeam")
     {
         if (!GuideManager.Instance.isGuideComplete())
         {
             ArmyManager.Instance.cleanAllEditArmy();
         }
         GuideManager.Instance.doGuide();
         //判断队伍6(公会战队伍)是否存在
         if (ArmyManager.Instance.getArmy(6) == null)
         {
             GetGuildFightTeamFPort fport = FPortManager.Instance.getFPort <GetGuildFightTeamFPort> ();
             fport.access(openTeamEmtpyWindow);
         }
         else
         {
             openTeamEmtpyWindow();
         }
     }
 }
예제 #19
0
    /** 初始化ui */
    private void initUI()
    {
        updateUI();
        int score = getGuildScore();

        if (score > 0)
        {
            guildClass.text = "[u]" + LanguageConfigManager.Instance.getLanguage("GuildArea_95") + GuildFightSampleManager.Instance().getJudgeString(score) + LanguageConfigManager.Instance.getLanguage("GuildArea_96") + "[/u]";
        }
        else
        {
            guildClass.text = "[u]" + LanguageConfigManager.Instance.getLanguage("GuildArea_71") + "[/u]";
        }
    }
예제 #20
0
 public string getJudeString()
 {
     return(GuildFightSampleManager.Instance().getJudgeString(judgeScore));
 }
예제 #21
0
    public void Intialize()
    {
        updateBar();
        int score = getGuildScore();

        if (score > 0)
        {
            classLabel.text = LanguageConfigManager.Instance.getLanguage("GuildArea_89") + GuildFightSampleManager.Instance().getJudgeString(score) + LanguageConfigManager.Instance.getLanguage("GuildArea_96");
        }
        else
        {
            classLabel.text = LanguageConfigManager.Instance.getLanguage("GuildArea_88");
        }
    }