本文整理汇总了C#中Server.MirObjects.MapObject.IsFriendlyTarget方法的典型用法代码示例。如果您正苦于以下问题:C# MapObject.IsFriendlyTarget方法的具体用法?C# MapObject.IsFriendlyTarget怎么用?C# MapObject.IsFriendlyTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MirObjects.MapObject
的用法示例。
在下文中一共展示了MapObject.IsFriendlyTarget方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PetEnhancer
private void PetEnhancer(MapObject target, UserMagic magic, out bool cast)
{
cast = false;
if (target == null || target.Race != ObjectType.Monster || !target.IsFriendlyTarget(this)) return;
int duration = GetAttackPower(MinSC, MaxSC) + magic.GetPower();
cast = true;
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, duration, target);
ActionList.Add(action);
}
示例2: UltimateEnhancer
private void UltimateEnhancer(MapObject target, UserMagic magic, out bool cast)
{
cast = false;
if (target == null || !target.IsFriendlyTarget(this)) return;
UserItem item = GetAmulet(1);
if (item == null) return;
long expiretime = GetAttackPower(MinSC, MaxSC) * 2 + (magic.Level + 1) * 10;
int value = MaxSC >= 5 ? Math.Min(8, MaxSC / 5) : 1;
switch (target.Race)
{
case ObjectType.Monster:
case ObjectType.Player:
//Only targets
if (target.IsFriendlyTarget(this))
{
target.AddBuff(new Buff { Type = BuffType.UltimateEnhancer, Caster = this, ExpireTime = Envir.Time + expiretime * 1000, Values = new int[] { value } });
target.OperateTime = 0;
LevelMagic(magic);
ConsumeItem(item, 1);
cast = true;
}
break;
}
}
示例3: EnergyShield
private void EnergyShield(MapObject target, UserMagic magic, out bool cast)
{
cast = false;
if (!target.IsFriendlyTarget(this)) target = this; //offical is only party target
int duration = 30 + 50 * magic.Level;
int power = GetAttackPower(magic.GetPower(MinSC), magic.GetPower(MaxSC) + 1);
int chance = 9 - (Luck / 3 + magic.Level);
int[] values = { chance < 2 ? 2 : chance, power };
switch (target.Race)
{
case ObjectType.Player:
//Only targets
if (target.IsFriendlyTarget(this))
{
target.AddBuff(new Buff { Type = BuffType.EnergyShield, Caster = this, ExpireTime = Envir.Time + duration * 1000, Visible = true, Values = values });
target.OperateTime = 0;
LevelMagic(magic);
cast = true;
}
break;
}
}
示例4: Purification
private void Purification(MapObject target, UserMagic magic)
{
if (target == null || !target.IsFriendlyTarget(this)) return;
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, target);
ActionList.Add(action);
}
示例5: Healing
private void Healing(MapObject target, UserMagic magic)
{
if (target == null || !target.IsFriendlyTarget(this)) return;
int health = GetAttackPower(MinSC, MaxSC) * 2 + magic.GetPower() + Level;
DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, health, target);
ActionList.Add(action);
}
示例6: EnergyShields
private void EnergyShields(MapObject target, UserMagic magic, out bool cast)
{
cast = false;
if (target == null || !target.IsFriendlyTarget(this)) return;
UserItem item = GetAmulet(1);
if (item == null) return;
int expireTime = GetAttackPower(MinSC, MaxSC) * 2 + (magic.Level + 1) * 10;
//int value = MaxSC >= 5 ? Math.Min(8, MaxSC / 5) : 1;
ActionList.Add(new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, expireTime));
}