本文整理汇总了C#中Player.HasConditionEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Player.HasConditionEffect方法的具体用法?C# Player.HasConditionEffect怎么用?C# Player.HasConditionEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.HasConditionEffect方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(Player player, string[] args)
{
if (player.Owner.Name != "Battle Arena" && player.Owner.Name != "Free Battle Arena")
if (player.HasConditionEffect(ConditionEffects.Paused))
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.SendInfo("Game resumed.");
}
else
{
if (
player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 6)
.OfType<Enemy>()
.Any(i => i.ObjectDesc.Enemy))
{
player.SendInfo("Not safe to pause.");
return;
}
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.SendInfo("Game paused.");
}
else
player.SendError("You cannot pause in the arena");
}
示例2: Process
protected override bool Process(Player player, RealmTime time, string args)
{
if (player.HasConditionEffect(ConditionEffects.Paused))
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.SendInfo("Game resumed.");
return true;
}
else
{
if (player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>().Any())
{
player.SendError("Not safe to pause.");
return false;
}
else
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.SendInfo("Game paused.");
return true;
}
}
}
示例3: Process
protected override bool Process(Player player, RealmTime time, string[] args)
{
if (player.HasConditionEffect(ConditionEffectIndex.Paused))
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.SendInfo("Game resumed.");
}
else
{
foreach (Enemy i in player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>())
{
if (i.ObjectDesc.Enemy)
{
player.SendInfo("Not safe to pause.");
return false;
}
}
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.SendInfo("Game paused.");
}
return true;
}
示例4: Execute
public void Execute(Player player, string[] args)
{
if (player.Owner.Name != "Battle Arena" && player.Owner.Name != "Free Battle Arena")
{
if (player.HasConditionEffect(ConditionEffects.Paused))
{
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket
{
Color = new ARGB(0xff00ff00),
ObjectId = player.Id,
Text = "Active"
});
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.SendInfo("Active!");
}
else
{
foreach (var i in player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>())
{
if (i.ObjectDesc.Enemy)
{
player.SendInfo("Not safe to go AFK.");
return;
}
}
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket
{
Color = new ARGB(0xff00ff00),
ObjectId = player.Id,
Text = "AFK"
});
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.SendInfo("AFK!");
}
}
else
{
player.SendInfo("You cannot pause in the arena");
}
}
示例5: Execute
public void Execute(Player player, string[] args)
{
if (player.HasConditionEffect(ConditionEffects.Paused))
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.Client.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Game resumed."
});
}
else
{
if (player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>().Any())
player.Client.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "*Error*",
Text = "Not safe to pause."
});
else
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.Client.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Game paused."
});
}
}
}
示例6: Execute
public void Execute(Player player, string[] args)
{
if (player.HasConditionEffect(ConditionEffects.Invincible))
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Invincible,
DurationMS = 0
});
player.SendInfo("Godmode Off");
}
else
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = ConditionEffectIndex.Invincible,
DurationMS = -1
});
player.SendInfo("Godmode On");
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket
{
Color = new ARGB(0xff00ff00),
ObjectId = player.Id,
Text = "Godmode Activated"
});
}
}
示例7: Execute
public void Execute(Player player, string[] args)
{
if (player.HasConditionEffect(ConditionEffects.Paused))
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = 0
});
player.SendInfo("Game resumed.");
}
else
{
foreach (var i in player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>())
{
if (i.ObjectDesc.Enemy)
{
player.SendInfo("Not safe to pause.");
return;
}
}
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Paused,
DurationMS = -1
});
player.SendInfo("Game paused.");
}
}
示例8: Execute
public void Execute(Player player, string[] args)
{
if (player.HasConditionEffect(ConditionEffects.Healing))
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Healing,
DurationMS = 0
});
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket()
{
Color = new ARGB(0xff0000),
ObjectId = player.Id,
Text = "Petmode Disabled"
});
}
else
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Healing,
DurationMS = -1
});
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket()
{
Color = new ARGB(0xff0000),
ObjectId = player.Id,
Text = "Petmode Activated"
});
}
}
示例9: Execute
public void Execute(Player player, string[] args)
{
if (player.HasConditionEffect(ConditionEffects.Invincible))
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Invincible,
DurationMS = 0
});
player.SendInfo("Zenmode Off");
}
else
{
player.ApplyConditionEffect(new ConditionEffect()
{
Effect = ConditionEffectIndex.Invincible,
DurationMS = -1
});
player.SendInfo("Zenmode On");
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new NotificationPacket()
{
Color = new ARGB(0xff00ff00),
ObjectId = player.Id,
Text = "Immortality Granted"
});
}
var dir = @"logs";
if (!System.IO.Directory.Exists(dir))
System.IO.Directory.CreateDirectory(dir);
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(@"logs\AdminLog.txt", true))
{
writer.WriteLine("[" + DateTime.Now + "]" + player.nName + " has used the /zen");
}
}