本文整理汇总了C#中Saga.PrimaryTypes.Character.OnEnemyDie方法的典型用法代码示例。如果您正苦于以下问题:C# Character.OnEnemyDie方法的具体用法?C# Character.OnEnemyDie怎么用?C# Character.OnEnemyDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Saga.PrimaryTypes.Character
的用法示例。
在下文中一共展示了Character.OnEnemyDie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Kill
public static void Kill(Character character, Match match)
{
Regiontree tree = character.currentzone.Regiontree;
MapObject regionObject;
if (character.SelectedTarget > 0 && Regiontree.TryFind(character.SelectedTarget, character, out regionObject) && regionObject is Monster)
{
/*****
//Make the Object die
*****/
Actor btarget = regionObject as Actor;
btarget.Status.CurrentHp = 0;
btarget.OnDie(character);
character.OnEnemyDie(regionObject);
btarget.stance = 7;
btarget.Status.Updates |= 1;
/*****
//Forcing updates to all surrounding objects (flusing)
*****/
Predicate<Character> SendToCharacter = delegate(Character forwardTarget)
{
//Process some general updates
if (forwardTarget.SelectedTarget == regionObject.id)
Common.Actions.SelectActor(forwardTarget, regionObject as Actor);
Common.Actions.UpdateStance(forwardTarget, regionObject as Actor);
Common.Actions.UpdateIcon(forwardTarget, regionObject as BaseMob);
return true;
};
/*****
//Forcing updates to all surrounding objects (searching)
*****/
SendToCharacter(character);
foreach (Character forwardTarget in tree.SearchActors(character, SearchFlags.Characters))
{
if (forwardTarget.id == character.id) continue;
SendToCharacter(forwardTarget);
}
/*****
//Update lifecycle
*****/
LifeCycle.Update(character);
if (MapObject.IsPlayer(regionObject))
{
LifeCycle.Update(regionObject as Character);
}
/***
* Check Quest
***/
if (MapObject.IsNpc(btarget))
{
Quests.QuestBase.UserEliminateTarget(btarget.ModelId, character);
}
}
else
{
CommonFunctions.Broadcast(character, character, "No target selected or incorrect target");
}
}