Exemplo n.º 1
0
        public string Use(Actor actor, ActionSpeed speed = ActionSpeed.FAST)
        {
            if (actor.IsTransitioning)
            {
                return("");
            }

            //Reset the checked state on the lockers in the room the killer is leaving
            actor.Room.Objects.FindAll(x => x.Type == Interest.LOCKER).ToList().ForEach(locker => ((Locker)locker).Checked = false);

            actor.Room.Actors.Remove(actor);
            actor.IsTransitioning = true;
            Thread thread = new Thread(new ParameterizedThreadStart(CompleteTransition));

            thread.IsBackground = true;
            thread.Start(new RoomTransition()
            {
                Actor = actor, Speed = speed
            });

            if (actor.IsLocalPlayer)
            {
                var verb = ConnectorType == RoomConnectorType.DOOR ? "MOVE" : ConnectorType == RoomConnectorType.WINDOW ? "VAULT" : "RUN UP";
                return($"You ^yellow:{(speed == ActionSpeed.FAST ? "QUICKLY" : "SLOWLY")}$ ^yellow:{verb}$ ^white:{ConnectorType}$ to the {Direction}");
            }

            return("");
        }
Exemplo n.º 2
0
        public void Vault(Direction direction, ActionSpeed speed)
        {
            if (!CanPerformActions())
            {
                Game.Current.AddHistory(IsLocalPlayer ? "^red:You cannot ^yellow:VAULT$" : "");
                return;
            }

            if (Room.Connectors.ContainsKey(direction))
            {
                var connector = Room.Connectors[direction];

                if (connector.ConnectorType != RoomConnectorType.WINDOW && !IsPerkActive(PerkType.SPRINT))
                {
                    Game.Current.AddHistory(IsLocalPlayer ? $"You can't VAULT a {connector.ConnectorType}" : "");
                }
                else
                {
                    Game.Current.AddHistory(connector.Use(this, this is Killer ? ActionSpeed.SLOW : ActionSpeed.FAST));
                }
            }
            else
            {
                Game.Current.AddHistory(IsLocalPlayer ? $"There is nothing {direction} to VAULT" : "");
            }
        }
Exemplo n.º 3
0
        public void Move(Direction direction, ActionSpeed speed)
        {
            if (!CanPerformActions())
            {
                Game.Current.AddHistory(IsLocalPlayer ? "^red:You cannot ^yellow:MOVE$" : "");
                return;
            }

            if (Room.Connectors.ContainsKey(direction))
            {
                var connector = Room.Connectors[direction];

                if (connector.ConnectorType == RoomConnectorType.WINDOW && !IsPerkActive(PerkType.SPRINT))
                {
                    if (this is Survivor)
                    {
                        //Game.Current.AddHistory($"^green:{Name}$ runs into a ^white:WINDOW$");
                    }
                    //Game.Current.AddHistory(IsLocalPlayer ? "You run into the ^white:WINDOW$" : "");
                }
                else
                {
                    if (this is Survivor)
                    {
                        //Game.Current.AddHistory($"^green:{Name}$ goes into a new ^white:room$");
                    }
                    Game.Current.AddHistory(connector.Use(this, this is Killer ? ActionSpeed.SLOW : speed));
                }
            }
            else
            {
                Game.Current.AddHistory(IsLocalPlayer ? $"There is nothing to the {direction}" : "");
            }
        }
Exemplo n.º 4
0
 public ActionSpeedState(Drawable target, ActionSpeed action)
     : base(target, action)
 {
     Speed = action.Speed;
     InnerActionState = action.InnerAction.StartAction(target);
 }