Exemple #1
0
    public void writeData()
    {
        string            d = "";
        RoleAttributeList l = ThisBasicRoleProperty()._role.AllARevision.Clone;

        for (int i = 0; i < l.AllAttributeData.Length; i++)
        {
            if (l.AllAttributeData[i] != 0)
            {
                d += (AttributeData)i + " " + l.AllAttributeData[i] + "|| ";
            }
        }
        string d2  = "";
        int    dmg = checkStatesDamaging();

        if (dmg != 0)
        {
            d2 += " 状态持续造成伤害:" + dmg;
        }
        string all = d + d2;

        Debug.Log(all);
        //
        ThisBasicRoleProperty()._role.RefreshCERAL();
    }
Exemple #2
0
    public void initEnemy(string enemyId)
    {
        UnitId = enemyId;
        SDEnemy e;

        if (GetComponent <SDEnemy>())
        {
            e = GetComponent <SDEnemy>();
        }
        else
        {
            e = gameObject.AddComponent <SDEnemy>();
        }
        EnemyProperty._enemy = e;
        //
        EnemyProperty.ID        = UnitId;
        EnemyProperty._enemy.ID = UnitId;
        //
        EnemyInfo   enemy  = SDDataManager.Instance.getEnemyInfoById(enemyId);
        ROEnemyData d      = SDDataManager.Instance.getEnemyDataById(enemyId);
        int         career = 0;

        if (rareWeight > 0)
        {
            career = UnityEngine.Random.Range(0, (int)Job.End);
        }
        d = enemyBuild.AddCareerData(d, career);
        //
        RoleAttributeList ral = enemyBuild.RALAddedByLevel(enemy.RAL).Clone;
        //
        float scale = SDConstants.HERO_MODEL_RATIO;

        if (isLittleBoss)
        {
            scale = SDConstants.HERO_MODEL_BIG_RATIO;
            d     = enemyBuild.LittleBossData(d, enemy.EnemyRank.Index);
        }
        //
        unit_character_model.initEnemyCharacterModel(UnitId, scale);
        //
        ral.AffectedByRate(d.RALRate);
        //
        EnemyProperty._enemy.initData(enemy.EnemyRank.Index, ral
                                      , d.CRIDmg, d.DmgReduction
                                      , d.DmgReflection, d.dropCoins, d.BarChartRegendPerTurn
                                      , enemy.ID, enemy.Name, 0);
        enemyBuild EB = FindObjectOfType <enemyBuild>();

        if (EB)
        {
            List <OneSkill> skills = EB.WriteEnemySkills(enemy);
            if (skills != null)
            {
                for (int i = 0; i < skills.Count; i++)
                {
                    _skills.Add(skills[i]);
                }
            }
        }
    }
Exemple #3
0
    public void checkAllGroupState()
    {
        selfRALChange  = RoleAttributeList.zero;
        otherRALChange = RoleAttributeList.zero;
        BM.resetHTED();
        BM.resetETHD();
        //
        CheckRaceEffect();
        //对玩家队伍效果
        for (int i = 0; i < BM.Remaining_SRL.Count; i++)
        {
            BM.Remaining_SRL[i].getBCOA(selfBarChartEffect);
            if (selfRALChange.HaveData)
            {
                BM.Remaining_SRL[i].ThisBasicRoleProperty()
                ._role.extraRALChangeData.Add(selfRALChange);
            }
        }

        //对敌对队伍效果
        for (int i = 0; i < BM.Remaining_ORL.Count; i++)
        {
            BM.Remaining_ORL[i].getBCOA(otherBarChartEffect);
            if (otherRALChange.HaveData)
            {
                BM.Remaining_ORL[i].ThisBasicRoleProperty()
                ._role.extraRALChangeData.Add(otherRALChange);
            }
        }
    }
