예제 #1
0
        private void OnNextSpawnGroups(ref NextSpawnGroupsParam prm)
        {
            if (prm.OldGroup == null)
            {
                return;
            }
            for (int i = 0; i < this.node_ary.Count; i++)
            {
                DragonIcon.DragonNode dragonNode = this.node_ary[i];
                if (dragonNode != null && dragonNode.spawnGroup == prm.OldGroup)
                {
                    dragonNode.spawnGroup = prm.NextGroups[0];
                }
            }
            ActorMeta         actorMeta = prm.OldGroup.TheActorsMeta[0];
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return;
            }
            if (dataCfgInfoByCurLevelDiff.bSoldierType == 9)
            {
                KillDetailInfo killDetailInfo = new KillDetailInfo();
                killDetailInfo.bSelfCamp = true;
                killDetailInfo.Type      = KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide;
                Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo);

                KillDetailInfo killDetailInfo2 = new KillDetailInfo();
                killDetailInfo2.bSelfCamp = true;
                killDetailInfo2.Type      = KillDetailInfoType.Info_Type_5V5SmallDragon_Enter;
                Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo2);
            }
        }
예제 #2
0
        public int GetKillDragonNum()
        {
            int num      = 0;
            int dragonId = Singleton <BattleLogic> .instance.DragonId;

            for (int i = 0; i < this.m_deadRecordList.Count; i++)
            {
                DeadRecord record = this.m_deadRecordList[i];
                if (dragonId == record.cfgId)
                {
                    num++;
                }
                else
                {
                    DeadRecord record2 = this.m_deadRecordList[i];
                    if (record2.actorType == ActorTypeDef.Actor_Type_Monster)
                    {
                        DeadRecord record3 = this.m_deadRecordList[i];
                        if (record3.actorSubType == 2)
                        {
                            DeadRecord        record4 = this.m_deadRecordList[i];
                            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record4.cfgId);
                            if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 9))
                            {
                                num++;
                            }
                        }
                    }
                }
            }
            return(num);
        }
예제 #3
0
        public void Init(GameObject mmNode_ugui, GameObject bmNode_ugui, GameObject mmNode_3dui, GameObject bmNode_3dui, bool b5V5)
        {
            this.m_b5v5 = b5V5;
            Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born));

            Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead));

            Singleton <GameEventSys> .instance.AddEventHandler <NextSpawnGroupsParam>(GameEventDef.Event_NextSpawnGroups, new RefAction <NextSpawnGroupsParam>(this.OnNextSpawnGroups));

            for (int i = 0; i < mmNode_ugui.transform.childCount; i++)
            {
                mmNode_ugui.transform.GetChild(i).gameObject.CustomSetActive(false);
            }
            for (int j = 0; j < bmNode_ugui.transform.childCount; j++)
            {
                bmNode_ugui.transform.GetChild(j).gameObject.CustomSetActive(false);
            }
            for (int k = 0; k < mmNode_3dui.transform.childCount; k++)
            {
                mmNode_3dui.transform.GetChild(k).gameObject.CustomSetActive(false);
            }
            for (int l = 0; l < bmNode_3dui.transform.childCount; l++)
            {
                bmNode_3dui.transform.GetChild(l).gameObject.CustomSetActive(false);
            }
            this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_3", 7, 0));
            this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_big", 8, 0));
            this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_1", 9, 13));
            this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_2", 9, 13));
            ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups();

            if (spawnGroups != null)
            {
                for (int m = 0; m < spawnGroups.Count; m++)
                {
                    SpawnGroup spawnGroup = spawnGroups[m];
                    if (spawnGroup != null)
                    {
                        ActorMeta         actorMeta = spawnGroup.TheActorsMeta[0];
                        ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId);
                        if (dataCfgInfoByCurLevelDiff != null)
                        {
                            bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13;
                            if (flag && !spawnGroup.bTriggerSpawn)
                            {
                                DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType);
                                if (dragonNode != null)
                                {
                                    dragonNode.spawnGroup = spawnGroup;
                                    dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, 0u, this.m_b5v5, true, true, true);
                                    dragonNode.ShowDead(true);
                                    MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui);
                                }
                            }
                        }
                    }
                }
            }
            this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer));
        }
