Beispiel #1
0
        public void SetConvergeTargeting()
        {
            stTargetIndexes.Clear();
            int enemyTeam = 1 - CombatLogic.Instance.LocalPlayerTeamIndex;

            LTCombatEventReceiver.Instance.ForEach(combatant =>
            {
                if (combatant.Index == null)
                {
                    return;
                }
                if (combatant.Index.TeamIndex == enemyTeam && (!combatant.IsDead()))
                {
                    stTargetIndexes.Add(combatant.Index.IndexOnTeam);
                }
            });
            var Myteam = Hotfix_LT.Combat.CombatSyncData.Instance.GetMyTeamData();

            if (Myteam != null)
            {
                var charlist = Hotfix_LT.Combat.CombatSyncData.Instance.GetMyTeamData().CharList;
                if (charlist.Count > 0)
                {
                    CharacterData = charlist[0];
                }
            }
            if (CharacterData != null)
            {
                CombatTargetSelectController.Instance.SetTargetingInfo(CharacterData.Index, enemyTeam, 1, stTargetIndexes);
            }
        }
Beispiel #2
0
        public void AutoSelectSkill(Combat.CombatCharacterSyncData character_data)
        {
            CharacterData = character_data;
            Hide();
            int skillID = 0;

            if (character_data != null && LTCombatHudController.Instance != null && LTCombatHudController.Instance.AutoCombatItems != null)
            {
                AutoCombatItem autoCombatItem = LTCombatHudController.Instance.AutoCombatItems.Find(item => item != null && item.ItemCharSyncData != null && item.ItemCharSyncData.ID == character_data.ID);

                if (autoCombatItem != null && autoCombatItem.IsNormalSkill)
                {
                    skillID = character_data.GetCanUseSkill(autoCombatItem.IsNormalSkill);
                }
            }

            if (_convergeTarget != null && _convergeTarget.GetHP() <= 0)
            {
                SetConvergeTarget(null);
            }

            if (character_data != null)
            {
                CombatManager.Instance.SetSkill(character_data.ID, 0, Combat.CombatSyncData.Instance.CombatId, _myTeam,
                                                CharacterData.IngameId,
                                                skillID == 0 ? -2 : GetSkillIndex(character_data, skillID),
                                                _convergeTarget != null ? _convergeTarget.Data.IngameId : -2);
            }
        }
Beispiel #3
0
        public void UpdateSkillList(Hotfix_LT.Combat.CombatCharacterSyncData character_data)
        {
            if (!isShow)
            {
                return;
            }
            if (character_data == CharacterData)
            {
                var emr = character_data.SkillDataList.Values.GetEnumerator();
                while (emr.MoveNext())
                {
                    Hotfix_LT.Combat.CombatCharacterSyncData.SkillData skilldata = emr.Current;
                    if (skilldata.SkillType != (int)Hotfix_LT.Data.eSkillType.NORMAL && skilldata.SkillType != (int)Hotfix_LT.Data.eSkillType.PASSIVE && skilldata.SkillType != (int)Hotfix_LT.Data.eSkillType.ACTIVE)
                    {
                        continue;
                    }
                    int             skillDataIndex = skilldata.Index;
                    CombatSkillItem skillItem      = null;
                    skillItem = mDMono.transform.GetChild(skillDataIndex).GetMonoILRComponent <CombatSkillItem>();

                    if (skilldata != null)
                    {
                        skillItem.mDMono.name = skilldata.SkillType.ToString() + skillDataIndex;
                        skillItem.Fill(skilldata, false, true);
                    }
                }
            }
        }
