Example #1
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SvrNtfGameOverCommand> command = FrameCommandFactory.CreateFrameCommand <SvrNtfGameOverCommand>();

            command.cmdData.m_bWinCamp = msg.stCmdInfo.stCmdSvrNtfGameover.bWinCamp;
            return(command);
        }
Example #2
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SwitchActorSuperKillerCommand> command = FrameCommandFactory.CreateFrameCommand <SwitchActorSuperKillerCommand>();

            command.cmdData.IsSuperKiller = msg.stCmdInfo.stCmdPlayerSwitchSuperKiller.chIsSuperKiller;
            return(command);
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerInOutEquipShopCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerInOutEquipShopCommand>();

            frameCommand.cmdData.m_inOut = msg.stCmdInfo.get_stCmdPlayerInOutEquipShop().bInOut;
            return(frameCommand);
        }
 public void UseSkillCacheMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed)
 {
     if (!_actorRoot)
     {
         return;
     }
     if (this.cacheMoveCommand != null && !this.cacheMoveExpire && this.cacheMoveCommand.cmdType == 131)
     {
         FrameCommand <MoveDirectionCommand> frameCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
         if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move))
         {
             VInt3 vInt    = VInt3.right.RotateY((int)frameCommand.cmdData.Degree).NormalizeTo(_moveSpeed * _deltaTime / 1000);
             VInt  groundY = _actorRoot.handle.groundY;
             vInt = PathfindingUtility.Move(_actorRoot.handle, vInt, out groundY, out _actorRoot.handle.hasReachedNavEdge, null);
             if (_actorRoot.handle.MovementComponent.isFlying)
             {
                 int y = _actorRoot.handle.location.y;
                 _actorRoot.handle.location += vInt;
                 VInt3 location = _actorRoot.handle.location;
                 location.y = y;
                 _actorRoot.handle.location = location;
             }
             else
             {
                 _actorRoot.handle.location += vInt;
             }
             _actorRoot.handle.groundY = groundY;
         }
     }
 }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerAddGoldCoinInBattleCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerAddGoldCoinInBattleCommand>();

            frameCommand.cmdData.m_addValue = msg.stCmdInfo.get_stCmdPlayerAddGoldCoinInBattle().dwAddValue;
            return(frameCommand);
        }
Example #6
0
        public override void Process(AGE.Action _action, Track _track)
        {
            Vector3    targetPos  = this.TargetPos;
            GameObject gameObject = _action.GetGameObject(this.destId);

            if (gameObject != null)
            {
                targetPos = gameObject.transform.position;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.srcId);

            if ((actorHandle == 0) || ((hostPlayer.Captain != 0) && (actorHandle == hostPlayer.Captain)))
            {
                if (hostPlayer.Captain.handle.ActorControl != null)
                {
                    FrameCommandFactory.CreateFrameCommand <StopMoveCommand>().Send();
                    FrameCommand <MoveToPosCommand> command2 = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>();
                    command2.cmdData.destPosition = (VInt3)targetPos;
                    command2.Send();
                }
            }
            else if (actorHandle != 0)
            {
                actorHandle.handle.ActorControl.RealMovePosition((VInt3)targetPos, 0);
            }
        }
Example #7
0
 /// <summary>
 /// Pushes the locally emitted command.
 /// </summary>
 /// <param name="command">The command.</param>
 public void PushLocalCommand(FrameCommand command)
 {
     command.Id           = _nextCommandId++;
     command.PlayerNumber = Session.LocalPlayer.Number;
     command.Frame        = _server.Simulation.CurrentFrame + 1;
     Send(command);
 }
Example #8
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <LockAttackTargetCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <LockAttackTargetCommand>();

            frameCommand.cmdData.LockAttackTarget = msg.stCmdInfo.get_stCmdPlayerLockAttackTarget().dwLockAttackTarget;
            return(frameCommand);
        }
Example #9
0
        private void SendMoveDirection(int moveDegree, uint playerId = 0)
        {
            byte num;

            if (playerId == 0)
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer == null)
                {
                    return;
                }
                playerId = hostPlayer.PlayerId;
            }
            this.PreMoveDirection   = moveDegree;
            this.ConfirmDirSndFrame = 0;
            this.FixtimeDirSndFrame = 0;
            FrameCommand <MoveDirectionCommand> command = FrameCommandFactory.CreateFrameCommand <MoveDirectionCommand>();

            command.playerID       = playerId;
            command.cmdData.Degree = (short)moveDegree;
            this.nDirMoveSeq       = (byte)((num = this.nDirMoveSeq) + 1);
            command.cmdData.nSeq   = num;
            command.Send();
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <AttackPositionCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();

            frameCommand.cmdData.WorldPos = CommonTools.ToVector3(msg.stCmdInfo.get_stCmdPlayerAttackPosition().stWorldPos);
            return(frameCommand);
        }