예제 #4
0
        private string QueryEliteName(ActorRoot inActor)
        {
            string str = null;

            if (inActor != null)
            {
                ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId);
                if (dataCfgInfoByCurLevelDiff == null)
                {
                    return(str);
                }
                str = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName);
                if ((inActor.SkillControl == null) || (inActor.SkillControl.talentSystem == null))
                {
                    return(str);
                }
                string         str3       = string.Empty;
                PassiveSkill[] skillArray = inActor.SkillControl.talentSystem.QueryTalents();
                if (skillArray != null)
                {
                    foreach (PassiveSkill skill in skillArray)
                    {
                        if ((skill != null) && skill.bShowAsElite)
                        {
                            str3 = str3 + skill.PassiveSkillName + "之";
                        }
                    }
                }
                if (!string.IsNullOrEmpty(str3))
                {
                    str = str3 + str;
                }
            }
            return(str);
        }
예제 #5
0
    private void AddActionsFromSoldier(DictionaryView <string, Action> actions, uint soldierID)
    {
        ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)soldierID);

        if (dataCfgInfoByCurLevelDiff == null)
        {
            return;
        }
        string     path      = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo);
        CActorInfo actorInfo = CActorInfo.GetActorInfo(path, enResourceType.BattleScene);

        if (actorInfo == null)
        {
            return;
        }
        this.AddBehaviorTree(actorInfo);
        string artPrefabName = actorInfo.GetArtPrefabName(0, -1);

        if (!this.prefabDict.ContainsKey(artPrefabName))
        {
            this.prefabDict.Add(artPrefabName, false);
        }
        if (dataCfgInfoByCurLevelDiff.SkillIDs != null && dataCfgInfoByCurLevelDiff.SkillIDs.Length > 0)
        {
            for (int i = 0; i < dataCfgInfoByCurLevelDiff.SkillIDs.Length; i++)
            {
                int skillID = dataCfgInfoByCurLevelDiff.SkillIDs[i];
                this.AddActionsFromSkill(actions, skillID);
            }
        }
    }
예제 #6
0
        public void Init(GameObject node, GameObject bigNode, bool b5V5)
        {
            this.m_b5v5 = b5V5;
            Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born));

            Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead));

            for (int i = 0; i < node.transform.childCount; i++)
            {
                node.transform.GetChild(i).gameObject.CustomSetActive(false);
            }
            for (int j = 0; j < bigNode.transform.childCount; j++)
            {
                bigNode.transform.GetChild(j).gameObject.CustomSetActive(false);
            }
            this.node_ary.Add(new DragonNode(node, bigNode, "d_3", 7, 0));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_big", 8, 0));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_1", 9, 13));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_2", 9, 13));
            SpawnGroup            group       = null;
            ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups();

            if (spawnGroups != null)
            {
                for (int k = 0; k < spawnGroups.Count; k++)
                {
                    group = spawnGroups[k];
                    if ((group != null) && (group.NextGroups.Length == 0))
                    {
                        ActorMeta         meta = group.TheActorsMeta[0];
                        ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(meta.ConfigId);
                        if ((dataCfgInfoByCurLevelDiff != null) && ((((dataCfgInfoByCurLevelDiff.bSoldierType == 8) || (dataCfgInfoByCurLevelDiff.bSoldierType == 9)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 7)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 13)))
                        {
                            DragonNode node2 = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType);
                            if (node2 != null)
                            {
                                node2.spawnGroup = group;
                                node2.SetData(group.gameObject.transform.position, dataCfgInfoByCurLevelDiff.bSoldierType, 0, this.m_b5v5);
                                node2.ShowDead(true);
                                MiniMapSysUT.RefreshMapPointerBig(node2.node_in_bigMap);
                            }
                        }
                    }
                }
            }
            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer));
            }
        }
예제 #7
0
 private void SetBossIcon(ActorRoot inActor)
 {
     if (inActor != null)
     {
         string str = UT.Bytes2String(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId).szBossIcon);
         if (!string.IsNullOrEmpty(str))
         {
             this.boss_icon.SetSprite(str, this.map_fromScript, true, false, false);
         }
         else
         {
             this.boss_icon.SetSprite("UGUI/Sprite/Dynamic/BustCircle/50001", this.map_fromScript, true, false, false);
         }
     }
 }
