Пример #1
0
    public UnitData getRareUnitData(UnitData bd, UnitData rd)
    {
        UnitData ud = new UnitData();

        ud.isCombineData = true;
        ud.isRare        = true;

        ud.id = rd.id;
        //ud.name = rd.name;

        ud.cooltime        = bd.cooltime + rd.cooltime;
        ud.maxSummonAtOnce = bd.maxSummonAtOnce + rd.maxSummonAtOnce;
        ud.sp = bd.sp + rd.sp;

        ud.speed     = bd.speed + rd.speed;
        ud.atkRange  = bd.atkRange + rd.atkRange;
        ud.atkSpeed  = bd.atkSpeed + rd.atkSpeed;
        ud.atkPhysic = bd.atkPhysic + rd.atkPhysic;
        ud.atkMagic  = bd.atkMagic + rd.atkMagic;
        ud.defPhysic = bd.defPhysic + rd.defPhysic;
        ud.defMagic  = bd.defMagic + rd.defMagic;
        ud.hp        = bd.hp + rd.hp;
        ud.unitType  = bd.unitType;        // 공중 지상

        ud.baseLevel = bd.baseLevel;

        ud.grade = bd.grade;

        int bs = 0;
        int rs = 0;

        if (bd.skill != null)
        {
            bs = bd.skill.Length;
        }
        if (rd.skill != null)
        {
            rs = rd.skill.Length;
        }

        ud.skill = new string[bs + rs];

        if (bs > 0)
        {
            bd.skill.CopyTo(ud.skill, 0);
        }
        if (rs > 0)
        {
            rd.skill.CopyTo(ud.skill, bs);
        }


        ud.description = rd.description;

        ud.effectType = rd.effectType;

        ud.baseUnitId = rd.baseUnitId;

        ud.attackType = new AttackData();

        ud.attackType.isShortType = bd.attackType.isShortType;
        ud.attackType.type        = bd.attackType.type;
        ud.attackType.attr        = Util.intArrayMerger(bd.attackType.attr, rd.attackType.attr);

        ud.reinforceLevel = GameIDData.getInforceLevelFromUnitId(id);

        ud.rare = ud.grade - 1;      //GameIDData.getRareLevelByReinforceLevel(reinforceLevel);

        ud.level = bd.baseLevel;

        return(ud);
    }