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

C# Keeps.AbstractGameKeep类代码示例

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

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



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

示例1: BroadcastCapture

		/// <summary>
		/// Sends a message to all players to notify them of the keep capture
		/// </summary>
		/// <param name="keep">The keep object</param>
		public static void BroadcastCapture(AbstractGameKeep keep)
		{
			string message = "";
			if (keep.Realm != eRealm.None)
			{
				message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.Captured", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
			}
			else
			{
                message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.CapturedR0", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
			}

			/*
			switch (GameServer.Instance.Configuration.ServerType)
			{
				case eGameServerType.GST_Normal:
					{
						message = string.Format("The forces of {0} have captured {1}!", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name);
						break;
					}
				case eGameServerType.GST_PvP:
					{
						string defeatersStr = "";
						message = string.Format("The forces of {0} have defeated the defenders of {1}!", defeatersStr, keep.Name);
						break;
					}
			}*/

			BroadcastMessage(message, eRealm.None);
			NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:35,代码来源:Player+Manager.cs


示例2: SendLevelChangeMessage

		public static void SendLevelChangeMessage(AbstractGameKeep keep)
		{
			string message = "Your guild's keep " + keep.Name + " is now level " + keep.Level;
			if (keep.Level != ServerProperties.Properties.MAX_KEEP_LEVEL)
				message += ", it is on the way to level " + ServerProperties.Properties.MAX_KEEP_LEVEL.ToString();
			SendMessageToGuild(message, keep.Guild);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:7,代码来源:Guild+Manager.cs


示例3: SendKeepRemove

		public override void SendKeepRemove(AbstractGameKeep keep)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepRemove));

			pak.WriteShort((ushort)keep.KeepID);
			SendTCP(pak);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:7,代码来源:PacketLib170.cs


示例4: ScoutMission

        public ScoutMission(object owner)
            : base(owner)
        {
            eRealm realm = 0;
            if (owner is Group)
                realm = (owner as Group).Leader.Realm;
            else if (owner is GamePlayer)
                realm = (owner as GamePlayer).Realm;

            ArrayList list = new ArrayList();

            ICollection<AbstractGameKeep> keeps;
            if (owner is Group)
                keeps = GameServer.KeepManager.GetKeepsOfRegion((owner as Group).Leader.CurrentRegionID);
            else if (owner is GamePlayer)
                keeps = GameServer.KeepManager.GetKeepsOfRegion((owner as GamePlayer).CurrentRegionID);
            else keeps = new List<AbstractGameKeep>();

            foreach (AbstractGameKeep keep in keeps)
            {
                if (keep.IsPortalKeep)
                    continue;
                if (keep.Realm != realm)
                    list.Add(keep);
            }

            if (list.Count > 0)
                m_keep = list[Util.Random(list.Count - 1)] as AbstractGameKeep;

            GameEventMgr.AddHandler(AreaEvent.PlayerEnter, new DOLEventHandler(Notify));
            GameEventMgr.AddHandler(KeepEvent.KeepTaken, new DOLEventHandler(Notify));
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:32,代码来源:ScoutMission.cs


示例5: SendChangeLevelTimeMessage

		public static void SendChangeLevelTimeMessage(AbstractGameKeep keep)
		{
            string message;
            string changeleveltext = "";
            int nextlevel = 0;

            byte maxlevel = (byte)ServerProperties.Properties.MAX_KEEP_LEVEL;

            if (keep.Level < maxlevel)
            {
                changeleveltext = "upgrade";
                nextlevel = keep.Level + 1;
            }
            else if (keep.Level > maxlevel)
            {
                changeleveltext = "downgrade";
                nextlevel = keep.Level - 1;
            }
            else
            {
                return;
            }
			message = "Your guild is starting to " + changeleveltext + " its area " + keep.Name + " to level 10.";
			TimeSpan time = keep.ChangeLevelTimeRemaining;
			message += " It will take ";
			if (time.Hours > 0)
				message += time.Hours + " hour(s) ";
			if (time.Minutes > 0)
				message += time.Minutes + " minute(s) ";
			else message += time.Seconds + " second(s)";
			message += " to reach the next level.";
			SendMessageToGuild(message, keep.Guild);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:33,代码来源:Guild+Manager.cs


示例6: SendKeepRealmUpdate

		public override void SendKeepRealmUpdate(AbstractGameKeep keep)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepRealmUpdate));

			pak.WriteShort((ushort)keep.KeepID);
			pak.WriteByte((byte)keep.Realm);
			pak.WriteByte((byte)keep.Level);
			SendTCP(pak);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:9,代码来源:PacketLib170.cs