예제 #8
0
        private void SpawnMonster(Action _action)
        {
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(this.ConfigID);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return;
            }
            string     fullPathInResources = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo) + ".asset";
            CActorInfo exists = Singleton <CResourceManager> .GetInstance().GetResource(fullPathInResources, typeof(CActorInfo), enResourceType.BattleScene, false, false).m_content as CActorInfo;

            if (exists)
            {
                ActorMeta actorMeta  = default(ActorMeta);
                ActorMeta actorMeta2 = actorMeta;
                actorMeta2.ConfigId  = this.ConfigID;
                actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster;
                actorMeta2.ActorCamp = this.PlayerCamp;
                actorMeta2.EnCId     = this.ConfigID;
                actorMeta            = actorMeta2;
                VInt3 location = this.tarActor.handle.location;
                VInt3 forward  = this.tarActor.handle.forward;
                PoolObjHandle <ActorRoot> poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, location, forward, false, true);

                if (poolObjHandle)
                {
                    poolObjHandle.handle.InitActor();
                    poolObjHandle.handle.PrepareFight();
                    Singleton <GameObjMgr> .instance.AddActor(poolObjHandle);

                    poolObjHandle.handle.StartFight();
                    poolObjHandle.handle.ObjLinker.Invincible = this.Invincible;
                    poolObjHandle.handle.ObjLinker.CanMovable = this.Moveable;
                    MonsterWrapper monsterWrapper = poolObjHandle.handle.ActorControl as MonsterWrapper;
                    if (monsterWrapper != null)
                    {
                        if (this.wayPoint != null)
                        {
                            monsterWrapper.AttackAlongRoute(this.wayPoint.GetComponent <WaypointsHolder>());
                        }
                        if (this.LifeTime > 0)
                        {
                            monsterWrapper.LifeTime = this.LifeTime;
                        }
                    }
                }
            }
        }
예제 #9
0
        public void RefreshDragNode(bool bUseCache, bool bRefreshMM = false)
        {
            ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .get_instance().mapLogic.GetSpawnGroups();

            if (spawnGroups != null)
            {
                for (int i = 0; i < spawnGroups.get_Count(); i++)
                {
                    SpawnGroup spawnGroup = spawnGroups.get_Item(i);
                    if (spawnGroup != null && spawnGroup.NextGroups.Length == 0)
                    {
                        ActorMeta         actorMeta = spawnGroup.TheActorsMeta[0];
                        ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId);
                        if (dataCfgInfoByCurLevelDiff != null)
                        {
                            bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13;
                            if (flag)
                            {
                                DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType);
                                if (dragonNode != null)
                                {
                                    dragonNode.spawnGroup = spawnGroup;
                                    dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, dragonNode.objid, this.m_b5v5, bUseCache, false, bRefreshMM);
                                    if (dragonNode.objid != 0u)
                                    {
                                        PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(dragonNode.objid);

                                        if (actor)
                                        {
                                            dragonNode.ShowDead(actor.get_handle().ActorControl.IsDeadState);
                                        }
                                        else
                                        {
                                            dragonNode.ShowDead(true);
                                        }
                                    }
                                    else
                                    {
                                        dragonNode.ShowDead(true);
                                    }
                                    MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui);
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #10
0
 private void SetBossIcon(ActorRoot inActor)
 {
     if ((inActor != null) && (this.map_fromScript != null))
     {
         ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId);
         if (dataCfgInfoByCurLevelDiff != null)
         {
             if (!string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon))
             {
                 this.boss_icon.SetSprite(dataCfgInfoByCurLevelDiff.szBossIcon, this.map_fromScript, true, false, false);
             }
             else
             {
                 this.boss_icon.SetSprite("UGUI/Sprite/Dynamic/BustCircle/50001", this.map_fromScript, true, false, false);
             }
         }
     }
 }
예제 #11
0
        public int GetBaronDeadCount(COM_PLAYERCAMP killerCamp)
        {
            int num = 0;

            for (int i = 0; i < this.m_deadRecordList.Count; i++)
            {
                DeadRecord record = this.m_deadRecordList[i];
                if (((killerCamp == record.killerCamp) && (record.actorType == ActorTypeDef.Actor_Type_Monster)) && (record.actorSubType == 2))
                {
                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId);
                    if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 8))
                    {
                        num++;
                    }
                }
            }
            return(num);
        }
