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


C# GameLiving类代码示例

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


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

示例1: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                ArrayList targets = new ArrayList();
                if (player.Group == null)
                    targets.Add(player);
                else
                {
                    foreach (GamePlayer grpplayer in player.Group.GetPlayersInTheGroup())
                    {
                        if (player.IsWithinRadius(grpplayer, SpellRadius) && grpplayer.IsAlive)
                            targets.Add(grpplayer);
                    }
                }
                foreach (GamePlayer target in targets)
                {
                    //send spelleffect
                    if (!target.IsAlive) continue;
                    ValhallasBlessingEffect ValhallasBlessing = target.EffectList.GetOfType<ValhallasBlessingEffect>();
                    if (ValhallasBlessing != null)
                        ValhallasBlessing.Cancel(false);
                    new ValhallasBlessingEffect().Start(target);
                }
            }
            DisableSkill(living);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:ValhallasBlessingAbility.cs

示例2: Start

        public override void Start(GameLiving target)
        {
            base.Start(target);
            owner = target;
            GamePlayer player = target as GamePlayer;
            if (player != null)
            {
                foreach (GamePlayer p in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    p.Out.SendSpellEffectAnimation(player, player, Icon, 0, false, 1);
                }
            }

            //[StephenxPimentel]
            //1.108 - this ability no longer reduces the users attack power by 50%

            //target.DebuffCategory[(int)eProperty.MissHit] -= 50;
            target.BuffBonusCategory4[(int)eProperty.EvadeChance] += 50;
            target.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 0.5);

            if (player != null)
            {
                player.Out.SendUpdateMaxSpeed();
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:25,代码来源:CombatAwarenessEffect.cs

示例3: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED )) return;

            bool deactivate = false;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                if (player.Group != null)
                {
                    SendCasterSpellEffectAndCastMessage(living, 7066, true);
                    foreach (GamePlayer member in player.Group.GetPlayersInTheGroup())
                    {
                        if (!CheckPreconditions(member, DEAD) && living.IsWithinRadius(member, 2000))
                        {
                            if (restoreMana(member, player))
                                deactivate = true;
                        }
                    }
                }
                else
                {
                    if (!CheckPreconditions(player, DEAD))
                    {
                        if (restoreMana(player, player))
                            deactivate = true;
                    }
                }

                if (deactivate)
                    DisableSkill(living);
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:38,代码来源:EpiphanyAbility.cs

