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

C# GS.GameObject类代码示例

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

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



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

示例1: EnemyHealedEventArgs

		/// <summary>
		/// Constructs new EnemyHealedEventArgs
		/// </summary>
		/// <param name="enemy">The healed enemy</param>
		/// <param name="healSource">The heal source</param>
		/// <param name="changeType">The health change type</param>
		/// <param name="healAmount">The heal amount</param>
		public EnemyHealedEventArgs(GameLiving enemy, GameObject healSource, GameLiving.eHealthChangeType changeType, int healAmount)
		{
			m_enemy = enemy;
			m_healSource = healSource;
			m_changeType = changeType;
			m_healAmount = healAmount;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:14,代码来源:EnemyHealedEventArgs.cs


示例2: RegionAction

 /// <summary>
 /// Constructs a new region action
 /// </summary>
 /// <param name="actionSource">The action source</param>
 public RegionAction(GameObject actionSource)
     : base(actionSource.CurrentRegion.TimeManager)
 {
     if (actionSource == null)
         throw new ArgumentNullException("actionSource");
     m_actionSource = actionSource;
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:RegionAction.cs


示例3: SelectTargets

        public override System.Collections.IList SelectTargets(GameObject castTarget)
        {
            ArrayList list = new ArrayList();
            GameLiving target = castTarget as GameLiving;

            if (Caster is GamePlayer)
            {
                GamePlayer casterPlayer = (GamePlayer)Caster;
                Group group = casterPlayer.Group;
                if(group == null) return list; // Should not appen since it is checked in ability handler
                int spellRange = CalculateSpellRange();
                if (group != null)
                {
                    lock (group)
                    {
                        foreach (GamePlayer groupPlayer in casterPlayer.GetPlayersInRadius((ushort)m_spell.Radius))
                        {
                            if (casterPlayer.Group.IsInTheGroup(groupPlayer))
                            {
                                if (groupPlayer != casterPlayer && groupPlayer.IsAlive)
                                {
                                    list.Add(groupPlayer);
                                    IControlledBrain npc = groupPlayer.ControlledBrain;
                                    if (npc != null)
                                        if (casterPlayer.IsWithinRadius( npc.Body, spellRange ))
                                            list.Add(npc.Body);
                                }
                            }
                        }
                    }
                }
            }
            return list;
        }    	    	
开发者ID:boscorillium,项目名称:dol,代码行数:34,代码来源:MetalGuardSpellHandler.cs


示例4: TakeDamageEventArgs

 /// <summary>
 /// Constructs new TakeDamageEventArgs
 /// </summary>
 /// <param name="damageSource">The damage source</param>
 /// <param name="damageType">The damage type</param>
 /// <param name="damageAmount">The damage amount</param>
 /// <param name="criticalAmount">The critical damage amount</param>
 public TakeDamageEventArgs(GameObject damageSource, eDamageType damageType, int damageAmount, int criticalAmount)
 {
     m_damageSource = damageSource;
     m_damageType = damageType;
     m_damageAmount = damageAmount;
     m_criticalAmount = criticalAmount;
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:14,代码来源:TakeDamageEventArgs.cs


示例5: SelectTargets

        public override IList<GameLiving> SelectTargets(GameObject castTarget)
        {
            var list = new List<GameLiving>(8);
            GameLiving target = castTarget as GameLiving;

            if (target == null || Spell.Range == 0)
                target = Caster;

            foreach (GamePlayer player in target.GetPlayersInRadius(false, (ushort)Spell.Radius))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(Caster, player, true))
                {
                    list.Add(player);
                }
            }
            foreach (GameNPC npc in target.GetNPCsInRadius(false, (ushort)Spell.Radius))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(Caster, npc, true))
                {
                    list.Add(npc);
                }
            }

            return list;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:25,代码来源:MonsterRez.cs