예제 #12
0
        public int GetKillSpecialMonsterNumAtTime(uint playerID, int deadTime, byte bySoldierType)
        {
            int num = 0;

            for (int i = 0; i < this.m_deadRecordList.Count; i++)
            {
                DeadRecord record = this.m_deadRecordList[i];
                if (((record.AttackPlayerID == playerID) && (record.actorType == ActorTypeDef.Actor_Type_Monster)) && (record.actorSubType == 2))
                {
                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId);
                    if (((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == bySoldierType)) && (record.deadTime < deadTime))
                    {
                        num++;
                    }
                }
            }
            return(num);
        }
예제 #13
0
        private string QueryEliteName(ActorRoot inActor)
        {
            string text = null;

            if (inActor == null)
            {
                return(text);
            }
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return(text);
            }
            string text2 = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName);

            text = text2;
            if (inActor.SkillControl == null || inActor.SkillControl.talentSystem == null)
            {
                return(text);
            }
            string text3 = string.Empty;

            PassiveSkill[] array = inActor.SkillControl.talentSystem.QueryTalents();
            if (array != null)
            {
                PassiveSkill[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    PassiveSkill passiveSkill = array2[i];
                    if (passiveSkill != null && passiveSkill.bShowAsElite)
                    {
                        text3 += passiveSkill.PassiveSkillName;
                        text3 += "之";
                    }
                }
            }
            if (!string.IsNullOrEmpty(text3))
            {
                text = text3 + text;
            }
            return(text);
        }
예제 #14
0
        public int GetBaronDeadTime(int index)
        {
            int num = 0;

            for (int i = 0; i < this.m_deadRecordList.Count; i++)
            {
                DeadRecord record = this.m_deadRecordList[i];
                if ((record.actorType == ActorTypeDef.Actor_Type_Monster) && (record.actorSubType == 2))
                {
                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId);
                    if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 8))
                    {
                        if (num == index)
                        {
                            DeadRecord record2 = this.m_deadRecordList[i];
                            return(record2.deadTime);
                        }
                        num++;
                    }
                }
            }
            return(0);
        }
 public ResMonsterCfgInfo FindMonsterConfig(int ConfigID)
 {
     return(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(ConfigID));
 }
예제 #16
0
        private void InitHeroPanelHeroInfo(uint uiObjId, Transform trHeroPanel, CHostHeroDamage objHostHeroDamage)
        {
            if (trHeroPanel == null || objHostHeroDamage == null)
            {
                return;
            }
            Transform transform = trHeroPanel.FindChild("PanelTop");

            if (transform)
            {
                int          num          = 0;
                string       text         = null;
                string       text2        = null;
                byte         b            = 0;
                byte         b2           = 0;
                ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num, ref b, ref b2))
                {
                    Transform transform2 = transform.FindChild("Imghead");
                    if (transform2)
                    {
                        Transform transform3 = transform2.FindChild("head");
                        if (transform3)
                        {
                            Image component = transform3.GetComponent <Image>();
                            if (component)
                            {
                                string prefabPath;
                                if (actorTypeDef == ActorTypeDef.Actor_Type_Hero)
                                {
                                    string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)num, 0u);
                                    prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + heroSkinPic;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Organ)
                                {
                                    prefabPath = KillNotify.building_icon;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Monster)
                                {
                                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(num);
                                    if (dataCfgInfoByCurLevelDiff != null && !string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon))
                                    {
                                        prefabPath = dataCfgInfoByCurLevelDiff.szBossIcon;
                                    }
                                    else if (b2 == 1)
                                    {
                                        prefabPath = KillNotify.monster_icon;
                                    }
                                    else if (b == 7 || b == 9)
                                    {
                                        prefabPath = KillNotify.dragon_icon;
                                    }
                                    else if (b == 8)
                                    {
                                        prefabPath = CHostHeroDeadInfo.m_strDragonBig;
                                    }
                                    else
                                    {
                                        prefabPath = KillNotify.yeguai_icon;
                                    }
                                }
                                else
                                {
                                    prefabPath = KillNotify.monster_icon;
                                }
                                component.SetSprite(prefabPath, this.m_heroDeadInfoForm, true, false, false, false);
                            }
                        }
                    }
                    Transform transform4 = transform.FindChild("heroName");
                    if (transform4)
                    {
                        Text component2 = transform4.GetComponent <Text>();
                        if (component2)
                        {
                            string text3 = text;
                            if (!string.IsNullOrEmpty(text3))
                            {
                                int    num2  = text3.IndexOf('(');
                                string text4 = text3.Substring(num2 + 1, text3.get_Length() - num2 - 2);
                                component2.text = text4;
                            }
                        }
                    }
                    Transform transform5 = transform.FindChild("playerName");
                    if (transform5)
                    {
                        Text component3 = transform5.GetComponent <Text>();
                        if (component3)
                        {
                            if (!string.IsNullOrEmpty(text2))
                            {
                                component3.text = text2;
                                transform5.gameObject.CustomSetActive(true);
                            }
                            else
                            {
                                transform5.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                }
            }
        }
