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


C# WeaponQuality类代码示例

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


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

示例1: Weapon

 /// <summary>
 /// Create a new weapon
 /// </summary>
 /// <param name="name">name of the weapon</param>
 /// <param name="type">class of weapon</param>
 /// <param name="hulls">class fo ship that can mount this weapon</param>
 /// <param name="slots">locatiosn where this weapon can be mounted</param>
 /// <param name="power">power used by this weapon</param>
 /// <param name="space">space used by this method</param>
 /// <param name="sp">cost of this weapon</param>
 /// <param name="str">strength of the weapon</param>
 /// <param name="damage">damage of the weapon</param>
 /// <param name="crit">crit rating of the weapon</param>
 /// <param name="range">range of the weapon</param>
 /// <param name="origin">rulebook containing this weapon</param>
 /// <param name="page">page this weapon can be found on</param>
 /// <param name="quality">quality of this weapon</param>
 /// <param name="wq">enum declaring which qualities to be adjusted</param>
 /// <param name="special">special rules of this weapon</param>
 /// <param name="turbo">Quality of turboweapon battery upgrade if applicable</param>
 public Weapon(string name, WeaponType type, HullType hulls, WeaponSlot slots, int power, int space, 
     int sp, int str, string damage, int crit, int range, RuleBook origin, byte page, Quality quality = Quality.Common,
     WeaponQuality wq = WeaponQuality.None, string special = null, Quality turbo = Quality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : this(name, type, hulls, slots, power, space, sp, str, new DiceRoll(damage), crit, range, 
     origin, page, quality, wq, special, turbo, comp, cond)
 {
 }
开发者ID:hooperk,项目名称:Starship,代码行数:27,代码来源:Weapon.cs

示例2: LandingBay

 /// <summary>
 /// Create a new Landing Bay
 /// </summary>
 /// <param name="name">name of the landing bay</param>
 /// <param name="hulls">class fo ship that can mount this weapon</param>
 /// <param name="slots">locatiosn where this weapon can be mounted</param>
 /// <param name="power">power used by this weapon</param>
 /// <param name="space">space used by this method</param>
 /// <param name="sp">cost of this weapon</param>
 /// <param name="str">strength of the weapon</param>
 /// <param name="capacity">total ammo capacity of the torpedo tube</param>
 /// <param name="origin">rulebook containing this weapon</param>
 /// <param name="page">page this weapon can be found on</param>
 /// <param name="quality">quality of this weapon</param>
 /// <param name="wq">enum declaring which qualities to be adjusted</param>
 /// <param name="special">special rules of this weapon</param>
 public LandingBay(string name, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str,
     RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None,
     string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : base(name, WeaponType.LandingBay, hulls, slots, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond)
 {
     Squadrons = new List<Squadron>(Strength * 3);
 }
开发者ID:hooperk,项目名称:Starship,代码行数:23,代码来源:LandingBay.cs

示例3: TorpedoTubes

 /// <summary>
 /// Create a new Torpedo Tube
 /// </summary>
 /// <param name="name">name of the torpedo tube</param>
 /// <param name="hulls">class of ship that can mount this weapon</param>
 /// <param name="slots">locatiosn where this weapon can be mounted</param>
 /// <param name="power">power used by this weapon</param>
 /// <param name="space">space used by this method</param>
 /// <param name="sp">cost of this weapon</param>
 /// <param name="str">strength of the weapon</param>
 /// <param name="capacity">total ammo capacity of the torpedo tube</param>
 /// <param name="origin">rulebook containing this weapon</param>
 /// <param name="page">page this weapon can be found on</param>
 /// <param name="quality">quality of this weapon</param>
 /// <param name="wq">enum declaring which qualities to be adjusted</param>
 /// <param name="special">special rules of this weapon</param>
 public TorpedoTubes(string name, HullType hulls, int power, int space, int sp, int str,
     int capacity, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None,
     string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : base(name, WeaponType.TorpedoTube, hulls, WeaponSlot.Prow | WeaponSlot.Keel, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, 
         quality, wq, special, Quality.None, comp, cond)
 {
     this.Capacity = capacity;
     Ammo = new List<Torpedo>(Capacity);
     Tubes = new Torpedo[Strength];
 }
开发者ID:hooperk,项目名称:Starship,代码行数:26,代码来源:TorpedoTubes.cs

示例4: WeaponQualityChooser

 public WeaponQualityChooser(WeaponType type, Quality last, WeaponQuality lastwq)
 {
     this.Type = type;
     this.CurrentQuality = this.OriginalQuality = last;
     this.CurrentWQ = this.OriginalWQ = lastwq;
     InitializeComponent();
     SpaceCheck.IsChecked = (CurrentWQ & WeaponQuality.Space) != 0;
     StrengthCheck.IsChecked = (CurrentWQ & WeaponQuality.Strength) != 0;
     DamageCheck.IsChecked = (CurrentWQ & WeaponQuality.Damage) != 0;
     RangeCheck.IsChecked = (CurrentWQ & WeaponQuality.Range) != 0;
     CritCheck.IsChecked = (CurrentWQ & WeaponQuality.Crit) != 0;
     QualityChoice.ItemsSource = new List<Quality>() { Quality.Poor, Quality.Common, Quality.Good, Quality.Best };
     QualityChoice.SelectedItem = CurrentQuality;
 }
开发者ID:hooperk,项目名称:Starship,代码行数:14,代码来源:WeaponQualityChooser.xaml.cs

示例5: CheckEnables

 private void CheckEnables()
 {
     int count = 0;
     CurrentWQ = WeaponQuality.None;
     if (SpaceCheck.IsChecked ?? false)
     {
         count++;
         CurrentWQ |= WeaponQuality.Space;
     }
     if (StrengthCheck.IsChecked ?? false) {
         count++;
     CurrentWQ |= WeaponQuality.Strength;
     }
     if (DamageCheck.IsChecked ?? false)
     {
         count++;
         CurrentWQ |= WeaponQuality.Damage;
     }
     if (RangeCheck.IsChecked ?? false)
     {
         count++;
         CurrentWQ |= WeaponQuality.Range;
     }
     if (CritCheck.IsChecked ?? false)
     {
         count++;
         CurrentWQ |= WeaponQuality.Crit;
     }
     int allowed;
     if (CurrentQuality == Quality.Good)
         allowed = 1;
     else if (CurrentQuality == Quality.Common)
         allowed = 0;
     else
         allowed = 2;
     SpaceCheck.IsEnabled = ((SpaceCheck.IsChecked ?? true) || count < allowed);
     StrengthCheck.IsEnabled = (CurrentQuality != Quality.Good && ((StrengthCheck.IsChecked ?? true) || count < allowed));
     DamageCheck.IsEnabled = (Type != WeaponType.LandingBay && Type != WeaponType.TorpedoTube && ((DamageCheck.IsChecked ?? true) || count < allowed));//Landing bays and Torpedoes don't have Damage
     RangeCheck.IsEnabled = (Type != WeaponType.LandingBay && Type != WeaponType.TorpedoTube && ((RangeCheck.IsChecked ?? true) || count < allowed));//Landing bays and torpedoes don't have range
     CritCheck.IsEnabled = (CurrentQuality != Quality.Good && (Type == WeaponType.Macrobattery || Type == WeaponType.Lance) && ((CritCheck.IsChecked ?? true) || count < allowed));//Only Macrobatteries and Lances have crit
     SetValues();
 }
开发者ID:hooperk,项目名称:Starship,代码行数:42,代码来源:WeaponQualityChooser.xaml.cs

示例6: CreateWeapon

    public static Weapon CreateWeapon(WeaponType type, WeaponQuality quality = WeaponQuality.Factory)
    {
        var weapon = new Weapon()
        {
            Guid = Guid.NewGuid(),
            Type = type,
            Quality = quality
        };

        var values = Enum.GetValues(typeof(WeaponType)).Cast<int>();
        var index = Enum.GetNames(typeof(WeaponType)).ToList().IndexOf(type.ToString()); // ugh

        var price = values.ElementAt(index);

        values = Enum.GetValues(typeof(WeaponQuality)).Cast<int>();
        index = Enum.GetNames(typeof(WeaponQuality)).ToList().IndexOf(quality.ToString()); // ugh

        price *= values.ElementAt(index);

        weapon.Price = price;
        weapon.Name = type.ToString();

        return weapon;
    }
开发者ID:Calebsem,项目名称:LordOfWarLD33,代码行数:24,代码来源:Weapon.cs

示例7: QualityChoice_SelectionChanged

 private void QualityChoice_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (QualityChoice.SelectedItem != null)
         CurrentQuality = (Quality)QualityChoice.SelectedItem;
     //QualityChoice.Text = CurrentQuality + " Quality";
     if (CurrentQuality == Quality.Common)//If moving to Common (nothing set)
         SpaceCheck.IsChecked = StrengthCheck.IsChecked = DamageCheck.IsChecked = RangeCheck.IsChecked = CritCheck.IsChecked = false;//uncheck all for common
     else if (CurrentQuality == Quality.Good)//If Good(Less can be set than poor or best)
         StrengthCheck.IsChecked = CritCheck.IsChecked = false;//uncheck disallowed options for good quality
     if ((Type == WeaponType.LandingBay || Type == WeaponType.TorpedoTube))
     {
         SpaceCheck.IsChecked = CurrentQuality != Quality.Common;
         CurrentWQ = WeaponQuality.Space;
         if (CurrentQuality == Quality.Poor || CurrentQuality == Quality.Best)
         {
             StrengthCheck.IsChecked = true;//Only two options available so auto check them
             CurrentWQ |= WeaponQuality.Strength;
         }
         SpaceCheck.IsEnabled = StrengthCheck.IsEnabled = DamageCheck.IsEnabled = RangeCheck.IsEnabled = CritCheck.IsEnabled = false;//disable all sinc there is only one valid permutation
         SetValues();
     }
     else
         CheckEnables();
 }
开发者ID:hooperk,项目名称:Starship,代码行数:24,代码来源:WeaponQualityChooser.xaml.cs

示例8: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			SaveFlag flags = (SaveFlag)reader.ReadInt();

			switch ( version )
			{
				case 8:
				{
					// turnned off AOS attributes
					goto case 7;
				}
				case 7:
				{
					goto case 6;
				}
				case 6:
				{
					goto case 5;
				}
				case 5:
				{
					if ( GetSaveFlag( flags, SaveFlag.DamageLevel ) )
						m_DamageLevel = (WeaponDamageLevel)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.AccuracyLevel ) )
						m_AccuracyLevel = (WeaponAccuracyLevel)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.DurabilityLevel ) )
						m_DurabilityLevel = (WeaponDurabilityLevel)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (WeaponQuality)reader.ReadInt();
					else
						m_Quality = WeaponQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.Hits ) )
						m_Hits = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.MaxHits ) )
						m_MaxHits = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Slayer ) )
						m_Slayer = (SlayerName)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Poison ) )
						m_Poison = Poison.Deserialize( reader );

					if ( GetSaveFlag( flags, SaveFlag.PoisonCharges ) )
						m_PoisonCharges = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Identified ) )
						m_Identified = ( version >= 6 || reader.ReadBool() );

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.DexReq ) )
						m_DexReq = reader.ReadInt();
					else
						m_DexReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.IntReq ) )
						m_IntReq = reader.ReadInt();
					else
						m_IntReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.MinDamage ) )
						m_MinDamage = reader.ReadInt();
					else
						m_MinDamage = -1;

					if ( GetSaveFlag( flags, SaveFlag.MaxDamage ) )
						m_MaxDamage = reader.ReadInt();
					else
						m_MaxDamage = -1;

					if ( GetSaveFlag( flags, SaveFlag.HitSound ) )
						m_HitSound = reader.ReadInt();
					else
						m_HitSound = -1;

					if ( GetSaveFlag( flags, SaveFlag.MissSound ) )
						m_MissSound = reader.ReadInt();
					else
						m_MissSound = -1;

					if ( GetSaveFlag( flags, SaveFlag.Speed ) )
						m_Speed = reader.ReadInt();
					else
						m_Speed = -1;

					if ( GetSaveFlag( flags, SaveFlag.MaxRange ) )