Exemple #4
0
    public static RoleAttributeList RALByDictionary(Dictionary <string, string> s)
    {
        RoleAttributeList RAL = new RoleAttributeList();

        RAL.Hp     = StringToInteger(s["hp"]);
        RAL.Mp     = StringToInteger(s["mp"]);
        RAL.Tp     = StringToInteger(s["tp"]);
        RAL.AT     = StringToInteger(s["at"]);
        RAL.AD     = StringToInteger(s["ad"]);
        RAL.MT     = StringToInteger(s["mt"]);
        RAL.MD     = StringToInteger(s["md"]);
        RAL.Speed  = StringToInteger(s["speed"]);
        RAL.Taunt  = StringToInteger(s["taunt"]);
        RAL.Accur  = StringToInteger(s["accur"]);
        RAL.Evo    = StringToInteger(s["evo"]);
        RAL.Crit   = StringToInteger(s["crit"]);
        RAL.Expect = StringToInteger(s["expect"]);

        RAL.Bleed_Def     = StringToInteger(s["bleed_def"]);
        RAL.Mind_Def      = StringToInteger(s["mind_def"]);
        RAL.Fire_Def      = StringToInteger(s["fire_def"]);
        RAL.Frost_Def     = StringToInteger(s["frost_def"]);
        RAL.Corrosion_Def = StringToInteger(s["corrosion_def"]);
        RAL.Hush_Def      = StringToInteger(s["hush_def"]);
        RAL.Dizzy_Def     = StringToInteger(s["dizzy_def"]);
        RAL.Confuse_Def   = StringToInteger(s["confuse_def"]);
        return(RAL);
    }
Exemple #5
0
    public static RoleAttributeList RandomSet(ScopeInt barchartAd
                                              , ScopeInt atkdefAd, ScopeInt extraAd, ScopeInt Rd)
    {
        RoleAttributeList L = RoleAttributeList.zero;

        L.Hp = UnityEngine.Random.Range(barchartAd.Min, barchartAd.Max);
        L.Mp = UnityEngine.Random.Range(barchartAd.Min, barchartAd.Max);
        L.Tp = UnityEngine.Random.Range(barchartAd.Min, barchartAd.Max);
        //
        L.AT = UnityEngine.Random.Range(atkdefAd.Min, atkdefAd.Max);
        L.AD = UnityEngine.Random.Range(atkdefAd.Min, atkdefAd.Max);
        L.MT = UnityEngine.Random.Range(atkdefAd.Min, atkdefAd.Max);
        L.MD = UnityEngine.Random.Range(atkdefAd.Min, atkdefAd.Max);
        //
        L.Speed  = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        L.Taunt  = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        L.Accur  = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        L.Evo    = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        L.Crit   = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        L.Expect = UnityEngine.Random.Range(extraAd.Min, extraAd.Max);
        //
        for (int i = 0; i < L.AllResistData.Length; i++)
        {
            L.AllResistData[i] = UnityEngine.Random.Range(Rd.Min, Rd.Max);
        }
        return(L);
    }
 public void initRAL(RoleAttributeList RAL
                     , SDConstants.CharacterType CType, int lv = 0)
 {
     currentRAL = RAL;
     _type      = CType;
     initRAL_AD_Panel();
 }
    /// <summary>
    /// 状态造成的属性影响计算
    /// </summary>
    /// <param name="source"></param>
    /// <param name="target"></param>
    /// <returns></returns>
    public override RoleAttributeList ralCaused(BattleRoleData source, BattleRoleData target)
    {
        RoleAttributeList ral = new RoleAttributeList();
        //RoleAttributeList sourceRal = source.ThisBasicRoleProperty()._role.ThisRoleAttributes.Clone;
        RoleAttributeList targetRal = source.ThisBasicRoleProperty()._role.ThisRoleAttributes.Clone;

        for (int i = 0; i < AllChangesInRAL.Count; i++)
        {
            ChangeInRAL c = AllChangesInRAL[i];
            int         d = c.ChangeData.DATA;
            if (!c.IsForRD)
            {
                if (c.UseDataType == ChangeInRAL.DataOrigin.normal)
                {
                    if (c.ChangeData.dataTag == NumberData.DataType.percent)
                    {
                        d = (int)(targetRal.read(c.ADTag)
                                  * c.ChangeData.DECIMAL);
                    }
                }
                else if (c.UseDataType == ChangeInRAL.DataOrigin.otherAtb)
                {
                    int ori = targetRal.read(c.OtherAtb);
                    d = (int)(ori * AllRandomSetClass.SimplePercentToDecimal(c.UsePercent));
                }
                else if (c.UseDataType == ChangeInRAL.DataOrigin.armor)
                {
                    RoleAttributeList _ral = getRALFromEquip(c.UsePos, source, target).Clone;
                    d = _ral.read(c.ADTag);
                }

                ral.Add(d, c.ADTag);
            }
            else
            {
                if (c.UseDataType == ChangeInRAL.DataOrigin.normal)
                {
                    if (c.ChangeData.dataTag == NumberData.DataType.percent)
                    {
                        d = (int)(targetRal.read(c.STag)
                                  * c.ChangeData.DECIMAL);
                    }
                }
                else if (c.UseDataType == ChangeInRAL.DataOrigin.otherAtb)
                {
                    int ori = targetRal.read(c.OtherAtb);
                    d = (int)(ori * AllRandomSetClass.SimplePercentToDecimal(c.UsePercent));
                }
                else if (c.UseDataType == ChangeInRAL.DataOrigin.armor)
                {
                    RoleAttributeList _ral = getRALFromEquip(c.UsePos, source, target).Clone;
                    d = _ral.read(c.STag);
                }

                ral.Add(d, c.STag);
            }
        }
        return(ral);
    }
    public void RefreshCERAL()
    {
        RoleAttributeList ral = ThisRoleAttributes.Clone;

        ral.Add(AllARevision);
        ral.Add(extraRALChangeData);
        CurrentExportRAL = ral.Clone;
    }
