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);
        }
    }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
 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));
         }
     }
 }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
    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++;
        }
    }
Ejemplo n.º 7
0
    private void ExcuteAttributes()
    {
        string[] attributes = this.m_Data.Attributes;
        int      index      = 0;
        int      length     = attributes.Length;

        while (index < length)
        {
            this.list.Add(Goods_goods.GetGoodData(attributes[index]));
            index++;
        }
    }
Ejemplo n.º 8
0
    private void ExcuteAttributes()
    {
        string[] attributes = this.buff_data.Attributes;
        int      index      = 0;
        int      length     = attributes.Length;

        while (index < length)
        {
            string str = attributes[index];
            this.attrList.Add(Goods_goods.GetGoodData(str));
            Goods_goods.GetAttribute(this.m_Entity, str);
            index++;
        }
    }
Ejemplo n.º 9
0
    private bool ContainsArrow(string[] attrs)
    {
        int index  = 0;
        int length = attrs.Length;

        while (index < length)
        {
            string goodType = Goods_goods.GetGoodData(attrs[index]).goodType;
            if ((goodType != null) && ((((goodType == "BulletForward") || (goodType == "BulletBackward")) || ((goodType == "BulletContinue") || (goodType == "BulletForSide"))) || (goodType == "BulletSide")))
            {
                return(true);
            }
            index++;
        }
        return(false);
    }
Ejemplo n.º 10
0
    public void UpdateUI(LocalSave.CardOne data, int index)
    {
        this.mData = data;
        string typeName = this.mData.GetTypeName(index);

        if (this.mData.data.BaseAttributes[0].Contains("Global_HarvestLevel"))
        {
            this.Text_Value.text = typeName;
        }
        else
        {
            string   currentAttribute = this.mData.GetCurrentAttribute(index);
            string   str3             = (Goods_goods.GetGoodData(this.mData.data.BaseAttributes[index]).value <= 0L) ? "-" : "+";
            object[] args             = new object[] { typeName, str3, currentAttribute };
            this.Text_Value.text = Utils.FormatString("{0} {1} {2}", args);
        }
    }
Ejemplo n.º 11
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);
    }
Ejemplo n.º 12
0
 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>());
         }
     }
 }
Ejemplo n.º 13
0
 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++;
         }
     }
 }
Ejemplo n.º 14
0
        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++;
            }
        }
Ejemplo n.º 15
0
 public void UpdateUI(LocalSave.EquipOne mBefore, LocalSave.EquipOne mAfter, int index)
 {
     this.mAfter  = mAfter;
     this.mBefore = mBefore;
     this.baseatt.SetActive(false);
     this.skills.SetActive(false);
     if (index < mBefore.data.Attributes.Length)
     {
         this.type = 0;
         this.baseatt.SetActive(true);
         string attName = mAfter.GetAttName(index);
         string currentAttributeString = mBefore.GetCurrentAttributeString(index);
         string str3 = mAfter.GetCurrentAttributeString(index);
         this.Text_Name.text = attName;
         object[] args = new object[] { currentAttributeString };
         this.Text_Before.text = Utils.FormatString("{0}", args);
         object[] objArray2 = new object[] { str3 };
         this.Text_After.text = Utils.FormatString("{0}", objArray2);
     }
     else if (mAfter.data.AdditionSkills.Length > mBefore.data.AdditionSkills.Length)
     {
         this.skills.SetActive(true);
         this.type             = 1;
         this.Text_Before.text = string.Empty;
         this.Text_After.text  = string.Empty;
         string s = mAfter.data.AdditionSkills[mAfter.data.AdditionSkills.Length - 1];
         this.Text_Name.text = GameLogic.Hold.Language.GetLanguageByTID("equip_combine_unlock_newatt", Array.Empty <object>());
         if (!int.TryParse(s, out int num))
         {
             this.Text_Down.text = Goods_goods.GetGoodShowData(s).ToString();
         }
         else
         {
             object[] args          = new object[] { num };
             string   languageByTID = GameLogic.Hold.Language.GetLanguageByTID(Utils.FormatString("技能描述{0}", args), Array.Empty <object>());
             this.Text_Down.text = languageByTID;
         }
     }
 }
Ejemplo n.º 16
0
 public static long GetAttack(EntityBase entity, string att)
 {
     Goods_goods.GoodData goodData = Goods_goods.GetGoodData(att);
     return(GetAttack(entity, goodData));
 }
Ejemplo n.º 17
0
    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);
        }
    }