Implement Core.TickCount

Convert movement, actions (lift/use), combat, and spells to use Core.TickCount and avoid DateTime caveats (performance, system time dependency, etc)
Refactor DateTime.Now to DateTime.UtcNow
Add LOS check for Iron Maiden addon
This commit is contained in:
Mark Sturgill 2013-10-06 03:21:18 -07:00
parent f99eefb288
commit d2c670f5c3
241 changed files with 842 additions and 831 deletions

View file

@ -27,7 +27,7 @@ namespace Server.SkillHandlers
from.RevealingAction();
from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
from.Target = new InternalTarget( from, instrument );
from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
from.NextSkillTime = Core.TickCount + 21600000;
}
private class InternalTarget : Target
@ -43,7 +43,7 @@ namespace Server.SkillHandlers
protected override void OnTargetFinish( Mobile from )
{
if ( m_SetSkillTime )
from.NextSkillTime = DateTime.Now;
from.NextSkillTime = Core.TickCount;
}
protected override void OnTarget( Mobile from, object targeted )
@ -69,7 +69,7 @@ namespace Server.SkillHandlers
else
{
m_SetSkillTime = false;
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
from.NextSkillTime = Core.TickCount + 10000;
if ( targeted == from )
{
@ -89,7 +89,7 @@ namespace Server.SkillHandlers
}
else
{
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
from.NextSkillTime = Core.TickCount + 5000;
m_Instrument.PlayInstrumentWell( from );
m_Instrument.ConsumeUse( from );
@ -113,7 +113,7 @@ namespace Server.SkillHandlers
m.Warmode = false;
if ( m is BaseCreature && !((BaseCreature)m).BardPacified )
((BaseCreature)m).Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 1.0 ) );
((BaseCreature)m).Pacify( from, DateTime.UtcNow + TimeSpan.FromSeconds( 1.0 ) );
}
if ( !calmed )
@ -147,7 +147,7 @@ namespace Server.SkillHandlers
else if ( !BaseInstrument.CheckMusicianship( from ) )
{
from.SendLocalizedMessage( 500612 ); // You play poorly, and there is no effect.
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
from.NextSkillTime = Core.TickCount + 5000;
m_Instrument.PlayInstrumentBadly( from );
m_Instrument.ConsumeUse( from );
}
@ -170,7 +170,7 @@ namespace Server.SkillHandlers
m_Instrument.PlayInstrumentWell( from );
m_Instrument.ConsumeUse( from );
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
from.NextSkillTime = Core.TickCount + 5000;
if ( targ is BaseCreature )
{
BaseCreature bc = (BaseCreature)targ;
@ -187,7 +187,7 @@ namespace Server.SkillHandlers
else if ( seconds < 10 )
seconds = 10;
bc.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( seconds ) );
bc.Pacify( from, DateTime.UtcNow + TimeSpan.FromSeconds( seconds ) );
}
else
{