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


C# AosAttribute类代码示例

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


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

示例1: GetValue

		public static int GetValue( Mobile m, AosAttribute att )
		{
			if ( EnhancementList.ContainsKey( m ) )
				return EnhancementList[m].Attributes[att];
			else
				return 0;
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:7,代码来源:Enhancement.cs

示例2: XmlAosAttribute

 public XmlAosAttribute(AosAttribute attr, int value, int duration)
 {
     Attribute = attr;
     m_Value = value;
     Expiration = TimeSpan.FromMinutes(duration);
     Name = Attribute.ToString() + " " + (Value >= 0 ? ("+" + Value.ToString()) : (Value.ToString()));
 }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:7,代码来源:XmlAosAttribute.cs

示例3: SetValue

		public static void SetValue( Mobile m, AosAttribute att, int value, string title )
		{
			if ( !EnhancementList.ContainsKey( m ) )
				AddMobile( m, title );

			if ( att == AosAttribute.BonusStr )
			{
				m.RemoveStatMod( "MagicalEnhancementStr" );
				m.AddStatMod( new StatMod( StatType.Str, "MagicalEnhancementStr", value, TimeSpan.Zero ) );
			}
			else if ( att == AosAttribute.BonusDex )
			{
				m.RemoveStatMod( "MagicalEnhancementDex" );
				m.AddStatMod( new StatMod( StatType.Dex, "MagicalEnhancementDex", value, TimeSpan.Zero ) );
			}
			else if ( att == AosAttribute.BonusInt )
			{
				m.RemoveStatMod( "MagicalEnhancementInt" );
				m.AddStatMod( new StatMod( StatType.Int, "MagicalEnhancementInt", value, TimeSpan.Zero ) );
			}

			if ( title != EnhancementList[m].Title )
				EnhancementList[m].Attributes[att] = value;
			else
				EnhancementList[m].Attributes[att] += value;
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:26,代码来源:Enhancement.cs

示例4: ApplyAttribute

		private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high, int scale )
		{
			if ( attr == AosAttribute.CastSpeed )
				attrs[attr] += Scale( min, max, low / scale, high / scale ) * scale;
			else
				attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;

			if ( attr == AosAttribute.SpellChanneling )
				attrs[AosAttribute.CastSpeed] -= 1;
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:10,代码来源:BaseRunicTool.cs

示例5: GetValue

        public static int GetValue(Mobile m, AosAttribute attr)
        {
            if (m == null || m.Deleted)
                return 0;

            ArrayList attachments = XmlAttach.FindAttachments(m, typeof(XmlAosAttribute));
            int value = 0;

            if (attachments == null)
                return 0;

            if (attachments.Count > 0)
            {
                foreach (XmlAosAttribute att in attachments)
                {
                    if (att.Attribute == attr)
                        value += att.Value;
                }
            }
            return value;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:21,代码来源:XmlAosAttribute.cs

示例6: HasAttribute

		public static bool HasAttribute(this Item item, AosAttribute attr, out int value)
		{
			return HasAttribute(item, "Attributes", (ulong)attr, out value);
		}
开发者ID:Vita-Nex,项目名称:Core,代码行数:4,代码来源:AttributesExt.cs

示例7: GetPropRange

 public static int[] GetPropRange(AosAttribute attr)
 {
     switch (attr)
     {
         case AosAttribute.Luck: return new int[] { 1, 100 };
         case AosAttribute.WeaponDamage: return new int[] { 2, 50 };
         case AosAttribute.WeaponSpeed: return new int[] { 5, 30 };
         case AosAttribute.LowerRegCost: return new int[] { 1, 20 };
         case AosAttribute.EnhancePotions: return new int[] { 5, 25 };
         case AosAttribute.AttackChance:
         case AosAttribute.DefendChance:
         case AosAttribute.ReflectPhysical: return new int[] { 1, 15 };
         case AosAttribute.SpellDamage: return new int[] { 1, 12 };
         case AosAttribute.BonusStr:
         case AosAttribute.BonusInt:
         case AosAttribute.BonusDex:
         case AosAttribute.BonusStam:
         case AosAttribute.BonusMana:
         case AosAttribute.LowerManaCost: return new int[] { 1, 8 };
         case AosAttribute.BonusHits: return new int[] { 1, 5 };
         case AosAttribute.CastRecovery:
         case AosAttribute.RegenStam: return new int[] { 1, 3 };
         case AosAttribute.RegenHits:
         case AosAttribute.RegenMana: return new int[] { 1, 2 };
         default:
         case AosAttribute.SpellChanneling:
         case AosAttribute.CastSpeed:
         case AosAttribute.Brittle:
         case AosAttribute.NightSight: return new int[] { 1, 1 };
     }
 }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:31,代码来源:Imbuing.cs

示例8: GetModForAttribute

        public static int GetModForAttribute(AosAttribute attr)
        {
            foreach (KeyValuePair<int, ImbuingDefinition> kvp in m_Table)
            {
                int mod = kvp.Key;
                ImbuingDefinition def = kvp.Value;

                if (def.Attribute is AosAttribute && (AosAttribute)def.Attribute == attr)
                    return mod;
            }

            return -1;
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:13,代码来源:Imbuing.cs

示例9: GetValue

		public static int GetValue( Mobile m, AosAttribute attribute )
		{
			if ( !Core.AOS )
				return 0;

return 0;
/*
			ArrayList items = m.Items;
			int value = 0;

			for ( int i = 0; i < items.Count; ++i )
			{
				object obj = items[i];

				if ( obj is BaseWeapon )
				{
					AosAttributes attrs = ((BaseWeapon)obj).Attributes;

					if ( attrs != null )
						value += attrs[attribute];

					if ( attribute == AosAttribute.Luck )
						value += ((BaseWeapon)obj).GetLuckBonus();
				}
				else if ( obj is BaseArmor )
				{
					AosAttributes attrs = ((BaseArmor)obj).Attributes;

					if ( attrs != null )
						value += attrs[attribute];

					if ( attribute == AosAttribute.Luck )
						value += ((BaseArmor)obj).GetLuckBonus();
				}
				else if ( obj is BaseJewel )
				{
					AosAttributes attrs = ((BaseJewel)obj).Attributes;

					if ( attrs != null )
						value += attrs[attribute];
				}
			}

			return value;
*/			
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:46,代码来源:AOS.cs

示例10: ApplyAttribute

 private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high )
 {
     attrs[attr] = Scale( min, max, low, high );
 }
开发者ID:evildude807,项目名称:kaltar,代码行数:4,代码来源:Spellcraft.cs

示例11: GetAttribute

 public int GetAttribute(AosAttribute attr)
 {
     foreach (ObjectProperty property in this.m_Props.Properties)
     {
         if (property.Number == attr)
         {
             string arguments = property.Arguments;
             switch (arguments)
             {
                 case "":
                 case " ":
                     return 1;
             }
             try
             {
                 return int.Parse(arguments);
             }
             catch
             {
                 return 0;
             }
         }
     }
     return 0;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:25,代码来源:AosAttributes.cs

示例12: GetValue

        public static int GetValue(Mobile m, AosAttribute attribute)
        {
            if (!Core.AOS)
                return 0;

            List<Item> items = m.Items;
            int value = 0;

            #region Enhancement
            value += Enhancement.GetValue(m, attribute);
            #endregion

            for (int i = 0; i < items.Count; ++i)
            {
                Item obj = items[i];

                if (obj is BaseWeapon)
                {
                    AosAttributes attrs = ((BaseWeapon)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];

                    if (attribute == AosAttribute.Luck)
                        value += ((BaseWeapon)obj).GetLuckBonus();
                }
                else if (obj is BaseArmor)
                {
                    AosAttributes attrs = ((BaseArmor)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];

                    if (attribute == AosAttribute.Luck)
                        value += ((BaseArmor)obj).GetLuckBonus();
                }
                else if (obj is BaseJewel)
                {
                    AosAttributes attrs = ((BaseJewel)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
                else if (obj is BaseClothing)
                {
                    AosAttributes attrs = ((BaseClothing)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
                else if (obj is Spellbook)
                {
                    AosAttributes attrs = ((Spellbook)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
                else if (obj is BaseQuiver)
                {
                    AosAttributes attrs = ((BaseQuiver)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
                else if (obj is BaseTalisman)
                {
                    AosAttributes attrs = ((BaseTalisman)obj).Attributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
				
                #region Mondain's Legacy
                if (attribute == AosAttribute.WeaponDamage)
                {
                    if (BaseMagicalFood.IsUnderInfluence(m, MagicalFood.WrathGrapes))
                        value += 10; // TODO check
                }
                else if (attribute == AosAttribute.SpellDamage)
                {
                    if (BaseMagicalFood.IsUnderInfluence(m, MagicalFood.WrathGrapes))
                        value += 5; // TODO check
                }
                else if (attribute == AosAttribute.CastSpeed)
                {
                    if (MonstrousInterredGrizzle.UnderCacophonicAttack(m) || LadyMelisande.UnderPutridNausea(m))
                        value -= 3; // TODO check
                }
                else if (attribute == AosAttribute.WeaponSpeed || LadyMelisande.UnderPutridNausea(m))
                {
                    if (MonstrousInterredGrizzle.UnderCacophonicAttack(m))
                        value -= 3; // TODO check
                }

                if (obj is ISetItem)
                { 
                    ISetItem item = (ISetItem)obj;

                    AosAttributes attrs = item.SetAttributes;
										
//.........这里部分代码省略.........
开发者ID:jasegiffin,项目名称:JustUO,代码行数:101,代码来源:AOS.cs

示例13: RemoveAttribute

 public static void RemoveAttribute( AosAttributes attrs, AosAttribute attr, int amount )
 {
     if ( attr == AosAttribute.SpellChanneling && attrs.SpellChanneling > 0 )
     {
         attrs[attr] = 0;
         attrs.CastSpeed++;
     }
     else
         attrs[attr] = Math.Max( attrs[attr] - amount, 0 );
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:10,代码来源:BonusAttribute.cs

示例14: BonusAttribute

 public BonusAttribute( AosAttribute attr, int amount )
     : this((object)attr, amount)
 {
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:4,代码来源:BonusAttribute.cs

示例15: ApplyAttribute

 public static void ApplyAttribute( AosAttributes attrs, AosAttribute attr, int amount )
 {
     if ( attr == AosAttribute.SpellChanneling && attrs.SpellChanneling == 0 )
     {
         attrs[attr] = 1;
         attrs.CastSpeed--;
     }
     else
         attrs[attr] += amount;
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:10,代码来源:BonusAttribute.cs


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