//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:BaseWeapon.cs

示例9: BaseWeapon

		public BaseWeapon( int itemID ) : base( itemID )
		{
			Layer = (Layer)ItemData.Quality;

			m_Quality = WeaponQuality.Regular;
			m_StrReq = -1;
			m_DexReq = -1;
			m_IntReq = -1;
			m_MinDamage = -1;
			m_MaxDamage = -1;
			m_HitSound = -1;
			m_MissSound = -1;
			m_Speed = -1;
			m_MaxRange = -1;
			m_Skill = (SkillName)(-1);
			m_Type = (WeaponType)(-1);
			m_Animation = (WeaponAnimation)(-1);

			m_Hits = m_MaxHits = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			m_Resource = CraftResource.Iron;

			m_AosAttributes = new AosAttributes( this );
			m_AosWeaponAttributes = new AosWeaponAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses(this);

            // mod to randomly add sockets and socketability features to weapons. These settings will yield
            // 2% drop rate of socketed/socketable items
            // 0.1% chance of 5 sockets
            // 0.5% of 4 sockets
            // 3% chance of 3 sockets
            // 15% chance of 2 sockets
            // 50% chance of 1 socket
            // the remainder will be 0 socket (31.4% in this case)
            // uncomment the next line to prevent artifacts from being socketed
            // if(ArtifactRarity == 0)
            XmlSockets.ConfigureRandom(this, 2.0, 0.1, 0.5, 3.0, 15.0, 50.0);
			m_AosElementDamages = new AosElementAttributes( this );
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:39,代码来源:BaseWeapon.cs

示例10: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 8:
				case 7:
				case 6:
				case 5:
				{
					SaveFlag flags = (SaveFlag)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.DamageLevel ) )
					{
						m_DamageLevel = (WeaponDamageLevel)reader.ReadInt();

						if ( m_DamageLevel > WeaponDamageLevel.Vanq )
							m_DamageLevel = WeaponDamageLevel.Ruin;
					}

					if ( GetSaveFlag( flags, SaveFlag.AccuracyLevel ) )
					{
						m_AccuracyLevel = (WeaponAccuracyLevel)reader.ReadInt();

						if ( m_AccuracyLevel > WeaponAccuracyLevel.Supremely )
							m_AccuracyLevel = WeaponAccuracyLevel.Accurate;
					}

					if ( GetSaveFlag( flags, SaveFlag.DurabilityLevel ) )
					{
						m_DurabilityLevel = (WeaponDurabilityLevel)reader.ReadInt();

						if ( m_DurabilityLevel > WeaponDurabilityLevel.Indestructible )
							m_DurabilityLevel = WeaponDurabilityLevel.Durable;
					}

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (WeaponQuality)reader.ReadInt();
					else
						m_Quality = WeaponQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.Hits ) )
						m_Hits = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.MaxHits ) )
						m_MaxHits = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Slayer ) )
						m_Slayer = (SlayerName)reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Poison ) )
						m_Poison = Poison.Deserialize( reader );

					if ( GetSaveFlag( flags, SaveFlag.PoisonCharges ) )
						m_PoisonCharges = reader.ReadInt();

					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Identified ) )
						m_Identified = ( version >= 6 || reader.ReadBool() );

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.DexReq ) )
						m_DexReq = reader.ReadInt();
					else
						m_DexReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.IntReq ) )
						m_IntReq = reader.ReadInt();
					else
						m_IntReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.MinDamage ) )
						m_MinDamage = reader.ReadInt();
					else
						m_MinDamage = -1;

					if ( GetSaveFlag( flags, SaveFlag.MaxDamage ) )
						m_MaxDamage = reader.ReadInt();
					else
						m_MaxDamage = -1;

					if ( GetSaveFlag( flags, SaveFlag.HitSound ) )
						m_HitSound = reader.ReadInt();
					else
						m_HitSound = -1;

					if ( GetSaveFlag( flags, SaveFlag.MissSound ) )
						m_MissSound = reader.ReadInt();
					else
						m_MissSound = -1;

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:101,代码来源:BaseWeapon.cs

