Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -18,13 +18,7 @@ namespace Server.SkillHandlers
SkillInfo.Table[(int)SkillName.AnimalTaming].Callback = OnUse;
}
private static bool m_DisableMessage;
public static bool DisableMessage
{
get => m_DisableMessage;
set => m_DisableMessage = value;
}
public static bool DisableMessage { get; set; }
public static TimeSpan OnUse( Mobile m )
{
@ -33,7 +27,7 @@ namespace Server.SkillHandlers
m.Target = new InternalTarget();
m.RevealingAction();
if ( !m_DisableMessage )
if ( !DisableMessage )
m.SendLocalizedMessage( 502789 ); // Tame which animal?
return TimeSpan.FromHours( 6.0 );

View file

@ -6,13 +6,7 @@ namespace Server.SkillHandlers
{
public class Hiding
{
private static bool m_CombatOverride;
public static bool CombatOverride
{
get => m_CombatOverride;
set => m_CombatOverride = value;
}
public static bool CombatOverride { get; set; }
public static void Initialize()
{
@ -61,12 +55,12 @@ namespace Server.SkillHandlers
//int range = 18 - (int)(m.Skills[SkillName.Hiding].Value / 10);
int range = Math.Min( (int)((100 - m.Skills[SkillName.Hiding].Value)/2) + 8, 18 ); //Cap of 18 not OSI-exact, intentional difference
bool badCombat = ( !m_CombatOverride && m.Combatant != null && m.InRange( m.Combatant.Location, range ) && m.Combatant.InLOS( m ) );
bool badCombat = ( !CombatOverride && m.Combatant != null && m.InRange( m.Combatant.Location, range ) && m.Combatant.InLOS( m ) );
bool ok = ( !badCombat /*&& m.CheckSkill( SkillName.Hiding, 0.0 - bonus, 100.0 - bonus )*/ );
if ( ok )
{
if ( !m_CombatOverride )
if ( !CombatOverride )
{
foreach ( Mobile check in m.GetMobilesInRange( range ) )
{

View file

@ -401,25 +401,23 @@ namespace Server.SkillHandlers
{
public static readonly TimeSpan StealTime = TimeSpan.FromMinutes( 2.0 );
private Item m_Stolen;
private Mobile m_Thief;
private Mobile m_Victim;
private DateTime m_Expires;
public Item Stolen { get; }
public Item Stolen => m_Stolen;
public Mobile Thief => m_Thief;
public Mobile Victim => m_Victim;
public DateTime Expires => m_Expires;
public Mobile Thief { get; }
public bool IsExpired => ( DateTime.UtcNow >= m_Expires );
public Mobile Victim { get; }
public DateTime Expires { get; private set; }
public bool IsExpired => ( DateTime.UtcNow >= Expires );
public StolenItem( Item stolen, Mobile thief, Mobile victim )
{
m_Stolen = stolen;
m_Thief = thief;
m_Victim = victim;
Stolen = stolen;
Thief = thief;
Victim = victim;
m_Expires = DateTime.UtcNow + StealTime;
Expires = DateTime.UtcNow + StealTime;
}
private static Queue<StolenItem> m_Queue = new Queue<StolenItem>();
@ -444,9 +442,9 @@ namespace Server.SkillHandlers
foreach ( StolenItem si in m_Queue )
{
if ( si.m_Stolen == item && !si.IsExpired )
if ( si.Stolen == item && !si.IsExpired )
{
victim = si.m_Victim;
victim = si.Victim;
return true;
}
}
@ -460,14 +458,14 @@ namespace Server.SkillHandlers
foreach ( StolenItem si in m_Queue )
{
if ( si.m_Stolen.RootParent == corpse && si.m_Victim != null && !si.IsExpired )
if ( si.Stolen.RootParent == corpse && si.Victim != null && !si.IsExpired )
{
if ( si.m_Victim.AddToBackpack( si.m_Stolen ) )
si.m_Victim.SendLocalizedMessage( 1010464 ); // the item that was stolen is returned to you.
if ( si.Victim.AddToBackpack( si.Stolen ) )
si.Victim.SendLocalizedMessage( 1010464 ); // the item that was stolen is returned to you.
else
si.m_Victim.SendLocalizedMessage( 1010463 ); // the item that was stolen from you falls to the ground.
si.Victim.SendLocalizedMessage( 1010463 ); // the item that was stolen from you falls to the ground.
si.m_Expires = DateTime.UtcNow; // such a hack
si.Expires = DateTime.UtcNow; // such a hack
}
}
}

View file

@ -13,21 +13,21 @@ namespace Server.SkillHandlers
public static double HidingRequirement => ( Core.ML ? 30.0 : ( Core.SE ? 50.0 : 80.0 ) );
public static int[,] ArmorTable => m_ArmorTable;
private static int[,] m_ArmorTable = {
// Gorget Gloves Helmet Arms Legs Chest Shield
/* Cloth */ { 0, 0, 0, 0, 0, 0, 0 },
/* Leather */ { 0, 0, 0, 0, 0, 0, 0 },
/* Studded */ { 2, 2, 0, 4, 6, 10, 0 },
/* Bone */ { 0, 5, 10, 10, 15, 25, 0 },
/* Spined */ { 0, 0, 0, 0, 0, 0, 0 },
/* Horned */ { 0, 0, 0, 0, 0, 0, 0 },
/* Barbed */ { 0, 0, 0, 0, 0, 0, 0 },
/* Ring */ { 0, 5, 0, 10, 15, 25, 0 },
/* Chain */ { 0, 0, 10, 0, 15, 25, 0 },
/* Plate */ { 5, 5, 10, 10, 15, 25, 0 },
/* Dragon */ { 0, 5, 10, 10, 15, 25, 0 }
};
public static int[,] ArmorTable { get; } =
{
// Gorget Gloves Helmet Arms Legs Chest Shield
/* Cloth */ { 0, 0, 0, 0, 0, 0, 0 },
/* Leather */ { 0, 0, 0, 0, 0, 0, 0 },
/* Studded */ { 2, 2, 0, 4, 6, 10, 0 },
/* Bone */ { 0, 5, 10, 10, 15, 25, 0 },
/* Spined */ { 0, 0, 0, 0, 0, 0, 0 },
/* Horned */ { 0, 0, 0, 0, 0, 0, 0 },
/* Barbed */ { 0, 0, 0, 0, 0, 0, 0 },
/* Ring */ { 0, 5, 0, 10, 15, 25, 0 },
/* Chain */ { 0, 0, 10, 0, 15, 25, 0 },
/* Plate */ { 5, 5, 10, 10, 15, 25, 0 },
/* Dragon */ { 0, 5, 10, 10, 15, 25, 0 }
};
public static int GetArmorRating( Mobile m )
{
@ -46,11 +46,11 @@ namespace Server.SkillHandlers
int materialType = (int)armor.MaterialType;
int bodyPosition = (int)armor.BodyPosition;
if ( materialType >= m_ArmorTable.GetLength( 0 ) || bodyPosition >= m_ArmorTable.GetLength( 1 ) )
if ( materialType >= ArmorTable.GetLength( 0 ) || bodyPosition >= ArmorTable.GetLength( 1 ) )
continue;
if ( armor.ArmorAttributes.MageArmor == 0 )
ar += m_ArmorTable[materialType, bodyPosition];
ar += ArmorTable[materialType, bodyPosition];
}
return ar;