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


C# InternalItem.Delete方法代码示例

本文整理汇总了C#中InternalItem.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# InternalItem.Delete方法的具体用法?C# InternalItem.Delete怎么用?C# InternalItem.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InternalItem的用法示例。


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

示例1: Target

		public void Target( IPoint3D p )
		{
			if ( !Caster.CanSee( p ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
            else if (/*SpellHelper.CheckTown(p, Caster) && */CheckSequence())
            {


                //if (CheckSequence())

				SpellHelper.GetSurfaceTop( ref p );

				int dx = Caster.Location.X - p.X;
				int dy = Caster.Location.Y - p.Y;
				int rx = (dx - dy) * 44;
				int ry = (dx + dy) * 44;

				bool eastToWest;

				if ( rx >= 0 && ry >= 0 )
				{
					eastToWest = false;
				}
				else if ( rx >= 0 )
				{
					eastToWest = true;
				}
				else if ( ry >= 0 )
				{
					eastToWest = true;
				}
				else
				{
					eastToWest = false;
				}

                Effects.PlaySound(p, Caster.Map, Sound);

				int itemID = eastToWest ? 0x398C : 0x3996;

				TimeSpan duration;

				if ( Core.AOS )
					duration = TimeSpan.FromSeconds( (15 + (Caster.Skills.Magery.Fixed / 5)) / 4 );
				else
					duration = TimeSpan.FromSeconds( 4.0 + (Caster.Skills[SkillName.Magery].Value * 0.5) );

                List<InternalItem> itemList = new List<InternalItem>();
				for ( int i = -3; i <= 3; ++i )
				{
					Point3D loc = new Point3D( eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z );
                   
                    //bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false);

                    //if (!canFit)
                    //    continue;

                    IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);

                    foreach (Mobile m in eable)
                    {
                        if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
                            continue;

                        //Taran: The whole field counts as a harmful action, not just the target
                        if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
                            Caster.DoHarmful(m);

                        if (m is BaseCreature)
                            ((BaseCreature)m).OnHarmfulSpell(Caster);
                    }

					InternalItem toAdd = new InternalItem( itemID, loc, Caster, Caster.Map, duration, i );
				    itemList.Add(toAdd);
                  
				}

                if (itemList.Count > 0)
                    new SoundTimer(itemList, Sound).Start();

                if (SphereSpellTarget is Mobile)
                {
                    InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3);
                    castItem.OnMoveOver(SphereSpellTarget as Mobile);
                    //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile
                    castItem.Delete();
                }
			}

			FinishSequence();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:98,代码来源:FireField.cs

示例2: Target

        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendAsciiMessage("Target is not in line of sight.");
                DoFizzle();
            }
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
            else if (/*SpellHelper.CheckTown(p, Caster) && */CheckSequence())
            {
                SpellHelper.GetSurfaceTop(ref p);

                int dx = Caster.Location.X - p.X;
                int dy = Caster.Location.Y - p.Y;
                int rx = (dx - dy)*44;
                int ry = (dx + dy)*44;

                bool eastToWest;

                if (rx >= 0 && ry >= 0)
                {
                    eastToWest = false;
                }
                else if (rx >= 0)
                {
                    eastToWest = true;
                }
                else if (ry >= 0)
                {
                    eastToWest = true;
                }
                else
                {
                    eastToWest = false;
                }

                Effects.PlaySound(p, Caster.Map, Sound);

                int itemID = eastToWest ? 0x3915 : 0x3922;

                TimeSpan duration = TimeSpan.FromSeconds(3 + (Caster.Skills.Magery.Fixed/25));


                List<InternalItem> itemList = new List<InternalItem>();

                for (int i = -3; i <= 3; ++i)
                {
                    Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);

                    IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);

                    foreach (Mobile m in eable)
                    {
                        if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
                            continue;

                        //Taran: The whole field counts as a harmful action, not just the target
                        if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
                            Caster.DoHarmful(m);
                    }

                    InternalItem item = new InternalItem(itemID, loc, Caster, Caster.Map, duration, i);
                    itemList.Add(item);
                }

                if (SphereSpellTarget is Mobile)
                {
                    InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3);
                    castItem.OnMoveOver(SphereSpellTarget as Mobile);
                    //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile

                    castItem.Delete();
                }

                if (itemList.Count > 0)
                    new SoundTimer(itemList, 517).Start();

                FinishSequence();
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:84,代码来源:PoisonField.cs

示例3: Target

		public void Target(IPoint3D p)
		{
			if ( !Caster.CanSee( p ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
			else if (CheckSequence())
			{
				SpellHelper.GetSurfaceTop(ref p);

				int dx = Caster.Location.X - p.X;
				int dy = Caster.Location.Y - p.Y;
				int rx = (dx - dy) * 44;
				int ry = (dx + dy) * 44;

				bool eastToWest;

				if (rx >= 0 && ry >= 0)
					eastToWest = false;
				else if (rx >= 0)
					eastToWest = true;
				else if (ry >= 0)
					eastToWest = true;
				else
					eastToWest = false;

				Effects.PlaySound(p, Caster.Map, Sound);

				int itemID = eastToWest ? 0x3967 : 0x3979;

				TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value / 3.0));

				List<Item> itemList = new List<Item>();
				for (int i = -3; i <= 3; ++i)
				{
					Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
                    //bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false);

                    //if (!canFit)
                    //    continue;

                    IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0);

                    foreach (Mobile m in eable)
                    {
                        if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young))
                            continue;

                        //Taran: The whole field counts as a harmful action, not just the target
                        if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10)
                            Caster.DoHarmful(m);

                        if (m is BaseCreature)
                            ((BaseCreature)m).OnHarmfulSpell(Caster);
                    }

					Item item = new InternalItem(Caster, itemID, loc, Caster.Map, duration);
					itemList.Add(item);
					item.ProcessDelta();
				}

				if (itemList.Count > 0)
					new FreezeTimer(itemList, Sound, duration.Seconds).Start();

                if (SphereSpellTarget is Mobile)
                {
                    InternalItem castItem = new InternalItem(Caster, itemID, (SphereSpellTarget as Mobile).Location, Caster.Map, duration);
                    castItem.OnMoveOver(SphereSpellTarget as Mobile);
                    //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile
                    castItem.Delete();
                    if (SphereSpellTarget is BaseCreature && ((BaseCreature)SphereSpellTarget).ParalyzeImmune)
                        ((Mobile)SphereSpellTarget).PublicOverheadMessage(MessageType.Emote, 0x3B2, true, "The paralyze spell seems to have no effect");
                }

				//Mobile mob = SphereSpellTarget as Mobile;

				/*if (mob != null)
				{
					InternalItem castItem = new InternalItem(Caster, itemID, mob.Location, Caster.Map, duration);
					castItem.OnMoveOver(mob);
					Caster.DoHarmful(mob);


					castItem.Delete();
				}*/
			}

			FinishSequence();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:94,代码来源:ParalyzeField.cs


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