示例7: SendKeepInfo

		public override void SendKeepInfo(AbstractGameKeep keep)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepInfo));

			pak.WriteShort((ushort)keep.KeepID);
			pak.WriteShort(0);//zone id not sure
			pak.WriteInt((uint)keep.X);
			pak.WriteInt((uint)keep.Y);
			pak.WriteShort((ushort)keep.Heading);
			pak.WriteByte((byte)keep.Realm);
			pak.WriteByte((byte)keep.Level);//level(not sure)
			pak.WriteShort(0);//unk
			pak.WriteByte(0x57);//model= 5-8Bit =lvl 1-4bit = Keep Type //uncertain
			pak.WriteByte(0xB7);//unk
			SendTCP(pak);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:16,代码来源:PacketLib170.cs


示例8: LoadFromDatabase

		/// <summary>
		/// load component from db object
		/// </summary>
		public virtual void LoadFromDatabase(DBKeepComponent component, AbstractGameKeep keep)
		{
			Region myregion = WorldMgr.GetRegion((ushort)keep.Region);
			if (myregion == null)
				return;
			this.Keep = keep;
			//this.DBKeepComponent = component;
			base.LoadFromDatabase(component);
			//this x and y is for get object in radius
			double angle = keep.Heading * ((Math.PI * 2) / 360); // angle*2pi/360;
			X = (int)(keep.X + ((sbyte)component.X * 148 * Math.Cos(angle) + (sbyte)component.Y * 148 * Math.Sin(angle)));
			Y = (int)(keep.Y - ((sbyte)component.Y * 148 * Math.Cos(angle) - (sbyte)component.X * 148 * Math.Sin(angle)));
			this.Z = keep.Z;
			// and this one for packet sent
			this.ComponentX = component.X;
			this.ComponentY = component.Y;
			this.ComponentHeading = (ushort)component.Heading;
			//need check to be sure for heading
			angle = (component.Heading * 90 + keep.Heading);
			if (angle > 360) angle -= 360;
			this.Heading = (ushort)(angle / 0.08789);
			this.Name = keep.Name;
			this.Model = INVISIBLE_MODEL;
			this.Skin = component.Skin;
			m_oldMaxHealth = MaxHealth;
			this.Health = MaxHealth;
			//			this.Health = component.Health;
			this.m_oldHealthPercent = this.HealthPercent;
			this.CurrentRegion = myregion;
			this.ID = component.ID;
			this.SaveInDB = false;
			this.IsRaized = false;
			LoadPositions();
			this.AddToWorld();
			FillPositions();
			this.RepairedHealth = this.MaxHealth;
			m_CreateInfo = component.CreateInfo;
			StartHealthRegeneration();
		}
开发者ID:boscorillium,项目名称:dol,代码行数:42,代码来源:GameKeepComponent.cs


示例9: RegisterKeep

 public virtual void RegisterKeep(int keepID, AbstractGameKeep keep)
 {
     m_keepList.Add(keepID, keep);
     log.Info("Registered Keep: " + keep.Name);
 }
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:5,代码来源:KeepManager.cs


