本文整理汇总了C#中WeaponAnimation类的典型用法代码示例。如果您正苦于以下问题:C# WeaponAnimation类的具体用法?C# WeaponAnimation怎么用?C# WeaponAnimation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WeaponAnimation类属于命名空间,在下文中一共展示了WeaponAnimation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GastroFork
public GastroFork()
{
Name = "Gastro Fork";
Hue = 2075;
Attributes.WeaponDamage = 30;
Attributes.WeaponSpeed = 25;
WeaponAttributes.SelfRepair = 1;
m_GastroAnimation = WeaponAnimation.Slash1H;
// WeaponAttributes.HitLeechMana = 40;
}
示例2: CheckHit
public override bool CheckHit( Mobile attacker, Mobile defender )
{
switch( m_GastroAnimation )
{
case WeaponAnimation.Slash1H: m_GastroAnimation = WeaponAnimation.Pierce1H; break;
case WeaponAnimation.Pierce1H: m_GastroAnimation = WeaponAnimation.Bash1H; break;
case WeaponAnimation.Bash1H: m_GastroAnimation = WeaponAnimation.Slash1H; break;
}
if ( base.CheckHit( attacker, defender ) )
return true;
else if ( m_GastroAnimation == WeaponAnimation.Pierce1H )
return true;
else
return false;
}
示例3: 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 );
}
示例4: Deserialize
//.........这里部分代码省略.........
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 ) )
m_MaxRange = reader.ReadInt();
else
m_MaxRange = -1;
if ( GetSaveFlag( flags, SaveFlag.Skill ) )
m_Skill = (SkillName)reader.ReadInt();
else
m_Skill = (SkillName)(-1);
if ( GetSaveFlag( flags, SaveFlag.Type ) )
m_Type = (WeaponType)reader.ReadInt();
else
m_Type = (WeaponType)(-1);
if ( GetSaveFlag( flags, SaveFlag.Animation ) )
m_Animation = (WeaponAnimation)reader.ReadInt();
else
m_Animation = (WeaponAnimation)(-1);
if ( GetSaveFlag( flags, SaveFlag.Resource ) )
m_Resource = (CraftResource)reader.ReadInt();
else
m_Resource = CraftResource.Iron;
if ( GetSaveFlag( flags, SaveFlag.xAttributes ) )
m_AosAttributes = new AosAttributes( this, reader );
else
m_AosAttributes = new AosAttributes( this );
if ( GetSaveFlag( flags, SaveFlag.xWeaponAttributes ) )
m_AosWeaponAttributes = new AosWeaponAttributes( this, reader );
else
m_AosWeaponAttributes = new AosWeaponAttributes( this );
if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
{
m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
((Mobile)Parent).AddSkillMod( m_SkillMod );
}
if ( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;
if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
{
m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
((Mobile)Parent).AddSkillMod( m_MageMod );
}
示例5: AlignRight
private void AlignRight(WeaponAnimation anim, int width, int height)
{
if (LeftHand &&
(weaponState == WeaponStates.Idle || weaponState == WeaponStates.StrikeDown || weaponState == WeaponStates.StrikeUp))
{
// Flip alignment
AlignLeft(anim, width, height);
return;
}
weaponPosition = new Rect(
Screen.width * (1f - anim.Offset) - width * weaponScaleX,
Screen.height - height * weaponScaleY,
width * weaponScaleX,
height * weaponScaleY);
}
示例6: Deserialize
//.........这里部分代码省略.........
m_HitSound = -1;
if ( GetSaveFlag( flags, SaveFlag.MissSound ) )
m_MissSound = reader.ReadInt();
else
m_MissSound = -1;
if ( GetSaveFlag( flags, SaveFlag.Speed ) )
{
if ( version < 9 )
m_Speed = reader.ReadInt();
else
m_Speed = reader.ReadFloat();
}
else
m_Speed = -1;
if ( GetSaveFlag( flags, SaveFlag.MaxRange ) )
m_MaxRange = reader.ReadInt();
else
m_MaxRange = -1;
if ( GetSaveFlag( flags, SaveFlag.Skill ) )
m_Skill = (SkillName)reader.ReadInt();
else
m_Skill = (SkillName)(-1);
if ( GetSaveFlag( flags, SaveFlag.Type ) )
m_Type = (WeaponType)reader.ReadInt();
else
m_Type = (WeaponType)(-1);
if ( GetSaveFlag( flags, SaveFlag.Animation ) )
m_Animation = (WeaponAnimation)reader.ReadInt();
else
m_Animation = (WeaponAnimation)(-1);
if ( GetSaveFlag( flags, SaveFlag.Resource ) )
m_Resource = (CraftResource)reader.ReadInt();
else
m_Resource = CraftResource.Iron;
if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
{
m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
((Mobile)Parent).AddSkillMod( m_SkillMod );
}
if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
m_PlayerConstructed = true;
if( GetSaveFlag( flags, SaveFlag.Slayer2 ) )
m_Slayer2 = (SlayerName)reader.ReadInt();
if( GetSaveFlag( flags, SaveFlag.EngravedText ) )
m_EngravedText = reader.ReadString();
break;
}
case 4:
{
m_Slayer = (SlayerName)reader.ReadInt();
goto case 3;
}
case 3:
示例7: Weapon
public Weapon(String name, WeaponAnimation animation)
{
m_name = name;
m_animation = animation;
}
示例8: AlignLeft
private void AlignLeft(WeaponAnimation anim, int width, int height)
{
weaponPosition = new Rect(
Screen.width * anim.Offset,
Screen.height - height * weaponScaleY,
width * weaponScaleX,
height * weaponScaleY);
}
示例9: Deserialize
//.........这里部分代码省略.........
m_HitSound = -1;
if( GetSaveFlag(flags, SaveFlag.MissSound) )
m_MissSound = reader.ReadInt();
else
m_MissSound = -1;
if( GetSaveFlag(flags, SaveFlag.Speed) )
{
if( version < 9 )
m_Speed = reader.ReadInt();
else
m_Speed = reader.ReadFloat();
}
else
m_Speed = -1;
if( GetSaveFlag(flags, SaveFlag.MaxRange) )
m_MaxRange = reader.ReadInt();
else
m_MaxRange = -1;
if( GetSaveFlag(flags, SaveFlag.Skill) )
m_Skill = (SkillName)reader.ReadInt();
else
m_Skill = (SkillName)(-1);
if( GetSaveFlag(flags, SaveFlag.Type) )
m_Type = (WeaponType)reader.ReadInt();
else
m_Type = (WeaponType)(-1);
if( GetSaveFlag(flags, SaveFlag.Animation) )
m_Animation = (WeaponAnimation)reader.ReadInt();
else
m_Animation = (WeaponAnimation)(-1);
if( GetSaveFlag(flags, SaveFlag.Resource) )
m_Resource = (CraftResource)reader.ReadInt();
else
m_Resource = CraftResource.Iron;
if( GetSaveFlag(flags, SaveFlag.xAttributes) )
m_AosAttributes = new AosAttributes(this, reader);
else
m_AosAttributes = new AosAttributes(this);
if( GetSaveFlag(flags, SaveFlag.xWeaponAttributes) )
m_AosWeaponAttributes = new AosWeaponAttributes(this, reader);
else
m_AosWeaponAttributes = new AosWeaponAttributes(this);
if( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
{
m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int)m_AccuracyLevel * 5);
((Mobile)Parent).AddSkillMod(m_SkillMod);
}
if( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;
if( Core.SE && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
{
m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
((Mobile)Parent).AddSkillMod(m_MageMod);
}
示例10: Deserialize
//.........这里部分代码省略.........
{
m_Speed = -1;
}
if (GetSaveFlag(flags, SaveFlag.MaxRange))
{
m_MaxRange = reader.ReadInt();
}
else
{
m_MaxRange = -1;
}
if (GetSaveFlag(flags, SaveFlag.Skill))
{
m_Skill = (SkillName)reader.ReadInt();
}
else
{
m_Skill = (SkillName)(-1);
}
if (GetSaveFlag(flags, SaveFlag.Type))
{
m_Type = (WeaponType)reader.ReadInt();
}
else
{
m_Type = (WeaponType)(-1);
}
if (GetSaveFlag(flags, SaveFlag.Animation))
{
m_Animation = (WeaponAnimation)reader.ReadInt();
}
else
{
m_Animation = (WeaponAnimation)(-1);
}
if (GetSaveFlag(flags, SaveFlag.Resource))
{
m_Resource = (CraftResource)reader.ReadInt();
}
else
{
m_Resource = CraftResource.Iron;
}
if (GetSaveFlag(flags, SaveFlag.xAttributes))
{
m_AosAttributes = new AosAttributes(this, reader);
}
else
{
m_AosAttributes = new AosAttributes(this);
}
if (GetSaveFlag(flags, SaveFlag.xWeaponAttributes))
{
m_AosWeaponAttributes = new AosWeaponAttributes(this, reader);
}
else
{
m_AosWeaponAttributes = new AosWeaponAttributes(this);
}
示例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_DamageMin = -1;
m_DamageMax = -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_DiceDamage = new[] {-1, -1, -1};
m_Hits = m_MaxHits = Utility.RandomMinMax(InitMinHits, InitMaxHits);
m_Resource = CraftResource.Iron;
}
示例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);
// 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 );
}
示例13: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 11:
{
OriginalItemID = reader.ReadInt();
OriginalHue = reader.ReadInt();
OriginalAnimation = (WeaponAnimation)reader.ReadInt();
goto case 10;
}
case 10:
{
var flags2 = (SaveFlag2) reader.ReadInt();
if (GetSaveFlag(flags2, SaveFlag2.Aesthetic)) // Alan Mod
{
m_Aesthetic = true;
}
m_DiceDamage = new[] {-1, -1, -1};
if (GetSaveFlag(flags2, SaveFlag2.DiceDamage))
{
m_DiceDamage[0] = reader.ReadEncodedInt();
m_DiceDamage[1] = reader.ReadEncodedInt();
m_DiceDamage[2] = reader.ReadEncodedInt();
}
goto case 9;
}
case 9:
case 8:
case 7:
case 6:
case 5:
{
var 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))
{
//.........这里部分代码省略.........
示例14: Deserialize
//.........这里部分代码省略.........
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 ) )
m_MaxRange = reader.ReadInt();
else
m_MaxRange = -1;
if ( GetSaveFlag( flags, SaveFlag.Skill ) )
m_Skill = (SkillName)reader.ReadInt();
else
m_Skill = (SkillName)(-1);
if ( GetSaveFlag( flags, SaveFlag.Type ) )
m_Type = (WeaponType)reader.ReadInt();
else
m_Type = (WeaponType)(-1);
if ( GetSaveFlag( flags, SaveFlag.Animation ) )
m_Animation = (WeaponAnimation)reader.ReadInt();
else
m_Animation = (WeaponAnimation)(-1);
if ( GetSaveFlag( flags, SaveFlag.Resource ) )
m_Resource = (CraftResource)reader.ReadInt();
else
m_Resource = CraftResource.Iron;
if ( GetSaveFlag( flags, SaveFlag.xAttributes ) )
m_AosAttributes = new AosAttributes( this, reader );
else
m_AosAttributes = new AosAttributes( this );
if ( GetSaveFlag( flags, SaveFlag.xWeaponAttributes ) )
m_AosWeaponAttributes = new AosWeaponAttributes( this, reader );
else
m_AosWeaponAttributes = new AosWeaponAttributes( this );
if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
{
m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
((Mobile)Parent).AddSkillMod( m_SkillMod );
}
if ( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;
if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
{
m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
((Mobile)Parent).AddSkillMod( m_MageMod );
}
示例15: 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_Components = new List<Item>();
m_AosAttributes = new AosAttributes( this );
m_AosWeaponAttributes = new AosWeaponAttributes( this );
m_AosSkillBonuses = new AosSkillBonuses( this );
m_AosElementDamages = new AosElementAttributes( this );
if( this is BaseRanged || this is AzhuranBoomerang ||
this is DruidStaff || this is ProphetDiviningRod || this is ClericCrook ||
this is QuarterStaff || this is GnarledStaff || this is SpikedClub || this is Club ||
this is BlackStaff )
this.Resource = CraftResource.Oak;
else
{
this.Resource = CraftResource.Copper;
this.Hue = 2413;
}
if( this is IBoneArmour )
this.Hue = 0;
}