Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -11,7 +11,7 @@ namespace Server.Items
private static bool m_IsRunicTool;
private static int m_LuckChance;
private static SkillName[] m_PossibleBonusSkills =
private static readonly SkillName[] m_PossibleBonusSkills =
{
SkillName.Swords,
SkillName.Fencing,
@ -43,7 +43,7 @@ namespace Server.Items
SkillName.Ninjitsu
};
private static SkillName[] m_PossibleSpellbookSkills =
private static readonly SkillName[] m_PossibleSpellbookSkills =
{
SkillName.Magery,
SkillName.Meditation,
@ -51,8 +51,8 @@ namespace Server.Items
SkillName.MagicResist
};
private static BitArray m_Props = new BitArray(MaxProperties);
private static int[] m_Possible = new int[MaxProperties];
private static readonly BitArray m_Props = new BitArray(MaxProperties);
private static readonly int[] m_Possible = new int[MaxProperties];
private CraftResource m_Resource;
public BaseRunicTool(CraftResource resource, int itemID) : base(itemID) => m_Resource = resource;
@ -92,10 +92,10 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
}
}
@ -291,62 +291,62 @@ namespace Server.Items
switch (random)
{
case 0:
{
switch (Utility.Random(5))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPhysicalArea, 2, 50, 2);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2);
break;
case 2:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2);
break;
case 3:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2);
break;
case 4:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2);
break;
}
switch (Utility.Random(5))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPhysicalArea, 2, 50, 2);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2);
break;
case 2:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2);
break;
case 3:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2);
break;
case 4:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2);
break;
}
break;
}
break;
}
case 1:
{
switch (Utility.Random(4))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2);
break;
case 2:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2);
break;
case 3:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2);
break;
}
switch (Utility.Random(4))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2);
break;
case 2:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2);
break;
case 3:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2);
break;
}
break;
}
break;
}
case 2:
{
switch (Utility.Random(2))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10);
break;
}
switch (Utility.Random(2))
{
case 0:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1);
break;
case 1:
ApplyAttribute(secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10);
break;
}
break;
}
break;
}
case 3:
ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 50);
break;
@ -446,22 +446,20 @@ namespace Server.Items
attrs[rand] = temp;
}
/*
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Energy, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Fire, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Poison, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Energy, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Fire, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Poison, totalDamage );
weapon.AosElementDamages[AosElementAttribute.Physical] = 100 - totalDamage;
weapon.AosElementDamages[AosElementAttribute.Physical] = 100 - totalDamage;
* */
for (int i = 0; i < attrs.Length; i++)
totalDamage = AssignElementalDamage(weapon, attrs[i], totalDamage);
//Order is Cold, Energy, Fire, Poison -> Physical left
//Cannot be looped, AoselementAttribute is 'out of order'
// Order is Cold, Energy, Fire, Poison -> Physical left
// Cannot be looped, AoselementAttribute is 'out of order'
weapon.Hue = weapon.GetElementalDamageHue();
}
@ -489,10 +487,10 @@ namespace Server.Items
SlayerGroup
group = groups[
Utility.Random(groups.Length -
1)]; //-1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
1)]; // -1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
SlayerEntry entry;
if (10 > Utility.Random(100)) // 10% chance to do super slayer
if (Utility.Random(100) < 10) // 10% chance to do super slayer
{
entry = group.Super;
}
@ -646,7 +644,7 @@ namespace Server.Items
case 23:
ApplyResistance(armor, min, max, ResistanceType.Energy, 1, 15);
break;
/* End Armor */
/* End Armor */
}
}
}
@ -869,14 +867,14 @@ namespace Server.Items
case 1:
case 2:
case 3:
{
ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
{
ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
for (int j = 0; j < 4; ++j)
m_Props.Set(j, true);
for (int j = 0; j < 4; ++j)
m_Props.Set(j, true);
break;
}
break;
}
case 4:
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
break;
@ -917,4 +915,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -57,9 +57,7 @@ namespace Server.Items
public virtual bool BreakOnDepletion => true;
public abstract CraftSystem CraftSystem{ get; }
#region ICraftable Members
public abstract CraftSystem CraftSystem { get; }
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
CraftItem craftItem, int resHue)
@ -72,8 +70,6 @@ namespace Server.Items
return quality;
}
#endregion
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
@ -85,7 +81,7 @@ namespace Server.Items
}
}
private bool ShowUsesRemaining{ get; set; } = true;
private bool ShowUsesRemaining { get; set; } = true;
bool IUsesRemaining.ShowUsesRemaining
{
@ -117,8 +113,8 @@ namespace Server.Items
base.GetProperties(list);
// Makers mark not displayed on OSI
//if ( m_Crafter != null )
// list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
// if (m_Crafter != null)
// list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
if (m_Quality == ToolQuality.Exceptional)
list.Add(1060636); // exceptional
@ -163,8 +159,7 @@ namespace Server.Items
int num = system.CanCraft(from, this, null);
if (num > 0 && (num != 1044267 || !Core.SE)
) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
{
from.SendLocalizedMessage(num);
}
@ -202,17 +197,17 @@ namespace Server.Items
switch (version)
{
case 1:
{
m_Crafter = reader.ReadMobile();
m_Quality = (ToolQuality)reader.ReadInt();
goto case 0;
}
{
m_Crafter = reader.ReadMobile();
m_Quality = (ToolQuality)reader.ReadInt();
goto case 0;
}
case 0:
{
m_UsesRemaining = reader.ReadInt();
break;
}
{
m_UsesRemaining = reader.ReadInt();
break;
}
}
}
}
}
}