Beispiel #4
0
 static StackObject *AssignFromStack_WaitCharacterData_2(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack)
 {
     ILRuntime.Runtime.Enviorment.AppDomain   __domain           = __intp.AppDomain;
     Hotfix_LT.Combat.CombatCharacterSyncData @WaitCharacterData = (Hotfix_LT.Combat.CombatCharacterSyncData) typeof(Hotfix_LT.Combat.CombatCharacterSyncData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
     ((Hotfix_LT.Combat.CombatSyncData)o).WaitCharacterData = @WaitCharacterData;
     return(ptr_of_this_method);
 }
Beispiel #5
0
 int GetSkillIndex(Hotfix_LT.Combat.CombatCharacterSyncData chardata, int skillid)
 {
     if (chardata.SkillDataList.ContainsKey(skillid))
     {
         return(chardata.SkillDataList[skillid].Index);
     }
     EB.Debug.LogError("SkillDataList Not ContainsKey for skillid={0}", skillid);
     return(0);
 }
Beispiel #6
0
        static StackObject *get_IsBoss_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            Hotfix_LT.Combat.CombatCharacterSyncData instance_of_this_method = (Hotfix_LT.Combat.CombatCharacterSyncData) typeof(Hotfix_LT.Combat.CombatCharacterSyncData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.IsBoss;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Beispiel #7
0
        static StackObject *Add_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            Hotfix_LT.Combat.CombatCharacterSyncData @item = (Hotfix_LT.Combat.CombatCharacterSyncData) typeof(Hotfix_LT.Combat.CombatCharacterSyncData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List <Hotfix_LT.Combat.CombatCharacterSyncData> instance_of_this_method = (System.Collections.Generic.List <Hotfix_LT.Combat.CombatCharacterSyncData>) typeof(System.Collections.Generic.List <Hotfix_LT.Combat.CombatCharacterSyncData>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Add(@item);

            return(__ret);
        }
Beispiel #8
0
        static StackObject *GetCanUseSkill_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @defaultNormal = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            Hotfix_LT.Combat.CombatCharacterSyncData instance_of_this_method = (Hotfix_LT.Combat.CombatCharacterSyncData) typeof(Hotfix_LT.Combat.CombatCharacterSyncData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetCanUseSkill(@defaultNormal);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Beispiel #9
0
 public void AttackTargetUseAIWithSpecialSkill(Hotfix_LT.Combat.CombatCharacterSyncData character_data)
 {
     Hide();
     LTCombatEventReceiver.Instance.ForEach(combatant => { combatant.HideRestrainFlag(); });
     CombatManager.Instance.SetSkill(character_data.ID, 0, Hotfix_LT.Combat.CombatSyncData.Instance.CombatId, _myTeam, CharacterData.IngameId, -2, -2);
 }
Beispiel #10
0
        public void ShowSkill(Combat.CombatCharacterSyncData character_data)
        {
            isShow = true;
            if (character_data.Uid != LoginManager.Instance.LocalUserId.Value)
            {
                return;
            }
            CharacterData = character_data;
            int realSkillCount = 0;
            var emr            = character_data.SkillDataList.Values.GetEnumerator();

            while (emr.MoveNext())
            {
                Combat.CombatCharacterSyncData.SkillData skilldata = emr.Current;
                if (skilldata.SkillType != (int)Data.eSkillType.NORMAL && skilldata.SkillType != (int)Data.eSkillType.PASSIVE && skilldata.SkillType != (int)Data.eSkillType.ACTIVE)
                {
                    continue;
                }
                realSkillCount++;
                int             skillDataIndex = skilldata.Index;
                CombatSkillItem skillItem      = null;
                if (skillDataIndex < mDMono.transform.childCount)
                {
                    skillItem = mDMono.transform.GetChild(skillDataIndex).GetMonoILRComponent <CombatSkillItem>();
                }
                if (skillItem == null)
                {
                    var go = GameObject.Instantiate(SkillItemTemplate.mDMono.gameObject) as GameObject;
                    go.name = "Clone";
                    go.transform.SetParent(mDMono.transform, false);
                    go.SetActive(true);
                    skillItem = go.GetMonoILRComponent <CombatSkillItem>();
                }
                if (skilldata != null)
                {
                    skillItem.mDMono.name = ((Data.eSkillType)skilldata.SkillType).ToString() + skillDataIndex;
                    skillItem.Fill(skilldata, skilldata.SkillType == (int)Data.eSkillType.NORMAL);
                }
                else
                {
                    EB.Debug.LogError("skillData is null");
                }
            }
            if (SceneLogic.BattleType == eBattleType.ChallengeCampaign || SceneLogic.BattleType == eBattleType.AlienMazeBattle)
            {
                realSkillCount++;
                if (!_hasSetBagSpace)
                {
                    _hasSetBagSpace = true;
                    mDMono.transform.localPosition -= new Vector3(SkillItemGrid.cellWidth, 0, 0);
                }
                BagBtn.gameObject.CustomSetActive(true);
                BagShadow.gameObject.CustomSetActive(CharacterData.ScrollTimes > 0);
            }
            SkillBGSprite.width = (779 - (4 - realSkillCount) * 162);
            SkillBGSprite.gameObject.CustomSetActive(true);

            for (int excessIndex = realSkillCount; ++excessIndex < mDMono.transform.childCount; ++excessIndex)
            {
                mDMono.transform.GetChild(excessIndex).gameObject.CustomSetActive(false);
            }
            SkillItemGrid.Reposition();

            if (character_data.NormalSkillData != null)
            {
                SetTargetingInfo(character_data.NormalSkillData.ID, _COMMON_TYPE);
            }
            else
            {
                EB.Debug.LogError("Not Found NormalSkill For Character:" + character_data);
            }
        }