本文整理汇总了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;
}
示例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()));
}
示例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;
}
示例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;
}
示例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;
}
示例6: HasAttribute
public static bool HasAttribute(this Item item, AosAttribute attr, out int value)
{
return HasAttribute(item, "Attributes", (ulong)attr, out value);
}
示例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 };
}
}
示例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;
}
示例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;
*/
}
示例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 );
}
示例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;
}
示例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;
//.........这里部分代码省略.........
示例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 );
}
示例14: BonusAttribute
public BonusAttribute( AosAttribute attr, int amount )
: this((object)attr, amount)
{
}
示例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;
}