本文整理汇总了C#中Server.MirObjects.MapObject类的典型用法代码示例。如果您正苦于以下问题:C# MapObject类的具体用法?C# MapObject怎么用?C# MapObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapObject类属于Server.MirObjects命名空间,在下文中一共展示了MapObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemObject
public ItemObject(MapObject dropper, uint gold, Point manuallocation)
{
ExpireTime = Envir.Time + Settings.ItemTimeOut * Settings.Minute;
Gold = gold;
CurrentMap = dropper.CurrentMap;
CurrentLocation = manuallocation;
}
示例2: ItemObject
public ItemObject(MapObject dropper, UserItem item, bool DeathDrop = false)
{
if (DeathDrop)//player dropped it when he died: allow for time to run back and pickup his drops
ExpireTime = Envir.Time + Settings.PlayerDiedItemTimeOut * Settings.Minute;
else
ExpireTime = Envir.Time + Settings.ItemTimeOut * Settings.Minute;
Item = item;
if (Item.IsAdded)
NameColour = Color.Cyan;
CurrentMap = dropper.CurrentMap;
CurrentLocation = dropper.CurrentLocation;
}
示例3: Remove
public void Remove(MapObject mapObject)
{
Objects.Remove(mapObject);
if (Objects.Count == 0) Objects = null;
}
示例4: Add
public void Add(MapObject mapObject)
{
if (Objects == null) Objects = new List<MapObject>();
Objects.Add(mapObject);
}
示例5: RemoveObject
public void RemoveObject(MapObject ob)
{
if (ob.Race == ObjectType.Player) Players.Remove((PlayerObject)ob);
if (ob.Race == ObjectType.Merchant) NPCs.Remove((NPCObject)ob);
GetCell(ob.CurrentLocation).Remove(ob);
}
示例6: SpecialArrowShot
public void SpecialArrowShot(MapObject target, UserMagic magic)
{
if (target == null || !target.IsAttackTarget(this)) return;
if ((Info.MentalState != 1) && !CanFly(target.CurrentLocation)) return;
int distance = Functions.MaxDistance(CurrentLocation, target.CurrentLocation);
int damage = (GetAttackPower(MinMC, MaxMC) + magic.GetPower());
if (magic.Spell != Spell.CrippleShot)
damage = (int)(damage * Math.Max(1, (distance * 0.4)));//range boost
damage = ApplyArcherState(damage);
int delay = distance * 50 + 500; //50 MS per Step
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, magic, damage, target);
ActionList.Add(action);
}
示例7: Pushed
public override int Pushed(MapObject pusher, MirDirection dir, int distance)
{
throw new NotSupportedException();
}
示例8: ApplyPoison
public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false)
{
throw new NotSupportedException();
}
示例9: ApplyPoison
public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false)
{
//FindTarget();
}
示例10: ApplyPoison
public abstract void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false);
示例11: DoKnockback
public void DoKnockback(MapObject target, UserMagic magic)//ElementalShot - knockback
{
Cell cell = CurrentMap.GetCell(target.CurrentLocation);
if (!cell.Valid || cell.Objects == null) return;
if (target.CurrentLocation.Y < 0 || target.CurrentLocation.Y >= CurrentMap.Height || target.CurrentLocation.X < 0 || target.CurrentLocation.X >= CurrentMap.Height) return;
if (target.Race != ObjectType.Monster && target.Race != ObjectType.Player) return;
if (!target.IsAttackTarget(this) || target.Level >= Level) return;
if (Envir.Random.Next(20) >= 6 + magic.Level * 3 + ElementsLevel + Level - target.Level) return;
int distance = 1 + Math.Max(0, magic.Level - 1) + Envir.Random.Next(2);
MirDirection dir = Functions.DirectionFromPoint(CurrentLocation, target.CurrentLocation);
target.Pushed(this, dir, distance);
}
示例12: ApplyPoison
public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false, bool ignoreDefence = true)
{
if ((Caster != null) && (!NoResist))
if (((Caster.Race != ObjectType.Player) || Settings.PvpCanResistPoison) && (Envir.Random.Next(Settings.PoisonResistWeight) < PoisonResist))
return;
if (!ignoreDefence && (p.PType == PoisonType.Green))
{
int armour = GetAttackPower(MinMAC, MaxMAC);
if (p.Value > armour)
p.PType = PoisonType.None;
else
p.Value -= armour;
}
if (p.Owner != null && p.Owner.Race == ObjectType.Player && Envir.Time > BrownTime && PKPoints < 200)
p.Owner.BrownTime = Envir.Time + Settings.Minute;
if ((p.PType == PoisonType.Green) || (p.PType == PoisonType.Red)) p.Duration = Math.Max(0, p.Duration - PoisonRecovery);
if (p.Duration == 0) return;
for (int i = 0; i < PoisonList.Count; i++)
{
if (PoisonList[i].PType != p.PType) continue;
if ((PoisonList[i].PType == PoisonType.Green) && (PoisonList[i].Value > p.Value)) return;//cant cast weak poison to cancel out strong poison
if ((PoisonList[i].PType != PoisonType.Green) && ((PoisonList[i].Duration - PoisonList[i].Time) > p.Duration)) return;//cant cast 1 second poison to make a 1minute poison go away!
if ((PoisonList[i].PType == PoisonType.Frozen) || (PoisonList[i].PType == PoisonType.Slow) || (PoisonList[i].PType == PoisonType.Paralysis) || (PoisonList[i].PType == PoisonType.LRParalysis)) return;//prevents mobs from being perma frozen/slowed
if (p.PType == PoisonType.DelayedExplosion) return;
ReceiveChat("You have been poisoned.", ChatType.System2);
PoisonList[i] = p;
return;
}
if (p.PType == PoisonType.DelayedExplosion)
{
ExplosionInflictedTime = Envir.Time + 4000;
Enqueue(new S.ObjectEffect { ObjectID = ObjectID, Effect = SpellEffect.DelayedExplosion });
Broadcast(new S.ObjectEffect { ObjectID = ObjectID, Effect = SpellEffect.DelayedExplosion });
ReceiveChat("You are a walking explosive.", ChatType.System);
}
else
ReceiveChat("You have been poisoned.", ChatType.System2);
PoisonList.Add(p);
}
示例13: OneWithNature
public void OneWithNature(MapObject target, UserMagic magic)
{
int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation);
CurrentMap.ActionList.Add(action);
}
示例14: ArcherSummon
public void ArcherSummon(UserMagic magic, MapObject target, Point location)
{
if (target != null && target.IsAttackTarget(this))
location = target.CurrentLocation;
if (!CanFly(location)) return;
uint duration = (uint)((magic.Level * 5 + 10) * 1000);
int value = (int)duration;
int delay = Functions.MaxDistance(CurrentLocation, location) * 50 + 500; //50 MS per Step
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, magic, value, location, target);
ActionList.Add(action);
}
示例15: NapalmShot
public void NapalmShot(MapObject target, UserMagic magic)
{
if (target == null || !target.IsAttackTarget(this)) return;
if ((Info.MentalState != 1) && !CanFly(target.CurrentLocation)) return;
int distance = Functions.MaxDistance(CurrentLocation, target.CurrentLocation);
int damage = (GetAttackPower(MinMC, MaxMC) + magic.GetPower());
damage = ApplyArcherState(damage);
int delay = distance * 50 + 500; //50 MS per Step
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, this, magic, damage, target.CurrentLocation);
CurrentMap.ActionList.Add(action);
}