示例11: BaseWeapon

        public BaseWeapon(int itemID)
            : base(itemID)
        {
            Layer = (Layer)ItemData.Quality;

            m_Quality = WeaponQuality.Regular;
            m_StrReq = -1;
            m_DexReq = -1;
            m_IntReq = -1;
            m_MinDamage = -1;
            m_MaxDamage = -1;
            m_HitSound = -1;
            m_MissSound = -1;
            m_Speed = -1;
            m_MaxRange = -1;
            m_Skill = (SkillName)(-1);
            m_Type = (WeaponType)(-1);
            m_Animation = (WeaponAnimation)(-1);

            m_Hits = m_MaxHits = Utility.RandomMinMax(InitMinHits, InitMaxHits);

            m_Resource = CraftResource.Iron;

            m_AosAttributes = new AosAttributes(this);
            m_AosWeaponAttributes = new AosWeaponAttributes(this);
            m_AosSkillBonuses = new AosSkillBonuses(this);
            m_AosElementDamages = new AosElementAttributes(this);
            #region SA
			m_SAAbsorptionAttributes = new SAAbsorptionAttributes( this );
			#endregion

            #region Mondain's Legacy Sets
            m_SetAttributes = new AosAttributes(this);
            m_SetSkillBonuses = new AosSkillBonuses(this);
            #endregion

		ItemValue = GearScore.GetItemValue( this );
        }
