Exemple #1
0
        public override void DoAction(Command p_command)
        {
            Grid        grid        = Grid;
            MoveCommand moveCommand = (MoveCommand)p_command;
            EDirection  edirection  = (EDirection)(((Int32)Party.Direction + (Int32)moveCommand.Direction) % (Int32)EDirection.COUNT);
            List <InteractiveObject> activeInteractiveObjects = grid.GetSlot(Party.Position).GetActiveInteractiveObjects(edirection);
            List <Trap> activeTraps = grid.GetSlot(Party.Position).GetActiveTraps(edirection);
            Boolean     flag        = grid.MoveEntity(Party, edirection);

            if (flag)
            {
                Party.MovementDone.Reset();
                LegacyLogic.Instance.GameTime.UpdateTime(grid.Type, ETimeChangeReason.Movement);
                GridSlot slot = grid.GetSlot(Party.Position);
                activeInteractiveObjects.AddRange(slot.GetActiveInteractiveObjects(EDirection.CENTER));
                activeTraps.AddRange(slot.GetActiveTraps(EDirection.CENTER));
                LegacyLogic.Instance.UpdateManager.InteractionsActor.AddObject(activeInteractiveObjects);
                if (!Party.HasAggro())
                {
                    CheckChestInFront();
                }
                foreach (Trap trap in activeTraps)
                {
                    trap.ResolveTrapEffect(grid, Party);
                }
                if (Party.HasSpotSecrets())
                {
                    grid.SpotSecrets(Party.Position, Party.Direction);
                }
                if (Party.HasClairvoyance())
                {
                    grid.SpotTraps(Party.Position, Party.Direction);
                }
                Party.SelectedInteractiveObject = null;
            }
        }