示例4: Start

		/// <summary>
		/// Start the stag on player
		/// </summary>
		/// <param name="living">The living object the effect is being started on</param>
		public override void Start(GameLiving living)
		{
			base.Start(living);

			m_originalModel = living.Model;

			if (living is GamePlayer)
			{
				if ((living as GamePlayer).Race == (int)eRace.Lurikeen)
					living.Model = 859;
				else living.Model = 583;
			}			


			double m_amountPercent = (m_level + 0.5 + Util.RandomDouble()) / 10; //+-5% random
			if (living is GamePlayer)
				m_amount = (int)((living as GamePlayer).CalculateMaxHealth(living.Level, living.GetModified(eProperty.Constitution)) * m_amountPercent);
			else m_amount = (int)(living.MaxHealth * m_amountPercent);

			living.BaseBuffBonusCategory[(int)eProperty.MaxHealth] += m_amount;
			living.Health += (int)(living.GetModified(eProperty.MaxHealth) * m_amountPercent);
			if (living.Health > living.MaxHealth) living.Health = living.MaxHealth;

			living.Emote(eEmote.StagFrenzy);

			if (living is GamePlayer)
			{
				(living as GamePlayer).Out.SendUpdatePlayer();
				(living as GamePlayer).Out.SendMessage(LanguageMgr.GetTranslation((living as GamePlayer).Client, "Effects.StagEffect.HuntsSpiritChannel"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:35,代码来源:StagEffect.cs

示例5: ReceiveItem

		/// <summary>
		/// Handle an item given to the scholar.
		/// </summary>
		/// <param name="source"></param>
		/// <param name="item"></param>
		/// <param name="target"></param>
		/// <returns></returns>
		public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
		{
			if (base.ReceiveItem(source, target, item))
				return true;

			GamePlayer player = source as GamePlayer;
			Scholar scholar = target as Scholar;
			if (player == null || scholar == null)
				return false;

			if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
			{
				Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
					(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
				
				if (versions.Count > 0 && RemoveItem(player, item))
				{
					GiveItem(scholar, player, ArtifactID, versions[";;"]);
					String reply = String.Format("Brilliant, thank you! Here, take the artifact. {0} {1} {2}",
						"I've unlocked its powers for you. As I've said before, I'm more interested",
						"in the stories and the history behind these artifacts than the actual items",
						"themselves.");
					scholar.TurnTo(player);
					scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
					FinishQuest();
					return true;
				}
			}

			return false;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:38,代码来源:BeltofOglidarsh.cs

示例6: ReceiveItem

		public override bool ReceiveItem(GameLiving source, InventoryItem item)
		{
			GamePlayer t = source as GamePlayer;
			if (t == null || item == null)
				return false;

			if (item.Level >= 10 && item.IsCrafted)
			{
				if (item.Object_Type != (int) eObjectType.Magical && item.Object_Type != (int) eObjectType.Bolt && item.Object_Type != (int) eObjectType.Poison)
				{
					if (item.Bonus == 0)
					{
						t.TempProperties.setProperty(ENCHANT_ITEM_WEAK, new WeakRef(item));
                        t.Client.Out.SendCustomDialog(LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text1", Money.GetString(CalculEnchantPrice(item))), new CustomDialogResponse(EnchanterDialogResponse));
                    }
					else
                        SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text2"));
                }
				else
                    SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text3"));
            }
			else
                SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text4"));

			return false;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:26,代码来源:Enchanter.cs

示例7: Start

		public override void Start(GameLiving target)
		{
			base.Start(target);
			owner = target;
			GamePlayer player = target as GamePlayer;
			if (player != null)
			{
				foreach (GamePlayer p in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				{
					p.Out.SendSpellEffectAnimation(player, player, Icon, 0, false, 1);
				}
			}

            GameEventMgr.AddHandler(target, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttack));

            //[StephenxPimentel]
            //1.108 updates this so it no longer stuns, but silences.
            //Rest of the code is now located in SpellHandler. (Line 617)
            owner.StopCurrentSpellcast();


			//owner.IsStunned = true;
			//owner.StopAttack();
			//owner.DisableTurning(true);
			//if (player != null)
			//{
			//	player.Out.SendUpdateMaxSpeed();
			//}
			//else
			//{
			//	owner.CurrentSpeed = owner.MaxSpeed;
			//}
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:33,代码来源:NaturesWombEffect.cs

示例8: CalculateDamageVariance

        public override void CalculateDamageVariance(GameLiving target, out double min, out double max)
        {
            int speclevel = 1;
            if (m_caster is GamePlayer)
            {
                speclevel = ((GamePlayer)m_caster).GetModifiedSpecLevel(m_spellLine.Spec);
            }
            min = 1;
            max = 1;

            if (target.Level > 0)
            {
                min = 0.5 + (speclevel - 1) / (double)target.Level * 0.5;
            }

            if (speclevel - 1 > target.Level)
            {
                double overspecBonus = (speclevel - 1 - target.Level) * 0.005;
                min += overspecBonus;
                max += overspecBonus;
            }

            if (min > max) min = max;
            if (min < 0) min = 0;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:25,代码来源:HereticDamageLostOnPulse.cs

示例9: CheckBeginCast

        public override bool CheckBeginCast(GameLiving selectedTarget)
        {
            if(!(Caster is GamePlayer))
            {
                return false;
            }
            /*
             * [Ganrod]Nidel: Like 1.90 EU off servers
             * -Need Main Turret under our controle before casting.
             * -Select automatically Main controlled Turret if player don't have target or Turret target.
             * -Cast only on our turrets.
             */
            if (Caster.ControlledBrain == null || Caster.ControlledBrain.Body == null)
            {
                MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "PetPBAOE.CheckBeginCast.NoPet"), eChatType.CT_System);
                return false;
            }
            TurretPet target = selectedTarget as TurretPet;

            if(target == null || !Caster.IsControlledNPC(target))
            {
                target = Caster.ControlledBrain.Body as TurretPet;
            }
            return base.CheckBeginCast(target);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:25,代码来源:PetPBAoE.cs

示例10: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            GamePlayer player = living as GamePlayer;
            if (player == null)
                return;

            // Check for MoC on the Sorceror: he cannot cast RA5L when the other is up
            MasteryofConcentrationEffect ra5l = null;
            lock (player.EffectList)
            {
                foreach (object effect in player.EffectList)
                {
                    if (effect is MasteryofConcentrationEffect)
                    {
                        ra5l = effect as MasteryofConcentrationEffect;
                        break;
                    }
                }
            }
            if (ra5l != null)
            {
                player.Out.SendMessage("You cannot currently use this ability", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }

            SendCasterSpellEffectAndCastMessage(player, 7048, true);
            ShieldOfImmunityEffect raEffect = new ShieldOfImmunityEffect();
            raEffect.Start(player);

            DisableSkill(living);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:37,代码来源:ShieldOfImmunityAbility.cs

示例11: CalculateSpellResistChance

        public override int CalculateSpellResistChance(GameLiving target)
        {
            int resistvalue = 0;
            int resist = 0;
            GameSpellEffect fury = SpellHandler.FindEffectOnTarget(target, "Fury");
            if (fury != null)
            {
                resist += (int)fury.Spell.Value;
            }

            //bonedancer rr5
            if (target.EffectList.GetOfType<AllureofDeathEffect>() != null)
            {
                return AllureofDeathEffect.ccchance;
            }

            if (m_spellLine.KeyName == GlobalSpellsLines.Combat_Styles_Effect)
                return 0;
            if (HasPositiveEffect)
                return 0;

            int hitchance = CalculateToHitChance(target);

            //Calculate the Resistchance
            resistvalue = (100 - hitchance + resist);
            if (resistvalue > 100)
                resistvalue = 100;
            //use ResurrectHealth=1 if the CC should not be resisted
            if(Spell.ResurrectHealth==1) resistvalue=0;
            //always 1% resistchance!
            else if (resistvalue < 1)
                resistvalue = 1;
            return resistvalue;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:34,代码来源:CCSpellHandler.cs

示例12: ReceiveItem

        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            GamePlayer player = source as GamePlayer;
            Scholar scholar = target as Scholar;
            if (player == null || scholar == null)
                return false;

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                    (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                IDictionaryEnumerator versionsEnum = versions.GetEnumerator();
                versionsEnum.MoveNext();

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactID, versionsEnum.Value as ItemTemplate);
                    String reply = String.Format("Thank you! Here, take this cloak. {0}",
                        "I hope you find it useful. Please don't lose it, I can't replace it!");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return true;
                }
            }

            return base.ReceiveItem(source, target, item);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:36,代码来源:Cloudsong.cs

示例13: ReceiveItem

		/// <summary>
		/// Handle an item given to the scholar.
		/// </summary>
		/// <param name="source"></param>
		/// <param name="item"></param>
		/// <param name="target"></param>
		/// <returns></returns>
		public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
		{
			if (base.ReceiveItem(source, target, item))
				return true;

			GamePlayer player = source as GamePlayer;
			Scholar scholar = target as Scholar;
			if (player == null || scholar == null)
				return false;

			if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
			{
				Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
					(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

				if (versions.Count > 0 && RemoveItem(player, item))
				{
					GiveItem(scholar, player, ArtifactID, versions[";;"]);
					String reply = String.Format("Great! Thanks! This should help us in {0} {1}",
						"our studies. We've found several other references to this shield. Don't know how",
						"much this book will help, but it certainly can't hurt!");
					scholar.TurnTo(player);
					scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
					FinishQuest();
					return true;
				}
			}

			return false;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:37,代码来源:ShieldOfKhaos.cs

示例14: ReceiveItem

		/// <summary>
		/// Handle an item given to the scholar.
		/// </summary>
		/// <param name="source"></param>
		/// <param name="item"></param>
		/// <param name="target"></param>
		/// <returns></returns>
		public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
		{
			if (base.ReceiveItem(source, target, item))
				return true;

			GamePlayer player = source as GamePlayer;
			Scholar scholar = target as Scholar;
			if (player == null || scholar == null)
				return false;

			if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
			{
				Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
					(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

				if (versions.Count > 0 && RemoveItem(player, item))
				{
					GiveItem(scholar, player, ArtifactID, versions[";;"]);
					String reply = String.Format("Ahh. This is a tale about some great {0} {1} {2} {3}.",
						"crazy champion named Remus. There's not much known about him, or his father,",
						"except what is in this tale. I've read pieces of it, but never did we find all",
						"the letters. It's a great find. Thank you,",
						player.Name);
					scholar.TurnTo(player);
					scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
					FinishQuest();
					return true;
				}
			}

			return false;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:39,代码来源:AtensShield.cs

示例15: CheckBeginCast

        /// <summary>
        /// Check whether it's possible to summon a pet.
        /// </summary>
        /// <param name="selectedTarget"></param>
        /// <returns></returns>
        public override bool CheckBeginCast(GameLiving selectedTarget)
        {
            if (Caster.GroundTarget == null)
            {
                if (Caster is GamePlayer)
                    MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "SummonAnimistPet.CheckBeginCast.GroundTargetNull"), eChatType.CT_SpellResisted);
                return false;
            }

            if (!Caster.GroundTargetInView)
            {
                if (Caster is GamePlayer)
                    MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "SummonAnimistPet.CheckBeginCast.GroundTargetNotInView"), eChatType.CT_SpellResisted);
                return false;
            }

            if (!Caster.IsWithinRadius(Caster.GroundTarget, CalculateSpellRange()))
            {
                if (Caster is GamePlayer)
                    MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "SummonAnimistPet.CheckBeginCast.GroundTargetNotInSpellRange"), eChatType.CT_SpellResisted);
                return false;
            }

            return base.CheckBeginCast(selectedTarget);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:30,代码来源:SummonAnimistPet.cs


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