开发者ID:romeov007,项目名称:imagine-uo,代码行数:38,代码来源:BaseWeapon.cs

示例12: BaseWeapon

		public BaseWeapon( int itemID ) : base( itemID )
		{
			Layer = (Layer)ItemData.Quality;

			m_Quality = WeaponQuality.Regular;
			m_StrReq = -1;
			m_DexReq = -1;
			m_IntReq = -1;
			m_MinDamage = -1;
			m_MaxDamage = -1;
			m_HitSound = -1;
			m_MissSound = -1;
			m_Speed = -1;
			m_MaxRange = -1;
			m_Skill = (SkillName)(-1);
			m_Type = (WeaponType)(-1);
			m_Animation = (WeaponAnimation)(-1);

			m_Hits = m_MaxHits = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			m_Resource = CraftResource.Iron;

			m_AosAttributes = new AosAttributes( this );
			m_AosWeaponAttributes = new AosWeaponAttributes( this );
			m_AosSkillBonuses = new AosSkillBonuses( this );
			m_AosElementDamages = new AosElementAttributes( this );

			#region GeNova: Mondain's Legacy
			m_SetAttributes = new AosAttributes( this );
			m_SetWeaponAttributes = new AosWeaponAttributes( this );
			m_SetSkillBonuses = new AosSkillBonuses( this );
			
			m_LastEquipped = false;
			#endregion
		}
