• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GamePlayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GamePlayer的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer类的具体用法?C# GamePlayer怎么用?C# GamePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: Interact

        /// <summary>
        /// Interact with trainer
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player)) return false;

            // check if class matches.
            if (player.CharacterClass.ID == (int) TrainedClass)
            {
                player.Out.SendMessage(this.Name + " says, \"Training makes for a strong, healthy Hero! Keep up the good work, " + player.Name + "!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
            }
            else
            {
                // perhaps player can be promoted
                if (CanPromotePlayer(player))
                {
                    player.Out.SendMessage(this.Name + " says, \"You wish to follow the [Path of Affinity] and walk as a Valewalker?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                    if (!player.IsLevelRespecUsed)
                    {
                        OfferRespecialize(player);
                    }
                }
                else
                {
                    CheckChampionTraining(player);
                }
            }
            return true;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:32,代码来源:ValewalkerTrainer.cs


示例2: Interact

		/// <summary>
		/// Interact with trainer
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public override bool Interact(GamePlayer player)
		{
			if (!base.Interact(player)) return false;
			
			// check if class matches.
			if (player.CharacterClass.ID == (int)TrainedClass)
			{
				OfferTraining(player);
			}
			else
			{
				// perhaps player can be promoted
				if (CanPromotePlayer(player))
				{
					player.Out.SendMessage(this.Name + " says, \"You have come to seek admittance into the [Temple of Arawn] to worship the old god that your ancestors worshipped?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
					if (!player.IsLevelRespecUsed)
					{
						OfferRespecialize(player);
					}
				}
				else
				{
					CheckChampionTraining(player);
				}
			}
			return true;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:32,代码来源:ReaverTrainer.cs


示例3: SetPlayerLooking

		/// <summary>
		/// Adds a player to the looking for group list
		/// </summary>
		/// <param name="member">player to add to the list</param>
		public static void SetPlayerLooking(GamePlayer member)
		{
			if (member.LookingForGroup == false && m_lfgPlayers.AddIfNotExists(member, true))
			{
				member.LookingForGroup = true;
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:11,代码来源:GroupMgr.cs


示例4: Interact

        /// <summary>
        /// Interact with trainer
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player)) return false;

            // check if class matches
            if (player.CharacterClass.ID == (int) TrainedClass)
            {
                // player can be promoted
                if (player.Level>=5)
                {
                    player.Out.SendMessage(this.Name + " says, \"You must now seek your training elsewhere. Which path would you like to follow? [Bard], [Druid] or [Warden]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                }
                else
                {
                    OfferTraining(player);
                }

                // ask for basic equipment if player doesnt own it
                if (player.Inventory.GetFirstItemByID(PRACTICE_WEAPON_ID, eInventorySlot.MinEquipable, eInventorySlot.LastBackpack) == null)
                {
                    player.Out.SendMessage(this.Name + " says, \"Do you require a [practice weapon]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                }
                if (player.Inventory.GetFirstItemByID(PRACTICE_SHIELD_ID, eInventorySlot.MinEquipable, eInventorySlot.LastBackpack) == null)
                {
                    player.Out.SendMessage(this.Name + " says, \"Do you require a [training shield]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                }
            }
            else
            {
                CheckChampionTraining(player);
            }
            return true;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:38,代码来源:NaturalistTrainer.cs


示例5: OnDestinationPicked

        /// <summary>
        /// Player has picked a destination.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="destination"></param>
        protected override void OnDestinationPicked(GamePlayer player, Teleport destination)
        {
            // Not porting to where we already are.

            List<String> playerAreaList = new List<String>();
            foreach (AbstractArea area in player.CurrentAreas)
                playerAreaList.Add(area.Description);

            if (playerAreaList.Contains(destination.TeleportID))
                return;

            switch (destination.TeleportID.ToLower())
            {
                case "aegirhamn":
                    break;
                case "bjarken":
                    break;
                case "hagall":
                    break;
                case "knarr":
                    break;
                default:
                    return;
            }

            SayTo(player, "Have a safe journey!");
            base.OnDestinationPicked(player, destination);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:33,代码来源:MidgardSITeleporter.cs


示例6: OnLevelUp

		public override void OnLevelUp(GamePlayer player)
		{

			base.OnLevelUp(player);

			player.AddSpecialization(SkillBase.GetSpecialization(Specs.Shields));
			player.AddSpecialization(SkillBase.GetSpecialization(Specs.Stormcalling));
			player.AddSpellLine(SkillBase.GetSpellLine("Stormcalling"));

			if (player.Level >= 10)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 1));
			}
			if (player.Level >= 12)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Shield, ShieldLevel.Large));
				player.AddAbility(SkillBase.GetAbility(Abilities.MidArmor, ArmorLevel.Chain));
			}
			if (player.Level >= 15)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Intercept));
				player.AddAbility(SkillBase.GetAbility(Abilities.Tireless));
			}
			if (player.Level >= 20)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 2));
			}
		}
