本文整理汇总了C#中Aura.Channel.World.Entities.Creature.Has方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.Has方法的具体用法?C# Creature.Has怎么用?C# Creature.Has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Channel.World.Entities.Creature
的用法示例。
在下文中一共展示了Creature.Has方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanTarget
public override bool CanTarget(Creature creature)
{
if (!base.CanTarget(creature))
return false;
// Named NPCs (normal dialog ones) can't be targeted.
// Important because AIs target /pc/ and most NPCs are humans.
if (creature.Has(CreatureStates.NamedNpc))
return false;
return true;
}
示例2: Stop
/// <summary>
/// Stops meditation.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="dict"></param>
/// <returns></returns>
public override StartStopResult Stop(Creature creature, Skill skill, MabiDictionary dict)
{
creature.Regens.Remove("Meditation");
creature.Conditions.Deactivate(ConditionsE.Meditation);
//Apply normal rest bonus instead of the campfire bonus if applicable.
creature.Regens.Remove("Rest");
var restSkill = creature.Skills.Get(SkillId.Rest);
if (restSkill != null && creature.Has(CreatureStates.SitDown))
{
Life.Rest.ApplyRestBonus(creature, restSkill, creature.Temp.SittingProp != null ? creature.Temp.SittingProp.EntityId : 0);
}
return StartStopResult.Okay;
}
示例3: Start
/// <summary>
/// Starts Meditation.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="dict"></param>
/// <returns></returns>
public override StartStopResult Start(Creature creature, Skill skill, MabiDictionary dict)
{
var rate = (skill.RankData.Var1 / 100f) * 0.05f;
// TODO: Night?
// "Disable" stm regen, triple hunger
creature.Regens.Add("Meditation", Stat.Stamina, -0.4f, creature.StaminaMax);
//Apply campfire rest bonus instead of the normal bonus if applicable.
creature.Regens.Remove("Rest");
var restSkill = creature.Skills.Get(SkillId.Rest);
if (restSkill != null && creature.Has(CreatureStates.SitDown))
{
Life.Rest.RestCampfireBonus(creature, restSkill, creature.Temp.SittingProp != null ? creature.Temp.SittingProp.EntityId : 0);
}
if (ChannelServer.Instance.Conf.World.EnableHunger)
creature.Regens.Add("Meditation", Stat.Hunger, 0.02f, creature.StaminaMax);
// Add mana regen
creature.Regens.Add("Meditation", Stat.Mana, rate, creature.ManaMax);
creature.Conditions.Activate(ConditionsE.Meditation);
return StartStopResult.Okay;
}
示例4: CanTarget
public override bool CanTarget(Creature creature)
{
if (!base.CanTarget(creature))
return false;
// Players can only target "bad" NPCs.
if (creature.Has(CreatureStates.GoodNpc))
return false;
// Players can't target players (outside of PvP, TODO)
if (creature.IsPlayer)
return false;
return true;
}
示例5: CanAttack
/// <summary>
/// Returns true if creature is able to attack this creature.
/// </summary>
/// <param name="creature"></param>
/// <returns></returns>
public bool CanAttack(Creature creature)
{
if (creature.IsInvincible)
return false;
//Check override first...
foreach (object target in this.AttackOverride)
{
//Check state first, then tag, then the creature itself.
if (target is CreatureStates)
{
if (creature.Has((CreatureStates)target))
return true;
}
else if (target is string)
{
if (creature.HasTag((string)target))
return true;
}
else
{
if (creature == target)
return true;
}
}
//Then check the actual filter.
foreach (object target in this.AttackFilter)
{
//Check state first, then tag, then the creature itself.
if (target is CreatureStates)
{
if (creature.Has((CreatureStates)target))
return false;
}
else if (target is string)
{
if (creature.HasTag((string)target))
return false;
}
else
{
if (creature == target)
return false;
}
}
return true;
}
示例6: Matches
public override bool Matches(Creature creature)
{
switch (this.Type)
{
case GlobalDropType.Npcs:
var isMonster = creature.Has(CreatureStates.Npc);
return isMonster;
case GlobalDropType.Players:
var isPlayer = (creature.IsPlayer);
return isPlayer;
}
return false;
}