Exemple #9
0
    public void CheckStates()
    {
        ThisBasicRoleProperty()._role.AllARevision.Clear();

        stateExtraDamage = 0;
        AllRegend        = ThisBasicRoleProperty().BarChartRegendPerTurn;
        checkAllStandardStates();
        //八大直接显示类状态
        for (int i = 0; i < (int)StateTag.End; i++)
        {
            if (checkPerState((StateTag)i))
            {
                ThisBasicRoleProperty()._role.AllARevision
                    += OneState((StateTag)i).UniqueEffectInRA;
                stateExtraDamage += OneState((StateTag)i).ExtraDmg;
                PerStateUnit((StateTag)i).gameObject.SetActive(true);
            }
            else
            {
                PerStateUnit((StateTag)i).gameObject.SetActive(false);
            }
        }
        HpController.getExtraDamage(stateExtraDamage);

        #region otherBuff
        if (_Tag == SDConstants.CharacterType.Hero)
        {
            Race _race = HeroProperty._hero._heroRace;
            RoleAttributeList basic = ThisBasicRoleProperty()._role.ThisRoleAttributes.Clone;
            ThisBasicRoleProperty()._role.AllARevision
            .Add(SDDataManager.Instance.BuffFromDaynight(basic));
            ThisBasicRoleProperty()._role.AllARevision
            .Add(SDDataManager.Instance.BuffFromRace(basic, _race));
        }
        #endregion

        #region GoddessState
        if (BM.GM.haveGoddess)
        {
            ThisBasicRoleProperty()._role.AllARevision.Add(BM.GM.GetRALUpByGoddess
                                                               (ThisBasicRoleProperty()._role.ThisRoleAttributes.Clone));
        }
        #endregion
        #region extraState
        RoleExtraState.checkExtraStates();
        #endregion
        #region fatigueStateCheck
        if (SDDataManager.Instance.checkHeroFatigueTooHigh(unitHashcode))
        {
            Debug.Log("英雄 " + name + " 过度劳累");
            HpController.getExtraDamage(HpController.CurrentHp);
        }
        #endregion

        writeData();
    }
Exemple #10
0
 public void initArmor(int level, RoleAttributeList dataRA
                       , int criDmg, int dmgReduction, int dmgReflection
                       , int RewardRate, RoleBarChart bcRegendPerTurn, string id, string name
                       , int wakeNum, int grade)
 {
     initData(level
              , dataRA, criDmg, dmgReduction, dmgReflection, RewardRate
              , bcRegendPerTurn, id, name, wakeNum);
     AddMultiplier(grade);
 }
Exemple #11
0
 public override void initData(int level
                               , RoleAttributeList dataRA
                               , int criDmg, int dmgReduction, int dmgReflection, int RewardRate
                               , RoleBarChart bcRegendPerTurn, string id, string name
                               , int wakeNum)
 {
     base.initData(level
                   , dataRA, criDmg, dmgReduction, dmgReflection, RewardRate
                   , bcRegendPerTurn, id, name, wakeNum);
 }
