Exemple #1
0
        static StackObject *PlaySelectedFX_12(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);
            UnityEngine.Vector3 @worldPos = new UnityEngine.Vector3();
            if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null)
            {
                ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.ParseValue(ref @worldPos, __intp, ptr_of_this_method, __mStack, true);
            }
            else
            {
                @worldPos = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
                __intp.Free(ptr_of_this_method);
            }

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

            instance_of_this_method.PlaySelectedFX(@worldPos);

            return(__ret);
        }
Exemple #2
0
        void TryDoSetup(List <int> targetIndicesCached)
        {
            if (setupDone)
            {
                return;
            }
            if (myTargets.Length == 0)
            {
                return;
            }

            setupDone = true;

            LTCombatEventReceiver.Instance.ForEach(combatant =>
            {
                if (combatant.Index == null)
                {
                    return;
                }

                if (combatant.IsLaunch())
                {
                    combatant.colorScale.SetIrrelevance(false);
                }
                else if (combatant.Index.TeamIndex != targetTeam && !combatant.Index.Equals(skillSender))
                {
                    combatant.colorScale.SetIrrelevance(true);
                }
                else if (combatant.Index.TeamIndex == targetTeam && targetIndicesCached.IndexOf(combatant.Index.IndexOnTeam) < 0)
                {
                    combatant.colorScale.SetIrrelevance(true);
                }
                else
                {
                    combatant.colorScale.SetIrrelevance(false);
                }

                combatant.RemoveSelectionFX(false);
                if (combatant.Index.Equals(skillSender))
                {
                    if (!LTCombatHudController.Instance.AutoMode)
                    {
                        combatant.SetupSelectFX();
                    }
                }
                else if (targetTeam != skillSender.TeamIndex && combatant.Index.TeamIndex == targetTeam && targetIndicesCached.IndexOf(combatant.Index.IndexOnTeam) >= 0)
                {
                    combatant.SetupSelectableFX();
                }
            });

            for (int ii = 0; ii < myTargets.Length; ++ii)
            {
                Hotfix_LT.Combat.Combatant cc = LTCombatEventReceiver.Instance.GetCombatant(targetTeam, targetIndicesCached[ii]);
                myTargets[ii]          = new SingleTarget();
                myTargets[ii].IngameId = cc.Data.IngameId;
                myTargets[ii].name     = cc.myName;
            }
        }
Exemple #3
0
 public void SetAllToColor(Hotfix_LT.Combat.Combatant cc, Color myColor)
 {
     if (cc != null && cc.redRing != null)
     {
         cc.redRing.gameObject.CustomSetActive(myColor == Color.red);
         cc.orangeRing.gameObject.CustomSetActive(myColor == combatOrange);
         cc.blackRing.gameObject.CustomSetActive(false);
         cc.greenRing.gameObject.CustomSetActive(myColor == Color.green);
     }
 }
Exemple #4
0
        static StackObject *SetupSelectableFX_18(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.Combatant instance_of_this_method = (Hotfix_LT.Combat.Combatant) typeof(Hotfix_LT.Combat.Combatant).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetupSelectableFX();

            return(__ret);
        }
Exemple #5
0
        static StackObject *get_Collider_13(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.Combatant instance_of_this_method = (Hotfix_LT.Combat.Combatant) typeof(Hotfix_LT.Combat.Combatant).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Collider;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemple #6
0
        public void ClearConvergeInfo(int ingameId)
        {
            if (_convergeTarget != null && _convergeTarget.Data != null && _convergeTarget.Data.IngameId == ingameId)
            {
                var healthBar = _convergeTarget.gameObject.GetMonoILRComponent <Combat.HealthBar2D>();

                if (healthBar != null)
                {
                    healthBar.Converge = false;
                }

                _convergeTarget = null;
            }
        }
Exemple #7
0
        static StackObject *GetMaxHP_19(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.Combatant instance_of_this_method = (Hotfix_LT.Combat.Combatant) typeof(Hotfix_LT.Combat.Combatant).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetMaxHP();

            __ret->ObjectType      = ObjectTypes.Long;
            *(long *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
Exemple #8
0
        static StackObject *SetRestrainFlag_9(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.Int32 @attr = ptr_of_this_method->Value;

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

            instance_of_this_method.SetRestrainFlag(@attr);

            return(__ret);
        }
Exemple #9
0
        static StackObject *RemoveSelectionFX_16(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 @all = ptr_of_this_method->Value == 1;

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

            instance_of_this_method.RemoveSelectionFX(@all);

            return(__ret);
        }
Exemple #10
0
        public void OnHitCombatantListener(Hotfix_LT.Combat.CombatHitDamageEvent e)
        {
            Hotfix_LT.Combat.Combatant combatant = e.TargetCombatant.GetComponent <Hotfix_LT.Combat.Combatant>();
            Vector3 offset = combatant.damageTextOffset;

            CombatDamagesHUD.eDamageTextType text_type = CombatDamagesHUD.eDamageTextType.Attack;
            if (e.ShowDamage < 0)
            {
                text_type = CombatDamagesHUD.eDamageTextType.Heal;
                offset    = combatant.healTextOffset;
            }
            else if (e.IsCrit)
            {
                text_type = CombatDamagesHUD.eDamageTextType.Crit;
            }
            ShowDamages(combatant.Data.Index.GetHashCode(), combatant.DamageTextTarget, offset, e.Shield > 0 ? e.Damage : e.ShowDamage, text_type);
        }
Exemple #11
0
        /// <summary>
        /// 判断该目标是否可以成为技能释放的对象
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        private bool IsCouldSetSkill(Hotfix_LT.Combat.Combatant target)
        {
            ///10001,该技能是一个被动技能,又该技能怪物无法被技能选择成为目标
            bool isCould = true;

            if (target != null && target.Data != null && target.Data.SkillDataList != null)
            {
                foreach (var skillId in target.Data.SkillDataList.Keys)
                {
                    if (skillId == 10001)
                    {
                        isCould = false;
                    }
                }
            }

            return(isCould);
        }
Exemple #12
0
        private int GetAttackTargetActionIDUseAI(int skillid, Hotfix_LT.Combat.Combatant converage)
        {
            Hotfix_LT.Data.SkillTemplate skill_tpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillid);
            switch (skill_tpl.SelectTargetType)
            {
            case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_TEMPLATE:
            {
                if (converage != null)
                {
                    return(converage.Data.IngameId);
                }
                else
                {
                    List <Hotfix_LT.Combat.CombatCharacterSyncData> enemyList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(1 - CombatLogic.Instance.LocalPlayerTeamIndex);
                    return(FindMinHpOne(enemyList));
                }
            }

            case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_ALL:
            case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_RANDOM:
            case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_ALL:
            case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_RANDOM:
            case Hotfix_LT.Data.eSkillSelectTargetType.SELF:
            {
                return(-1);
            };

            case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_TEMPLATE:
            {
                List <Hotfix_LT.Combat.CombatCharacterSyncData> friendList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(CombatLogic.Instance.LocalPlayerTeamIndex);
                return(FindMinHpOne(friendList));
            };

            case Hotfix_LT.Data.eSkillSelectTargetType.All_NOT_SELF:
            {
                List <Hotfix_LT.Combat.CombatCharacterSyncData> friendList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(CombatLogic.Instance.LocalPlayerTeamIndex);
                return(FindMinHpOne(friendList, Hotfix_LT.Combat.CombatSyncData.Instance.ActionId));
            }

            default:
                EB.Debug.LogError("skillSelectTargetType error for skillid={0} gskillSelectTargetType={1},characterData={2}", skillid, skill_tpl.SelectTargetType, CharacterData.ToString());
                return(-2);
            }
        }
Exemple #13
0
        static StackObject *get_HealthBar_20(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.Combatant instance_of_this_method = (Hotfix_LT.Combat.Combatant) typeof(Hotfix_LT.Combat.Combatant).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.HealthBar;

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemple #14
0
        static StackObject *get_OriginPosition_14(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.Combatant instance_of_this_method = (Hotfix_LT.Combat.Combatant) typeof(Hotfix_LT.Combat.Combatant).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.OriginPosition;

            if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null)
            {
                ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.PushValue(ref result_of_this_method, __intp, __ret, __mStack);
                return(__ret + 1);
            }
            else
            {
                return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
            }
        }
Exemple #15
0
        public void PlayTrailRenderer(TrailRendererEventProperties properties)
        {
            bool isCrit = false;

            Hotfix_LT.Combat.Combatant combatant = gameObject.GetComponent <Hotfix_LT.Combat.Combatant>();
            if (combatant != null)
            {
                isCrit = combatant.IsCurrentAttackCritical();
            }
            GameObject trail = MoveUtils.InstantiateTrailInstance(properties, GetComponent <Animator>(), _flipped, isCrit);

            if (trail != null)
            {
                RegisterTrail(trail, properties._eventName, properties._isInterruptible);
                trail.GetComponent <TrailRendererInstance>().Play(Time.time);

                if (!string.IsNullOrEmpty(properties.RigAnimClipName))
                {
                    Animation animRoot = trail.transform.Find("anim_root").GetComponent <Animation>();
                    animRoot.Play(properties.RigAnimClipName);
                }
            }
        }
Exemple #16
0
        void SetConvergeTarget(Hotfix_LT.Combat.Combatant target)
        {
            if (target != null)
            {
                var healthBar = target.gameObject.GetMonoILRComponent <Combat.HealthBar2D>();

                if (healthBar != null)
                {
                    healthBar.Converge = true;
                }
            }

            if (_convergeTarget != null && _convergeTarget != target)
            {
                var healthBar = _convergeTarget.gameObject.GetMonoILRComponent <Combat.HealthBar2D>();

                if (healthBar != null)
                {
                    healthBar.Converge = false;
                }
            }

            _convergeTarget = target;
        }
Exemple #17
0
        /// <summary>
        /// 查找技能选择的目标
        /// </summary>
        /// <param name="location"></param>
        /// <returns>目标</returns>
        private Hotfix_LT.Combat.Combatant FindClosestTarget(Vector3 location)
        {
            try
            {
                Hotfix_LT.Combat.Combatant result = null;
                float minDistance = float.MaxValue;
                for (int ii = 0; ii < myTargets.Length; ++ii)
                {
                    Hotfix_LT.Combat.Combatant cc = LTCombatEventReceiver.Instance.GetCombatantByIngameId(myTargets[ii].IngameId);
                    if (cc == null)
                    {
                        EB.Debug.LogWarning("FindClosestTarget cc is null");
                        continue;
                    }

                    float   teamMultiplier = targetTeam == 1 ? 1.0f : -1.0f;
                    Vector3 screenPositionTop, screenPositionBottom;
                    float   scaleFactor = cc.transform.localScale.x;
                    if (cc.Collider.direction == 1 || cc.Collider.direction == 2)
                    {
                        float bottomFrontZ, topBackY, topBackZ;
                        if (cc.Collider.direction == 1)
                        {
                            bottomFrontZ = cc.Collider.radius * scaleFactor;
                            topBackY     = cc.Collider.height * scaleFactor;
                            topBackZ     = cc.Collider.radius * scaleFactor;
                        }
                        else
                        {
                            bottomFrontZ = cc.Collider.height / 2 * scaleFactor;
                            topBackY     = cc.Collider.center.y + cc.Collider.radius * scaleFactor;
                            topBackZ     = cc.Collider.height / 2 * scaleFactor;
                        }
                        Vector3 bottomFront = (cc.gameObject.transform.rotation * (new Vector3(0.0f, 0.0f, teamMultiplier * bottomFrontZ))) + cc.OriginPosition;
                        teamMultiplier *= -1.0f;
                        Vector3 topBack = (cc.gameObject.transform.rotation * (new Vector3(0.0f, topBackY, teamMultiplier * topBackZ))) + cc.OriginPosition;
                        screenPositionTop    = Camera.main.WorldToScreenPoint(topBack);
                        screenPositionBottom = Camera.main.WorldToScreenPoint(bottomFront);
                    }
                    else
                    {
                        float bottomLeftX, topRightX, topRightY;
                        bottomLeftX     = cc.Collider.height / 2 * scaleFactor;
                        topRightX       = cc.Collider.height / 2 * scaleFactor;
                        topRightY       = cc.Collider.center.y + cc.Collider.radius * scaleFactor;
                        teamMultiplier *= -1.0f;
                        Vector3 bottomLeft = (cc.gameObject.transform.rotation * (new Vector3(teamMultiplier * bottomLeftX, 0.0f, 0.0f))) + cc.OriginPosition;
                        teamMultiplier *= -1.0f;
                        Vector3 topRight = (cc.gameObject.transform.rotation * (new Vector3(teamMultiplier * topRightX, topRightY, 0.0f))) + cc.OriginPosition;
                        screenPositionTop    = Camera.main.WorldToScreenPoint(topRight);
                        screenPositionBottom = Camera.main.WorldToScreenPoint(bottomLeft);
                    }

                    myTargets[ii].screenPosition = (screenPositionTop + screenPositionBottom) / 2.0f;
                    myTargets[ii].radius         = Vector3.Magnitude(screenPositionTop - screenPositionBottom) / 2.0f;

                    float distance = Vector3.Magnitude(myTargets[ii].screenPosition - location);
                    if (distance < myTargets[ii].radius && distance < minDistance)
                    {
                        minDistance = distance;
                        result      = cc;
                    }
                }

                return(result);
            }
            catch (System.NullReferenceException e)
            {
                EB.Debug.LogError(e.ToString());
                return(null);
            }
        }
Exemple #18
0
 public void Init(Hotfix_LT.Combat.Combatant player)
 {
     _player = player;
 }