开发者ID:boscorillium,项目名称:dol,代码行数:28,代码来源:ClassThane.cs


示例7: UseSkillAction

			/// <summary>
			/// Constructs a new UseSkillAction
			/// </summary>
			/// <param name="actionSource">The action source</param>
			/// <param name="flagSpeedData">The skill type</param>
			/// <param name="index">The skill index</param>
			/// <param name="type">The skill type</param>
			public UseSkillAction(GamePlayer actionSource, int flagSpeedData, int index, int type)
				: base(actionSource)
			{
				m_flagSpeedData = flagSpeedData;
				m_index = index;
				m_type = type;
			}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:14,代码来源:UseSkillHandler.cs


示例8: Interact

		/// <summary>
		/// Interact with trainer
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public override bool Interact(GamePlayer player)
		{
			if (!base.Interact(player)) return false;

			// check if class matches.
			if (player.CharacterClass.ID == (int) TrainedClass)
			{
				player.Out.SendMessage(this.Name + " says, \"Do you wish to learn some more, " + player.Name + "? Step up and receive your training!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
			}
			else
			{
				// perhaps player can be promoted
				if (CanPromotePlayer(player))
				{
					player.Out.SendMessage(this.Name + " says, \"" + player.Name + ", do you choose the Path of Affinity, and life as a [Vampiir]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
					if (!player.IsLevelRespecUsed)
					{
						OfferRespecialize(player);
					}
				}
				else
				{
					CheckChampionTraining(player);
				}
			}
			return true;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:32,代码来源:VampiirrTrainer.cs


示例9: Interact

        /// <summary>
        /// Interact with the NPC.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player) || player == null)
                return false;

            if (GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
            {
                if (player.CurrentRegion.Expansion == (int)eClientExpansion.DarknessRising)
                {
                    SayTo(player, "Do you wish to [exit]?");
                }
                else
                {
                    SayTo(player, "Do you require an audience with the [King]?");
                }
                return true;
            }
            else
            {
                String reply = "I am afraid, but the King is busy right now.";

                if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
                    reply += " If you're only here to get your Personal Bind Recall Stone then I'll see what I can [do].";

                SayTo(player, reply);
                return false;
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:33,代码来源:ThroneRoomTeleporter.cs


示例10: Interact

		/// <summary>
		/// Interact with trainer
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public override bool Interact(GamePlayer player)
		{
			if (!base.Interact(player)) return false;
			
			// check if class matches.
			if (player.CharacterClass.ID == (int) TrainedClass)
			{
				player.Out.SendMessage(this.Name + " says, \"I shall impart all that I know, young Druid.\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
			}
			else
			{
				// perhaps player can be promoted
				if (CanPromotePlayer(player))
				{
					player.Out.SendMessage(this.Name + " says, \"Do you wish to walk the Path of Harmony and learn the ways of the [Druid]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
					if (!player.IsLevelRespecUsed)
					{
						OfferRespecialize(player);
					}
				}
				else
				{
					CheckChampionTraining(player);
				}
			}
			return true;
		}
开发者ID:boscorillium,项目名称:dol,代码行数:32,代码来源:DruidTrainer.cs


示例11: Interact

        /// <summary>
        /// Interact with trainer
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player)) return false;

            // check if class matches.
            if (player.CharacterClass.ID == (int)TrainedClass)
            {
                OfferTraining(player);
            }
            else
            {
                // perhaps player can be promoted
                if (CanPromotePlayer(player))
                {
                    player.Out.SendMessage(this.Name + " says, \"You have come far to find us! Is it your wish to [join the Guild of Shadows] and become our dagger of the night? An Infiltrator!\"", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
                    if (!player.IsLevelRespecUsed)
                    {
                        OfferRespecialize(player);
                    }
                }
                else
                {
                    CheckChampionTraining(player);
                }
            }
            return true;
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:32,代码来源:InfiltratorTrainer.cs


示例12: Interact

		/// <summary>
		/// Interact with trainer
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public override bool Interact(GamePlayer player)
		{
			if (!base.Interact(player)) return false;

			// check if class matches
			if (player.CharacterClass.ID == (int)TrainedClass)
			{
				OfferTraining(player);
			}
			else
			{
				// perhaps player can be promoted
				if (CanPromotePlayer(player))
				{
					player.Out.SendMessage(this.Name + " says, \"Do you desire to [join the Temple of the Iron Fist] and fight for the glorious realm of Albion?\"", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
					if (!player.IsLevelRespecUsed)
					{
						OfferRespecialize(player);
					}
				}
				else
				{
					CheckChampionTraining(player);
				}
			}
			return true;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:32,代码来源:AlbionMaulerTrainer.cs


示例13: IsValid

        public override bool IsValid(GamePlayer player)
        {
            BusinessLocation bl = player.Locations[Location];
            LocationStorage ls = bl.Storage;            
            ItemQuantity iq = ls.GetItem(Item);
            int q;
            if (iq == null)
            {
                q = 0;
            }
            else
            {
                q = iq.StoredQuantity;
            }       

            switch (ComparisonType)
            {
                case ComparisonEnum.Equal:
                    return q == Quantity;
                case ComparisonEnum.GreaterThan:
                    return q > Quantity;
                case ComparisonEnum.GreaterThanOrEqual:
                    return q >= Quantity;
                case ComparisonEnum.LessThan:
                    return q < Quantity;
                case ComparisonEnum.LessThanOrEqual:
                    return q <= Quantity;
                case ComparisonEnum.NotEqual:
                    return q != Quantity;
            }

            return false;
        }
开发者ID:kasmeltz,项目名称:PizzaEmpire,代码行数:33,代码来源:StorageItemStoredQuantityCompareRule.cs


示例14: Interact

        /// <summary>
        /// Interacting with the djinn resets the timer.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            lock (m_syncObject)
                m_timer.Restart();

            return base.Interact(player);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:SummonedDjinn.cs


示例15: IsAllowedToCombine

		/// <summary>
		/// This function is called when player accept the combine
		/// </summary>
		/// <param name="player"></param>
		/// <param name="item"></param>
		public override bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
		{
			if (!base.IsAllowedToCombine(player, item)) 
                return false;
			
			if (((InventoryItem)player.TradeWindow.TradeItems[0]).Object_Type != 
                (int)eObjectType.AlchemyTincture)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, 
                    "Alchemy.IsAllowedToCombine.AlchemyTinctures"), PacketHandler.eChatType.CT_System, 
                    PacketHandler.eChatLoc.CL_SystemWindow);
				
                return false;
			}

			if (player.TradeWindow.ItemsCount > 1)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
                    "Alchemy.IsAllowedToCombine.OneTincture"), PacketHandler.eChatType.CT_System, 
                    PacketHandler.eChatLoc.CL_SystemWindow);

				return false;
			}

			if (item.ProcSpellID != 0 || item.SpellID != 0)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, 
                    "Alchemy.IsAllowedToCombine.AlreadyImbued", item.Name), 
                    PacketHandler.eChatType.CT_System, PacketHandler.eChatLoc.CL_SystemWindow);

				return false;
			}

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


