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

C# Items.BaseWeapon类代码示例

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

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



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

示例1: ExpireTimer

 public ExpireTimer(BaseWeapon weapon, TimeSpan delay, object state)
     : base(delay)
 {
     m_Caster = (Mobile)state;
     this.m_Weapon = weapon;
     this.Priority = TimerPriority.OneSecond;
 }
开发者ID:Jascen,项目名称:UOSmart,代码行数:7,代码来源:CurseWeapon.cs


示例2: OnWeaponHit

		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				defender.BoltEffect(0);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:28,代码来源:XmlLightning.cs


示例3: Capacitor

        public void Capacitor(Mobile attacker, Mobile defender, BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fourth)
            {
                if (!(weapon is Fists) && !(weapon is BaseRanged) && weapon is BaseWeapon && Utility.RandomDouble() <= 0.10)
                {
                    int element = Utility.RandomMinMax(1, 4);

                    switch (element)
                    {
                        case 1:
                            {
                                weapon.DoLightning(attacker, defender);
                                break;
                            }
                        case 2:
                            {
                                weapon.DoMagicArrow(attacker, defender);
                                break;
                            }
                        case 3:
                            {
                                weapon.DoHarm(attacker, defender);
                                break;
                            }
                        case 4:
                            {
                                weapon.DoFireball(attacker, defender);
                                break;
                            }

                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:35,代码来源:Warlock.cs


示例4: OnWeaponHit

		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int drain = 0;

			if (m_Drain > 0)
			{
				drain = Utility.Random(m_Drain);
			}

			if (defender != null && attacker != null && drain > 0)
			{
				defender.Stam -= drain;
				if (defender.Stam < 0)
				{
					defender.Stam = 0;
				}

				attacker.Stam += drain;
				if (attacker.Stam < 0)
				{
					attacker.Stam = 0;
				}

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:35,代码来源:XmlStamDrain.cs


示例5: EnchantSpellGump

        public EnchantSpellGump(Mobile caster, Item scroll, BaseWeapon weapon)
            : base(20, 20)
        {
            m_Caster = caster;
            m_Scroll = scroll;
            m_Weapon = weapon;

            int font = 0x7FFF;

            AddBackground(0, 0, 170, 200, 9270);
            AddAlphaRegion(10, 10, 150, 180);

            AddHtmlLocalized(20, 22, 150, 16, 1080133, font, false, false); //Select Enchant

            AddButton(20, 50, 9702, 9703, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 50, 200, 16, 1079705, font, false, false); //Hit Lighting

            AddButton(20, 75, 9702, 9703, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 75, 200, 16, 1079703, font, false, false); //Hit Fireball

            AddButton(20, 100, 9702, 9703, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 100, 200, 16, 1079704, font, false, false); //Hit Harm

            AddButton(20, 125, 9702, 9703, 4, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 125, 200, 16, 1079706, font, false, false); //Hit Magic Arrow

            AddButton(20, 150, 9702, 9703, 5, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 150, 200, 16, 1079702, font, false, false); //Hit Dispel
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:29,代码来源:EnchantGump.cs


示例6: IsSpecialWeapon

			private bool IsSpecialWeapon( BaseWeapon weapon )
			{
				// Weapons repairable but not craftable

				if ( m_CraftSystem is DefTinkering )
				{
					return ( weapon is Cleaver )
						|| ( weapon is Hatchet )
						|| ( weapon is Pickaxe )
						|| ( weapon is ButcherKnife )
						|| ( weapon is SkinningKnife );
				}
				else if ( m_CraftSystem is DefCarpentry )
				{
					return ( weapon is Club )
						|| ( weapon is BlackStaff )
						|| ( weapon is MagicWand );
				}
				else if ( m_CraftSystem is DefBlacksmithy )
				{
					return ( weapon is Pitchfork );
				}

				return false;
			}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:25,代码来源:Repair.cs


示例7: ImmolatingWeaponEntry

			public ImmolatingWeaponEntry( int damage, BaseWeapon weapon, TimeSpan duration )
			{
				Damage = damage;
				
				Timer = new ExpireTimer( weapon, duration );
				Timer.Start();
			}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:7,代码来源:ImmolatingWeapon.cs


示例8: OnWeaponHit

		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
				attacker.PlaySound(0x15E);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:29,代码来源:XmlFire.cs


示例9: CombatHit

        public static int CombatHit(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, bool UseHitscript)
        {
            bool ApplyDamage = true;

            int Damage = 0;

            if (Weapon is BaseRanged)
                Damage = RangedHit(Attacker, Defender, Weapon, UseHitscript);
            else if (Weapon is BaseMeleeWeapon)
                Damage = MeleeHit(Attacker, Defender, Weapon);

            //(100-weaponType.Speed)/10

            //long Ticks = ((100 - Weapon.Speed) / 10) * TimeSpan.TicksPerMillisecond;

            if (UseHitscript)
            {
                ApplyDamage = HitscriptManager.Run(Weapon.Hitscript, Attacker, Defender, Weapon, ref Damage);
            }

            if (!ApplyDamage)
                Damage = 0;
            //Timer.DelayCall(new TimeSpan(Ticks), new TimerStateCallback(ApplyCombatDamage), Damage);

            if (Damage < 0)
                Damage = 0;

            Attacker.SendMessage("Returning Damage is {0}", Damage);

            return Damage;
        }
开发者ID:notsentient,项目名称:RunZHA,代码行数:31,代码来源:ZuluCombat.cs


示例10: SlayerSelectWeaponGump

		public SlayerSelectWeaponGump( BaseWeapon item ) : base( 0, 0 )
		{
			m_Item = item;

			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;

			AddPage(0);
			AddBackground(131, 90, 185, 292, 9200);
			AddAlphaRegion(137, 96, 172, 25);
			AddAlphaRegion(137, 130, 172, 247);
			AddHtml( 137, 96, 172, 25, @"<BASEFONT COLOR=#FFFFFF><CENTER>Select A Slayer</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(145, 140, 4023, 4024, 1, GumpButtonType.Reply, 0);
			AddLabel(180, 140, 1152, @"Repond Slayer");
			AddButton(145, 170, 4023, 4024, 2, GumpButtonType.Reply, 0);
			AddLabel(180, 170, 1152, @"Reptile Slayer");
			AddButton(145, 200, 4023, 4024, 3, GumpButtonType.Reply, 0);
			AddLabel(180, 200, 1152, @"Demon Slayer");
			AddButton(145, 230, 4023, 4024, 4, GumpButtonType.Reply, 0);
			AddLabel(180, 230, 1152, @"Elemental Slayer");
			AddButton(145, 260, 4023, 4024, 5, GumpButtonType.Reply, 0);
			AddLabel(180, 260, 1152, @"Undead Slayer");
			AddButton(145, 290, 4023, 4024, 6, GumpButtonType.Reply, 0);
			AddLabel(180, 290, 1152, @"Arachnid Slayer");
			AddButton(145, 320, 4023, 4024, 7, GumpButtonType.Reply, 0);
			AddLabel(180, 320, 1152, @"Fey Slayer");
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:29,代码来源:SlayerSelectWeaponGump.cs


示例11: Run

        public static bool Run(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, ref int BaseDamage)
        {
            Effects.SendLocationParticles(EffectItem.Create(Defender.Location, Defender.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
            Effects.PlaySound(Defender, Defender.Map, 0x201);

            bool Summoned = false;

            if (Defender is BaseCreature)
            {
                BaseCreature Creature = Defender as BaseCreature;
                Summoned = Creature.Summoned;
                if (Summoned)
                {
                    if(Attacker.NetState != null)
                        Attacker.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x03B2, true,
                            "Your weapon causes the creature to dissipate on impact!", Attacker.NetState);

                    Creature.Delete();
                    return true;
                }
            }

            ZuluUtil.WipeMods(Defender);

            Defender.Mana = 0;

            if (Weapon.DamageLevel == WeaponDamageLevel.Regular)
                BaseDamage += ZuluCombat.GetDamageLevel(WeaponDamageLevel.Devastation);

            return true;
        }
开发者ID:notsentient,项目名称:RunZHA,代码行数:31,代码来源:BlackrockHitscript.cs


示例12: ShenStrike

        public void ShenStrike(Mobile attacker, Mobile defender, BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fifth)
            {
                if (weapon is Fists && Utility.RandomDouble() <= 0.10)
                {
                    int element = Utility.RandomMinMax(2, 4);

                    switch (element)
                    {
                        case 1:
                            {
                                weapon.DoLightning(attacker, defender);
                                break;
                            }
                        case 2:
                            {
                                weapon.DoMagicArrow(attacker, defender);
                                break;
                            }
                        case 3:
                            {
                                weapon.DoHarm(attacker, defender);
                                break;
                            }
                        case 4:
                            {
                                weapon.DoFireball(attacker, defender);
                                break;
                            }

                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:35,代码来源:Monk.cs


示例13: OnHit

		public override int OnHit( BaseWeapon weapon, int damageTaken )
		{
			if( weapon is PBWeapon )
				HitPoints -= 1;
			if( HitPoints == 0 )
				Hue = weapon.Hue;
			return 0;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:8,代码来源:PBEquipment.cs


示例14: GetImmolatingDamage

        public static int GetImmolatingDamage( BaseWeapon w )
        {
            ImmolatingWeaponEntry iEntry = m_Table[w] as ImmolatingWeaponEntry;

            if ( iEntry != null )
                return iEntry.m_Damage;

            return 0;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:9,代码来源:ImmolatingWeapon.cs


示例15: OnWeaponHit

		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			if (m_Chance <= 0 || Utility.Random(100) > m_Chance)
			{
				return;
			}

			if (defender != null && attacker != null)
			{
				// spawn a minion
				object o = null;
				try
				{
					o = Activator.CreateInstance(SpawnerType.GetType(m_Minion));
				}
				catch
				{ }

				if (o is BaseCreature)
				{
					BaseCreature b = o as BaseCreature;
					b.MoveToWorld(attacker.Location, attacker.Map);

					if (attacker is PlayerMobile)
					{
						b.Controlled = true;
						b.ControlMaster = attacker;
					}

					b.Combatant = defender;

					// add it to the list of controlled mobs
					MinionList.Add(b);
				}
				else
				{
					if (o is Item)
					{
						((Item)o).Delete();
					}
					if (o is Mobile)
					{
						((Mobile)o).Delete();
					}
					// bad minion specification so delete the attachment
					Delete();
				}

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:60,代码来源:XmlMinionStrike.cs


示例16: EnchantContext

        public EnchantContext( GenericReader reader, BaseWeapon weapon )
        {
            m_Owner = reader.ReadMobile();
            m_Attribute = (WeaponAttribute) reader.ReadInt();
            m_SpellChanneling = reader.ReadBool();
            m_Timer = Timer.DelayCall( reader.ReadTimeSpan(), new TimerStateCallback<BaseWeapon>( EnchantSpell.RemoveEnchantContext ), weapon );

            weapon.EnchantContext = this;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:9,代码来源:EnchantSpell.cs


示例17: Use

		public void Use( Mobile from, BaseWeapon weapon )
		{
			BeginSwing();

			from.Direction = from.GetDirectionTo( GetWorldLocation() );
			weapon.PlaySwingAnimation( from );

			from.CheckSkill( weapon.Skill, m_MinSkill, m_MaxSkill );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:9,代码来源:TrainingDummies.cs


示例18: GetImmolatingDamage

        public static int GetImmolatingDamage( BaseWeapon weapon )
        {
            ImmolatingWeaponEntry entry;

            if ( m_WeaponDamageTable.TryGetValue( weapon, out entry ) )
                return entry.m_Damage;

            return 0;
        }
开发者ID:nathanvy,项目名称:runuo,代码行数:9,代码来源:ImmolatingWeapon.cs


示例19: GetDamage

		public static int GetDamage( BaseWeapon weapon )
		{
			ImmolatingWeaponEntry entry = m_Table[ weapon ] as ImmolatingWeaponEntry;

			if( entry != null )
				return entry.Damage;

			return 0;
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:9,代码来源:ImmolatingWeapon.cs


示例20: LongArm

        public double LongArm(BaseWeapon weapon) 
        {
            if (Level >= PerkLevel.Fourth)
            {
                if (weapon.Layer == Layer.TwoHanded)
                    return 0.33;
            }

            return 0;
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:10,代码来源:Dragoon.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Items.Boots类代码示例发布时间:2022-05-26
下一篇:
C# Items.BaseTool类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap