Example #1
0
        public static void AddBuff(string creepId, Units target)
        {
            if (!StringUtils.CheckValid(creepId))
            {
                return;
            }
            SysBattleMonsterCreepVo dataById = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(creepId);

            if (dataById != null && StringUtils.CheckValid(dataById.got_buff))
            {
                string[] stringValue = StringUtils.GetStringValue(dataById.got_buff, '|');
                int      num         = int.Parse(stringValue[0]);
                string   buff_id     = stringValue[1];
                if (num == 2)
                {
                    ActionManager.AddBuff(buff_id, target, target, true, string.Empty);
                }
                else if (num == 1)
                {
                    IList <Units> mapUnits = MapManager.Instance.GetMapUnits((TeamType)target.teamType, TargetTag.Hero);
                    foreach (Units current in mapUnits)
                    {
                        ActionManager.AddBuff(buff_id, current, current, true, string.Empty);
                    }
                }
            }
        }
Example #2
0
    public override void TryAddBirthEffect()
    {
        if (!StringUtils.CheckValid(this._creepId))
        {
            return;
        }
        SysBattleMonsterCreepVo dataById = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(this._creepId);

        if (dataById == null)
        {
            return;
        }
        if (!StringUtils.CheckValid(dataById.perform_id))
        {
            return;
        }
        string[] array = dataById.perform_id.Split(new char[]
        {
            ','
        });
        if (array.Length <= 0)
        {
            return;
        }
        string text = string.Empty;
        int    num  = 0;

        for (int i = 0; i < array.Length; i++)
        {
            if (StringUtils.CheckValid(array[i]))
            {
                string[] array2 = array[i].Split(new char[]
                {
                    '|'
                });
                if (array2.Length == 2)
                {
                    if (int.TryParse(array2[0], out num))
                    {
                        if (num == 4)
                        {
                            text = array2[1];
                            break;
                        }
                    }
                }
            }
        }
        if (!StringUtils.CheckValid(text))
        {
            return;
        }
        base.StartEffect(text);
    }
Example #3
0
        private static CreepInfoType GetCreepInfoType(Units inCreep, string inBattleMonsterCreepId, int inOldGroupType)
        {
            if (!StringUtils.CheckValid(inBattleMonsterCreepId))
            {
                return(CreepInfoType.creep_none);
            }
            SysBattleMonsterCreepVo dataById = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(inBattleMonsterCreepId);

            if (dataById == null)
            {
                return(CreepInfoType.creep_none);
            }
            if (dataById.trigger_condition == 3)
            {
                if (inOldGroupType == 2)
                {
                    return(CreepInfoType.creep_gold_killed);
                }
                return(CreepInfoType.creep_gold_plundered);
            }
            else if (StringUtils.CheckValid(dataById.summons2))
            {
                if (inOldGroupType == 2)
                {
                    return(CreepInfoType.creep_in_control);
                }
                return(CreepInfoType.creep_killed);
            }
            else
            {
                if (StringUtils.CheckValid(dataById.summons))
                {
                    return(CreepInfoType.creep_spawn_assistantcreep);
                }
                if (StringUtils.CheckValid(dataById.assist_soldier))
                {
                    return(CreepInfoType.creep_spawn_assistantsoldier);
                }
                if (inCreep != null)
                {
                    int data = inCreep.GetData <int>(DataType.ItemType);
                    if (data == 128)
                    {
                        return(CreepInfoType.creep_killed);
                    }
                }
                return(CreepInfoType.creep_none);
            }
        }
Example #4
0
 public static void TryShowCreepSpecialEffect(string inBattleMonsterCreepId, Units inMonster)
 {
     if (inMonster == null)
     {
         return;
     }
     if (StringUtils.CheckValid(inBattleMonsterCreepId))
     {
         SysBattleMonsterCreepVo dataById      = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(inBattleMonsterCreepId);
         string fxNameByBattleMonsterCreepData = CreepHelper.GetFxNameByBattleMonsterCreepData(dataById, CreepFxType.creep_under_control);
         if (StringUtils.CheckValid(fxNameByBattleMonsterCreepData))
         {
             ActionManager.PlayEffect(fxNameByBattleMonsterCreepData, inMonster, null, null, true, string.Empty, null);
         }
     }
 }
Example #5
0
    private bool NeutralMonsterDeath(Units attacker)
    {
        if (base.hp > 0f)
        {
            return(false);
        }
        if (Singleton <PvpManager> .Instance.IsInPvp)
        {
            return(false);
        }
        if (this.neutralRelive)
        {
            return(false);
        }
        if (base.teamType != 2)
        {
            return(false);
        }
        SysBattleMonsterCreepVo reliveCreepVo = CreepSpawner.GetReliveCreepVo(this.unique_id);

        if (reliveCreepVo == null)
        {
            return(false);
        }
        if (StringUtils.CheckValid(reliveCreepVo.summons2))
        {
            SysBattleMonsterCreepVo dataById = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(reliveCreepVo.summons2);
            string[] stringValue             = StringUtils.GetStringValue(dataById.monsters, '|');
            base.ChangeTeam((TeamType)attacker.teamType);
            if (Singleton <CreepSpawner> .Instance != null)
            {
                Singleton <CreepSpawner> .Instance.AddNPCId(stringValue[0]);
            }
            this.neutralRelive = true;
            MapManager.Instance.ReliveNeutralMonster(this, stringValue[0], attacker.teamType);
            string fxName = CreepHelper.GetFxName(this._creepId, CreepFxType.creep_under_control);
            if (fxName != null)
            {
                ActionManager.PlayEffect(fxName, this, null, null, true, string.Empty, null);
            }
            return(true);
        }
        return(false);
    }
Example #6
0
        public static string GetFxName(string id, CreepFxType type)
        {
            Dictionary <int, string> dictionary = new Dictionary <int, string>();
            int num = (int)type;
            SysBattleMonsterCreepVo dataById = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(id);

            if (dataById == null)
            {
                UnityEngine.Debug.LogError("no data get for id: " + id);
                return(null);
            }
            string perform_id = dataById.perform_id;

            if (StringUtils.CheckValid(perform_id))
            {
                string[] stringValues = StringUtils.GetStringValues(perform_id, 0, ',', '|');
                int      num2         = -1;
                for (int i = 0; i < stringValues.Length; i++)
                {
                    if (stringValues[i].Equals(num.ToString()))
                    {
                        num2 = i;
                        break;
                    }
                }
                if (num2 == -1)
                {
                    return(null);
                }
                string[] stringValues2 = StringUtils.GetStringValues(perform_id, 1, ',', '|');
                if (stringValues2 != null && stringValues2.Length > num2)
                {
                    return(stringValues2[num2]);
                }
            }
            return(null);
        }
Example #7
0
        public static string GetFxNameByBattleMonsterCreepData(SysBattleMonsterCreepVo inData, CreepFxType inType)
        {
            if (inData == null)
            {
                return("[]");
            }
            string perform_id = inData.perform_id;

            if (!StringUtils.CheckValid(perform_id))
            {
                return("[]");
            }
            int num = (int)inType;

            string[] array = perform_id.Split(new char[]
            {
                ','
            });
            int num2 = array.Length;

            for (int i = 0; i < num2; i++)
            {
                string[] array2 = array[i].Split(new char[]
                {
                    '|'
                });
                if (array2.Length == 2)
                {
                    if (array2[0].Equals(num.ToString()))
                    {
                        return(array2[1]);
                    }
                }
            }
            return("[]");
        }