示例16: CheckQuestQualification

        /// <summary>
        /// Check if player is eligible for this quest.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            if (!base.CheckQuestQualification(player))
                return false;

            return (player.Level >= 45);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:12,代码来源:EirenesHauberk.cs


示例17: AbstractTask

		/// <summary>
		/// Constructs a new Quest
		/// </summary>
		/// <param name="taskPlayer">The player doing this task</param>
		public AbstractTask(GamePlayer taskPlayer)
		{
			m_taskPlayer = taskPlayer;

			DBTask dbTask=null;

			// Check if player already has a task
			// if yes reuse dbtask object to keep TasksDone from old dbtask object.
			if (taskPlayer.Task!=null)
			{
				dbTask = taskPlayer.Task.m_dbTask;
			}
			else // if player has no active task, load dbtask an use tasksdone
			{
				// Load Task object of player ...
				var tasks = GameServer.Database.FindObjectByKey<DBTask>(taskPlayer.QuestPlayerID);
				if (tasks != null)
					dbTask = tasks;
			}

			// this should happen only if player never did a task and has no entry in DBTask.
			if (dbTask==null)
			{
				dbTask = new DBTask();
				dbTask.Character_ID = taskPlayer.QuestPlayerID;
			}

			dbTask.TaskType = GetType().FullName;

			m_dbTask = dbTask;

			ParseCustomProperties();
			SaveIntoDatabase();
		}
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:38,代码来源:AbstractTask.cs