Example #11
0
 public void RequestBuyEquip()
 {
     if (((uint)m_frame + m_wrapper.actor.ObjID) % 30 == 0)
     {
         //CBattleEquipSystem battleEquipSystem = (CBattleEquipSystem)CBattleSystem.instance.m_battleEquipSystem;
         //if (battleEquipSystem == null)
         //{
         //    return;
         //}
         m_wrapper.actor.pEquipCtrl.GetQuicklyBuyEquipList();
         {
             for (int i = 0; i < m_wrapper.actor.pEquipCtrl.retlist.Length; i++)
             {
                 if (m_wrapper.actor.pEquipCtrl.retlist[i] > 0)
                 {
                     FrameCommand <PlayerBuyEquipCommand>   frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerBuyEquipCommand>();
                     MGFrameCommand <PlayerBuyEquipCommand> cmd          = SmartReferencePool.instance.Fetch <MGFrameCommand <PlayerBuyEquipCommand> >();
                     frameCommand.cmdData.m_equipID = m_wrapper.actor.pEquipCtrl.retlist[i];
                     cmd.SetFrameCommand(ref frameCommand);
                     cmd.playerID = CPlayerManager.instance.HostPlayerId;
                     GameDefine.BattleNetHandler.WriteMsg(cmd);
                     break;
                 }
             }
         }
     }
 }
Example #12
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerAttackOrganCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerAttackOrganCommand>();

            frameCommand.cmdData.attackOrganMode = msg.stCmdInfo.stCmdPlayAttackOrganMode.bAttackOrganMode;
            return(frameCommand);
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerSellEquipCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerSellEquipCommand>();

            frameCommand.cmdData.m_equipIndex = (int)msg.stCmdInfo.get_stCmdPlayerSellEquip().bEquipIndex;
            return(frameCommand);
        }
Example #14
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SwitchActorSwitchGodMode> command = FrameCommandFactory.CreateFrameCommand <SwitchActorSwitchGodMode>();

            command.cmdData.IsGodMode = msg.stCmdInfo.stCmdPlayerSwitchGodMode.chIsGodMode;
            return(command);
        }
Example #15
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SvrNtfChgFrameLaterCommand> command = FrameCommandFactory.CreateFrameCommand <SvrNtfChgFrameLaterCommand>();

            command.cmdData.LaterNum = msg.stCmdInfo.stCmdSvrNtfChgFrameLater.bKFrameLaterNum;
            return(command);
        }
Example #16
0
 public void UseSkillCacheMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed)
 {
     if ((_actorRoot != 0) && (((this.cacheMoveCommand != null) && !this.cacheMoveExpire) && (this.cacheMoveCommand.cmdType == 2)))
     {
         FrameCommand <MoveDirectionCommand> cacheMoveCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
         if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move))
         {
             VInt3 delta   = VInt3.right.RotateY(cacheMoveCommand.cmdData.Degree).NormalizeTo((_moveSpeed * _deltaTime) / 0x3e8);
             VInt  groundY = _actorRoot.handle.groundY;
             delta = PathfindingUtility.Move(_actorRoot.handle, delta, out groundY, out _actorRoot.handle.hasReachedNavEdge, null);
             if (_actorRoot.handle.MovementComponent.isFlying)
             {
                 int       y      = _actorRoot.handle.location.y;
                 ActorRoot handle = _actorRoot.handle;
                 handle.location += delta;
                 VInt3 location = _actorRoot.handle.location;
                 location.y = y;
                 _actorRoot.handle.location = location;
             }
             else
             {
                 ActorRoot local2 = _actorRoot.handle;
                 local2.location += delta;
             }
             _actorRoot.handle.groundY = groundY;
         }
     }
 }
Example #17
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <MoveToPosCommand> command = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>();

            command.cmdData.destPosition = CommonTools.ToVector3(msg.stCmdInfo.stCmdPlayerMove.stWorldPos);
            return(command);
        }
