本文整理匯總了C#中RS2.Server.player.Player.getHits方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getHits方法的具體用法?C# Player.getHits怎麽用?C# Player.getHits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getHits方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Test Damage command]: ::testdmg dmg ::testdmg 2000");
return;
}
int dmg = 0;
Hits.Hit hit;
if (!int.TryParse(arguments[0], out dmg))
{
dmg = 0;
hit = new Hits.Hit(dmg, Hits.HitType.NO_DAMAGE);
}
else
{
hit = new Hits.Hit(dmg, Hits.HitType.NORMAL_DAMAGE);
}
player.getHits().setHit1(hit);
player.getUpdateFlags().setHitUpdateRequired(true);
}
示例2: appendHitUpdate
private static void appendHitUpdate(Player p, PacketBuilder updateBlock)
{
int ratio = p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) * 255 / p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS);
if (p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) > p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS))
{
ratio = p.getSkills().getMaxLevel(3) * 255 / p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS);
}
if (p.getHits().getHitDamage1() < 128) //damage can be either addByte [for damage less then 128 otherwise UShort]
updateBlock.addByte((byte)p.getHits().getHitDamage1());
else
updateBlock.addUShort(p.getHits().getHitDamage1() + 0x8000);
updateBlock.addByteA((byte)p.getHits().getHitType1());
updateBlock.addByteS(ratio);
}
示例3: appendHit2Update
private static void appendHit2Update(Player p, PacketBuilder updateBlock)
{
updateBlock.addByte((byte)p.getHits().getHitDamage2());
updateBlock.addByteS((byte)p.getHits().getHitType2());
}