Exemple #12
0
 public void Clear(bool ResetCondition = false)
 {
     UniqueEffectInRA = RoleAttributeList.zero;
     //BCArray.ResetSelf();
     ExtraDmg = 0;
     if (ResetCondition)
     {
         stateCondition = 0;
     }
 }
Exemple #13
0
 public void Add(RoleAttributeList RAL)
 {
     for (int i = 0; i < AllAttributeData.Length; i++)
     {
         AllAttributeData[i] += RAL.AllAttributeData[i];
     }
     for (int i = 0; i < AllResistData.Length; i++)
     {
         AllResistData[i] += RAL.AllResistData[i];
     }
 }
Exemple #14
0
    public RoleAttributeList GetRALUpByGoddess(RoleAttributeList baseRAL)
    {
        RoleAttributeList ral  = RoleAttributeList.zero;
        float             rate = AllRandomSetClass.SimplePercentToDecimal(GP.heroAttiUp);

        ral.AT = (int)(baseRAL.AT * rate);
        ral.AD = (int)(baseRAL.AD * rate);
        ral.MT = (int)(baseRAL.MT * rate);
        ral.MD = (int)(baseRAL.MD * rate);
        return(ral);
    }
Exemple #15
0
 public override void initData_Hero(Job heroJob, Race heroRace, int grade, int quality, int Level
                                    , RoleAttributeList ra, int criDmg
                                    , int dmgReduction, int dmgReflection, int RewardRate
                                    , RoleBarChart bcRegendPerTurn, string id, string name, int wakeNum)
 {
     base.initData_Hero(heroJob, heroRace, grade, quality, Level
                        , ra, criDmg, dmgReduction, dmgReflection, RewardRate
                        , bcRegendPerTurn, id, name, wakeNum);
     Debug.Log(name + " " + heroJob + " & " + heroRace);
     this._heroJob  = heroJob;
     this._heroRace = heroRace;
 }
    /// <summary>
    /// 构建英雄数据
    /// </summary>
    /// <param name="heroJob"></param>
    /// <param name="grade">英雄当前等级</param>
    /// <param name="quality"></param>
    /// <param name="Level"></param>
    /// <param name="ra"></param>
    /// <param name="raRate"></param>
    /// <param name="speed"></param>
    /// <param name="cri"></param>
    /// <param name="criDmg"></param>
    /// <param name="dmgReduction"></param>
    /// <param name="dmgReflection"></param>
    /// <param name="RewardRate"></param>
    /// <param name="bcRegendPerTurn"></param>
    /// <param name="id"></param>
    /// <param name="name"></param>
    /// <param name="wakeNum"></param>
    public virtual void initData_Hero(Job heroJob, Race heroRace, int grade
                                      , int quality, int Level
                                      , RoleAttributeList ra
                                      , int criDmg, int dmgReduction, int dmgReflection, int RewardRate
                                      , RoleBarChart bcRegendPerTurn, string id, string name, int wakeNum)
    {
        LEVEL                 = Level;
        Quality               = quality;
        RoleBasicRA           = ra.Clone;
        CRIDmg                = criDmg;
        DmgReduction          = dmgReduction; DmgReflection = dmgReflection;
        this.RewardRate       = RewardRate;
        BarChartRegendPerTurn = bcRegendPerTurn;
        ID = id; Name = name;
        AddMultiplier(grade);
        AddWakeMultiplier(wakeNum);
        //补充设置(职业影响)
        switch (heroJob)
        {
        case Job.Fighter:
            initData_supplement_H_Fighter(RoleBasicRA, grade);
            break;

        case Job.Ranger:
            initData_supplement_H_Ranger(RoleBasicRA, grade);
            break;

        case Job.Priest:
            initData_supplement_H_Priest(RoleBasicRA, grade);
            break;

        case Job.Caster:
            initData_supplement_H_Caster(RoleBasicRA, grade);
            break;
        }
        switch (heroRace)
        {
        case Race.Human:
            initData_supplement_H_human();
            break;

        case Race.Elf:
            initData_supplement_H_elf();
            break;

        case Race.Dragonborn:
            initData_supplement_H_dragonborn();
            break;
        }
        AddLEVELNumMultiplier(LEVEL);
        Name = SDGameManager.T(name);
    }
 public virtual void initData(int level, RoleAttributeList dataRA
                              , int criDmg, int dmgReduction, int dmgReflection, int RewardRate
                              , RoleBarChart bcRegendPerTurn, string id, string name, int wakeNum)
 {
     LEVEL                 = level;
     RoleBasicRA           = dataRA.Clone;
     CRIDmg                = criDmg;
     DmgReduction          = dmgReduction;
     DmgReflection         = dmgReflection;
     this.RewardRate       = RewardRate;
     BarChartRegendPerTurn = bcRegendPerTurn;
     ID = id; Name = SDGameManager.T(name);
 }
