コード例 #1
0
        public eCharTypeDef GetActorType(uint objID)
        {
            CharHandle_t actor = GameCharMgr.instance.GetActor(objID);

            if (!actor)
            {
                return(eCharTypeDef.Invalid);
            }
            return(actor.handle.pCharMeta.ActorType);
        }
コード例 #2
0
        public EBTStatus CheckSkillFilter(eSkillSlotType InSlot, uint objID)
        {
            Skill        skill = m_wrapper.GetSkill(InSlot);
            uint         dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter;
            CharHandle_t actor = GameCharMgr.instance.GetActor(objID);

            if (((ulong)dwSkillTargetFilter & (ulong)(1L << (int)(actor.handle.pCharMeta.ActorType & (eCharTypeDef)31))) > 0uL)
            {
                return(EBTStatus.BT_FAILURE);
            }
            return(EBTStatus.BT_SUCCESS);
        }
コード例 #3
0
        public bool HasMemberHpLessThan(int hpRate)
        {
            Player ownerPlayer = CharHelper.GetOwnerPlayer(ref m_wrapper.actorPtr);

            ReadonlyContext <CharHandle_t> .Enumerator enumerator = ownerPlayer.GetAllHeroes().GetEnumerator();
            while (enumerator.MoveNext())
            {
                CharHandle_t current = enumerator.Current;
                CCChar       handle  = current.handle;
                if (hpRate > handle.pPropertyCtrl.actorHp * 10000 / handle.pPropertyCtrl.actorHpTotal)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
        public bool IsDistanceToActorInRange(uint objID, int range)
        {
            CharHandle_t actor = GameCharMgr.instance.GetActor(objID);

            if (!actor)
            {
                return(false);
            }
            CCChar handle = actor.handle;
            long   num    = (long)range;

            if (handle.CharInfo != null)
            {
                num += (long)handle.CharInfo.iCollisionSize.x;
            }
            return((m_wrapper.actorLocation - handle.location).sqrMagnitudeLong2D < num * num);
        }
コード例 #5
0
        public bool IsTargetCanBeAttacked(uint objID)
        {
            CharHandle_t actor = GameCharMgr.instance.GetActor(objID);

            if (!actor)
            {
                m_wrapper.ClearTarget();
                return(false);
            }
            bool flag = m_wrapper.CanAttack(actor) && actor.handle.VisibilityControl.IsVisibleFor(m_wrapper.actor.pCharMeta.ActorCamp);

            if (!flag)
            {
                m_wrapper.ClearTarget();
            }
            return(flag);
        }
コード例 #6
0
        public virtual void RequestMoveToActor(uint objID)
        {
            //             RealMoveToActor(objID);
            //             return;

            CharHandle_t actor = GameCharMgr.instance.GetActor(objID);

            if (!actor)
            {
                return;
            }
            VecInt3 dest2 = actor.handle.location;

            if (m_lastDest != dest2)
            {
                m_lastDest = dest2;
                //VecInt3 vInt = dest2 - m_wrapper.actor.location;

                //if (vInt != VecInt3.zero)
                //{
                //    int num = (int)((double)(IntMath.atan2(-vInt.z, vInt.x).single * 180f) / 3.1416);
                //    DebugHelper.Assert(num < 32767 && num > -32768, "WARN: num < 32767 && num > -32768");
                //    int num2 = num - InputModel.instance.PreMoveDirection;
                //    if (num2 > 1 || num2 < -1 || InputModel.instance.FixtimeDirSndFrame > 30)
                //    {
                //        InputModel.instance.SendMoveDirection(num);
                //    }
                //}

                FrameCommand <MoveToPosCommand>   frameCommand = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>();
                MGFrameCommand <MoveToPosCommand> final        = SmartReferencePool.instance.Fetch <MGFrameCommand <MoveToPosCommand> >();
                Player ownerPlayer = CharHelper.GetOwnerPlayer(ref m_wrapper.actorPtr);
                frameCommand.playerID             = ownerPlayer.PlayerId;
                frameCommand.cmdData.destPosition = dest2;

                final.SetFrameCommand(ref frameCommand);
                final.playerID = ownerPlayer.PlayerId;

                GameDefine.BattleNetHandler.WriteMsg(final);
            }
        }