本文整理汇总了C#中Server.Map类的典型用法代码示例。如果您正苦于以下问题:C# Map类的具体用法?C# Map怎么用?C# Map使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Map类属于Server命名空间,在下文中一共展示了Map类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CraftShopRegion
public CraftShopRegion( XmlElement xml, Map map, Region parent )
: base(xml, map, parent)
{
int skill = 0;
ReadInt32( xml, "skill", ref skill, true );
m_Skills = (CraftSkillType)skill;
}
示例2: TreasureRegion
private const int Range = 5;// No house may be placed within 5 tiles of the treasure
public TreasureRegion(int x, int y, Map map)
: base(null, map, Region.DefaultPriority, new Rectangle2D(x - Range, y - Range, 1 + (Range * 2), 1 + (Range * 2)))
{
this.GoLocation = new Point3D(x, y, map.GetAverageZ(x, y));
this.Register();
}
示例3: PlaySound
public static void PlaySound( IPoint3D p, Map map, int soundID )
{
if ( soundID <= -1 )
return;
if ( map != null )
{
Packet playSound = null;
IPooledEnumerable eable = map.GetClientsInRange( new Point3D( p ) );
foreach ( NetState state in eable )
{
state.Mobile.ProcessDelta();
if ( playSound == null )
playSound = Packet.Acquire( new PlaySound( soundID, p ) );
state.Send( playSound );
}
Packet.Release( playSound );
eable.Free();
}
}
示例4: Explode
public virtual void Explode( Mobile from, Point3D loc, Map map )
{
if ( Deleted || map == null )
return;
Consume();
// Check if any other players are using this potion
for ( int i = 0; i < m_Users.Count; i ++ )
{
ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;
if ( targ != null && targ.Potion == this )
Target.Cancel( from );
}
// Effects
Effects.PlaySound( loc, map, 0x20C );
for ( int i = -2; i <= 2; i ++ )
{
for ( int j = -2; j <= 2; j ++ )
{
Point3D p = new Point3D( loc.X + i, loc.Y + j, loc.Z );
if ( map.CanFit( p, 12, true, false ) && from.InLOS( p ) )
new InternalItem( from, p, map, MinDamage, MaxDamage );
}
}
}
示例5: OnExplode
public override void OnExplode( Mobile source, Item itemSource, int intensity, Point3D loc, Map map )
{
Server.Effects.PlaySound( loc, map, 0x22F );
int radius = 2; // for anything that's calling this, and is not a bomb
if ( itemSource is BombPotion )
{
BombPotion bomb = itemSource as BombPotion;
radius = bomb.ExplosionRange;
}
int delay = (int)(intensity * Divisor);
if ( delay <= 0 )
delay = 1;
TimeSpan time = TimeSpan.FromSeconds( delay );
List<Point3D> circlePoints = CircleHelper.CircleMidpoint( loc.X, loc.Y, loc.Z, radius, true );
Point3D eye = new Point3D( loc );
eye.Z += 14;
foreach( Point3D point in circlePoints )
{
Point3D target = new Point3D(point);
target.Z += 14;
if ( map.LineOfSight( eye, target ) )
{
FireTile tile = new FireTile( time+TimeSpan.FromSeconds( Utility.RandomDouble()*5 ), source, FireEffectType );
tile.MoveToWorld( point, map );
tile.AddCurrentOccupants();
}
}
}
示例6: CustomRegion
public CustomRegion( RegionControl m, Map map )
: base("", "Custom Region", map, typeof( WarriorGuard ))
{
LoadFromXml = false;
m_Controller = m;
}
示例7: MovementPath
public MovementPath(Mobile m, Point3D goal)
{
Point3D start = m.Location;
Map map = m.Map;
this.m_Map = map;
this.m_Start = start;
this.m_Goal = goal;
if (map == null || map == Map.Internal)
return;
if (Utility.InRange(start, goal, 1))
return;
try
{
PathAlgorithm alg = m_OverrideAlgorithm;
if (alg == null)
{
alg = FastAStarAlgorithm.Instance;
//if ( !alg.CheckCondition( m, map, start, goal ) ) // SlowAstar is still broken
// alg = SlowAStarAlgorithm.Instance; // TODO: Fix SlowAstar
}
if (alg != null && alg.CheckCondition(m, map, start, goal))
this.m_Directions = alg.Find(m, map, start, goal);
}
catch (Exception e)
{
Console.WriteLine("Warning: {0}: Pathing error from {1} to {2}", e.GetType().Name, start, goal);
}
}
示例8: DeleteMoonGate
private static int DeleteMoonGate(Map map, Point3D p)
{
Queue<Item> m_Queue = new Queue<Item>();
IPooledEnumerable eable = map.GetItemsInRange(p, 0);
foreach (Item item in eable)
{
if (item is PublicMoongate)
{
int delta = item.Z - p.Z;
if (delta >= -12 && delta <= 12)
m_Queue.Enqueue(item);
}
}
eable.Free();
int m_Count = m_Queue.Count;
while (m_Queue.Count > 0)
(m_Queue.Dequeue()).Delete();
return m_Count;
}
示例9: Sector
public Sector( int x, int y, Map owner )
{
m_X = x;
m_Y = y;
m_Owner = owner;
m_Active = false;
}
示例10: Explode
public virtual void Explode( Mobile from, Point3D loc, Map map )
{
if ( Deleted || map == null )
return;
Consume();
// Check if any other players are using this potion
for ( int i = 0; i < m_Users.Count; i ++ )
{
ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;
if ( targ != null && targ.Potion == this )
Target.Cancel( from );
}
// Effects
Effects.PlaySound( loc, map, 0x207 );
Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( BlastEffect ), 270, 90 );
Timer.DelayCall( TimeSpan.FromSeconds( 0.3 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } );
foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
{
if (mobile is BaseCreature)
{
BaseCreature mon = (BaseCreature) mobile;
mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
}
}
}
示例11: GetDestination
public override bool GetDestination( PlayerMobile player, ref Point3D loc, ref Map map )
{
QuestSystem qs = player.Quest;
if ( qs is EminosUndertakingQuest )
{
QuestObjective obj = qs.FindObjective( typeof( TakeBlueTeleporterObjective ) );
if ( obj != null )
{
if ( X == 423 && Y == 805 && Z == -1 )
{
loc = new Point3D( 411, 1116, 0 );
}
if ( X == 411 && Y == 1117 && Z == 0 )
{
loc = new Point3D( 424, 807, 0 );
}
map = Map.Malas;
return true;
}
}
return false;
}
示例12: QuestCompleteObjectiveRegion
public QuestCompleteObjectiveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
XmlElement questEl = xml["quest"];
ReadType( questEl, "type", ref m_Quest );
ReadType( questEl, "complete", ref m_Objective );
}
示例13: CheckItem
private static void CheckItem( Item item, Map oldMap )
{
if ( item.Map == null || item.Map == Map.Internal )
return;
if ( !m_Timers.ContainsKey( item ) )
{
MoonbindTimer timer = new MoonbindTimer( item );
timer.Start();
m_Timers.Add( item, timer );
}
Mobile parent = item.Parent as Mobile;
if ( parent != null )
{
bool sendMessage = oldMap != null && oldMap != Map.Internal && ( oldMap == Map.Felucca || item.Map == Map.Felucca );
if ( sendMessage )
{
if ( item.IsEphemeral() )
parent.SendLocalizedMessage( 1153088 ); // The power of the moon Felucca no longer strengthens your Faction gear.
else
parent.SendLocalizedMessage( 1153087 ); // The power of the moon Felucca strengthens your Faction gear.
}
}
item.InvalidateProperties();
}
示例14: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 2:
{
m_Level = reader.ReadInt();
goto case 1;
}
case 1:
{
m_TargetMap = reader.ReadMap();
break;
}
case 0:
{
m_TargetMap = Map.Trammel;
break;
}
}
if ( version < 2 )
m_Level = GetRandomLevel();
}
示例15: Explode
public virtual void Explode( Mobile from, Point3D loc, Map map )
{
if ( Deleted || map == null )
return;
Consume();
// Check if any other players are using this potion
for ( int i = 0; i < m_Users.Count; i ++ )
{
ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;
if ( targ != null && targ.Potion == this )
Target.Cancel( from );
}
// Add delay
AddDelay( from );
// Effects
Effects.PlaySound( loc, map, 0x207 );
EffectCircle( loc, map, Radius );
foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
{
if ( mobile is BaseCreature )
{
BaseCreature mon = (BaseCreature) mobile;
mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
}
}
}