本文整理汇总了C#中InternalItem.OnMoveOver方法的典型用法代码示例。如果您正苦于以下问题:C# InternalItem.OnMoveOver方法的具体用法?C# InternalItem.OnMoveOver怎么用?C# InternalItem.OnMoveOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InternalItem
的用法示例。
在下文中一共展示了InternalItem.OnMoveOver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if (/*SpellHelper.CheckTown(p, Caster) && */CheckSequence())
{
//if (CheckSequence())
SpellHelper.GetSurfaceTop( ref p );
int dx = Caster.Location.X - p.X;
int dy = Caster.Location.Y - p.Y;
int rx = (dx - dy) * 44;
int ry = (dx + dy) * 44;
bool eastToWest;
if ( rx >= 0 && ry >= 0 )
{
eastToWest = false;
}
else if ( rx >= 0 )
{
eastToWest = true;
}
else if ( ry >= 0 )
{
eastToWest = true;
}
else
{
eastToWest = false;
}
Effects.PlaySound(p, Caster.Map, Sound);
int itemID = eastToWest ? 0x398C : 0x3996;
TimeSpan duration;
if ( Core.AOS )
duration = TimeSpan.FromSeconds( (15 + (Caster.Skills.Magery.Fixed / 5)) / 4 );
else
duration = TimeSpan.FromSeconds( 4.0 + (Caster.Skills[SkillName.Magery].Value * 0.5) );
List<InternalItem> itemList = new List<InternalItem>();
for ( int i = -3; i <= 3; ++i )
{
Point3D loc = new Point3D( eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z );
//bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false);
//if (!canFit)
// continue;
IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);
foreach (Mobile m in eable)
{
if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
continue;
//Taran: The whole field counts as a harmful action, not just the target
if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
Caster.DoHarmful(m);
if (m is BaseCreature)
((BaseCreature)m).OnHarmfulSpell(Caster);
}
InternalItem toAdd = new InternalItem( itemID, loc, Caster, Caster.Map, duration, i );
itemList.Add(toAdd);
}
if (itemList.Count > 0)
new SoundTimer(itemList, Sound).Start();
if (SphereSpellTarget is Mobile)
{
InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3);
castItem.OnMoveOver(SphereSpellTarget as Mobile);
//Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile
castItem.Delete();
}
}
FinishSequence();
}
示例2: Target
public void Target(IPoint3D p)
{
if (!Caster.CanSee(p))
{
Caster.SendAsciiMessage("Target is not in line of sight.");
DoFizzle();
}
else if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if (/*SpellHelper.CheckTown(p, Caster) && */CheckSequence())
{
SpellHelper.GetSurfaceTop(ref p);
int dx = Caster.Location.X - p.X;
int dy = Caster.Location.Y - p.Y;
int rx = (dx - dy)*44;
int ry = (dx + dy)*44;
bool eastToWest;
if (rx >= 0 && ry >= 0)
{
eastToWest = false;
}
else if (rx >= 0)
{
eastToWest = true;
}
else if (ry >= 0)
{
eastToWest = true;
}
else
{
eastToWest = false;
}
Effects.PlaySound(p, Caster.Map, Sound);
int itemID = eastToWest ? 0x3915 : 0x3922;
TimeSpan duration = TimeSpan.FromSeconds(3 + (Caster.Skills.Magery.Fixed/25));
List<InternalItem> itemList = new List<InternalItem>();
for (int i = -3; i <= 3; ++i)
{
Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);
foreach (Mobile m in eable)
{
if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
continue;
//Taran: The whole field counts as a harmful action, not just the target
if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
Caster.DoHarmful(m);
}
InternalItem item = new InternalItem(itemID, loc, Caster, Caster.Map, duration, i);
itemList.Add(item);
}
if (SphereSpellTarget is Mobile)
{
InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3);
castItem.OnMoveOver(SphereSpellTarget as Mobile);
//Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile
castItem.Delete();
}
if (itemList.Count > 0)
new SoundTimer(itemList, 517).Start();
FinishSequence();
}
}
示例3: Target
public void Target(IPoint3D p)
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if (CheckSequence())
{
SpellHelper.GetSurfaceTop(ref p);
int dx = Caster.Location.X - p.X;
int dy = Caster.Location.Y - p.Y;
int rx = (dx - dy) * 44;
int ry = (dx + dy) * 44;
bool eastToWest;
if (rx >= 0 && ry >= 0)
eastToWest = false;
else if (rx >= 0)
eastToWest = true;
else if (ry >= 0)
eastToWest = true;
else
eastToWest = false;
Effects.PlaySound(p, Caster.Map, Sound);
int itemID = eastToWest ? 0x3967 : 0x3979;
TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value / 3.0));
List<Item> itemList = new List<Item>();
for (int i = -3; i <= 3; ++i)
{
Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
//bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false);
//if (!canFit)
// continue;
IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);
foreach (Mobile m in eable)
{
if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
continue;
//Taran: The whole field counts as a harmful action, not just the target
if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
Caster.DoHarmful(m);
if (m is BaseCreature)
((BaseCreature)m).OnHarmfulSpell(Caster);
}
Item item = new InternalItem(Caster, itemID, loc, Caster.Map, duration);
itemList.Add(item);
item.ProcessDelta();
}
if (itemList.Count > 0)
new FreezeTimer(itemList, Sound, duration.Seconds).Start();
if (SphereSpellTarget is Mobile)
{
InternalItem castItem = new InternalItem(Caster, itemID, (SphereSpellTarget as Mobile).Location, Caster.Map, duration);
castItem.OnMoveOver(SphereSpellTarget as Mobile);
//Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile
castItem.Delete();
if (SphereSpellTarget is BaseCreature && ((BaseCreature)SphereSpellTarget).ParalyzeImmune)
((Mobile)SphereSpellTarget).PublicOverheadMessage(MessageType.Emote, 0x3B2, true, "The paralyze spell seems to have no effect");
}
//Mobile mob = SphereSpellTarget as Mobile;
/*if (mob != null)
{
InternalItem castItem = new InternalItem(Caster, itemID, mob.Location, Caster.Map, duration);
castItem.OnMoveOver(mob);
Caster.DoHarmful(mob);
castItem.Delete();
}*/
}
FinishSequence();
}