Exemple #18
0
    public static RoleAttributeList GDEToRAL(GDERoleAttritubeData data)
    {
        RoleAttributeList RAL = RoleAttributeList.zero;

        for (int i = 0; i < data.AD_List.Count; i++)
        {
            RAL.AllAttributeData[i] = data.AD_List[i];
        }
        for (int i = 0; i < data.RD_List.Count; i++)
        {
            RAL.AllResistData[i] = data.RD_List[i];
        }
        return(RAL);
    }
Exemple #19
0
    public static RoleAttributeList operator -(RoleAttributeList a, int b)
    {
        RoleAttributeList _a = a.Clone;

        for (int i = 0; i < (int)AttributeData.End; i++)
        {
            _a.AllAttributeData[i] -= b;
        }
        for (int i = 0; i < (int)StateTag.End; i++)
        {
            _a.AllResistData[i] -= b;
        }
        return(_a);
    }
Exemple #20
0
 public static RoleAttributeList RALByResistStr(RoleAttributeList ral, string str)
 {
     if (!string.IsNullOrEmpty(str))
     {
         RoleAttributeList RAL   = ral;
         string[]          allSs = str.Split('|');
         for (int i = 0; i < allSs.Length; i++)
         {
             string[] Ss = allSs[i].Split(':');
             RAL.Set(StringToInteger(Ss[1]), ROHelp.STATE_TAG(Ss[0]));
         }
         return(RAL);
     }
     return(ral);
 }
Exemple #21
0
    public void initHero(int heroHashCode)
    {
        unitHashcode = heroHashCode;
        SDHero h;

        if (GetComponent <SDHero>())
        {
            h = GetComponent <SDHero>();
        }
        else
        {
            h = gameObject.AddComponent <SDHero>();
        }
        HeroProperty._hero = h;
        GDEHeroData heroData
            = SDDataManager.Instance.GetHeroOwnedByHashcode(unitHashcode);

        //
        if (heroData != null)
        {
            HeroProperty._hero.nameBeforeId = heroData.nameBeforeId;

            //
            UnitId          = SDDataManager.Instance.getHeroIdByHashcode(unitHashcode);
            HeroProperty.ID = HeroProperty._hero.ID = UnitId;
            ROHeroData dal = SDDataManager.Instance
                             .getHeroDataByID(UnitId, heroData.starNumUpgradeTimes);
            //
            unit_character_model.initHeroCharacterModel(heroHashCode, SDConstants.HERO_MODEL_RATIO);
            //
            int grade = SDDataManager.Instance.getLevelByExp(heroData.exp);
            HeroProperty._hero.grade = grade;

            RoleAttributeList _ral = dal.ExportRAL;
            _ral.Add(RoleAttributeList.GDEToRAL(heroData.RoleAttritubeList));
            //
            Race _race = dal.Info.Race.Race;
            //
            HeroProperty._hero.initData_Hero
                (dal.Info.Career.Career, _race
                , grade, 0, dal.starNum
                , _ral
                , dal.CRIDmg, dal.DmgReduction, dal.DmgReflection, dal.RewardRate
                , dal.BarChartRegendPerTurn, UnitId, dal.Info.Name, heroData.wakeNum);;
            HeroProperty._hero.gender = (CharacterSex)heroData.sex;
            addSkillByCareerByRaceByStarnum(heroHashCode, dal.starNum);
        }
    }
    public void initData_supplement_H_Caster(RoleAttributeList ra, int grade)
    {
        RoleAttributeList gradeEffect = AdolescentSet.AttritubeShowByLevel_basic(grade
                                                                                 , 0.6f       //生命
                                                                                 , 0.75f      //法力
                                                                                 , 0.6f       //怒气
                                                                                 , 0.2f, 0.2f //物攻防
                                                                                 , 1.1f, 0.6f //法攻防
                                                                                 );

        RoleBasicRA = ra.Clone;
        RoleBasicRA.Add(gradeEffect);//等级加成
        AddTempleMultiplier(Job.Priest);
        //额外效果
        CRIDmg += 25;
    }
    public void initData_supplement_H_Fighter(RoleAttributeList ra, int grade)
    {
        RoleAttributeList gradeEffect = AdolescentSet.AttritubeShowByLevel_basic(grade
                                                                                 , 1.2f       //生命
                                                                                 , 0.1f       //法力
                                                                                 , 1f         //怒气
                                                                                 , 0.2f, 1f   //物攻防
                                                                                 , 0.1f, 0.1f //法攻防
                                                                                 );

        RoleBasicRA = ra.Clone;
        RoleBasicRA.Add(gradeEffect);//等级加成
        AddTempleMultiplier(Job.Fighter);
        //额外效果
        DmgReduction += 10;
    }
Exemple #24
0
    public void checkAllStandardStates()
    {
        RoleAttributeList RAL = new RoleAttributeList();

        for (int i = 0; i < CurrentStateList.Count; i++)
        {
            if (CurrentStateList[i].LastTime <= 0)
            {
                CurrentStateList.RemoveAt(i);
            }
            else
            {
                if (CurrentStateList[i].StateEndType == StandardState.StateEndType.time)
                {
                    CurrentStateList[i].LastTime--;
                }
                //
                RAL.Add(CurrentStateList[i].RAL);
                stateExtraDamage += CurrentStateList[i].ExtraDmg;
                AllRegend        += CurrentStateList[i].BarChart;
                CurrentStateList[i].ExtraFunction(this);
            }
        }
        Debug.Log("StandardState_IfHaveData: " + RAL.HaveData);
        ThisBasicRoleProperty()._role.AllARevision.Add(RAL);
        Debug.Log("AllARevision_IfHaveData: "
                  + ThisBasicRoleProperty()._role.AllARevision.HaveData);
        //
        if (RAL.AllAttributeData.ToList().Exists(x => x > 0) ||
            RAL.AllResistData.ToList().Exists(x => x > 0))
        {
            Unit_Buff.gameObject.SetActive(true);
        }
        else
        {
            Unit_Buff.gameObject.SetActive(false);
        }
        if (RAL.AllAttributeData.ToList().Exists(x => x < 0) ||
            RAL.AllResistData.ToList().Exists(x => x < 0))
        {
            Unit_Debuff.gameObject.SetActive(true);
        }
        else
        {
            Unit_Debuff.gameObject.SetActive(false);
        }
    }
Exemple #25
0
    /// <summary>
    /// 全战斗属性百分比增减+-()%
    /// </summary>
    /// <param name="ForwardRA">原属性</param>
    /// <param name="Percent">增加或减少的百分比</param>
    /// <returns></returns>
    public static RoleAttributeList RAChangeInPercent(RoleAttributeList ForwardRA, int Percent)
    {
        float             Decimal = AllRandomSetClass.SimplePercentToDecimal(Percent);
        RoleAttributeList RA      = ForwardRA;

        for (int i = 0; i < (int)AttributeData.End; i++)
        {
            AttributeData Tag = (AttributeData)i;
            RA.Add((int)(RA.read(Tag) * Decimal), Tag);
        }
        for (int i = 0; i < (int)StateTag.End; i++)
        {
            StateTag Tag = (StateTag)i;
            RA.Add((int)(RA.read(Tag) * Decimal), Tag);
        }
        return(RA);
    }
Exemple #26
0
    public static RoleAttributeList RALAddedByLevel(RoleAttributeList basicRAL)
    {
        RoleAttributeList ral = basicRAL;
        int lvl = SDGameManager.Instance.currentLevel;
        //每章结束循环利用数据
        int index = lvl / SDConstants.LevelNumPerChapter;

        ral.AddPerc(75 * index, AttributeData.Hp);
        ral.AddPerc(75 * index, AttributeData.AT);
        ral.AddPerc(75 * index, AttributeData.AD);
        ral.AddPerc(75 * index, AttributeData.MT);
        ral.AddPerc(75 * index, AttributeData.MD);
        ral.Add(5 * index, AttributeData.Evo);
        ral.Add(10 * index, AttributeData.Accur);
        ral.Add(2 * index, AttributeData.Speed);
        return(ral);
    }
