當前位置: 首頁>>代碼示例>>C#>>正文


C# PlayerMobile.HasGump方法代碼示例

本文整理匯總了C#中Server.Mobiles.PlayerMobile.HasGump方法的典型用法代碼示例。如果您正苦於以下問題:C# PlayerMobile.HasGump方法的具體用法?C# PlayerMobile.HasGump怎麽用?C# PlayerMobile.HasGump使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.HasGump方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SendGumpThreaded

        public static void SendGumpThreaded(PlayerMobile to)
        {
            if (to.AntiMacroGump && m_GumpDictionary.ContainsKey(to))
            {
                AntiMacroGump oldGump = m_GumpDictionary[to];
                m_GumpDictionary.Remove(to);

                //Close existing gump if it exists
                if (to.HasGump(typeof(AntiMacroGump)))
                    to.CloseGump(typeof(AntiMacroGump));

                to.SendGump(new AntiMacroGump(oldGump) );

                return;
            }

            if ( !MySQLManager.SQLEnabled)
            {
                to.SendGump(new OldAntiMacroGump(to));
                return;
            }

            AntiMacroGump gump = new AntiMacroGump(to);
            new Thread(gump.ThreadedGump).Start();
        }
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:25,代碼來源:AntiMacroGump.cs

示例2: OnLevelChanged

        public override void OnLevelChanged( PlayerMobile owner )
        {
            base.OnLevelChanged( owner );

            owner.ComputeResistances();

            if( owner.HasGump( typeof( Gumps.CharInfoGump ) ) && owner.m_CharInfoTimer == null )
            {
                owner.m_CharInfoTimer = new Gumps.CharInfoGump.CharInfoTimer( owner );
                owner.m_CharInfoTimer.Start();
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:12,代碼來源:PureDodge.cs

示例3: AttemptRemoval

        public virtual void AttemptRemoval( PlayerMobile m, int level, bool freeRemoval )
        {
            if( level != Level )
                m.SendMessage( "Please remove the higher levels of this skill first." );

            else if( CanRemoveThisFeat(m, freeRemoval) )
            {
                m.CP += Level * BaseCost;
                m.CPSpent -= Level * BaseCost;
                m.FeatSlots -= Level * BaseCost;

                if( m.HasGump( typeof(CharInfoGump) ) )
                    m.SendGump( new CharInfoGump(m) );

                Level--;
                OnLevelChanged( m );
                OnLevelLowered( m );

                for( int i = 0; i < AssociatedFeats.Length; i++ )
                    m.Feats.SetFeatLevel( AssociatedFeats[i], Level, m );

                for( int i = 0; i < AssociatedSkills.Length; i++ )
                    m.Skills[AssociatedSkills[i]].Base = SkillLevel;
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:25,代碼來源:BaseFeat.cs

示例4: AttemptPurchase

        public virtual void AttemptPurchase( PlayerMobile m, int level, bool freeRemoval )
        {
            if( CostLevel == FeatCost.None )
                m.SendMessage( "This skill cannot be directly purchased." );

            if( !MeetsOurRequirements(m) )
                m.SendMessage( "You do not meet the requirements for this skill." );

            else if( Level >= level )
                AttemptRemoval( m, level, freeRemoval );

            else if( (level - Level) != 1 )
                m.SendMessage( "You cannot acquire a skill level before purchasing all previous levels." );

            else if( m.CP < CostToRaise )
                m.SendMessage( "You do not have enough CPs to acquire this skill level." );

            else if( LevelSystem.CanSpendCP(m, CostToRaise) )
            {
                m.CP -= CostToRaise;
                m.CPSpent += CostToRaise;
                m.FeatSlots += CostToRaise;
                Level++;
                OnLevelChanged( m );
                OnLevelRaised( m );
                m.SendMessage( "You have purchased " + Name + " Level " + Level.ToString() + "." );

                for( int i = 0; i < AssociatedFeats.Length; i++ )
                    m.Feats.SetFeatLevel( AssociatedFeats[i], Level, m );

                for( int i = 0; i < AssociatedSkills.Length; i++ )
                    m.Skills[AssociatedSkills[i]].Base = SkillLevel;

                if( m.HasGump( typeof(CharInfoGump) ) )
                    m.SendGump( new CharInfoGump(m) );
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:37,代碼來源:BaseFeat.cs


注:本文中的Server.Mobiles.PlayerMobile.HasGump方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。