예제 #1
0
    public override void Init()
    {
        complexBattleParam = new DataUnit.BasicBattleParam();
        complexBattleParam.Copy(dataUnit.battleParam);

        Model_Unit modelUnit = new Model_Unit();

        modelUnit.Parse(pbUnit);
        DataUnitPart[] dataParts = modelUnit.GetDataParts();
        foreach (DataUnitPart part in dataParts)
        {
            complexBattleParam.Add(part.battleParam);
        }

        if (heroId > 0)
        {
            DataHero dataHero = DataManager.instance.dataHeroGroup.GetHero(heroId, pbHero.exp, pbHero.stage);
            complexBattleParam.Add(dataHero.basicParam);
        }

        complexBattleParam.damage *= powerScale;
        complexBattleParam.ammo   *= powerScale;
        complexBattleParam.hp     *= unitCount;
        currentHp = complexBattleParam.hp;
    }
예제 #2
0
    virtual public void Init()
    {
        complexBattleParam = new DataUnit.BasicBattleParam();
        complexBattleParam.Copy(_dataUnit.battleParam);

        if (isPlayerUnit)
        {
            if (InstancePlayer.instance.model_User.isLogin)
            {
                Model_Unit     modelUnit = InstancePlayer.instance.model_User.unlockUnits [unitId];
                DataUnitPart[] dataParts = modelUnit.GetDataParts();
                foreach (DataUnitPart part in dataParts)
                {
                    complexBattleParam.Add(part.battleParam);
                }
            }

            if (heroId > 0)
            {
                SlgPB.Hero hero     = InstancePlayer.instance.model_User.model_heroGroup.GetHero(heroId);
                DataHero   dataHero = DataManager.instance.dataHeroGroup.GetHero(heroId, hero.exp, hero.stage);
                complexBattleParam.Add(dataHero.basicParam);
            }
        }

        complexBattleParam.damage *= powerScale;
        complexBattleParam.ammo   *= powerScale;
        complexBattleParam.hp     *= unitCount;
        currentHp = complexBattleParam.hp;
    }