本文整理汇总了C#中Server.MirObjects.MapObject.Attacked方法的典型用法代码示例。如果您正苦于以下问题:C# MapObject.Attacked方法的具体用法?C# MapObject.Attacked怎么用?C# MapObject.Attacked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MirObjects.MapObject
的用法示例。
在下文中一共展示了MapObject.Attacked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessSpell
public void ProcessSpell(MapObject ob)
{
if (Envir.Time < StartTime) return;
switch (Spell)
{
case Spell.FireWall:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MAC, false);
break;
case Spell.Healing: //SafeZone
if (ob.Race != ObjectType.Player && (ob.Race != ObjectType.Monster || ob.Master == null || ob.Master.Race != ObjectType.Player)) return;
if (ob.Dead || ob.HealAmount != 0 || ob.PercentHealth == 100) return;
ob.HealAmount += 25;
Broadcast(new S.ObjectEffect {ObjectID = ob.ObjectID, Effect = SpellEffect.Healing});
break;
case Spell.PoisonField:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.None, false);
if (!ob.Dead)
ob.ApplyPoison(new Poison
{
Duration = 15,
Owner = Caster,
PType = PoisonType.Green,
TickSpeed = 2000,
Value = Value/20
}, Caster);
break;
case Spell.Blizzard:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (Caster.ActiveBlizzard == false) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MACAgility, false);
if (!ob.Dead && Envir.Random.Next(8) == 0)
ob.ApplyPoison(new Poison
{
Duration = 5 + Envir.Random.Next(Caster.Freezing),
Owner = Caster,
PType = PoisonType.Slow,
TickSpeed = 2000,
}, Caster);
break;
case Spell.MeteorStrike:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (Caster.ActiveBlizzard == false) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MACAgility, false);
break;
}
}
示例2: ProcessSpell
public void ProcessSpell(MapObject ob)
{
if (Envir.Time < StartTime) return;
switch (Spell)
{
case Spell.FireWall:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MAC, false);
break;
case Spell.Healing: //SafeZone
if (ob.Race != ObjectType.Player && (ob.Race != ObjectType.Monster || ob.Master == null || ob.Master.Race != ObjectType.Player)) return;
if (ob.Dead || ob.HealAmount != 0 || ob.PercentHealth == 100) return;
ob.HealAmount += 25;
Broadcast(new S.ObjectEffect {ObjectID = ob.ObjectID, Effect = SpellEffect.Healing});
break;
case Spell.PoisonCloud:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.None, false);
if (!ob.Dead)
ob.ApplyPoison(new Poison
{
Duration = 15,
Owner = Caster,
PType = PoisonType.Green,
TickSpeed = 2000,
Value = Value/20
}, Caster, false, false);
break;
case Spell.Blizzard:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (Caster.ActiveBlizzard == false) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MAC, false);
if (!ob.Dead && Envir.Random.Next(8) == 0)
ob.ApplyPoison(new Poison
{
Duration = 5 + Envir.Random.Next(Caster.Freezing),
Owner = Caster,
PType = PoisonType.Slow,
TickSpeed = 2000,
}, Caster);
break;
case Spell.MeteorStrike:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (Caster.ActiveBlizzard == false) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MAC, false);
break;
case Spell.ExplosiveTrap:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
if (DetonatedTrap) return;//make sure explosion happens only once
DetonateTrapNow();
ob.Attacked(Caster, Value, DefenceType.MAC, false);
break;
case Spell.MapLava:
case Spell.MapLightning:
if (Value == 0) return;
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
ob.Struck(Value, DefenceType.MAC);
break;
case Spell.Portal:
if (ob.Race != ObjectType.Player) return;
if (Caster != ob && (Caster == null || (Caster.GroupMembers == null) || (!Caster.GroupMembers.Contains((PlayerObject)ob)))) return;
if (ExitMap == null) return;
MirDirection dir = ob.Direction;
Point newExit = Functions.PointMove(ExitCoord, dir, 1);
if (!ExitMap.ValidPoint(newExit)) return;
ob.Teleport(ExitMap, newExit, false);
break;
}
}
示例3: ProcessSpell
public void ProcessSpell(MapObject ob)
{
switch (Spell)
{
case Spell.FireWall:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.MAC, false);
break;
case Spell.Healing: //SafeZone
if (ob.Race != ObjectType.Player && (ob.Race != ObjectType.Monster || ob.Master == null || ob.Master.Race != ObjectType.Player)) return;
if (ob.Dead || ob.HealAmount != 0 || ob.PercentHealth == 100) return;
ob.HealAmount += 25;
Broadcast(new S.ObjectEffect {ObjectID = ob.ObjectID, Effect = SpellEffect.Healing});
break;
case Spell.PoisonField:
if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster) return;
if (ob.Dead) return;
if (!ob.IsAttackTarget(Caster)) return;
ob.Attacked(Caster, Value, DefenceType.None, false);
if (!ob.Dead)
ob.ApplyPoison(new Poison
{
Duration = 15,
Owner = Caster,
PType = PoisonType.Green,
TickSpeed = 2000,
Value = Value/20
});
break;
}
}