Exemple #1
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);
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        public void RequestMovePosition(Vector3 dest)
        {
            //             RealMovePosition(dest);
            //             return;
            //
            //             UnityEngine.Debug.Log(".................." + dest
            VecInt3 dest2 = new VecInt3(dest);

            if (m_lastDest != dest2 || m_wrapper.myBehavior != eObjBehavMode.Destination_Move)
            {
                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);
            }
        }