示例18: OnLevelUp

		public override void OnLevelUp(GamePlayer player)
		{

			base.OnLevelUp(player);

			player.AddSpecialization(SkillBase.GetSpecialization(Specs.Battlesongs));
			player.AddSpellLine(SkillBase.GetSpellLine("Battlesongs"));
			player.AddAbility(SkillBase.GetAbility(Abilities.Shield, ShieldLevel.Medium));

			if (player.Level >= 12)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 1));
			}
			if (player.Level >= 15)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Tireless));
			}
			if (player.Level >= 19)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 2));
			}
			if (player.Level >= 20)
			{
				player.AddAbility(SkillBase.GetAbility(Abilities.MidArmor, ArmorLevel.Chain));
				player.AddAbility(SkillBase.GetAbility(Abilities.Evade, 1));
			}
		}
开发者ID:boscorillium,项目名称:dol,代码行数:27,代码来源:ClassSkald.cs


示例19: Interact

		public override bool Interact(GamePlayer player)
		{
			if (!base.Interact(player))
				return false;

			House house = HouseMgr.GetHouseByPlayer(player);

			if (house != null)
			{
				//the player might be targeting a lot he already purchased that has no house on it yet
				if (house.HouseNumber != DatabaseItem.HouseNumber && player.Client.Account.PrivLevel != (int)ePrivLevel.Admin)
				{
					ChatUtil.SendSystemMessage(player, "You already own a house!");
					return false;
				}
			}

			if (string.IsNullOrEmpty(DatabaseItem.OwnerID))
			{
				player.Out.SendCustomDialog("Do you want to buy this lot?\r\n It costs " + Money.GetString(HouseTemplateMgr.GetLotPrice(DatabaseItem)) + "!", BuyLot);
			}
			else
			{
				if (HouseMgr.IsOwner(DatabaseItem, player))
				{
					player.Out.SendMerchantWindow(HouseTemplateMgr.GetLotMarkerItems(this), eMerchantWindowType.Normal);
				}
				else
				{
					ChatUtil.SendSystemMessage(player, "You do not own this lot!");
				}
			}

			return true;
		}
开发者ID:boscorillium,项目名称:dol,代码行数:35,代码来源:LotMarker.cs


示例20: Interact

        /// <summary>
        /// Interact with trainer
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player)) return false;

            // check if class matches.
            if (player.CharacterClass.ID == (int) TrainedClass)
            {
                player.Out.SendMessage(this.Name + " says, \"Ahh, well met " + player.Name + ". Back for more lore and knowledge, eh.\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
            }
            else
            {
                // perhaps player can be promoted
                if (CanPromotePlayer(player))
                {
                    player.Out.SendMessage(this.Name + " says, \"Do you wish to walk the Path of Essence, pursuing a life of storytelling and [song]? Of brave deeds which grow braver with every telling?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                    if (!player.IsLevelRespecUsed)
                    {
                        OfferRespecialize(player);
                    }
                }
                else
                {
                    CheckChampionTraining(player);
                }
            }
            return true;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:32,代码来源:BardTrainer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameScenes类代码示例发布时间:2022-05-24
下一篇:
C# GamePacketEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap