当前位置: 首页>>代码示例>>C#>>正文


C# Character.OnEnemyDie方法代码示例

本文整理汇总了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");
            }
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:61,代码来源:gmcommands.cs


注:本文中的Saga.PrimaryTypes.Character.OnEnemyDie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。