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


C# GS.GameObject类代码示例

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


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


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