private static void OnStartMoving(RolePlayActor actor, MovementBehavior movement)
        {
            if (!AllowComparer)
                return;

            var bot = BotManager.Instance.GetCurrentBot();

            Task.Factory.StartNew(
                () =>
                {
                    var element = movement.TimedPath.GetCurrentElement();

                    bot.Character.HighlightCell(element.CurrentCell, Color.Green);

                    while(!movement.IsEnded())
                    {
                        var newElement = movement.TimedPath.GetCurrentElement();

                        if (element != newElement)
                        {
                            element = newElement;

                            bot.Character.ResetCellsHighlight();
                            bot.Character.HighlightCell(element.CurrentCell, Color.Green);
                        }

                        Thread.Sleep(30);
                    }
                });
        }
Ejemplo n.º 2
0
 public bool RemoveActor(RolePlayActor actor)
 {
     return m_actors.Remove(actor);
 }
Ejemplo n.º 3
0
 public void AddActor(RolePlayActor actor)
 {
     m_actors.Add(actor);
 }
Ejemplo n.º 4
0
 public void NotifyInteractiveUseEnded()
 {
     if (UsedBy != null)
     {
         UsedBy.NotifyInteractiveUseEnded();
         UsedBy = null;
     }
 }
Ejemplo n.º 5
0
        public void NotifyInteractiveUsed(InteractiveUsedMessage message)
        {
            var actor = Map.GetActor(message.entityId);
            var skill = EnabledSkills.Concat(DisabledSkills).FirstOrDefault(x => x.JobSkill != null && x.JobSkill.id == message.skillId);

            var evnt = Used;
            if (evnt != null)
                evnt(this, actor, skill, message.duration);

            if (actor != null)
            {
                actor.NotifyUseInteractive(this, skill, message.duration);

                if (message.duration > 0)
                    UsedBy = actor;
            }
        }