Example #18
0
        public override void Fight()
        {
            base.Fight();
            this.AddNoAbilityFlag(ObjAbilityType.ObjAbility_Move);
            this.AddNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneCrit);
            FrameCommand <AttackPositionCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();

            frameCommand.cmdId            = 1u;
            frameCommand.cmdData.WorldPos = this.actor.location;
            base.CmdAttackMoveToDest(frameCommand, this.actor.location);
            if (this.isTower)
            {
                this.HitEffect.Reset(this);
            }
            this.actor.ValueComponent.mActorValue[34].baseValue = this.actor.TheStaticData.TheOrganOnlyInfo.PhyArmorHurtRate;
            this._aroundEnemyMonsterCount = 0;
            ValueDataInfo valueDataInfo = this.actor.ValueComponent.mActorValue[3] + this.actor.TheStaticData.TheOrganOnlyInfo.NoEnemyAddPhyDef;

            valueDataInfo = this.actor.ValueComponent.mActorValue[4] + this.actor.TheStaticData.TheOrganOnlyInfo.NoEnemyAddMgcDef;
            if (this.actor.HorizonMarker != null)
            {
                if (FogOfWar.enable)
                {
                    if (this.GetActorSubType() == 1 || this.GetActorSubType() == 4)
                    {
                        this.actor.HorizonMarker.SightRadius = Horizon.QueryFowTowerSightRadius();
                    }
                    this.TarEyeList_ = new List <PoolObjHandle <ActorRoot> >();
                }
                else
                {
                    this.actor.HorizonMarker.SightRadius = this.actor.TheStaticData.TheOrganOnlyInfo.HorizonRadius;
                }
            }
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SwitchActorAutoAICommand> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchActorAutoAICommand>();

            frameCommand.cmdData.IsAutoAI = msg.stCmdInfo.get_stCmdPlayerSwithAutoAI().chIsAutoAI;
            return(frameCommand);
        }
Example #20
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <AttackActorCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <AttackActorCommand>();

            frameCommand.cmdData.ObjectID = (uint)msg.stCmdInfo.get_stCmdPlayerAttackPlayer().iObjectID;
            return(frameCommand);
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerCheatCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerCheatCommand>();

            frameCommand.cmdData.CheatType = msg.stCmdInfo.stCmdPlayerCheat.bCheatType;
            return(frameCommand);
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerBuyEquipCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerBuyEquipCommand>();

            frameCommand.cmdData.m_equipID = msg.stCmdInfo.get_stCmdPlayerBuyEquip().wEquipID;
            return(frameCommand);
        }
Example #23
0
        private void RequestUseSkillSelectMode(uint objID)
        {
            Skill skill = (this.NextSkillObj == null) ? this.SkillObj : this.NextSkillObj;

            if (((objID == 0) || (skill == null)) || ((skill.cfgData == null) || !this.IsEnableSkillSlot()))
            {
                MonoSingleton <CameraSystem> .GetInstance().SetFocusActor(this.Actor);
            }
            else
            {
                PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(objID);

                if ((actor == 0) || actor.handle.ActorControl.IsDeadState)
                {
                    MonoSingleton <CameraSystem> .GetInstance().SetFocusActor(this.Actor);
                }
                else if (Singleton <SkillDetectionControl> .GetInstance().Detection((SkillUseRule)skill.cfgData.dwSkillUseRule, this))
                {
                    FrameCommand <UseObjectiveSkillCommand> command = FrameCommandFactory.CreateCSSyncFrameCommand <UseObjectiveSkillCommand>();
                    command.cmdData.ObjectID = objID;
                    command.cmdData.SlotType = this.SlotType;
                    command.cmdData.iSkillID = skill.SkillID;
                    command.Send(true);
                }
                else
                {
                    MonoSingleton <CameraSystem> .GetInstance().SetFocusActor(this.Actor);
                }
            }
        }
 public void UseSkillCacheLerpMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed)
 {
     if (!_actorRoot)
     {
         return;
     }
     if (this.cacheMoveCommand != null && !this.cacheMoveExpire && this.cacheMoveCommand.cmdType == 131)
     {
         FrameCommand <MoveDirectionCommand> frameCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
         if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move))
         {
             VInt3   vInt     = VInt3.right.RotateY((int)frameCommand.cmdData.Degree);
             Vector3 position = _actorRoot.handle.myTransform.position;
             VInt3   vInt2    = vInt.NormalizeTo(_moveSpeed * _deltaTime / 1000);
             VInt    vInt3    = 0;
             vInt2 = PathfindingUtility.MoveLerp(_actorRoot, (VInt3)position, vInt2, out vInt3);
             if (_actorRoot.handle.MovementComponent.isFlying)
             {
                 float y = position.y;
                 _actorRoot.handle.myTransform.position += (Vector3)vInt2;
                 Vector3 position2 = _actorRoot.handle.myTransform.position;
                 position2.y = y;
                 _actorRoot.handle.myTransform.position = position2;
             }
             else
             {
                 _actorRoot.handle.myTransform.position += (Vector3)vInt2;
             }
         }
     }
 }
Example #25
0
        public override void Process(Action _action, Track _track)
        {
            Vector3    vector     = this.TargetPos;
            GameObject gameObject = _action.GetGameObject(this.destId);

            if (gameObject != null)
            {
                vector = gameObject.transform.position;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.srcId);

            if (!actorHandle || (hostPlayer.Captain && actorHandle == hostPlayer.Captain))
            {
                ObjWrapper actorControl = hostPlayer.Captain.get_handle().ActorControl;
                if (actorControl != null)
                {
                    FrameCommandFactory.CreateFrameCommand <StopMoveCommand>().Send();
                    FrameCommand <MoveToPosCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>();
                    frameCommand.cmdData.destPosition = (VInt3)vector;
                    frameCommand.Send();
                }
            }
            else if (actorHandle)
            {
                actorHandle.get_handle().ActorControl.RealMovePosition((VInt3)vector, 0u);
            }
        }
Example #26
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <SwitchCaptainCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>();

            frameCommand.cmdData.ObjectID = (uint)msg.stCmdInfo.stCmdPlayerSwitchCaptain.iObjectID;
            return(frameCommand);
        }
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerSellEquipCommand> command = FrameCommandFactory.CreateFrameCommand <PlayerSellEquipCommand>();

            command.cmdData.m_equipIndex = msg.stCmdInfo.stCmdPlayerSellEquip.bEquipIndex;
            return(command);
        }
Example #28
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayAttackTargetModeCommand> command = FrameCommandFactory.CreateFrameCommand <PlayAttackTargetModeCommand>();

            command.cmdData.AttackTargetMode = msg.stCmdInfo.stCmdPlayerAttackTargetMode.chAttackTargetMode;
            return(command);
        }
Example #29
0
 public void UseSkillCacheLerpMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed)
 {
     if ((_actorRoot != 0) && (((this.cacheMoveCommand != null) && !this.cacheMoveExpire) && (this.cacheMoveCommand.cmdType == 2)))
     {
         FrameCommand <MoveDirectionCommand> cacheMoveCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
         if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move))
         {
             VInt3   num      = VInt3.right.RotateY(cacheMoveCommand.cmdData.Degree);
             Vector3 position = _actorRoot.handle.gameObject.transform.position;
             VInt3   delta    = num.NormalizeTo((_moveSpeed * _deltaTime) / 0x3e8);
             VInt    groundY  = 0;
             delta = PathfindingUtility.MoveLerp((ActorRoot)_actorRoot, (VInt3)position, delta, out groundY);
             if (_actorRoot.handle.MovementComponent.isFlying)
             {
                 float     y         = position.y;
                 Transform transform = _actorRoot.handle.gameObject.transform;
                 transform.position += (Vector3)delta;
                 Vector3 vector2 = _actorRoot.handle.gameObject.transform.position;
                 vector2.y = y;
                 _actorRoot.handle.gameObject.transform.position = vector2;
             }
             else
             {
                 Transform transform2 = _actorRoot.handle.gameObject.transform;
                 transform2.position += (Vector3)delta;
             }
         }
     }
 }
Example #30
0
        public static IFrameCommand Creator(ref FRAME_CMD_PKG msg)
        {
            FrameCommand <PlayerChooseEquipSkillCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerChooseEquipSkillCommand>();

            frameCommand.cmdData.m_iEquipSlotIndex = (int)msg.stCmdInfo.get_stCmdPlayerChooseEquipSkill().bEquipSlotIndex;
            return(frameCommand);
        }
Example #31
0
 protected void SetMotionStatus(FrameCommand x, FrameCommand d1, FrameCommand d2)
 {
     RunCommand(Command.MOTION_CTRL, new byte[] { (byte)x, (byte)d1, (byte)d2 }, 5);
 }
Example #32
0
 protected void ControlFrame(FrameCommand command)
 {
     RunCommand(Command.FBUF_CTRL, new byte[] { (byte)command }, 5);
 }