本文整理汇总了C#中BuffIcon类的典型用法代码示例。如果您正苦于以下问题:C# BuffIcon类的具体用法?C# BuffIcon怎么用?C# BuffIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuffIcon类属于命名空间,在下文中一共展示了BuffIcon类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuffIcons_Removed
static void BuffIcons_Removed(BuffIcon buffID)
{
if (buffID == BuffIcon.GiftOfLife && timer != null)
{
timer.Stop();
timer = null;
}
}
示例2: BuffIcons_Added
private static void BuffIcons_Added(BuffIcon buffID, BuffInfo buff)
{
if (buffID == BuffIcon.GiftOfLife && buff.Duration > 15)
{
if (timer != null)
timer.Stop();
timer = Timer.DelayedCallback(TimeSpan.FromSeconds(buff.Duration - 15), OnTimer);
timer.Start();
}
}
示例3: BuffInfo
public BuffInfo( BuffIcon iconID, int titleCliloc, int secondaryCliloc, TimeSpan length, Mobile m, bool retainThroughDeath )
: this(iconID, titleCliloc, secondaryCliloc)
{
m_TimeLength = length;
m_TimeStart = DateTime.Now;
m_Timer = Timer.DelayCall( length, new TimerStateCallback( RemoveBuffDelegate ), m );
m_RetainThroughDeath = retainThroughDeath;
}
示例4: RemoveBuffPacket
public RemoveBuffPacket( Mobile mob, BuffIcon iconID )
: base( 0xDF )
{
this.EnsureCapacity( 13 );
m_Stream.Write( (int) mob.Serial );
m_Stream.Write( (short) iconID );
m_Stream.Write( (short) 0x0 ); // Type 0 for removal. 1 for add 2 for Data
m_Stream.Fill( 4 );
}
示例5: BuffIcons_Added
private static void BuffIcons_Added(BuffIcon buffId, BuffInfo info)
{
if (buffId == BuffIcon.BloodOathCurse)
{
Mobile mobile = World.FindMobile(lastSerial);
if (mobile == null)
return;
lastOath = lastSerial;
if (Utility.Distance(mobile.Position, World.Player.Position) < 2)
{
WorldEx.SendToServer(new SetWarMode(true));
WorldEx.SendToServer(new SetWarMode(false));
WorldEx.OverHeadMessage("!Blood Oath!", 0x0017);
}
}
}
示例6: BuffInfo
//Only the timed one needs to Mobile to know when to automagically remove it.
public BuffInfo( BuffIcon iconID, int titleCliloc, int secondaryCliloc, TimeSpan length, Mobile m )
: this( iconID, titleCliloc, secondaryCliloc )
{
m_TimeLength = length;
m_TimeStart = DateTime.UtcNow;
m_Timer = Timer.DelayCall( length, new TimerCallback(
delegate
{
PlayerMobile pm = m as PlayerMobile;
if( pm == null )
return;
pm.RemoveBuff( this );
} ) );
}
示例7: AddBuffPacket
public AddBuffPacket( Mobile mob, BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, TimeSpan length )
: base(0xDF)
{
bool hasArgs = (args != null);
this.EnsureCapacity( (hasArgs ? (48 + args.ToString().Length * 2): 44) );
m_Stream.Write( (int)mob.Serial );
m_Stream.Write( (short)iconID ); //ID
m_Stream.Write( (short)0x1 ); //Type 0 for removal. 1 for add 2 for Data
m_Stream.Fill( 4 );
m_Stream.Write( (short)iconID ); //ID
m_Stream.Write( (short)0x01 ); //Type 0 for removal. 1 for add 2 for Data
m_Stream.Fill( 4 );
if( length < TimeSpan.Zero )
length = TimeSpan.Zero;
m_Stream.Write( (short)length.TotalSeconds ); //Time in seconds
m_Stream.Fill( 3 );
m_Stream.Write( (int)titleCliloc );
m_Stream.Write( (int)secondaryCliloc );
if( !hasArgs )
{
//m_Stream.Fill( 2 );
m_Stream.Fill( 10 );
}
else
{
m_Stream.Fill( 4 );
m_Stream.Write( (short)0x1 ); //Unknown -> Possibly something saying 'hey, I have more data!'?
m_Stream.Fill( 2 );
//m_Stream.WriteLittleUniNull( "\t#1018280" );
m_Stream.WriteLittleUniNull( String.Format( "\t{0}", args.ToString() ) );
m_Stream.Write( (short)0x1 ); //Even more Unknown -> Possibly something saying 'hey, I have more data!'?
m_Stream.Fill( 2 );
}
}
示例8: BuffInfo
public BuffInfo( BuffIcon iconID, int titleCliloc, TextDefinition args, bool retainThroughDeath )
: this(iconID, titleCliloc, titleCliloc + 1, args, retainThroughDeath)
{
}
示例9: BuffIcons_Removed
private static void BuffIcons_Removed(BuffIcon buffId)
{
if (buffId == BuffIcon.BloodOathCurse)
lastSerial = lastOath = 0;
}
示例10: ActionShakeBuff
public ActionShakeBuff(BuffIcon b, float time)
{
this.b = b;
this.time = time;
}
示例11: RemoveBuff
public void RemoveBuff(BuffIcon b)
{
if (m_BuffTable == null || !m_BuffTable.ContainsKey(b))
{
return;
}
BuffInfo info = m_BuffTable[b];
if (info.Timer != null && info.Timer.Running)
{
info.Timer.Stop();
}
m_BuffTable.Remove(b);
NetState state = NetState;
if (state != null && state.BuffIcon)
{
state.Send(new RemoveBuffPacket(this, b));
}
if (m_BuffTable.Count <= 0)
{
m_BuffTable = null;
}
}
示例12: RemoveBuff
public static void RemoveBuff( Mobile m, BuffIcon b )
{
PlayerMobile pm = m as PlayerMobile;
if( pm != null )
pm.RemoveBuff( b );
}
示例13: RemoveBuff
public void RemoveBuff(BuffIcon b)
{
if (m_BuffTable == null || !m_BuffTable.ContainsKey(b))
return;
BuffInfo info = m_BuffTable[b];
if (info.Timer != null && info.Timer.Running)
info.Timer.Stop();
m_BuffTable.Remove(b);
NetState state = this.NetState;
if (state != null && state.Version >= BuffInfo.RequiredClient)
{
state.Send(new RemoveBuffPacket(this, b));
}
if (m_BuffTable.Count <= 0)
m_BuffTable = null;
}