示例10: KeepEventArgs

		public KeepEventArgs(AbstractGameKeep keep, eRealm realm)
		{
			this.m_keep = keep;
			this.m_realm = realm;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:5,代码来源:KeepEventArgs.cs


示例11: GetRealmPointsForKeep

        /// <summary>
        /// Realm points a keep is worth when captured
        /// </summary>
        /// <param name="keep"></param>
        /// <returns></returns>
        public virtual int GetRealmPointsForKeep(AbstractGameKeep keep)
        {
            int value = 0;

            if (keep is GameKeep)
            {
                value = Math.Max(50, ServerProperties.Properties.KEEP_RP_BASE + ((keep.BaseLevel - 50) * ServerProperties.Properties.KEEP_RP_MULTIPLIER));
            }
            else
            {
                value = Math.Max(5, ServerProperties.Properties.TOWER_RP_BASE + ((keep.BaseLevel - 50) * ServerProperties.Properties.TOWER_RP_MULTIPLIER));
            }

            value += ((keep.Level - ServerProperties.Properties.STARTING_KEEP_LEVEL) * ServerProperties.Properties.UPGRADE_MULTIPLIER);

            return Math.Max(5, value);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:22,代码来源:AbstractServerRules.cs


示例12: BroadcastRaize

		/// <summary>
		/// Sends a message to all players to notify them of the raize
		/// </summary>
		/// <param name="keep">The keep object</param>
		/// <param name="realm">The raizing realm</param>
		public static void BroadcastRaize(AbstractGameKeep keep, eRealm realm)
		{
			string message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastRaize.Razed", keep.Name, GlobalConstants.RealmToName(realm)));
			BroadcastMessage(message, eRealm.None);
			NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:11,代码来源:Player+Manager.cs


示例13: SendKeepRealmUpdate

		public virtual void SendKeepRealmUpdate(AbstractGameKeep keep)
		{
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:3,代码来源:PacketLib168.cs


示例14: CalcCY

 public int CalcCY(GamePlayer player, AbstractGameKeep myKeep, double angle)
 {
     if (Math.Abs(Math.Sin(angle)) < 0.0001)
     {
         return (myKeep.Y - player.Y) / 148;
     }
     else
     {
         int cx = (int)((148 * Math.Sin(angle) * myKeep.X - 148 * Math.Sin(angle) * player.X + player.Y - myKeep.Y)
                     / (148 * Math.Sin(angle) - 148 * 148 * 2 * Math.Sin(angle) * Math.Cos(angle)));
         return (int)((myKeep.Y - player.Y + 148 * Math.Sin(angle) * cx) / (148 * Math.Cos(angle)));
     }
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:KeepComponent.cs


示例15: IsAllowedToInteract

		/// <summary>
		/// Method to tell us if a player can interact with the lord to do certain tasks
		/// </summary>
		/// <param name="player">The player object</param>
		/// <param name="keep">The area object</param>
		/// <param name="type">The type of interaction</param>
		/// <returns></returns>
		public static bool IsAllowedToInteract(GamePlayer player, AbstractGameKeep keep, eInteractType type)
		{
			if (player.Client.Account.PrivLevel > 1)
				return true;
			if (player.Realm != keep.Realm)
				return false;
			if (player.Guild == null)
				return false;

			if (keep.InCombat)
			{
				log.DebugFormat("KEEPWARNING: {0} attempted to {1} {2} while in combat.", player.Name, type, keep.Name);
				return false;
			}

			switch (type)
			{
				case eInteractType.Claim:
					{
						if (keep.Guild != null)
							return false;
						foreach (AbstractGameKeep k in GameServer.KeepManager.GetAllKeeps())
						{
							if (k.Guild == player.Guild)
								return false;
						}
						if (player.Group == null)
							return false;
						if (player.Group.Leader != player)
							return false;
						if (player.Group.MemberCount < ServerProperties.Properties.CLAIM_NUM)
							return false;
						if (!player.GuildRank.Claim)
							return false;
						break;
					}
				case eInteractType.Release:
					{
						if (keep.Guild == null)
							return false;
						if (keep.Guild != player.Guild)
							return false;
						if (!player.GuildRank.Claim)
							return false;
						break;
					}
				case eInteractType.ChangeLevel:
					{
						if (keep.Guild == null)
							return false;
						if (keep.Guild != player.Guild)
							return false;
						if (!player.GuildRank.Claim)
							return false;
						break;
					}
			}
			return true;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:66,代码来源:Player+Manager.cs


示例16: SendKeepComponentUpdate

		public virtual void SendKeepComponentUpdate(AbstractGameKeep keep, bool LevelUp)
		{
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:3,代码来源:PacketLib168.cs


示例17: CalcCX

 public int CalcCX(GamePlayer player, AbstractGameKeep myKeep, double angle)
 {
     if (Math.Abs(Math.Sin(angle)) < 0.0001) //for approximations, == 0 wont work.
     {
         return (player.X - myKeep.X) / 148;
     }
     else
     {
         return (int)((148 * Math.Sin(angle) * myKeep.X - 148 * Math.Sin(angle) * player.X + player.Y - myKeep.Y)
                     / (148 * Math.Sin(angle) - 148 * 148 * 2 * Math.Sin(angle) * Math.Cos(angle)));
     }
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:12,代码来源:KeepComponent.cs


示例18: CreatePatrolPosition

		/// <summary>
		/// Creates a guard patrol position
		/// </summary>
		/// <param name="guardID">The guard ID</param>
		/// <param name="component">The component object</param>
		/// <param name="player">The player object</param>
		/// <returns>The position object</returns>
		public static DBKeepPosition CreatePatrolPosition(string guardID, GameKeepComponent component, GamePlayer player, AbstractGameKeep.eKeepType keepType)
		{
			DBKeepPosition pos = CreatePosition(guardID, component, player);
			pos.Height = 0;
			pos.ClassType = "DOL.GS.Keeps.Patrol";
			pos.KeepType = (int)keepType;
			GameServer.Database.AddObject(pos);
			return pos;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:16,代码来源:Position+Manager.cs


示例19: KeepArea

		public KeepArea(AbstractGameKeep keep)
			: base(keep.Name, keep.X, keep.Y, 0, keep.IsPortalKeep ? PK_RADIUS : (keep is GameKeepTower ? TOWER_RADIUS : KEEP_RADIUS)
)		{
			Keep = keep;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:5,代码来源:KeepArea.cs


示例20: KeepStringBuilder

		private string KeepStringBuilder(AbstractGameKeep keep)
		{
			string buffer = "";
			buffer += keep.Name + ": " + GlobalConstants.RealmToName(keep.Realm);
			if (keep.Guild != null)
			{
				buffer += " (" + keep.Guild.Name + ")";
			}
			buffer += "\n";
			return buffer;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:11,代码来源:realm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Keeps.GameKeepComponent类代码示例发布时间:2022-05-24
下一篇:
C# Housing.House类代码示例发布时间: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