开发者ID:brodock,项目名称:genova-project,代码行数:35,代码来源:BaseWeapon.cs

示例13: Deserialize


//.........这里部分代码省略.........

						if (GetSaveFlag(flags, SaveFlag.DamageLevel))
						{
							m_DamageLevel = (WeaponDamageLevel)reader.ReadInt();

							if (m_DamageLevel > WeaponDamageLevel.Vanq)
							{
								m_DamageLevel = WeaponDamageLevel.Ruin;
							}
						}

						if (GetSaveFlag(flags, SaveFlag.AccuracyLevel))
						{
							m_AccuracyLevel = (WeaponAccuracyLevel)reader.ReadInt();

							if (m_AccuracyLevel > WeaponAccuracyLevel.Supremely)
							{
								m_AccuracyLevel = WeaponAccuracyLevel.Accurate;
							}
						}

						if (GetSaveFlag(flags, SaveFlag.DurabilityLevel))
						{
							m_DurabilityLevel = (WeaponDurabilityLevel)reader.ReadInt();

							if (m_DurabilityLevel > WeaponDurabilityLevel.Indestructible)
							{
								m_DurabilityLevel = WeaponDurabilityLevel.Durable;
							}
						}

						if (GetSaveFlag(flags, SaveFlag.Quality))
						{
							m_Quality = (WeaponQuality)reader.ReadInt();
						}
						else
						{
							m_Quality = WeaponQuality.Regular;
						}

						if (GetSaveFlag(flags, SaveFlag.Hits))
						{
							m_Hits = reader.ReadInt();
						}

						if (GetSaveFlag(flags, SaveFlag.MaxHits))
						{
							m_MaxHits = reader.ReadInt();
						}

						if (GetSaveFlag(flags, SaveFlag.Slayer))
						{
							m_Slayer = (SlayerName)reader.ReadInt();
						}

						if (GetSaveFlag(flags, SaveFlag.Poison))
						{
							m_Poison = Poison.Deserialize(reader);
						}

						if (GetSaveFlag(flags, SaveFlag.PoisonCharges))
						{
							m_PoisonCharges = reader.ReadInt();
						}

						if (GetSaveFlag(flags, SaveFlag.Crafter))
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:67,代码来源:BaseWeapon.cs

