• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Ticker.TickTimer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mooege.Core.GS.Ticker.TickTimer的典型用法代码示例。如果您正苦于以下问题:C# TickTimer类的具体用法?C# TickTimer怎么用?C# TickTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TickTimer类属于Mooege.Core.GS.Ticker命名空间,在下文中一共展示了TickTimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: CycloneDodgeBuff

 public CycloneDodgeBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
开发者ID:jujuman,项目名称:mooege,代码行数:4,代码来源:Monk.cs


示例17: FireDamageBuff

 //firedamage
 public FireDamageBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
开发者ID:jujuman,项目名称:mooege,代码行数:5,代码来源:Monk.cs


示例18: SpiritBuff

 //spirit
 public SpiritBuff(TickTimer timeout)
 {
     Timeout = timeout;
 }
开发者ID:jujuman,项目名称:mooege,代码行数:5,代码来源:Monk.cs


示例19: CastEffect

 //grantor
 public CastEffect(TickTimer timeout)
 {
     Timeout = timeout;
 }
开发者ID:jujuman,项目名称:mooege,代码行数:5,代码来源:Monk.cs


示例20: Stack

        public override bool Stack(Buff buff)
        {
            TimedBuff newbuff = (TimedBuff)buff;
            // update buff if new timeout is longer than current one, or if new buff has no timeout
            if (newbuff.Timeout == null || this.Timeout != null && newbuff.Timeout.TimeoutTick > this.Timeout.TimeoutTick)
                this.Timeout = newbuff.Timeout;

            return true;
        }
开发者ID:loonbg,项目名称:mooege,代码行数:9,代码来源:BaseBuffs.cs



注:本文中的Mooege.Core.GS.Ticker.TickTimer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Accounts.Account类代码示例发布时间:2022-05-26
下一篇:
C# Map.World类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap