本文整理汇总了C#中PlayerObject.GatherElement方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerObject.GatherElement方法的具体用法?C# PlayerObject.GatherElement怎么用?C# PlayerObject.GatherElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerObject
的用法示例。
在下文中一共展示了PlayerObject.GatherElement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
int armour = 0;
switch (type)
{
case DefenceType.ACAgility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.AC:
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.MACAgility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
armour = GetAttackPower(MinMAC, MaxMAC);
break;
case DefenceType.MAC:
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.Agility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
break;
}
if (armour >= damage) return 0;
if (damageWeapon)
attacker.DamageWeapon();
ShockTime = 0;
if (Master != null && Master != attacker)
if (Envir.Time > Master.BrownTime && Master.PKPoints < 200)
attacker.BrownTime = Envir.Time + Settings.Minute;
if (EXPOwner == null || EXPOwner.Dead)
EXPOwner = attacker;
if (EXPOwner == attacker)
EXPOwnerTime = Envir.Time + EXPOwnerDelay;
Broadcast(new S.ObjectStruck { ObjectID = ObjectID, AttackerID = attacker.ObjectID, Direction = Direction, Location = CurrentLocation });
attacker.GatherElement();//ArcherSpells - Elemental system
ChangeHP(-1);
return 1;
}
示例2: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
int armour = 0;
switch (type)
{
case DefenceType.ACAgility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.AC:
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.MACAgility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
armour = GetAttackPower(MinMAC, MaxMAC);
break;
case DefenceType.MAC:
armour = GetAttackPower(MinAC, MaxAC);
break;
case DefenceType.Agility:
if (Envir.Random.Next(Agility + 1) > attacker.Accuracy) return 0;
break;
}
if (armour >= damage) return 0;
if (damageWeapon)
attacker.DamageWeapon();
ShockTime = 0;
for (int i = PoisonList.Count - 1; i >= 0; i--)
{
if (PoisonList[i].PType != PoisonType.LRParalysis) continue;
PoisonList.RemoveAt(i);
OperateTime = 0;
}
if (Master != null && Master != attacker)
if (Envir.Time > Master.BrownTime && Master.PKPoints < 200)
attacker.BrownTime = Envir.Time + Settings.Minute;
if (EXPOwner == null || EXPOwner.Dead)
EXPOwner = attacker;
if (EXPOwner == attacker)
EXPOwnerTime = Envir.Time + EXPOwnerDelay;
Broadcast(new S.ObjectStruck { ObjectID = ObjectID, AttackerID = attacker.ObjectID, Direction = Direction, Location = CurrentLocation });
attacker.GatherElement();
ChangeHP(-1);
return 1;
}