protected override void OnInstall()
 {
     if (base.m_SkillData.Args.Length != 2)
     {
         object[] args = new object[] { base.m_SkillData.SkillID, base.m_SkillData.Args.Length };
         SdkManager.Bugly_Report("SkillAlone1084", Utils.FormatString("SkillID:{0} args.length:{1} != 2", args));
     }
     else if (!float.TryParse(base.m_SkillData.Args[0], out this.time))
     {
         object[] args = new object[] { base.m_SkillData.SkillID };
         SdkManager.Bugly_Report("SkillAlone1084", Utils.FormatString("SkillID:{0} args[0] is not a float type.", args));
     }
     else if (string.IsNullOrEmpty(base.m_SkillData.Args[1]))
     {
         object[] args = new object[] { base.m_SkillData.SkillID };
         SdkManager.Bugly_Report("SkillAlone1084", Utils.FormatString("SkillID:{0} args[1] is null.", args));
     }
     else
     {
         this.att            = base.m_SkillData.Args[1];
         this.mAdd           = Goods_goods.GetGoodData(this.att);
         this.mRemove        = Goods_goods.GetGoodData(this.att);
         this.mRemove.value *= -1L;
         ReleaseModeManager mode = GameLogic.Release.Mode;
         mode.OnGotoNextRoom = (Action <RoomGenerateBase.Room>)Delegate.Combine(mode.OnGotoNextRoom, new Action <RoomGenerateBase.Room>(this.OnGotoNextRoom));
     }
 }
    private static long GetAttack(EntityBase entity, Goods_goods.GoodData data)
    {
        long   num      = 0L;
        string goodType = data.goodType;

        if (goodType != null)
        {
            if (goodType != "Attack")
            {
                if (goodType != "Attack%")
                {
                    return(num);
                }
            }
            else
            {
                return(data.value);
            }
            if (entity != null)
            {
                num = (long)(((float)(entity.m_EntityData.GetAttackBase() * data.value)) / 100f);
            }
        }
        return(num);
    }
    private void InitUI()
    {
        GameLogic.Hold.Sound.PlayUI(0xf4244);
        this.buttonok.onClick     = new Action(this.OnClickOK);
        this.buttoncancel.onClick = new Action(this.OnClickCanccel);
        GameLogic.SetPause(true);
        bool flag = GameLogic.Random(0, 100) < 40;
        Room_eventdemontext2lose _eventdemontextlose = null;
        int randomID = GameLogic.Release.Form.GetRandomID("DemonSkill");

        this.mFormid = randomID;
        Room_eventdemontext2skill beanById = LocalModelManager.Instance.Room_eventdemontext2skill.GetBeanById(randomID);
        int index = GameLogic.Random(0, beanById.Loses.Length);
        int num4  = beanById.Loses[index];

        _eventdemontextlose = LocalModelManager.Instance.Room_eventdemontext2lose.GetBeanById(beanById.Loses[index]);
        this.mGetid         = beanById.GetID;
        object[] args = new object[] { GameLogic.Hold.Language.GetLanguageByTID("获得技能", Array.Empty <object>()), GameLogic.Hold.Language.GetSkillName(this.mGetid) };
        this.text_content2.text = Utils.FormatString("{0} : {1}", args);
        int skillIcon = LocalModelManager.Instance.Skill_skill.GetBeanById(this.mGetid).SkillIcon;

        this.image_2.set_sprite(SpriteManager.GetSkillIcon(skillIcon));
        this.image_2.GetComponent <RectTransform>().sizeDelta = new Vector2(120f, 120f);
        this.mLoseid = _eventdemontextlose.LoseID;
        Goods_goods.GoodData goodData = Goods_goods.GetGoodData(LocalModelManager.Instance.Goods_food.GetBeanById(this.mLoseid).Values[0]);
        string str = MathDxx.Abs((long)(((float)(GameLogic.Self.m_EntityData.attribute.HPValue.ValueLong * goodData.value)) / 10000f)).ToString();

        object[] objArray2 = new object[] { GameLogic.Hold.Language.GetLanguageByTID("失去", Array.Empty <object>()), str, GameLogic.Hold.Language.GetLanguageByTID(_eventdemontextlose.Content1, Array.Empty <object>()) };
        this.text_content1.text = Utils.FormatString("{0} {1} {2}", objArray2);
    }
    private void Excute(string str)
    {
        bool flag = true;

        Goods_goods.GoodData goodData = Goods_goods.GetGoodData(str);
        switch (goodData.goodType)
        {
        case "CallID":
            this.partid = (int)goodData.value;
            break;

        case "Time":
            this.time = ((float)goodData.value) / 1000f;
            break;

        case "Weight":
            this.weight = (int)goodData.value;
            break;

        default:
            flag = false;
            break;
        }
        if (!flag)
        {
            this.mAttrs.Add(goodData);
        }
    }
        public List <Goods_goods.GoodShowData> GetEquipShowAttrs(LocalSave.EquipOne one)
        {
            List <Goods_goods.GoodShowData> list = new List <Goods_goods.GoodShowData>();
            int         level    = one.Level;
            Equip_equip beanById = base.GetBeanById(one.EquipID);
            int         index    = 0;
            int         length   = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                level = MathDxx.Clamp(level, 0, one.CurrentMaxLevel);
                if (goodData.percent)
                {
                    goodData.value += ((level - 1) * beanById.AttributesUp[index]) * 100;
                }
                else
                {
                    goodData.value += (level - 1) * beanById.AttributesUp[index];
                }
                goodData.value = (long)(goodData.value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                Goods_goods.GoodShowData goodShowData = Goods_goods.GetGoodShowData(goodData);
                if (one.IsBaby && !goodData.goodType.Contains("EquipBaby:"))
                {
                    string   languageByTID = GameLogic.Hold.Language.GetLanguageByTID("Attr_BabyParentContent", Array.Empty <object>());
                    object[] args          = new object[] { languageByTID, goodShowData.goodType };
                    goodShowData.goodType = Utils.FormatString("{0}{1}", args);
                }
                list.Add(goodShowData);
                index++;
            }
            return(list);
        }
        public List <string> GetEquipAttributesNext(LocalSave.EquipOne one)
        {
            LocalSave.EquipOne one2 = new LocalSave.EquipOne {
                EquipID = one.EquipID,
                Level   = one.Level + 1
            };
            List <Goods_goods.GoodData> equipAttributes = this.GetEquipAttributes(one);
            List <Goods_goods.GoodData> list2           = this.GetEquipAttributes(one2);
            List <string> list3    = new List <string>();
            Equip_equip   beanById = base.GetBeanById(one.EquipID);
            int           index    = 0;
            int           length   = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                string item = string.Empty;
                if (goodData.percent)
                {
                    object[] args = new object[] { beanById.AttributesUp[index] };
                    item = item + Utils.FormatString("+ {0}%", args);
                }
                else
                {
                    equipAttributes[index].value = (long)(equipAttributes[index].value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                    list2[index].value           = (long)(list2[index].value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                    object[] args = new object[] { list2[index].value - equipAttributes[index].value };
                    item = item + Utils.FormatString("+ {0}", args);
                }
                list3.Add(item);
                index++;
            }
            return(list3);
        }
 protected override void OnInstall()
 {
     if (base.m_SkillData.Args.Length != 2)
     {
         object[] args = new object[] { base.m_SkillData.SkillID, base.m_SkillData.Args.Length };
         SdkManager.Bugly_Report("SkillAlone1081", Utils.FormatString("SkillID:{0} args.length:{1} != 2", args));
     }
     else if (!float.TryParse(base.m_SkillData.Args[0], out this.hppercent))
     {
         object[] args = new object[] { base.m_SkillData.SkillID };
         SdkManager.Bugly_Report("SkillAlone1081", Utils.FormatString("SkillID:{0} args[0] is not a float type.", args));
     }
     else
     {
         this.hppercent /= 100f;
         this.addatt     = base.m_SkillData.Args[1];
         try
         {
             this.data_add                  = Goods_goods.GetGoodData(this.addatt);
             this.data_remove               = Goods_goods.GetGoodData(this.addatt);
             this.data_remove.value        *= -1L;
             base.m_Entity.OnChangeHPAction = (Action <long, long, float, long>)Delegate.Combine(base.m_Entity.OnChangeHPAction, new Action <long, long, float, long>(this.OnChangeHP));
             this.bInit = true;
         }
         catch
         {
             object[] args = new object[] { base.m_SkillData.SkillID };
             SdkManager.Bugly_Report("SkillAlone1081", Utils.FormatString("SkillID:{0} args[1] is invalid.", args));
         }
     }
 }
 public void Excute(string att)
 {
     Goods_goods.GoodData goodData = Goods_goods.GetGoodData(att);
     if ((!this.Excute(goodData.goodType, goodData.value) && !this.attribute.Excute(goodData)) && att.Contains("LevelUp:"))
     {
         this.levelups.Add(att);
     }
 }
    private void UpdateAttributes(int symbol)
    {
        int index  = 0;
        int length = this.m_Data.Attributes.Length;

        while (index < length)
        {
            Goods_goods.GoodData goodData = Goods_goods.GetGoodData(this.m_Data.Attributes[index]);
            this.m_Entity.m_EntityData.ExcuteAttributes(goodData.goodType, goodData.value * symbol);
            index++;
        }
    }
    private void InstallAttrs(int symbol)
    {
        int num   = 0;
        int count = this.list.Count;

        while (num < count)
        {
            Goods_goods.GoodData data = this.list[num];
            long num3 = data.value * symbol;
            this.m_Entity.m_EntityData.ExcuteAttributes(data.goodType, num3);
            num++;
        }
    }
        public float GetGoldDropPercent(int layer)
        {
            string[] stageLevelAttributes = this.GetStageLevelAttributes(layer);
            int      index  = 0;
            int      length = stageLevelAttributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(stageLevelAttributes[index]);
                if (goodData.goodType == "GoldDrop%")
                {
                    return(1f + (((float)goodData.value) / 100f));
                }
                index++;
            }
            return(1f);
        }
Exemple #12
0
    public static long GetMaxHP(int entityid)
    {
        EntityAttributeBase base2 = new EntityAttributeBase(entityid);

        string[] monsterTmxAttributes = Hold.BattleData.mModeData.GetMonsterTmxAttributes();
        if ((monsterTmxAttributes != null) && (monsterTmxAttributes.Length > 0))
        {
            int index  = 0;
            int length = monsterTmxAttributes.Length;
            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(monsterTmxAttributes[index]);
                base2.Excute(goodData);
                index++;
            }
        }
        return(base2.HPValue.Value);
    }
 protected override void OnInstall(object[] args)
 {
     base.mBabyID = int.Parse(base.m_SkillData.Args[0]);
     base.OnInstall();
     this.mParent = base.baby.GetParent();
     if (this.mParent != null)
     {
         this.mParent.m_EntityData.attribute.OnAttackUpdate = (Action <long>)Delegate.Combine(this.mParent.m_EntityData.attribute.OnAttackUpdate, new Action <long>(this.OnAttackUpdate));
         if (this.mParent.m_EntityData.attribute.BabyCountAttack.Value > 0f)
         {
             this.mParent.m_EntityData.ExcuteAttributes("Attack%", this.mParent.m_EntityData.attribute.BabyCountAttack.ValueLong);
         }
         if (this.mParent.m_EntityData.attribute.BabyCountAttackSpeed.Value > 0f)
         {
             this.mParent.m_EntityData.ExcuteAttributes("AttackSpeed%", this.mParent.m_EntityData.attribute.BabyCountAttackSpeed.ValueLong);
         }
     }
     for (int i = 1; i < base.m_SkillData.Args.Length; i++)
     {
         string str = base.m_SkillData.Args[i];
         Goods_goods.GoodData goodData = Goods_goods.GetGoodData(str);
         if (goodData.goodType == "AttackParentAttack%")
         {
             this.attackparentatt = str;
         }
         base.baby.m_EntityData.ExcuteAttributes(goodData);
     }
     if (((args.Length == 1) && (args[0] != null)) && (args[0] is LocalSave.EquipOne))
     {
         LocalSave.EquipOne          one            = args[0] as LocalSave.EquipOne;
         List <Goods_goods.GoodData> babyAttributes = one.GetBabyAttributes();
         for (int j = 0; j < babyAttributes.Count; j++)
         {
             base.baby.m_EntityData.ExcuteAttributes(babyAttributes[j]);
         }
         List <int> babySkills = one.GetBabySkills();
         for (int k = 0; k < babySkills.Count; k++)
         {
             base.baby.AddSkillBaby(babySkills[k], Array.Empty <object>());
         }
     }
 }
 private void ExcuteSoldierUp()
 {
     if (GameLogic.Hold.BattleData.mModeData != null)
     {
         string[] monsterTmxAttributes = GameLogic.Hold.BattleData.mModeData.GetMonsterTmxAttributes();
         int      index  = 0;
         int      length = monsterTmxAttributes.Length;
         while (index < length)
         {
             Goods_goods.GoodData goodData = Goods_goods.GetGoodData(monsterTmxAttributes[index]);
             if (base.IsElite && (goodData.goodType == "HPMax%"))
             {
                 goodData.value *= 2L;
                 goodData.value += 0x2710L;
             }
             base.m_EntityData.ExcuteAttributes(goodData);
             index++;
         }
     }
 }
        private void AddAttributes()
        {
            int index  = 0;
            int length = this.attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(this.attributes[index]);
                switch (goodData.goodType)
                {
                case "HPAdd%":
                    this.HPAddPercent.UpdateValuePercent(goodData.value);
                    break;

                case "TrapHit%":
                    this.TrapHit.UpdateValuePercent(goodData.value);
                    break;
                }
                index++;
            }
        }
        public List <string> GetAttributes(LocalSave.CardOne one)
        {
            List <string> list     = new List <string>();
            Skill_slotout beanById = base.GetBeanById(one.CardID);

            if (beanById != null)
            {
                if (beanById.BaseAttributes.Length != beanById.AddAttributes.Length)
                {
                    object[] args = new object[] { one.CardID };
                    SdkManager.Bugly_Report("Skill_slotoutModel_Extra", Utils.FormatString("GetAttributes[{0}] attributes is error.", args));
                    return(list);
                }
                int index  = 0;
                int length = beanById.BaseAttributes.Length;
                while (index < length)
                {
                    string str2;
                    string str = beanById.BaseAttributes[index];
                    float  num = beanById.AddAttributes[index];
                    Goods_goods.GoodData goodData = Goods_goods.GetGoodData(str);
                    if (goodData.percent)
                    {
                        num  = goodData.value + (((one.level - 1) * num) * 100f);
                        num /= 100f;
                        str2 = num.ToString();
                    }
                    else
                    {
                        str2 = (goodData.value + ((one.level - 1) * ((long)num))).ToString();
                    }
                    object[] args = new object[] { goodData.goodType, goodData.GetSymbolString(), str2 };
                    str = Utils.FormatString("{0} {1} {2}", args);
                    list.Add(str);
                    index++;
                }
            }
            return(list);
        }
        public List <Goods_goods.GoodData> GetEquipAttributes(LocalSave.EquipOne one)
        {
            List <Goods_goods.GoodData> list = new List <Goods_goods.GoodData>();
            Equip_equip beanById             = base.GetBeanById(one.EquipID);
            int         level  = one.Level;
            int         index  = 0;
            int         length = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                if (goodData.percent)
                {
                    goodData.value += ((level - 1) * beanById.AttributesUp[index]) * 100;
                }
                else
                {
                    goodData.value += (level - 1) * beanById.AttributesUp[index];
                }
                list.Add(goodData);
                index++;
            }
            return(list);
        }
 public static long GetAttack(EntityBase entity, string att)
 {
     Goods_goods.GoodData goodData = Goods_goods.GetGoodData(att);
     return(GetAttack(entity, goodData));
 }
    private void Excute_Thunder()
    {
        this.thunder_range    = 0f;
        this.thunder_otherhit = 0f;
        this.thunder_selfhit  = 0f;
        int index  = 0;
        int length = this.buff_data.FirstEffects.Length;

        while (index < length)
        {
            Goods_goods.GoodData goodData = Goods_goods.GetGoodData(this.buff_data.FirstEffects[index]);
            string goodType = goodData.goodType;
            if (goodType != null)
            {
                if (goodType != "SelfAttack%")
                {
                    if (goodType == "OtherAttack%")
                    {
                        goto Label_00E6;
                    }
                    if (goodType == "SelfFixedDamage")
                    {
                        goto Label_0121;
                    }
                    if (goodType == "OtherFixedDamage")
                    {
                        goto Label_0133;
                    }
                    if (goodType == "Range")
                    {
                        goto Label_0145;
                    }
                }
                else if (this.m_Target != null)
                {
                    this.thunder_selfhit = (((float)goodData.value) / 10000f) * this.m_Target.m_EntityData.GetAttackBase();
                }
            }
            goto Label_015E;
Label_00E6:
            if (this.m_Target != null)
            {
                this.thunder_otherhit = (((float)goodData.value) / 10000f) * this.m_Target.m_EntityData.GetAttackBase();
            }
            goto Label_015E;
Label_0121:
            this.thunder_selfhit = goodData.value;
            goto Label_015E;
Label_0133:
            this.thunder_otherhit = goodData.value;
            goto Label_015E;
Label_0145:
            this.thunder_range += goodData.value;
Label_015E:
            index++;
        }
        float num3 = 1f;

        if (this.args.Length > 0f)
        {
            num3 *= this.args[0];
        }
        this.thunder_selfhit  *= num3;
        this.thunder_otherhit *= num3;
        if (this.thunder_selfhit != 0f)
        {
            this.m_Entity.m_EntityData.ExcuteBuffs(this.m_Target, this.buff_data.BuffID, this.buff_data.Attribute, this.thunder_selfhit);
        }
        List <EntityBase> list = GameLogic.Release.Entity.GetRoundEntities(this.m_Entity, this.thunder_range, false);
        int num4  = 0;
        int count = list.Count;

        while (num4 < count)
        {
            EntityBase to = list[num4];
            to.m_EntityData.ExcuteBuffs(this.m_Target, this.buff_data.BuffID, this.buff_data.Attribute, this.thunder_otherhit);
            GameLogic.EffectGet("Effect/Attributes/ThunderLine").GetComponent <ThunderLineCtrl>().UpdateEntity(this.m_Entity, to);
            num4++;
        }
        if (list.Count > 0)
        {
            GameLogic.Hold.Sound.PlayBattleSpecial(0x4c4b4a, this.m_Entity.position);
        }
    }