Exemple #27
0
    RoleAttributeList getRALFromEquip(EquipPosition UsePos, BattleRoleData source, BattleRoleData target)
    {
        RoleAttributeList _ral = RoleAttributeList.zero;
        SDArmor           SDA  = null;

        if (UsePos == EquipPosition.Head)
        {
            SDA = target.HeroProperty._helmet;
        }
        else if (UsePos == EquipPosition.Breast)
        {
            SDA = target.HeroProperty._breastplate;
        }
        else if (UsePos == EquipPosition.Arm)
        {
            SDA = target.HeroProperty._gardebras;
        }
        else if (UsePos == EquipPosition.Leg)
        {
            SDA = target.HeroProperty._legging;
        }
        else if (UsePos == EquipPosition.Hand)
        {
            SDA = target.HeroProperty._weapon;
        }
        if (SDA != null)
        {
            _ral = SDA.RoleBasicRA.Clone;
        }
        if (UsePos == EquipPosition.Finger)
        {
            RoleAttributeList r0 = RoleAttributeList.zero;
            if (target.HeroProperty._jewelry0 != null)
            {
                r0 = target.HeroProperty._jewelry0.RoleBasicRA.Clone;
            }
            RoleAttributeList r1 = RoleAttributeList.zero;
            if (target.HeroProperty._jewelry1 != null)
            {
                r1 = target.HeroProperty._jewelry1.RoleBasicRA.Clone;
            }
            _ral = r0 + r1;
        }
        return(_ral);
    }
Exemple #28
0
    /// <summary>
    /// 角色成长公式
    /// </summary>
    /// <param name="Level">等级</param>
    /// <param name="hpUp">生命+</param>
    /// <param name="spUp">护盾+</param>
    /// <param name="mpUp">法力+</param>
    /// <param name="tpUp">怒气+</param>
    /// <param name="atUp">物伤+</param>
    /// <param name="adUp">物防+</param>
    /// <param name="mtUp">法伤+</param>
    /// <param name="mdUp">法防+</param>
    /// <returns></returns>
    public static RoleAttributeList AttritubeShowByLevel_basic(int Level
                                                               , float hpUp, float mpUp, float tpUp
                                                               , float atUp, float adUp, float mtUp, float mdUp)
    {
        RoleAttributeList A = new RoleAttributeList();

        #region 随等级提升基础属性
        A.Hp += (int)(Level * hpUp); //生命
        A.Mp += (int)(Level * mpUp); //法力
        A.Tp += (int)(Level * tpUp); //怒气

        A.AT += (int)(Level * atUp); //物攻
        A.MT += (int)(Level * mtUp); //魔攻
        A.AD += (int)(Level * adUp); //物防
        A.MD += (int)(Level * mdUp); //魔防
        #endregion
        return(A);
    }
Exemple #29
0
 public void AffectedByRate(RoleAttributeList rate)
 {
     for (int i = 0; i < AllAttributeData.Length; i++)
     {
         if (rate.AllAttributeData[i] != 0)
         {
             float DECIMAL = (rate.AllAttributeData[i] + 100) * 1f / 100;
             AllAttributeData[i] = (int)(AllAttributeData[i] * DECIMAL);
         }
     }
     for (int i = 0; i < AllResistData.Length; i++)
     {
         if (rate.AllResistData[i] != 0)
         {
             float DECIMAL = (rate.AllResistData[i] + 100) * 1f / 100;
             AllResistData[i] = (int)(AllResistData[i] * DECIMAL);
         }
     }
 }
Exemple #30
0
    public void StateFunctionWork(BattleRoleData source, BattleRoleData target
                                  , RoleAttributeList ral, RoleBarChart bc
                                  , int dmg, int lastTime)
    {
        OneStateController state = new OneStateController()
        {
            ID       = NAME + "#" + stateTag.ToString().ToUpper(),
            NAME     = NAME,
            LastTime = stateEndType == StateEndType.time ? lastTime : 1,
            RAL      = ral,
            BarChart = bc,
            ExtraDmg = dmg,
            StateTag = stateTag,
        };

        if (target.AddStandardState(state))
        {
            Debug.Log("对 " + target.name + "添加 状态(sstate)" + state.NAME + " 成功");
        }
    }