本文整理汇总了C#中BaseGame.SendGameUpdateFrozenState方法的典型用法代码示例。如果您正苦于以下问题:C# BaseGame.SendGameUpdateFrozenState方法的具体用法?C# BaseGame.SendGameUpdateFrozenState怎么用?C# BaseGame.SendGameUpdateFrozenState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseGame
的用法示例。
在下文中一共展示了BaseGame.SendGameUpdateFrozenState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD, m_living.Id);
pkg.Parameter1 = m_living.Id;
pkg.WriteByte((byte)eTankCmdType.LIVING_RANGEATTACKING);
List<Living> playersAround = game.Map.FindPlayers(m_fx, m_tx, m_players);
int count = playersAround.Count;
foreach (Living p in playersAround)
{
if (m_living.IsFriendly(p) == true)
count--;
}
pkg.WriteInt(count);
m_living.SyncAtTime = false;
try
{
foreach (Living p in playersAround)
{
p.SyncAtTime = false;
if (m_living.IsFriendly(p) == true)
continue;
int dander = 0;
p.IsFrost = false;
game.SendGameUpdateFrozenState(p);
int damage = MakeDamage(p);
int critical = MakeCriticalDamage(p, damage);
int totalDemageAmount = 0;
if (p.TakeDamage(m_living, ref damage, ref critical, "范围攻击"))
{
totalDemageAmount = damage + critical;
if (p is Player)
{
Player player = p as Player;
dander = player.Dander;
}
}
pkg.WriteInt(p.Id);
pkg.WriteInt(totalDemageAmount);
pkg.WriteInt(p.Blood);
//同步怒气值
pkg.WriteInt(dander);
//attackEffect
pkg.WriteInt(new Random().Next(2));
}
game.SendToAll(pkg);
Finish(tick);
}
finally
{
m_living.SyncAtTime = true;
foreach (Living p in playersAround)
{
p.SyncAtTime = true;
}
}
}