本文整理匯總了C#中System.Entity.HasConditionEffect方法的典型用法代碼示例。如果您正苦於以下問題:C# Entity.HasConditionEffect方法的具體用法?C# Entity.HasConditionEffect怎麽用?C# Entity.HasConditionEffect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Entity
的用法示例。
在下文中一共展示了Entity.HasConditionEffect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetSpeed
public static float GetSpeed(Entity entity, float stat)
{
var ret = 4 + 5.6f * (stat / 75f);
if (entity.HasConditionEffect(ConditionEffects.Speedy))
ret *= 1.5f;
if (entity.HasConditionEffect(ConditionEffects.Slowed))
ret = 4;
if (entity.HasConditionEffect(ConditionEffects.Paralyzed))
ret = 0;
return ret;
}
示例2: GetDefenseDamage
public static float GetDefenseDamage(Entity host, int dmg, int def)
{
if (host.HasConditionEffect(ConditionEffects.Armored))
def *= 2;
if (host.HasConditionEffect(ConditionEffects.ArmorBroken))
def = 0;
float limit = dmg * 0.15f;
float ret;
if (dmg - def < limit) ret = limit;
else ret = dmg - def;
if (host.HasConditionEffect(ConditionEffects.Invulnerable) ||
host.HasConditionEffect(ConditionEffects.Invincible))
ret = 0;
return ret;
}
示例3: GetSpeedMultiplier
protected float GetSpeedMultiplier(Entity entity)
{
float ret = 1;
if (entity.HasConditionEffect(ConditionEffects.Slowed))
ret *= 0.5f;
if (entity.HasConditionEffect(ConditionEffects.Paralyzed) ||
entity.HasConditionEffect(ConditionEffects.Stasis))
ret = 0;
return ret;
}
示例4: ValidateAndMove
public static bool ValidateAndMove(Entity entity, float x, float y)
{
if (entity.Owner == null ||
entity.HasConditionEffect(ConditionEffects.Paralyzed)) return false;
if (Validate(entity, x, y))
entity.Move(x, y);
else if (Validate(entity, entity.X, y))
entity.Move(entity.X, y);
else if (Validate(entity, x, entity.Y))
entity.Move(x, entity.Y);
else
return false;
return true;
}
示例5: Validate
public static bool Validate(Entity entity, float x, float y)
{
if (entity.Owner == null ||
entity.HasConditionEffect(ConditionEffects.Paralyzed)) return false;
if (x < 0 || x >= entity.Owner.Map.Width ||
y < 0 || y >= entity.Owner.Map.Height)
return false;
if (entity.ObjectDesc.Flying &&
entity.Owner.Obstacles[(int)x, (int)y] != 2) return true;
var objId = entity.Owner.Map[(int)x, (int)y].ObjType;
if (objId != 0 &&
XmlDatas.ObjectDescs[objId].OccupySquare)
return false;
if (entity.Owner.Obstacles[(int)x, (int)y] != 0)
return false;
return true;
}