當前位置: 首頁>>代碼示例>>C#>>正文


C# Ticker.TickTimer類代碼示例

本文整理匯總了C#中Mooege.Core.GS.Ticker.TickTimer的典型用法代碼示例。如果您正苦於以下問題:C# TickTimer類的具體用法?C# TickTimer怎麽用?C# TickTimer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TickTimer類屬於Mooege.Core.GS.Ticker命名空間,在下文中一共展示了TickTimer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Projectile

        private bool _spawned;  // using my own spawn flag cause Actor.Spawned isn't being used right now

        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Field7 = 0x00000001;  // TODO: test if this is necessary

            if (this.Scale == 0f)
                this.Scale = 1.00f;

            this.Context = context;
            this.Position = new Vector3D(position);
            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
            // 2 second default timeout for projectiles
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _prevUpdatePosition = null;
            _mover = new ActorMover(this);
            _spawned = false;
        }
開發者ID:RC1140,項目名稱:mooege,代碼行數:29,代碼來源:Projectile.cs

示例2: Projectile

        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Scale = 1.35f;
            // just use default? GBHandle.Projectile is 10, but most projectiles I see use 17
            //this.GBHandle.Type = (int)GBHandleType.Projectile; this.GBHandle.GBID = 1;
            this.Field7 = 0x00000001;
            // these no longer needed?
            //this.Field10 = 0x1;
            //this.Field11 = 0x1;
            //this.Field12 = 0x1;
            //this.Field13 = 0x1;
            //this.CollFlags = 0x4;
            
            this.Context = context;
            this.Position = new Vector3D(position);
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);  // 2 second default timeout for projectiles

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _arrivalTime = null;
            _lastUpdateTick = 0;
            _prevUpdatePosition = null;
            _onArrivalCalled = false;

            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
        }
開發者ID:n3rus,項目名稱:mooege,代碼行數:34,代碼來源:Projectile.cs

示例3: Run

        public sealed override IEnumerable<TickTimer> Run()
        {
            if (_runTimeout == null || _runTimeout.TimedOut)
            {
                _runTimeout = WaitSeconds(RunDelay);
                foreach (TickTimer timeout in RunChannel())
                    yield return timeout;
            }

            yield break;
        }
開發者ID:loonbg,項目名稱:mooege,代碼行數:11,代碼來源:ChanneledPower.cs

示例4: Think

        public override void Think(int tickCounter)
        {
            // this needed? /mdz
            //if (this.Body is NPC) return;

            // check if in disabled state, if so cancel any action then do nothing
            if (this.Body.Attributes[GameAttribute.Frozen] ||
                this.Body.Attributes[GameAttribute.Stunned] ||
                this.Body.Attributes[GameAttribute.Blind] ||
                this.Body.World.BuffManager.GetFirstBuff<Powers.Implementations.KnockbackBuff>(this.Body) != null)
            {
                if (this.CurrentAction != null)
                {
                    this.CurrentAction.Cancel(tickCounter);
                    this.CurrentAction = null;
                }
                _powerDelay = null;

                return;
            }

            // select and start executing a power if no active action
            if (this.CurrentAction == null)
            {
                // do a little delay so groups of monsters don't all execute at once
                if (_powerDelay == null)
                    _powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble());

                if (_powerDelay.TimedOut)
                {
                    
                    if (this.Body.GetObjectsInRange<Monster>(40f).Count != 0)
                    {
                        _target = this.Body.GetObjectsInRange<Monster>(40f)[0];
                        //System.Console.Out.WriteLine("Enemy in range, use powers");
                        //This will only attack when you and your minions are not moving..TODO: FIX.
                        int powerToUse = PickPowerToUse();
                        if (powerToUse > 0)
                            this.CurrentAction = new PowerAction(this.Body, powerToUse,_target);
                    }
                    else
                    {
                        //System.Console.Out.WriteLine("No enemies in range, return to master");
                        this.CurrentAction = new MoveToPointAction(this.Body, this.Body.CheckPointPosition);
                    }
                }
            }
        }
開發者ID:God601,項目名稱:mooege,代碼行數:48,代碼來源:AggressiveNPCBrain.cs

示例5: Think

        public override void Think(int tickCounter)
        {
            // this needed? /mdz
            if (this.Body is NPC) return;

            // check if in disabled state, if so cancel any action then do nothing
            if (this.Body.Attributes[GameAttribute.Frozen] ||
                this.Body.Attributes[GameAttribute.Stunned] ||
                this.Body.Attributes[GameAttribute.Blind] ||
                this.Body.World.BuffManager.GetFirstBuff<Powers.Implementations.KnockbackBuff>(this.Body) != null ||
                this.Body.World.BuffManager.GetFirstBuff<Powers.Implementations.SummonedBuff>(this.Body) != null)
            {
                if (this.CurrentAction != null)
                {
                    this.CurrentAction.Cancel(tickCounter);
                    this.CurrentAction = null;
                }
                _powerDelay = null;

                return;
            }


            // select and start executing a power if no active action
            if (this.CurrentAction == null)
            {
                // do a little delay so groups of monsters don't all execute at once
                if (_powerDelay == null)
                    _powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble());


                if (_powerDelay.TimedOut)
                {
                    int powerToUse = PickPowerToUse();
                    if (powerToUse > 0)
                    {
                        this.CurrentAction = new PowerAction(this.Body, powerToUse);
                    }
                }
            }
        }
開發者ID:loonbg,項目名稱:mooege,代碼行數:41,代碼來源:MonsterBrain.cs

示例6: Update

        public virtual void Update(int tickCounter)
        {
            if (Timeout != null && Timeout.TimedOut)
            {
                if (OnTimeout != null)
                    OnTimeout();

                this.Destroy();
            }
            else if (OnUpdate != null)
            {
                if (_updateTimer == null || _updateTimer.TimedOut)
                {
                    OnUpdate();
                    if (this.UpdateDelay > 0f)
                        _updateTimer = new SecondsTickTimer(this.Context.World.Game, this.UpdateDelay);
                    else
                        _updateTimer = null;
                }
            }
        }
開發者ID:loonbg,項目名稱:mooege,代碼行數:21,代碼來源:EffectActor.cs

示例7: Run

        public sealed override IEnumerable<TickTimer> Run()
        {
            // process channeled skill events
            if (IsChannelOpen)
            {
                OnChannelUpdated();
            }
            else  // first call to this skill's Run(), set channel as open
            {
                OnChannelOpen();
                IsChannelOpen = true;
            }

            // run main script if ready
            if (_effectTimeout == null || _effectTimeout.TimedOut)
            {
                _effectTimeout = WaitSeconds(EffectsPerSecond);
                foreach (TickTimer timeout in Main())
                    yield return timeout;
            }
        }
開發者ID:loonbg,項目名稱:mooege,代碼行數:21,代碼來源:ChanneledSkill.cs

示例8: SerenityAlliesBuff

 public SerenityAlliesBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:4,代碼來源:Monk.cs

示例9: ReclamationAura

 //AuraBuff
 public ReclamationAura(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:5,代碼來源:Monk.cs

示例10: ConvictionAura

 public ConvictionAura(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:4,代碼來源:Monk.cs

示例11: CastGroupBuff

 //grantee
 public CastGroupBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:5,代碼來源:Monk.cs

示例12: HealingShield

 //holyAuraRune_shield.efg
 public HealingShield(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:5,代碼來源:Monk.cs

示例13: IndigoDebuff

 public IndigoDebuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:4,代碼來源:Monk.cs

示例14: DOTbuff

 public DOTbuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:4,代碼來源:Monk.cs

示例15: SerenityBuff

 public SerenityBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
開發者ID:jujuman,項目名稱:mooege,代碼行數:4,代碼來源:Monk.cs


注:本文中的Mooege.Core.GS.Ticker.TickTimer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。