예제 #17
0
 private string QueryBossName()
 {
     DebugHelper.Assert(this.bossActorRoot);
     return(UT.Bytes2String(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(this.bossActorRoot.handle.TheActorMeta.ConfigId).szName));
 }
예제 #18
0
        private void SpawnSoldier(uint SoldierID)
        {
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)SoldierID);

            if (dataCfgInfoByCurLevelDiff != null)
            {
                if (CActorInfo.GetActorInfo(StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo), enResourceType.BattleScene) != null)
                {
                    Transform      transform = this.Region.transform;
                    COM_PLAYERCAMP campType  = this.Region.CampType;
                    ActorMeta      actorMeta = new ActorMeta {
                        ConfigId  = (int)SoldierID,
                        ActorType = ActorTypeDef.Actor_Type_Monster,
                        ActorCamp = campType
                    };
                    VInt3 position = (VInt3)transform.position;
                    VInt3 forward  = (VInt3)transform.forward;
                    PoolObjHandle <ActorRoot> actor = new PoolObjHandle <ActorRoot>();
                    if (!Singleton <GameObjMgr> .GetInstance().TryGetFromCache(ref actor, ref actorMeta))
                    {
                        actor = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, position, forward, false, true);

                        if (actor != 0)
                        {
                            actor.handle.InitActor();
                            actor.handle.PrepareFight();
                            Singleton <GameObjMgr> .instance.AddActor(actor);

                            actor.handle.StartFight();
                        }
                    }
                    else
                    {
                        ActorRoot handle = actor.handle;
                        handle.TheActorMeta.ActorCamp = actorMeta.ActorCamp;
                        handle.ReactiveActor(position, forward);
                    }
                    if (actor != 0)
                    {
                        if (this.Region.AttackRoute != null)
                        {
                            actor.handle.ActorControl.AttackAlongRoute(this.Region.AttackRoute.GetComponent <WaypointsHolder>());
                        }
                        else if (this.Region.finalTarget != null)
                        {
                            FrameCommand <AttackPositionCommand> cmd = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();
                            cmd.cmdId            = 1;
                            cmd.cmdData.WorldPos = new VInt3(this.Region.finalTarget.transform.position);
                            actor.handle.ActorControl.CmdAttackMoveToDest(cmd, cmd.cmdData.WorldPos);
                        }
                        if (!this.isCannonNotified && (this.WaveInfo.bType == 1))
                        {
                            KillNotify killNotifation = Singleton <CBattleSystem> .GetInstance().GetKillNotifation();

                            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                            if ((killNotifation != null) && (hostPlayer != null))
                            {
                                bool bSrcAllies = hostPlayer.PlayerCamp == actor.handle.TheActorMeta.ActorCamp;
                                if (bSrcAllies)
                                {
                                    KillInfo killInfo = new KillInfo((hostPlayer.PlayerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? KillNotify.red_cannon_icon : KillNotify.blue_cannon_icon, null, KillDetailInfoType.Info_Type_Cannon_Spawned, bSrcAllies, false, ActorTypeDef.Invalid);
                                    killNotifation.AddKillInfo(killInfo);
                                    this.isCannonNotified = true;
                                }
                            }
                        }
                    }
                }
                if (this.Region.bTriggerEvent)
                {
                    SoldierWaveParam prm = new SoldierWaveParam(this.Index, this.repeatCount, this.Region.GetNextRepeatTime(false));
                    Singleton <GameEventSys> .instance.SendEvent <SoldierWaveParam>(GameEventDef.Event_SoldierWaveNextRepeat, ref prm);
                }
            }
        }
