Example #1
0
    void OnSelectSkillAutoCallback(Creature creature, int index)
    {
        TeamCreature team_creature = m_CurrentTeam.Creatures.Find(c => c.creature.Idx == creature.Idx);

        if (team_creature != null)
        {
            team_creature.auto_skill_index = (short)index;
        }
    }
Example #2
0
 public void RemoveAdventureCreature(TeamCreature creature)
 {
     AdventureTeams.ForEach(c =>
     {
         if (c.NoDuplicate == false)
         {
             c.Creatures.RemoveAll(e => e.creature.Idx == creature.creature.Idx);
         }
     });
 }
Example #3
0
    public void Init(TeamCreature team_creature, System.Action <Creature, int> callback = null)
    {
        gameObject.SetActive(false);
        m_TeamCreature        = team_creature;
        m_Creature            = m_TeamCreature.creature;
        OnSelectSkillCallback = callback;

        string       sprite_name     = string.Format("cs_{0}", m_Creature.Info.ID);
        string       new_sprite_name = "_cut_" + sprite_name;
        UISpriteData sp = m_Character.atlas.CloneCustomSprite(sprite_name, new_sprite_name);

        if (sp != null)
        {
            sp.height = sp.width;
        }

        m_Character.spriteName = new_sprite_name;

        if (m_Creature.Skills.Count > 1 && m_Creature.Skills[1].Info.Type == eSkillType.active)
        {
            m_Skill[0].spriteName = m_Creature.Skills[1].Info.IconID;
            m_SkillEmpty[0].SetActive(true);
        }
        else
        {
            m_SkillEmpty[0].SetActive(false);
            m_SkillEmpty[1].SetActive(false);
        }
        if (m_Creature.Skills.Count > 2 && m_Creature.Skills[2].Info.Type == eSkillType.active)
        {
            m_Skill[1].spriteName = m_Creature.Skills[2].Info.IconID;
            m_SkillEmpty[1].SetActive(true);
        }
        else
        {
            m_SkillEmpty[1].SetActive(false);
        }

        m_ToggleSkill[0].group = m_Creature.Info.IDN + 1000;
        m_ToggleSkill[1].group = m_Creature.Info.IDN + 1000;
        m_ToggleSkill[2].group = m_Creature.Info.IDN + 1000;

        if (m_TeamCreature.auto_skill_index != -1)
        {
            m_ToggleSkill[m_TeamCreature.auto_skill_index].value = true;
        }
        gameObject.SetActive(true);
    }
Example #4
0
    void SaveTeamData()
    {
        List <TeamCreature> creatures = null;

        creatures = new List <TeamCreature>();
        foreach (var character in m_MainLayout.m_Characters.Where(c => c.IsInit))
        {
            Creature     creature      = CreatureManager.Instance.GetInfoByIdx(character.CharacterAsset.Asset.Creature.Idx);
            TeamCreature team_creature = m_TeamData.Creatures.Find(c => c.creature == creature);
            if (team_creature != null)
            {
                creatures.Add(team_creature);
            }
            else
            {
                creatures.Add(new TeamCreature(creature, 1));
            }
        }
        m_TeamData.SetCreatures(creatures, Tutorial.Instance.Completed);
        m_TeamData.SetLeaderCreature(m_LeaderSkill.LeaderCreature, m_LeaderSkill.UseLeaderSkillType, Tutorial.Instance.Completed);
        GameMain.Instance.UpdateNotify(false);
    }
Example #5
0
    void SaveTeamData()
    {
        List <TeamCreature> creatures = null;

        creatures = new List <TeamCreature>();
        foreach (var character in m_MainLayout.m_Characters.Where(c => c.IsInit))
        {
            Creature     creature      = CreatureManager.Instance.GetInfoByIdx(character.CharacterAsset.Asset.Creature.Idx);
            TeamCreature team_creature = m_CurrentTeam.Creatures.Find(c => c.creature.Idx == creature.Idx);
            if (team_creature != null)
            {
                creatures.Add(team_creature);
            }
            else
            {
                creatures.Add(new TeamCreature(creature, -1));
            }
        }
        //List<TeamCreature> creatures = m_MainLayout.m_Characters.Where(c => c.IsInit).Select(c => new TeamCreature(CreatureManager.Instance.GetInfoByIdx(c.CharacterAsset.Asset.Creature.Idx), 1)).ToList();
        m_CurrentTeam.SetCreatures(creatures, m_DeckType == eDeckType.Offense);
        m_TeamPower.text = Localization.Format("PowerValue", m_CurrentTeam == null ? 0 : m_CurrentTeam.Power);

        GameMain.Instance.UpdateNotify(false);
    }