本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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;
}
}
}
示例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;
}
}
示例8: SerenityAlliesBuff
public SerenityAlliesBuff(TickTimer timeout)
{
Timeout = timeout;
}
示例9: ReclamationAura
//AuraBuff
public ReclamationAura(TickTimer timeout)
{
Timeout = timeout;
}
示例10: ConvictionAura
public ConvictionAura(TickTimer timeout)
{
Timeout = timeout;
}
示例11: CastGroupBuff
//grantee
public CastGroupBuff(TickTimer timeout)
{
Timeout = timeout;
}
示例12: HealingShield
//holyAuraRune_shield.efg
public HealingShield(TickTimer timeout)
{
Timeout = timeout;
}
示例13: IndigoDebuff
public IndigoDebuff(TickTimer timeout)
{
Timeout = timeout;
}
示例14: DOTbuff
public DOTbuff(TickTimer timeout)
{
Timeout = timeout;
}
示例15: SerenityBuff
public SerenityBuff(TickTimer timeout)
{
Timeout = timeout;
}