コード例 #1
0
    void InitCharacter()
    {
        pe_Team team_id = m_StageInfo.TeamID;

        m_TeamData = TeamDataManager.Instance.GetTeam(team_id);

        if (m_TeamData == null)
        {
            m_TeamData = new TeamData(m_StageInfo.TeamID, null);
            TeamDataManager.Instance.AddTeam(m_TeamData, Tutorial.Instance.Completed);
            m_TeamDataBackup = null;
        }
        else
        {
            m_TeamDataBackup = m_TeamData.Clone();
        }

        m_MainLayout.Init(m_TeamData);

        m_LeaderSkill.Init(m_TeamData.LeaderCreature, m_TeamData.UseLeaderSkillType, OnLeaderSkill);
        //OnChangedLeaderSkillChanged(m_TeamData!=null?m_TeamData.LeaderCreature:null);


        UpdateCharacterInfo(false);
    }
コード例 #2
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
    public string GetTeamString(Creature creature)
    {
        if (creature == null)
        {
            return("");
        }

        if (CheckAdventureTeam(creature.Idx))
        {
            return(Localization.Get("IN_Adventure"));
        }


        if (CheckTeam(creature.Idx, pe_Team.PVP_Defense))
        {
            return(Localization.Get("IN_PVP"));
        }

        pe_Team team_type = CheckTeam(creature.Idx);

        if (team_type != pe_Team.Invalid)
        {
            return(Localization.Get("IN_TEAM"));
        }

        if (creature.IsLock)
        {
            return(Localization.Get("Lock"));
        }

        return("");
    }
コード例 #3
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
    public bool CheckTeam(long creature_idx, pe_Team team_type)
    {
        foreach (var team in Teams)
        {
            if (team.TeamType != team_type)
            {
                continue;
            }

            if (IsAdventureTeam(team.TeamType) && team.NoDuplicate == false)
            {
                continue;
            }

            if (team.Creatures.Any(c => c.creature.Idx == creature_idx) == true)
            {
                return(true);
            }
        }
        return(false);
    }
コード例 #4
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
 public TeamData(pe_Team team_type, TeamData data)
 {
     TeamType = team_type;
     if (data != null)
     {
         IsAuto             = data.IsAuto;
         IsFast             = data.IsFast;
         UseLeaderSkillType = data.UseLeaderSkillType;
         SetCreatures(CloneCreatures(data.Creatures), false);
         m_LeaderCreature = data.LeaderCreature;
         NoDuplicate      = data.NoDuplicate;
     }
     else
     {
         UseLeaderSkillType = pe_UseLeaderSkillType.TeamDanger;
         IsAuto             = GameConfig.Get <bool>("default_auto_battle");
         IsFast             = false;
         m_Creatures        = new List <TeamCreature>();
         NoDuplicate        = false;
     }
     m_Creatures2 = m_Creatures;
 }
コード例 #5
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
 static public bool IsAdventureTeam(pe_Team team)
 {
     return((int)team >= 20000 && (int)team < 30000);
 }
コード例 #6
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
 public bool Contains(pe_Team idn)
 {
     return(Teams.Find(d => d.TeamType == idn) != null);
 }
コード例 #7
0
ファイル: TeamData.cs プロジェクト: tapenjoyGame/cry
    ////////////////////////////////////////////////////////////////

    public TeamData GetTeam(pe_Team idn)
    {
        return(Teams.Find(d => d.TeamType == idn));
    }
コード例 #8
0
    public void Init(pe_UseLeaderSkillType condition, OnChangedLeaderSkillConditionDelegate callback, pe_Team team_type)
    {
        m_OnChangedLeaderSkillCondition = callback;
        SetCondition(condition, false);

        UnlockAll();

        switch (team_type)
        {
        case pe_Team.PVP:
        case pe_Team.PVP_Defense:
            SetLock(pe_UseLeaderSkillType.Manual);
            SetLock(pe_UseLeaderSkillType.LastWave);
            break;

        case pe_Team.Boss:
            SetLock(pe_UseLeaderSkillType.LastWave);
            break;
        }
    }