Пример #1
0
    protected void AddTeam(int id, ETeamType type)
    {
        var team = new TeamController();

        team.TeamType = type;
        m_TeamList.Add(team);

        if (type == ETeamType.LeftSide)
        {
            var pupilId   = AdventureProxy.instance.GetData().PupilId;
            var pupilInfo = PupilProxy.instance.getPupilInfo(pupilId);
            var wuxue     = pupilInfo.GetEquipingWuXue();

            var character = team.AddCharacter(1, pupilId);
            character.TeamType = type;
            character.InitHp(200, 200);
            character.SkillId = wuxue != null ? wuxue.Id : 0;

            var normalAttack = new NormalAttack();
            normalAttack.AttackCount  = 1;
            normalAttack.AttackHurt   = 20;
            normalAttack.AttackTarget = null;
            character.InitNormalAttack(normalAttack);

            var skillAttack = new SkillAttack();
            skillAttack.AttackCount  = 4;
            skillAttack.AttackHurt   = 10;
            skillAttack.AttackTarget = null;
            skillAttack.SkillId      = character.SkillId;
            character.InitSkillAttack(skillAttack);
        }
        else
        {
            var character = team.AddCharacter(2, m_EnemyId);
            character.TeamType = type;
            character.InitHp(200, 200);
            character.SkillId = EnemyDeploy.GetInfo(m_EnemyId).SkillEffectId;

            var normalAttack = new NormalAttack();
            normalAttack.AttackCount  = 1;
            normalAttack.AttackHurt   = 10;
            normalAttack.AttackTarget = null;
            character.InitNormalAttack(normalAttack);

            var skillAttack = new SkillAttack();
            skillAttack.AttackCount  = 4;
            skillAttack.AttackHurt   = 5;
            skillAttack.AttackTarget = null;
            skillAttack.SkillId      = character.SkillId;
            character.InitSkillAttack(skillAttack);
        }
    }