示例14: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch( version )
            {
                case 11:
                case 10:
                case 9:
                case 8:
                    {
                        if( version <= 9 )
                        {
                            reader.ReadMobile();
                            reader.ReadString();
                            reader.ReadMobile();
                        }

                        goto case 7;
                    }
                case 7:
                case 6:
                case 5:
                    {
                        SaveFlag flags = (SaveFlag)reader.ReadInt();

                        if( GetSaveFlag(flags, SaveFlag.DamageLevel) )
                        {
                            m_DamageLevel = (WeaponDamageLevel)reader.ReadInt();

                            if( m_DamageLevel > WeaponDamageLevel.Vanq )
                                m_DamageLevel = WeaponDamageLevel.Ruin;
                        }

                        if( GetSaveFlag(flags, SaveFlag.AccuracyLevel) )
                        {
                            m_AccuracyLevel = (WeaponAccuracyLevel)reader.ReadInt();

                            if( m_AccuracyLevel > WeaponAccuracyLevel.Supremely )
                                m_AccuracyLevel = WeaponAccuracyLevel.Accurate;
                        }

                        if( GetSaveFlag(flags, SaveFlag.DurabilityLevel) )
                        {
                            m_DurabilityLevel = (WeaponDurabilityLevel)reader.ReadInt();

                            if( m_DurabilityLevel > WeaponDurabilityLevel.Indestructible )
                                m_DurabilityLevel = WeaponDurabilityLevel.Durable;
                        }

                        if( GetSaveFlag(flags, SaveFlag.Quality) )
                            m_Quality = (WeaponQuality)reader.ReadInt();
                        else
                            m_Quality = WeaponQuality.Regular;

                        if( GetSaveFlag(flags, SaveFlag.Hits) )
                            m_Hits = reader.ReadInt();

                        if( GetSaveFlag(flags, SaveFlag.MaxHits) )
                            m_MaxHits = reader.ReadInt();

                        if( GetSaveFlag(flags, SaveFlag.Slayer) )
                            m_Slayer = (SlayerName)reader.ReadInt();

                        if( GetSaveFlag(flags, SaveFlag.Poison) )
                            m_Poison = Poison.Deserialize(reader);

                        if( GetSaveFlag(flags, SaveFlag.PoisonCharges) )
                            m_PoisonCharges = reader.ReadInt();

                        if( GetSaveFlag(flags, SaveFlag.Crafter) )
                            m_Crafter = reader.ReadMobile();

                        if( GetSaveFlag(flags, SaveFlag.Identified) )
                        {
                            if( version <= 10 )
                                m_Identified = true;
                            else
                                m_Identified = reader.ReadBool();
                        }

                        if( GetSaveFlag(flags, SaveFlag.StrReq) )
                            m_StrReq = reader.ReadInt();
                        else
                            m_StrReq = -1;

                        if( GetSaveFlag(flags, SaveFlag.DexReq) )
                            m_DexReq = reader.ReadInt();
                        else
                            m_DexReq = -1;

                        if( GetSaveFlag(flags, SaveFlag.IntReq) )
                            m_IntReq = reader.ReadInt();
                        else
                            m_IntReq = -1;

                        if( GetSaveFlag(flags, SaveFlag.MinDamage) )
                            m_MinDamage = reader.ReadInt();
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:BaseWeapon.cs

示例15: OnCraft

        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (WeaponQuality)quality;

            if (makersMark) // Add to CraftItem.cs mark table
                Crafter = from;

            Type resourceType = typeRes;

            if (resourceType == null)
                resourceType = craftItem.Resources.GetAt(0).ItemType;

            if (!craftItem.ForceNonExceptional)
                Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
                Hue = 0;

            if (craftItem != null)
            {
                if (tool is BaseRunicTool)
                    ((BaseRunicTool)tool).ApplyAttributesTo(this);

                CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);

                if (resInfo == null)
                    return quality;

                CraftAttributeInfo attrInfo = resInfo.AttributeInfo;

                if (attrInfo == null)
                    return quality;

                if (m_Resource != CraftResource.Heartwood)
                {
                    m_AosAttributes.WeaponDamage += attrInfo.WeaponDamage;
                    m_AosAttributes.WeaponSpeed += attrInfo.WeaponSwingSpeed;
                    m_AosAttributes.AttackChance += attrInfo.WeaponHitChance;
                    m_AosAttributes.RegenHits += attrInfo.WeaponRegenHits;
                }
                else
                {
                    switch (Utility.Random(6))
                    {
                        case 0: m_AosAttributes.WeaponDamage += attrInfo.WeaponDamage; break;
                        case 1: m_AosAttributes.WeaponSpeed += attrInfo.WeaponSwingSpeed; break;
                        case 2: m_AosAttributes.AttackChance += attrInfo.WeaponHitChance; break;
                        case 3: m_AosAttributes.Luck += attrInfo.WeaponLuck; break;
                    }
                }

                if ((m_Resource == CraftResource.Frostwood || m_Resource == CraftResource.Heartwood) && m_AosAttributes.SpellChanneling == 0)
                {
                    Attributes.SpellChanneling = 1;
                    Attributes.CastSpeed -= 1;
                }
            }

            return quality;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:62,代码来源:FishingPole.cs


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