本文整理汇总了C#中Game.Logic.Phy.Object.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于Game.Logic.Phy.Object命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
{
switch (item.Property2)
{
case 0:
if (player.IsLiving)
{
player.AddBlood(item.Property3);
}
break;
case 1:
List<Player> temps = player.Game.GetAllFightPlayers();
foreach (Player p in temps)
{
if (p.IsLiving && p.Team == player.Team)
{
p.AddBlood(item.Property3);
}
}
break;
default:
break;
}
}
示例2: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.HasPaymentTakeCard == false)
{
if (player.PlayerDetail.RemoveMoney(100) > 0&&player.PlayerDetail.RemoveGiftToken(429)>0)
{
int index = packet.ReadByte();
player.CanTakeOut += 1;
player.FinishTakeCard = false;
player.HasPaymentTakeCard = true;
player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_PaymentTakeCard, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
if (index < 0 || index > game.Cards.Length)
{
game.TakeCard(player);
}
else
{
game.TakeCard(player, index);
}
}
else
{
player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.PaymentTakeCard);
}
}
}
示例3: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if(game is PVEGame)
{
PVEGame pve = game as PVEGame;
int tryAgain = packet.ReadInt();
bool isHost = packet.ReadBoolean();
if (isHost == true)
{
if (tryAgain == 1)
{
if (player.PlayerDetail.RemoveMoney(100) > 0)
{
//退回关卡结算
pve.WantTryAgain = 1;
game.SendToAll(packet);
player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_TryAgain, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
}
else
{
player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.TryAgain);
}
}
else
{
//退回房间
pve.WantTryAgain = 0;
game.SendToAll(packet);
}
pve.CheckState(0);
}
}
}
示例4: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.Skip(packet.ReadByte());
}
}
示例5: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (game.GameState != eGameState.Playing || player.GetSealState())
return;
int type = packet.ReadByte();
int place = packet.ReadInt();
int templateID = packet.ReadInt();
ItemTemplateInfo template = ItemMgr.FindItemTemplate(templateID);
if (player.CanUseItem(template))
{
//if (player.CurrentBall.ID == 3 && template.TemplateID == 10003)
// return;
//if (player.PlayerDetail.UsePropItem(game, type, place, templateID, player.IsLiving))
//{
// if (player.UseItem(template) == false)
// {
// BaseGame.log.Error("Using prop error");
// }
//}
if (player.PlayerDetail.UsePropItem(game, type, place, templateID, player.IsLiving))
{
if (player.UseItem(template) == false)
{
BaseGame.log.Error("Using prop error");
}
}
else
{
player.UseItem(template);
}
}
}
示例6: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (game is PVEGame)
{
PVEGame pve = game as PVEGame;
if (pve.BossCardCount + 1 > 0)
{
int index = packet.ReadByte();
if (index < 0 || index > pve.BossCards.Length)
{
if (pve.IsBossWar != "")
{
pve.TakeBossCard(player);
}
else pve.TakeCard(player);
}
else
{
if (pve.IsBossWar != "")
{
pve.TakeBossCard(player, index);
}
else pve.TakeCard(player, index);
}
}
}
}
示例7: LivingSealAction
public LivingSealAction(Living Living, Player target, int type, int delay)
: base(delay, 2000)
{
m_Living = Living;
m_Target = target;
m_Type = type;
}
示例8: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if(player.IsAttacking)
{
player.UseFlySkill();
}
}
示例9: OnRemovedFromPlayer
protected override void OnRemovedFromPlayer(Player player)
{
player.PlayerShoot -= new PlayerEventHandle(ChangeProperty);
player.AfterKillingLiving -= new KillLivingEventHanlde(player_AfterKillingLiving);
}
示例10: Execute
public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
{
if (player.IsLiving)
{
new SealEffect(item.Property3, 1).Start(player);
}
}
示例11: MoveToPlayer
public void MoveToPlayer(Player player)
{
int dis = Game.Random.Next(((SimpleNpc)Body).NpcInfo.MoveMin, ((SimpleNpc)Body).NpcInfo.MoveMax);
if (player.X > Body.X)
{
if (Body.X + dis >= player.X)
{
Body.MoveTo(player.X - 10, Body.Y, "walk", 2000, new LivingCallBack(Beat));
}
else
{
Body.MoveTo(Body.X + dis, Body.Y, "walk", 2000, new LivingCallBack(Beat));
}
}
else
{
if (Body.X - dis <= player.X)
{
Body.MoveTo(player.X + 10, Body.Y, "walk", 2000, new LivingCallBack(Beat));
}
else
{
Body.MoveTo(Body.X - dis, Body.Y, "walk", 2000, new LivingCallBack(Beat));
}
}
}
示例12: RandomShootPlayer
private void RandomShootPlayer()
{
List<Player> players = Game.GetAllLivingPlayers();
int index = Game.Random.Next(0, players.Count);
m_target = players[index];
NpcAttack();
}
示例13: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsLiving == false)
{
player.TargetPoint.X = packet.ReadInt();
player.TargetPoint.Y = packet.ReadInt();
}
}
示例14: ChangeProperty
private void ChangeProperty(Player player)
{
if (rand.Next(100) < m_probability)
{
SpellMgr.ExecuteSpell(player.Game, player, ItemMgr.FindItemTemplate(10022));
player.Game.SendEquipEffect(player, LanguageMgr.GetTranslation("AtomBombEquipEffect.Success"));
}
}
示例15: GhostMoveAction
public GhostMoveAction(Player player, Point target)
: base(0, 1000)
{
m_player = player;
m_target = target;
m_v = new Point(target.X - m_player.X, target.Y - m_player.Y);
m_v.Normalize(2);
}