예제 #19
0
        private void SpawnSoldier(uint SoldierID)
        {
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)SoldierID);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return;
            }
            string     path      = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo);
            CActorInfo actorInfo = CActorInfo.GetActorInfo(path, enResourceType.BattleScene);

            if (actorInfo)
            {
                Transform      transform  = this.Region.transform;
                COM_PLAYERCAMP campType   = this.Region.CampType;
                ActorMeta      actorMeta  = default(ActorMeta);
                ActorMeta      actorMeta2 = actorMeta;
                actorMeta2.ConfigId  = (int)SoldierID;
                actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster;
                actorMeta2.ActorCamp = campType;
                actorMeta            = actorMeta2;
                VInt3 vInt  = (VInt3)transform.position;
                VInt3 vInt2 = (VInt3)transform.forward;
                PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
                if (!Singleton <GameObjMgr> .GetInstance().TryGetFromCache(ref poolObjHandle, ref actorMeta))
                {
                    poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, vInt, vInt2, false, true);

                    if (poolObjHandle)
                    {
                        poolObjHandle.handle.InitActor();
                        poolObjHandle.handle.PrepareFight();
                        Singleton <GameObjMgr> .instance.AddActor(poolObjHandle);

                        poolObjHandle.handle.StartFight();
                    }
                }
                else
                {
                    ActorRoot handle = poolObjHandle.handle;
                    handle.TheActorMeta.ActorCamp = actorMeta.ActorCamp;
                    handle.ReactiveActor(vInt, vInt2);
                }
                if (poolObjHandle)
                {
                    if (this.Region.AttackRoute != null)
                    {
                        poolObjHandle.handle.ActorControl.AttackAlongRoute(this.Region.AttackRoute.GetComponent <WaypointsHolder>());
                    }
                    else if (this.Region.finalTarget != null)
                    {
                        FrameCommand <AttackPositionCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();
                        frameCommand.cmdId            = 1u;
                        frameCommand.cmdData.WorldPos = new VInt3(this.Region.finalTarget.transform.position);
                        poolObjHandle.handle.ActorControl.CmdAttackMoveToDest(frameCommand, frameCommand.cmdData.WorldPos);
                    }
                    if (!this.isCannonNotified && this.WaveInfo.bType == 1 && this.Region != null && (this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_MID || this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_NONE))
                    {
                        KillNotify theKillNotify = Singleton <CBattleSystem> .GetInstance().TheKillNotify;

                        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                        if (theKillNotify != null && hostPlayer != null)
                        {
                            bool flag = hostPlayer.PlayerCamp == poolObjHandle.handle.TheActorMeta.ActorCamp;
                            if (flag)
                            {
                                KillInfo killInfo = new KillInfo((hostPlayer.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? KillNotify.blue_cannon_icon : KillNotify.red_cannon_icon, null, KillDetailInfoType.Info_Type_Cannon_Spawned, flag, false, ActorTypeDef.Invalid, false);
                                theKillNotify.AddKillInfo(ref killInfo);
                                this.isCannonNotified = true;
                            }
                        }
                    }
                    if (this.WaveInfo.bType == 2)
                    {
                        if (!this.isNotifiedBigDragonSoldier && this.Region != null && (this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_MID || this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_NONE))
                        {
                            KillNotify theKillNotify2 = Singleton <CBattleSystem> .GetInstance().TheKillNotify;

                            Player hostPlayer2 = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                            if (theKillNotify2 != null && hostPlayer2 != null)
                            {
                                bool     bSrcAllies = hostPlayer2.PlayerCamp == poolObjHandle.handle.TheActorMeta.ActorCamp;
                                KillInfo killInfo2  = new KillInfo(KillNotify.soldier_bigdragon_icon, null, KillDetailInfoType.Info_Type_Soldier_BigDragon, bSrcAllies, false, ActorTypeDef.Invalid, false);
                                theKillNotify2.AddKillInfo(ref killInfo2);
                                this.isNotifiedBigDragonSoldier = true;
                            }
                        }
                    }
                    else if (this.isNotifiedBigDragonSoldier)
                    {
                        this.isNotifiedBigDragonSoldier = false;
                    }
                }
            }
            SoldierWaveParam soldierWaveParam = new SoldierWaveParam(this.Index, this.repeatCount, this.Region.GetNextRepeatTime(false), this);

            Singleton <GameEventSys> .instance.SendEvent <SoldierWaveParam>(GameEventDef.Event_SoldierWaveNextRepeat, ref soldierWaveParam);
        }
