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


C# GamePlayer.Notify方法代码示例

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


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

示例1: OnPlayerEnter

        /// <summary>
        /// Called whenever a player enters the given area
        /// </summary>
        /// <param name="player"></param>
        public virtual void OnPlayerEnter(GamePlayer player)
        {
            if (m_displayMessage && Description != null && Description != "")
            {
                string description = Description;
                string screenDescription = description;

                DataObject translation = LanguageMgr.GetTranslation(player.Client, this);
                if (translation != null)
                {
                    if (!Util.IsEmpty(((DBLanguageArea)translation).Description))
                        description = ((DBLanguageArea)translation).Description;

                    if (!Util.IsEmpty(((DBLanguageArea)translation).ScreenDescription))
                        screenDescription = ((DBLanguageArea)translation).ScreenDescription;
                }

                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "AbstractArea.Entered", description),
                    eChatType.CT_System, eChatLoc.CL_SystemWindow);

                //Changed by Apo 9. August 2010: Areas never send an screen description, but we will support it with an server property
                if (ServerProperties.Properties.DISPLAY_AREA_ENTER_SCREEN_DESC)
                    player.Out.SendMessage(screenDescription, eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
            }
            if (Sound != 0)
            {
                player.Out.SendRegionEnterSound(Sound);
            }
            player.Notify(AreaEvent.PlayerEnter, this, new AreaEventArgs(this, player));
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:AbstractArea.cs

示例2: OnPlayerLeave

        /// <summary>
        /// Called whenever a player leaves the given area
        /// </summary>
        /// <param name="player"></param>
        public virtual void OnPlayerLeave(GamePlayer player)
        {
            if (m_displayMessage && Description != null && Description != "")
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "AbstractArea.Left", Description),
                    eChatType.CT_System, eChatLoc.CL_SystemWindow);

            player.Notify(AreaEvent.PlayerLeave, this, new AreaEventArgs(this, player));
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:AbstractArea.cs

示例3: Interact

		/// <summary>
		/// Interacting with a training dummy does nothing
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public override bool Interact(GamePlayer player)
		{
			Notify(GameObjectEvent.Interact, this, new InteractEventArgs(player));
			player.Notify(GameObjectEvent.InteractWith, player, new InteractWithEventArgs(this));
			return true;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:11,代码来源:GameTrainingDummy.cs

示例4: Interact

		/// <summary>
		/// This function is called from the ObjectInteractRequestHandler
		/// </summary>
		/// <param name="player">GamePlayer that interacts with this object</param>
		/// <returns>false if interaction is prevented</returns>
		public virtual bool Interact(GamePlayer player)
		{
			if (player.Client.Account.PrivLevel == 1 && !this.IsWithinRadius(player, InteractDistance))
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameObject.Interact.TooFarAway", GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				Notify(GameObjectEvent.InteractFailed, this, new InteractEventArgs(player));
				return false;
			}

			Notify(GameObjectEvent.Interact, this, new InteractEventArgs(player));
			player.Notify(GameObjectEvent.InteractWith, player, new InteractWithEventArgs(this));

			foreach (DataQuest q in DataQuestList)
			{
				// Notify all our potential quests of the interaction so we can check for quest offers
				q.Notify(GameObjectEvent.Interact, this, new InteractEventArgs(player));
			}

			return true;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:25,代码来源:GameObject.cs

示例5: AddAbilities

        /// <summary>
        /// Add all abilities for this level.
        /// </summary>
        /// <param name="artifactLevel">The level to add abilities for.</param>
        /// <param name="player"></param>
        /// <returns>True, if artifact gained 1 or more abilities, else false.</returns>
        private bool AddAbilities(GamePlayer player, int artifactLevel)
        {
            ItemTemplate template = GameServer.Database.FindObjectByKey<ItemTemplate>(Id_nb);

            if (template == null)
            {
                log.Warn(String.Format("Item template missing for artifact '{0}'", Name));
                return false;
            }

            bool abilityGained = false;

            for (ArtifactBonus.ID bonusID = ArtifactBonus.ID.Min; bonusID <= ArtifactBonus.ID.Max; ++bonusID)
            {
                if (m_levelRequirements[(int)bonusID] == artifactLevel)
                {
                    Template.SetBonusType(bonusID, template.GetBonusType(bonusID));
                    Template.SetBonusAmount(bonusID, template.GetBonusAmount(bonusID));

                    if (bonusID <= ArtifactBonus.ID.MaxStat)
                        player.Notify(PlayerInventoryEvent.ItemBonusChanged, this, new ItemBonusChangedEventArgs(Template.GetBonusType(bonusID), Template.GetBonusAmount(bonusID)));

                    abilityGained = true;
                }
            }

            return abilityGained;
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:InventoryArtifact.cs


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