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


C# PlayerMobile.InLOS方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerMobile.InLOS方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.InLOS方法的具体用法?C# PlayerMobile.InLOS怎么用?C# PlayerMobile.InLOS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.InLOS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoSpeech

            private static void DoSpeech(PlayerMobile targ, string toSay)
            {
                IPooledEnumerable eable = targ.Map.GetClientsInRange(targ.Location, 15);

                if (targ.UseUnicodeSpeech)
                {
                    foreach (NetState state in eable)
                        if (state != null && (!state.Mobile.HasFilter || targ.InLOS(state.Mobile)))
                            state.Send(new UnicodeMessage(targ.Serial, targ.Body, MessageType.Regular, targ.SpeechHue, 3, "ENU", targ.Name, toSay));
                }
                else
                {
                    foreach (NetState state in eable)
                        if (state != null && (!state.Mobile.HasFilter || targ.InLOS(state.Mobile)))
                            state.Send(new AsciiMessage(targ.Serial, targ.Body, MessageType.Regular, targ.SpeechHue, 3, targ.Name, toSay));
                }

                eable.Free();
            }
开发者ID:rberiot,项目名称:imaginenation,代码行数:19,代码来源:SayCommands.cs

示例2: TryEffectTarget

        public bool TryEffectTarget(PlayerMobile from, Mobile target, bool isAreaEffect)
        {
            if (from == null || from.Deleted || !from.Alive || from.IsDeadBondedPet)
                return false;
            if (target == null || target.Deleted || !target.Alive || target.IsDeadBondedPet)
                return false;

            if (isAreaEffect)
            {
                if (from.IsAllyOf(target))
                {
                    if (Repetitions > 0)
                    {
                        RecurrentPrayerTimer timer = new RecurrentPrayerTimer(from, target, this);
                        timer.Start();
                    }
                    return DoPrayerEffect(from, target);
                }
                else
                    return false;
            }
            else
            {
                if (target.InRange(target.Location, m_Range) && from.InLOS(target))
                {
                    SpellHelper.Turn(from, target);
                    if (Repetitions > 0)
                    {
                        RecurrentPrayerTimer timer = new RecurrentPrayerTimer(from, target, this);
                        timer.Start();
                    }
                    return DoPrayerEffect(from, target);
                }
                else
                {
                    from.SendMessage("You are too far away.");
                    return false;
                }
            }

            return false;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:42,代码来源:CustomFaithSpell.cs

示例3: FightingBackToBack

        public static void FightingBackToBack( PlayerMobile pm, bool movingaway )
        {
            ArrayList list = new ArrayList();
            ArrayList allies = new ArrayList();
            ArrayList leavelist = new ArrayList();

            if( pm.Feats.GetFeatLevel(FeatList.BackToBack) > 0 )
            {
                if( pm.Warmode && !pm.Mounted )
                {
                    foreach( Mobile m in pm.GetMobilesInRange( 2 ) )
                        list.Add( m );

                    for( int i = 0; i < list.Count; ++i )
                    {
                        PlayerMobile m = (Mobile)list[i] as PlayerMobile;
                        Mobile x = m as Mobile;
                        Mobile y = pm as Mobile;

                        if( m is PlayerMobile && m != pm && m.Warmode && !m.Mounted )
                        {
                            if( m == null || m.Deleted || m.Map != pm.Map || !m.Alive || !pm.CanSee( m ) || m.Feats.GetFeatLevel(FeatList.BackToBack) < 1 || !pm.AllyList.Contains( x ) || !m.AllyList.Contains( y ) )
                                continue;

                            if( pm.InLOS( m ) )
                                allies.Add( m );
                        }
                    }

                    if( allies.Count > 0 )
                    {
                        for( int i = 0; i < allies.Count; ++i )
                        {
                            PlayerMobile m = (Mobile)allies[i] as PlayerMobile;

                            if( !m.BackToBack )
                            {
                                BackToBackBonus( m, true );
                            }

                            if( !pm.BackToBack )
                            {
                                BackToBackBonus( pm, true );
                            }
                        }
                    }

                    else
                    {
                        if( pm.BackToBack )
                        {
                            BackToBackBonus( pm, false );
                        }

                        if( !movingaway )
                        {
                            foreach( Mobile mob in pm.GetMobilesInRange( 3 ) )
                                leavelist.Add( mob );

                            for( int i = 0; i < leavelist.Count; ++i )
                            {
                                PlayerMobile m = (Mobile)leavelist[i] as PlayerMobile;

                                if( m != pm && m is PlayerMobile )
                                {
                                    FightingBackToBack( m, true );
                                }
                            }
                        }
                    }
                }

                else
                {
                    if( pm.BackToBack )
                    {
                        BackToBackBonus( pm, false );
                    }
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:81,代码来源:PlayerMobile.cs


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