예제 #20
0
    public void AddPreloadActor(ref List <ActorPreloadTab> list, ref ActorMeta actorMeta, float spawnCnt, int ownerSkinID = 0)
    {
        ActorStaticData        inStaticData      = default(ActorStaticData);
        IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

        actorDataProvider.GetActorStaticData(ref actorMeta, ref inStaticData);
        ActorServerData        actorServerData    = default(ActorServerData);
        IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

        actorDataProvider2.GetActorServerData(ref actorMeta, ref actorServerData);
        CActorInfo actorInfo = CActorInfo.GetActorInfo(inStaticData.TheResInfo.ResPath, enResourceType.BattleScene);

        if (actorInfo == null)
        {
            return;
        }
        for (int i = 0; i < list.get_Count(); i++)
        {
            ActorPreloadTab actorPreloadTab = list.get_Item(i);
            if (actorPreloadTab.theActor.ActorType == actorMeta.ActorType && actorPreloadTab.theActor.ConfigId == actorMeta.ConfigId)
            {
                if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
                {
                    int actorMarkID = this.GetActorMarkID(actorMeta);
                    if (actorMarkID != actorPreloadTab.MarkID)
                    {
                        goto IL_13B;
                    }
                    uint skillID = 0u;
                    if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID))
                    {
                        this.AnalyseSkill(ref actorPreloadTab, (int)skillID);
                    }
                }
                else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && spawnCnt > 0f)
                {
                    actorPreloadTab.spawnCnt += spawnCnt;
                    list.set_Item(i, actorPreloadTab);
                }
                LoaderHelper.retCnt++;
                return;
            }
            IL_13B :;
        }
        ActorPreloadTab actorPreloadTab2 = new ActorPreloadTab();

        actorPreloadTab2.theActor = actorMeta;
        actorPreloadTab2.modelPrefab.assetPath    = actorInfo.GetArtPrefabName((ownerSkinID != 0) ? ownerSkinID : ((int)actorServerData.SkinId), -1);
        actorPreloadTab2.modelPrefab.nInstantiate = 1;
        actorPreloadTab2.spawnCnt   = spawnCnt;
        actorPreloadTab2.MarkID     = this.GetActorMarkID(actorMeta);
        actorPreloadTab2.ageActions = new List <AssetLoadBase>();
        actorPreloadTab2.parPrefabs = new List <AssetLoadBase>();
        actorPreloadTab2.mesPrefabs = new List <AssetLoadBase>();
        if (actorServerData.SkinId != 0u)
        {
            actorInfo.PreLoadAdvanceSkin(actorPreloadTab2.mesPrefabs, actorServerData.SkinId, -1);
        }
        actorPreloadTab2.spritePrefabs = new List <AssetLoadBase>();
        actorPreloadTab2.soundBanks    = new List <AssetLoadBase>();
        actorPreloadTab2.behaviorXml   = new List <AssetLoadBase>();
        ActorStaticSkillData actorStaticSkillData = default(ActorStaticSkillData);

        for (int j = 0; j < 8; j++)
        {
            actorDataProvider.GetActorStaticSkillData(ref actorMeta, (ActorSkillSlot)j, ref actorStaticSkillData);
            this.AnalyseSkill(ref actorPreloadTab2, actorStaticSkillData.SkillId);
            this.AnalysePassiveSkill(ref actorPreloadTab2, actorStaticSkillData.PassiveSkillId);
        }
        if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
        {
            int skillID2;
            int skillID3;
            int skillID4;
            int passiveSkillID;
            this.GetMapSkills(out skillID2, out skillID3, out skillID4, out passiveSkillID);
            this.AnalyseSkill(ref actorPreloadTab2, skillID2);
            this.AnalyseSkill(ref actorPreloadTab2, skillID3);
            this.AnalyseSkill(ref actorPreloadTab2, skillID4);
            this.AnalysePassiveSkill(ref actorPreloadTab2, passiveSkillID);
            uint skillID5 = 0u;
            if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID5))
            {
                this.AnalyseSkill(ref actorPreloadTab2, (int)skillID5);
            }
            this.AnalyseHeroBornAndReviveAge(ref actorPreloadTab2, actorMeta.ConfigId);
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)actorMeta.ConfigId);
            if (dataByKey != null)
            {
                this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID1);
                this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID2);
            }
        }
        else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
        {
            ActorStaticData        actorStaticData    = default(ActorStaticData);
            IGameActorDataProvider actorDataProvider3 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

            actorDataProvider3.GetActorStaticData(ref actorMeta, ref actorStaticData);
            int randomPassiveSkillRule = actorStaticData.TheBaseAttribute.RandomPassiveSkillRule;
            if (randomPassiveSkillRule > 0 && !this.randomSkillCheckerSet.ContainsKey(randomPassiveSkillRule))
            {
                this.randomSkillCheckerSet.Add(randomPassiveSkillRule, true);
                ResRandomSkillPassiveRule dataByKey2 = GameDataMgr.randomSkillPassiveDatabin.GetDataByKey((long)randomPassiveSkillRule);
                if (dataByKey2.astRandomSkillPassiveID1 != null && dataByKey2.astRandomSkillPassiveID1.Length > 0)
                {
                    for (int k = 0; k < dataByKey2.astRandomSkillPassiveID1.Length; k++)
                    {
                        this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID1[k].iParam);
                    }
                }
                if (dataByKey2.astRandomSkillPassiveID2 != null && dataByKey2.astRandomSkillPassiveID2.Length > 0)
                {
                    for (int l = 0; l < dataByKey2.astRandomSkillPassiveID2.Length; l++)
                    {
                        this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID2[l].iParam);
                    }
                }
            }
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId);
            if (dataCfgInfoByCurLevelDiff != null && dataCfgInfoByCurLevelDiff.iBufDropID != 0 && dataCfgInfoByCurLevelDiff.iBufDropRate > 0)
            {
                ShenFuSystem.PreLoadShenfuResource(dataCfgInfoByCurLevelDiff.iBufDropID, ref actorPreloadTab2, this);
            }
            if (actorStaticData.TheMonsterOnlyInfo.SoldierType == 8 && dataCfgInfoByCurLevelDiff != null)
            {
                ListView <Assets.Scripts.GameLogic.SoldierWave> listView = new ListView <Assets.Scripts.GameLogic.SoldierWave>();
                int iKillByCamp1ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp1ChangeSoldierWave;
                int iKillByCamp2ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp2ChangeSoldierWave;
                listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp1ChangeSoldierWave));
                listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp2ChangeSoldierWave));
                for (int m = 0; m < listView.Count; m++)
                {
                    Assets.Scripts.GameLogic.SoldierWave soldierWave = listView[m];
                    if (soldierWave != null && soldierWave.WaveInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo.Length > 0)
                    {
                        for (int n = 0; n < soldierWave.WaveInfo.astNormalSoldierInfo.Length; n++)
                        {
                            ResSoldierTypeInfo resSoldierTypeInfo = soldierWave.WaveInfo.astNormalSoldierInfo[n];
                            if (resSoldierTypeInfo.dwSoldierID == 0u)
                            {
                                break;
                            }
                            ActorMeta actorMeta2 = default(ActorMeta);
                            ActorMeta actorMeta3 = actorMeta2;
                            actorMeta3.ActorType = ActorTypeDef.Actor_Type_Monster;
                            actorMeta3.ConfigId  = (int)resSoldierTypeInfo.dwSoldierID;
                            actorMeta2           = actorMeta3;
                            this.AddPreloadActor(ref list, ref actorMeta2, resSoldierTypeInfo.dwSoldierNum * 2f, 0);
                        }
                    }
                }
            }
        }
        if (!string.IsNullOrEmpty(actorInfo.deadAgePath))
        {
            actorPreloadTab2.ageActions.Add(new AssetLoadBase
            {
                assetPath = actorInfo.deadAgePath
            });
        }
        if (!string.IsNullOrEmpty(actorInfo.BtResourcePath) && !this.behaviorXmlSet.ContainsKey(actorInfo.BtResourcePath))
        {
            actorPreloadTab2.behaviorXml.Add(new AssetLoadBase
            {
                assetPath = actorInfo.BtResourcePath
            });
            this.behaviorXmlSet.Add(actorInfo.BtResourcePath, true);
        }
        actorPreloadTab2.soundBanks = new List <AssetLoadBase>();
        this.AnalyseSoundBanks(ref actorPreloadTab2, ref actorInfo, ref actorServerData);
        list.Add(actorPreloadTab2);
        if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
        {
            this.CheckCallMonsterSkill(actorInfo, ref list, ref actorMeta, (int)actorServerData.SkinId);
        }
        else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
        {
            this.CheckOrganSoldierWave(ref list, ref actorMeta, inStaticData);
        }
    }