Tick() public method

public Tick ( IBehaviorHost host, RealmTime time ) : bool
host IBehaviorHost
time wServer.realm.RealmTime
return bool
Beispiel #1
0
        protected override bool TickCore(RealmTime time)
        {
            var chr = Host as Character;
            var w   = RealmManager.GetWorld(Host.Self.Owner.Id);

            while (doTimes > timesDone)
            {
                w.Timers.Add(new WorldTimer(cooldown, (world, t) =>
                {
                    try
                    {
                        timesDone++;
                    }
                    catch
                    {
                        timesDone++;
                    }
                }));


                return(behavior.Tick(Host, time));
            }

            return(false);
        }
Beispiel #2
0
        protected override bool TickCore(RealmTime time)
        {
            bool ret = false;

            foreach (var i in GetNearestEntitiesByGroup(radius, group))
            {
                ret |= behav.Tick(i, time);
            }
            return(ret);
        }
Beispiel #3
0
        protected override bool TickCore(RealmTime time)
        {
            var d = radius;
            var x = GetNearestEntity(ref d, objType);

            if (x != null)
            {
                return(behav.Tick(x, time));
            }
            return(false);
        }
Beispiel #4
0
        protected override bool TickCore(RealmTime time)
        {
            var enemy = Host as Enemy;

            if (new Random().Next(1, 100) <= percent)
            {
                return(result.Tick(Host, time));
            }

            return(false);
        }
Beispiel #5
0
        protected override bool TickCore(RealmTime time)
        {
            var  x   = GetNearestEntities(radius, objType);
            bool ret = false;

            foreach (var i in x)
            {
                ret = true;
                behav.Tick(i, time);
            }
            return(ret);
        }
Beispiel #6
0
 protected override void BehaveCore(BehaviorCondition cond, RealmTime?time, object state)
 {
     behav.Tick(Host, time.Value);
 }