本文整理汇总了C#中Creature.HasTag方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.HasTag方法的具体用法?C# Creature.HasTag怎么用?C# Creature.HasTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature.HasTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreatureKilled
public void OnCreatureKilled(Creature deadCreature, Creature killer)
{
// the Tank
// Enable if a creature dies for a party member.
// Exact functionality unknown, we're gonna assume if a party member
// hit the monster first, and you then die by that monster's paw,
// you died for your teammate.
// ------------------------------------------------------------------
if (deadCreature.IsPlayer && !deadCreature.Titles.IsUsable(57) && deadCreature.Party.MemberCount > 1)
{
// Get tracker of dead creature to compare the id to the member's.
var deadTracker = killer.GetHitTracker(deadCreature.EntityId);
if (deadTracker != null)
{
// Go through living party members
var members = deadCreature.Party.GetMembers();
foreach (var member in members.Where(a => !a.IsDead))
{
// If the member's tracker has a lower id than that of the
// dead creature, the member attacked first.
var memberTracker = killer.GetHitTracker(member.EntityId);
if (memberTracker != null && memberTracker.Id < deadTracker.Id)
deadCreature.Titles.Enable(57);
}
}
}
// who was Defeated by a Fox at Age 17
// Enable when killed by a fox at Age 17+.
// ------------------------------------------------------------------
if (!deadCreature.Titles.IsUsable(77) && deadCreature.Age >= 17)
{
if (killer.HasTag("/fox/"))
deadCreature.Titles.Enable(77);
}
if (deadCreature.HasTag("/bear/"))
{
// who Almost Slew a Bear at 10
// Show when killing a bear at age 12+, enable on age 11.
// ------------------------------------------------------------------
if (killer.Age >= 11 && !killer.Titles.IsUsable(78))
{
if (killer.Age >= 12)
killer.Titles.Show(78);
else
killer.Titles.Enable(78);
}
// the Bear Slayer with Bare Hands
// Enable when killing a bear without weapons.
//
// the Bear Slayer with a Single Blow
// Show when killing a bear without weapons.
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(79) && killer.RightHand == null)
{
killer.Titles.Enable(79);
if (!killer.Titles.Knows(81))
killer.Titles.Show(81);
}
// who slew a bear at age 10
// Enable when killing a bear at age 10 mostly alone.
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(80) && killer.Age == 10 && deadCreature.GetTopDamageDealer().Attacker == killer)
killer.Titles.Enable(80);
// the Bear Slayer with a Single Blow
// Enable when killing... it's right in the title...!
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(81) && deadCreature.GetTotalHits() == 1)
killer.Titles.Enable(81);
}
else if (deadCreature.HasTag("/golem/"))
{
// the Golem Slayer with a Single Blow
// Enable when killing a golem with one hit.
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(82))
{
if (deadCreature.GetTotalHits() == 1)
killer.Titles.Enable(82);
else if (!killer.Titles.Knows(82))
killer.Titles.Show(82);
}
// the Golem Slayer
// Enable when killing a golem.
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(83))
killer.Titles.Enable(83);
}
else if (deadCreature.HasTag("/succubus/"))
{
// the Succubus Slayer
// Enable when killing a succubus.
// ------------------------------------------------------------------
if (!killer.Titles.IsUsable(84))
//.........这里部分代码省略.........