示例6: GameMoney

		/// <summary>
		/// Constructs a new Money bag with a value and the position of the dropper
		/// It will disappear after 2 minutes
		/// </summary>
		/// <param name="copperValue">the coppervalue of this bag</param>
		/// <param name="dropper">the gameobject that dropped this bag</param>
		public GameMoney(long copperValue, GameObject dropper):this(copperValue)
		{
			X=dropper.X;
			Y=dropper.Y;
			Z=dropper.Z;
			Heading = dropper.Heading;
			CurrentRegion = dropper.CurrentRegion;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:14,代码来源:GameMoney.cs


示例7: OnPlayerKilled

		/// <summary>
		/// Invoked on Player death and deals out
		/// experience/realm points if needed
		/// </summary>
		/// <param name="killedPlayer">player that died</param>
		/// <param name="killer">killer</param>
		public override void OnPlayerKilled(GamePlayer killedPlayer, GameObject killer)
		{
			base.OnPlayerKilled(killedPlayer, killer);
			if (killer == null || killer is GamePlayer)
				killedPlayer.TempProperties.setProperty(KILLED_BY_PLAYER_PROP, KILLED_BY_PLAYER_PROP);
			else
				killedPlayer.TempProperties.removeProperty(KILLED_BY_PLAYER_PROP);
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:14,代码来源:PvPServerRules.cs


示例8: BroadcastMsg

 /// <summary>
 /// Broadcasts a message to players within saydistance from this object
 /// </summary>
 /// <param name="obj">The object that says the message</param>
 /// <param name="msg">The message that the object says</param>
 /// <param name="chattype">The chattype of the message</param>
 /// <param name="IsSaying">Is this object saying the message if false the message will drop the 'objname says' part</param>
 public static void BroadcastMsg(GameObject obj, string msg, eChatType chattype, bool IsSaying)
 {
     foreach (GamePlayer bPlayer in obj.GetPlayersInRadius((ushort)WorldMgr.SAY_DISTANCE))
     {
         if (IsSaying) { bPlayer.Out.SendMessage(obj.Name + " says \"" + msg + "\"", chattype, eChatLoc.CL_ChatWindow); }
         else { bPlayer.Out.SendMessage(msg, chattype, eChatLoc.CL_ChatWindow); }
     }
     return;
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:16,代码来源:EncounterMgr.cs


示例9: SelectTargets

 public override IList SelectTargets(GameObject castTarget)
 {
     ArrayList list = new ArrayList();
     GameLiving target = Caster;
     foreach (GameNPC npc in target.GetNPCsInRadius((ushort)Spell.Radius))
     {
         if (npc is GameNPC && npc.Brain is ControlledNpcBrain)//!(npc is NecromancerPet))
             list.Add(npc);
     }
     return list;
 }
开发者ID:mynew4,项目名称:DAoC,代码行数:11,代码来源:Warlord.cs


示例10: TakeDamage

		/// <summary>
		/// This methode is override to remove XP system
		/// </summary>
		/// <param name="source">the damage source</param>
		/// <param name="damageType">the damage type</param>
		/// <param name="damageAmount">the amount of damage</param>
		/// <param name="criticalAmount">the amount of critical damage</param>
		public override void TakeDamage(GameObject source, eDamageType damageType, int damageAmount, int criticalAmount)
		{
			//Work around the XP system
			if (IsAlive)
			{
				Health -= (damageAmount + criticalAmount);
				if (!IsAlive)
				{
					Health = 0;
					Die(source);
				}
			}
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:20,代码来源:GameMovingObject.cs


示例11: Attack

		/// <summary>
		/// Direct the subpets to attack too
		/// </summary>
		/// <param name="target">The target to attack</param>
		public override void Attack(GameObject target)
		{
			base.Attack(target);
			//Check for any abilities
			CheckAbilities();
			if (Body.ControlledNpcList != null)
			{
				lock (Body.ControlledNpcList)
				{
					foreach (BDPetBrain icb in Body.ControlledNpcList)
						if (icb != null)
							icb.Attack(target);
				}
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:19,代码来源:CommanderBrain.cs


示例12: StartAttack

        public override void StartAttack(GameObject target)
        {
            base.StartAttack(target);

            if (!TempProperties.getProperty<bool>(ALREADY_GOT_HELP))
            {
                foreach (GameNPC npc in GetNPCsInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    //on initial attack, all fireborn in range add!
                    if (npc.Name == "minotaur fireborn")
                    npc.StartAttack(target);
                }

                TempProperties.setProperty(ALREADY_GOT_HELP, true);
            }
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:16,代码来源:ArrektosProtector.cs


示例13: Attack

        public void Attack(GameObject target)
        {
            foreach (Spell spell in Body.HarmfulSpells)
            {
                if (target.IsAttackable && !target.HasEffect(spell))
                {
                    Body.StopMoving();
                    Body.TargetObject = target;
                    Body.TurnTo(target);
                    Body.CastSpell(spell, SpellLine);
                    return;
                }
            }

            Body.Notify(GameLivingEvent.CastFailed, Body);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:16,代码来源:CastingBehaviour.cs


示例14: StartAttack

        public override void StartAttack(GameObject attackTarget)
        {
            base.StartAttack(attackTarget);

            foreach (GamePlayer player in GetPlayersInRadius(WorldMgr.SAY_DISTANCE))
            {
                if (player != null)
                    switch (Realm)
                    {
                        case eRealm.Albion:
                            player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Albion.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break;
                        case eRealm.Midgard:
                            player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Midgard.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break;
                        case eRealm.Hibernia:
                            player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Hibernia.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break;
                    }
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:18,代码来源:GameGuard.cs


示例15: TakeDamage

        public override void TakeDamage(GameObject source, eDamageType damageType, int damageAmount, int criticalAmount)
        {
            //Check if this encounter mob is tethered and if so, ignore any damage done both outside of or too far from it's tether range.
            if (this.TetherRange > 100)
            {
                // if controlled NPC - do checks for owner instead
                if (source is GameNPC)
                {
                    IControlledBrain controlled = ((GameNPC)source).Brain as IControlledBrain;
                    if (controlled != null)
                    {
                        source = controlled.GetPlayerOwner();
                    }
                }

                if (IsOutOfTetherRange)
                {
                    if (source is GamePlayer)
                    {
                        GamePlayer player = source as GamePlayer;
                        player.Out.SendMessage("The " + this.Name + " is too far from its encounter area, your damage fails to have an effect on it!", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
                        return;
                    }
                    return;
                }
                else
                {
                    if (IsWithinRadius(source, this.TetherRange))
                    {
                        base.TakeDamage(source, damageType, damageAmount, criticalAmount);
                        return;
                    }
                    if (source is GamePlayer)
                    {
                        GamePlayer player = source as GamePlayer;
                        player.Out.SendMessage("You are too far from the " + this.Name + ", your damage fails to effect it!", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
                    }
                    return;
                }
            }
            else
                base.TakeDamage(source, damageType, damageAmount, criticalAmount);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:43,代码来源:TetheredEncounterMob.cs


示例16: GenerateLoot

		/// <summary>
        /// Generate loot for given mob
		/// </summary>
		/// <param name="mob"></param>
		/// <param name="killer"></param>
		/// <returns></returns>
		public override LootList GenerateLoot(GameNPC mob, GameObject killer)
		{
			LootList loot = base.GenerateLoot(mob, killer);

			int lvl = mob.Level + 1;
			if (lvl < 1) lvl = 1;
			int minLoot = 2 + ((lvl * lvl * lvl) >> 3);

			long moneyCount = minLoot + Util.Random(minLoot >> 1);
			moneyCount = (long)((double)moneyCount * ServerProperties.Properties.MONEY_DROP);

			ItemTemplate money = new ItemTemplate();
			money.Model = 488;
			money.Name = "bag of coins";
			money.Level = 0;

			money.Price = moneyCount;
			
			loot.AddFixed(money, 1);
			return loot;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:27,代码来源:LootGeneratorMoney.cs


示例17: Attack

		public override void Attack(GameObject target)
		{
			GameLiving defender = target as GameLiving;
			if(defender == null)
			{
				return;
			}

			if(!GameServer.ServerRules.IsAllowedToAttack(Body, defender, true))
			{
				return;
			}

			if(AggressionState == eAggressionState.Passive)
			{
				AggressionState = eAggressionState.Defensive;
				UpdatePetWindow();
			}
			m_orderAttackTarget = defender;
			AttackMostWanted();
			Body.StartAttack(m_orderAttackTarget);
			return;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:23,代码来源:TurretMainPetCasterBrain.cs


示例18: StartAttack

		public override void StartAttack(GameObject attackTarget)
		{
			if (attackTarget == null)
				return;

			if (attackTarget is GameLiving && GameServer.ServerRules.IsAllowedToAttack(this, (GameLiving)attackTarget, true) == false)
				return;

			if (Brain is IControlledBrain)
			{
				if ((Brain as IControlledBrain).AggressionState == eAggressionState.Passive)
					return;
				GamePlayer playerowner;
				if ((playerowner = ((IControlledBrain)Brain).GetPlayerOwner()) != null)
					playerowner.Stealth(false);
			}

			TargetObject = attackTarget;
			if (TargetObject.Realm == 0 || Realm == 0)
				m_lastAttackTickPvE = m_CurrentRegion.Time;
			else
				m_lastAttackTickPvP = m_CurrentRegion.Time;

			if (m_attackers.Count == 0)
			{
				if (SpellTimer == null)
					SpellTimer = new SpellAction(this);
				if (!SpellTimer.IsAlive)
					SpellTimer.Start(1);
			}

			if (Brain is TurretMainPetTankBrain)
			{
				base.StartAttack(TargetObject);
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:36,代码来源:TurretPet.cs


示例19: ChatToArea

		/// <summary>
		/// Sends a message to the chat window of players inside
		/// a specific distance of the center object
		/// </summary>
		/// <param name="centerObject">The center object of the message</param>
		/// <param name="message">The message to send</param>
		/// <param name="chatType">The type of message to send</param>
		/// <param name="distance">The distance around the center where players will receive the message</param>
		/// <param name="excludes">An optional list of excluded players</param>
		/// <remarks>If the center object is a player, he will get the message too</remarks>
		public static void ChatToArea(GameObject centerObject, string message, eChatType chatType, ushort distance, params GameObject[] excludes)
		{
			MessageToArea(centerObject, message, chatType, eChatLoc.CL_ChatWindow, distance, excludes);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:14,代码来源:Message.cs


示例20: DespawnTimer

 /// <summary>
 /// Constructs a new DespawnTimer.
 /// </summary>
 /// <param name="timerOwner">The owner of this timer.</param>
 /// <param name="npc">The GameNPC to despawn when the time is up.</param>
 /// <param name="delay">The time after which the add is supposed to despawn.</param>
 public DespawnTimer(GameObject timerOwner, GameNPC npc, int delay)
     : base(timerOwner.CurrentRegion.TimeManager)
 {
     m_npc = npc;
     Start(delay);
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:GameDragon.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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