Esempio n. 1
0
 private void Elapsed(PlayerActor player)
 {
     if (Manager.Map.TutorialMode && Singleton <Resources> .IsInstance() && Manager.Map.GetTutorialProgress() == 14)
     {
         ActionPoint currentPoint       = player.CurrentPoint;
         int?        yotunbaiRegisterId = Singleton <Resources> .Instance.CommonDefine?.Tutorial?.YotunbaiRegisterID;
         if (Object.op_Inequality((Object)currentPoint, (Object)null) && yotunbaiRegisterId.HasValue && currentPoint.RegisterID == yotunbaiRegisterId.Value)
         {
             Manager.Map.SetTutorialProgress(15);
         }
     }
     if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null))
     {
         player.CurrentPoint.RemoveBooking((Actor)player);
         CommandArea commandArea = player.PlayerController.CommandArea;
         commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
         commandArea.RefreshCommands();
     }
     if (player.PlayerController.PrevStateName == "Follow")
     {
         player.PlayerController.ChangeState("Follow");
     }
     else
     {
         player.Controller.ChangeState("Normal");
     }
 }
        public void ProcessCommand(IExecutionContext context, Command command)
        {
            var commandExecutor = GetWorkerCommand(command.Event);

            if (commandExecutor == null)
            {
                throw new Exception(StringUtil.Loc("CommandNotFound2", CommandArea.ToLowerInvariant(), command.Event, CommandArea));
            }
            commandExecutor.Execute(context, command);
        }
        private void AddCommandableObject()
        {
            CommandArea commandArea = (!Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player)?.PlayerController?.CommandArea;

            if (Object.op_Equality((Object)commandArea, (Object)null))
            {
                return;
            }
            commandArea.AddCommandableObject((ICommandable)this);
        }
Esempio n. 4
0
        protected override void OnRelease(PlayerActor player)
        {
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null) && player.CurrentPoint.RemoveBooking((Actor)player))
            {
                player.CurrentPoint.SetImpossible(false, (Actor)player);
                CommandArea commandArea = player.PlayerController.CommandArea;
                commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
                commandArea.RefreshCommands();
            }
            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
        }
Esempio n. 5
0
        public void ProcessCommand(IExecutionContext context, Command command, IWorkerCommandRestrictionPolicy restrictionPolicy)
        {
            var commandExecutor = GetWorkerCommand(command.Event);

            if (commandExecutor == null)
            {
                throw new Exception(StringUtil.Loc("CommandNotFound2", CommandArea.ToLowerInvariant(), command.Event, CommandArea));
            }
            if (restrictionPolicy.isCommandAllowed(commandExecutor))
            {
                commandExecutor.Execute(context, command);
            }
            else
            {
                context.Warning(StringUtil.Loc("CommandNotAllowed", command.Area, command.Event));
            }
        }
        private void RemoveCommandableObject()
        {
            CommandArea commandArea = (!Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player)?.PlayerController?.CommandArea;

            if (Object.op_Equality((Object)commandArea, (Object)null))
            {
                return;
            }
            bool flag = commandArea.ContainsConsiderationObject((ICommandable)this);

            commandArea.RemoveCommandableObject((ICommandable)this);
            if (!flag)
            {
                return;
            }
            commandArea.RefreshCommands();
        }
Esempio n. 7
0
        protected override void OnRelease(PlayerActor player)
        {
            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null) && player.CurrentPoint.RemoveBooking((Actor)player))
            {
                player.CurrentPoint.SetImpossible(false, (Actor)player);
                CommandArea commandArea = player.PlayerController.CommandArea;
                commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
                commandArea.RefreshCommands();
            }
            player.Animation.ResetDefaultAnimatorController();
            int           index     = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.DoorOpen].Item1;
            ActorAnimInfo animInfo  = player.Animation.AnimInfo;
            PlayState     playState = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][player.PoseID];

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, playState.DirectionType);
            player.Animation.RefsActAnimInfo = true;
        }
        public void ProcessCommand(IExecutionContext context, Command command)
        {
            ArgUtil.NotNull(context, nameof(context));
            ArgUtil.NotNull(command, nameof(command));

            var commandExecutor = GetWorkerCommand(command.Event);

            if (commandExecutor == null)
            {
                throw new Exception(StringUtil.Loc("CommandNotFound2", CommandArea.ToLowerInvariant(), command.Event, CommandArea));
            }

            var checker = context.GetHostContext().GetService <ITaskRestrictionsChecker>();

            if (checker.CheckCommand(context, commandExecutor, command))
            {
                commandExecutor.Execute(context, command);
            }
        }
Esempio n. 9
0
        private void Elapsed(PlayerActor player)
        {
            DoorPoint currentPoint = player.CurrentPoint as DoorPoint;

            if (Object.op_Inequality((Object)currentPoint, (Object)null))
            {
                if (currentPoint.OpenType == DoorPoint.OpenTypeState.Right || currentPoint.OpenType == DoorPoint.OpenTypeState.Right90)
                {
                    currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenRight, true);
                }
                else
                {
                    currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenLeft, true);
                }
            }
            player.PlayerController.CommandArea.RefreshCommands();
            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null))
            {
                player.CurrentPoint.RemoveBooking((Actor)player);
                CommandArea commandArea = player.PlayerController.CommandArea;
                commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
                commandArea.RefreshCommands();
            }
            if (player.PlayerController.PrevStateName == "Onbu")
            {
                player.Controller.ChangeState(player.PlayerController.PrevStateName);
            }
            else if (player.PlayerController.PrevStateName == "Follow")
            {
                player.PlayerController.ChangeState("Follow");
            }
            else
            {
                player.Controller.ChangeState("Normal");
            }
        }
Esempio n. 10
0
        protected void InstallWorkerCommand(IWorkerCommand commandExecutor)
        {
            ArgUtil.NotNull(commandExecutor, nameof(commandExecutor));
            if (_commands.ContainsKey(commandExecutor.Name))
            {
                throw new Exception(StringUtil.Loc("CommandDuplicateDetected", commandExecutor.Name, CommandArea.ToLowerInvariant()));
            }
            _commands[commandExecutor.Name] = commandExecutor;
            var aliasList = commandExecutor.Aliases;

            if (aliasList != null)
            {
                foreach (var alias in commandExecutor.Aliases)
                {
                    if (_commands.ContainsKey(alias))
                    {
                        throw new Exception(StringUtil.Loc("CommandDuplicateDetected", alias, CommandArea.ToLowerInvariant()));
                    }
                    _commands[alias] = commandExecutor;
                }
            }
        }
 /// <summary>
 /// Defines possible usage location for <see cref="CommandAttribute">a command</see>.
 /// </summary>
 /// <param name="area">The area where <see cref="CommandAttribute">commands</see> can be used</param>
 public UsageAreaAttribute(CommandArea area) =>