Exemple #1
0
    void JoinCombat()
    {
        MainCameraM.s_Instance.EnableDrag(true);
        WndManager.DestoryDialog <SelectSoldierwnd>();

        CombatInfoWnd wndInfo = WndManager.GetDialog <CombatInfoWnd>();

        if (wndInfo != null)
        {
            wndInfo.SetWndMode(CombatInfoMode.combat);
        }

        CombatWnd wnd = WndManager.GetDialog <CombatWnd>();

        if (wnd != null)
        {
            wnd.InitSoldierUI();
        }

        if (m_SelectedBlackScienceCaptainID != 0)       //黑科技设置
        {
            CmCarbon.AddGodSkill(true, m_SelectedBlackScienceCaptainID, ConfigM.GetInitMana());

            GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>();
            if (gsw != null)
            {
                gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana());
            }
        }

        CombatScheduler.SetCSState(CSState.Combat);
    }
Exemple #2
0
    public override void BuildUI()
    {
        Life.Environment = LifeEnvironment.Combat;
        CombatScheduler.SetCSState(CSState.Ready);

        if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE)
        {
            if (StageDC.GetPveMode() == PVEMode.Attack)
            {
                WndManager.GetDialog <SelectSoldierwnd>();
                BattleEnvironmentM.BuildScene();
            }
            else
            {
                BattleEnvironmentM.BuildScene();
                WndManager.GetDialog <CombatWnd>();
                CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
                if (wnd != null)
                {
                    wnd.SetWndMode(CombatInfoMode.combat);
                }
                if (CmCarbon.GetGodSkill(StageDC.GetPveMode() == PVEMode.Attack) != null)
                {
                    //船长技能设置
                    GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>();
                    if (gsw != null)
                    {
                        gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                        gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana());
                    }
                }
                //
            }
        }
        else
        {
            WndManager.GetDialog <CombatWnd>();
            WndManager.GetDialog <CombatCountDownWnd>();
            CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
            if (wnd != null)
            {
                wnd.SetWndMode(CombatInfoMode.view);
            }
            BattleEnvironmentM.BuildScene();
        }
        BattleEnvironmentM.AddFireSoldierCompent();

        Screen.sleepTimeout    = SleepTimeout.NeverSleep;//prevent  phone from going to sleep
        m_oldUserInfo.Level    = UserDC.GetLevel();
        m_oldUserInfo.Physical = UserDC.GetPhysical();
    }
    void Update()
    {
        if (CombatScheduler.State == CSState.Pause)
        {
            return;
        }
        if (CombatScheduler.State == CSState.End)
        {
            Destroy(this);
            return;
        }

        if (CombatScheduler.State == CSState.Start || CombatScheduler.State == CSState.Ready)
        {
            CombatScheduler.SetCSState(CSState.Combat);
        }

        m_timeElapse += Time.deltaTime;

        CreateWatingSoldiers();
        UpdateWatingSoliderUI();
        FrieSoldiers();
    }
Exemple #4
0
    public void ReleaseSkill(MapGrid g, Vector3 pos, Life target = null)
    {
        if (!CheckMana())
        {
            CancelSelect();
            return;
        }
        //Building.ShowAllHp(false);
        GodSkill    godSkill     = CmCarbon.GetGodSkill(true);
        int         selectTarget = godSkill.m_godskill.m_selectTarget;
        List <Life> listSelfLife = new List <Life>();

        switch (selectTarget)
        {
        case 0:    //不需要选择目标
            //NGUIUtil.DebugLog("不需要选择目标");
            break;

        case 1:    //需要己方单位目标
            //NGUIUtil.DebugLog("需要己方单位目标");
            if (target != null)

            {
                listSelfLife.Add(target);
            }
            else
            {
                Life life = SearchSelfNearestTarget(g, godSkill.Camp, 1f);
                listSelfLife.Add(life);
                if (life == null)
                {
                    //NGUIUtil.ShowTipWnd(string.Format("{0} 需要己方单位目标!",godSkill.m_godskill.m_name),1.0f);
                    return;
                }
                else
                {
                    //NGUIUtil.ShowTipWnd(string.Format("{0} 己方单位目标!", life.transform.name), 1.0f);
                }
            }

            break;

        case 2:    //需要敌方单位目标
            //NGUIUtil.DebugLog("需要敌方单位目标");
            break;

        default:
            break;
        }
        m_ReleaseSkill      = true;
        m_ReadyReleaseSkill = false;
        Vector3 vpos = MyHead.Vaule.transform.position;

        vpos.z -= 1;
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000581", vpos, MyHead.Vaule.transform.parent);

        iseffecttime = true;
        if (gae != null)
        {
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f);
            gae.gameObject.AddComponent <SetRenderQueue>();
            ndEffect.m_complete = EffectFinish;
            gae.AddAction(ndEffect);
        }

        if (CSState.Start == CombatScheduler.State)
        {
            CombatScheduler.SetCSState(CSState.Combat);
        }
        godSkill.ListSkillTarget = listSelfLife;
        godSkill.ReleaseGodSkill(g, pos);

        int require = int.Parse(MyHead.RequireMana.text);

        SetRequireMana(godSkill.GetRequireMana());
        CmCarbon.SubGodSkillMana(true, require);
        SetCurMana(CmCarbon.GetGodSkillMana(true));
        UnDoClick();

        CancelSelect();
        //Fire.SetActive(false);
    }