Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 • committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -93,7 +93,7 @@ namespace Server.Mobiles
public static bool Withdraw(Mobile from, int amount)
{
// If for whatever reason the TOL checks fail, we should still try old methods for withdrawing currency.
if (AccountGold.Enabled && from.Account != null && from.Account.WithdrawGold(amount)) return true;
if (AccountGold.Enabled && from.Account?.WithdrawGold(amount) == true) return true;
int balance = GetBalance(from, out Item[] gold, out Item[] checks);
@ -133,7 +133,7 @@ namespace Server.Mobiles
public static bool Deposit(Mobile from, int amount)
{
// If for whatever reason the TOL checks fail, we should still try old methods for depositing currency.
if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(amount)) return true;
if (AccountGold.Enabled && from.Account?.DepositGold(amount) == true) return true;
BankBox box = from.FindBankNoCreate();
@ -179,7 +179,7 @@ namespace Server.Mobiles
public static int DepositUpTo(Mobile from, int amount)
{
// If for whatever reason the TOL checks fail, we should still try old methods for depositing currency.
if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(amount)) return amount;
if (AccountGold.Enabled && from.Account?.DepositGold(amount) == true) return amount;
BankBox box = from.FindBankNoCreate();

View file

@ -658,10 +658,8 @@ namespace Server.Mobiles
m_Table = new Dictionary<string, EscortDestinationInfo>();
foreach (Region r in list)
{
if (r.Name != null && (r is DungeonRegion || r is TownRegion))
m_Table[r.Name] = new EscortDestinationInfo(r.Name, r);
}
}
public static EDI Find(string name)

View file

@ -22,16 +22,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -25,15 +25,15 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(5))
return Utility.Random(5) switch
{
default:
case 0: return Utility.RandomBlueHue();
case 1: return Utility.RandomGreenHue();
case 2: return Utility.RandomRedHue();
case 3: return Utility.RandomYellowHue();
case 4: return Utility.RandomNeutralHue();
}
0 => Utility.RandomBlueHue(),
1 => Utility.RandomGreenHue(),
2 => Utility.RandomRedHue(),
3 => Utility.RandomYellowHue(),
4 => Utility.RandomNeutralHue(),
_ => Utility.RandomBlueHue()
};
}
public override void InitOutfit()

View file

@ -22,16 +22,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -16,16 +16,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -23,16 +23,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -16,16 +16,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -35,16 +35,16 @@ namespace Server.Mobiles
private static int GetRandomHue()
{
switch (Utility.Random(6))
return Utility.Random(6) switch
{
default:
case 0: return 0;
case 1: return Utility.RandomBlueHue();
case 2: return Utility.RandomGreenHue();
case 3: return Utility.RandomRedHue();
case 4: return Utility.RandomYellowHue();
case 5: return Utility.RandomNeutralHue();
}
0 => 0,
1 => Utility.RandomBlueHue(),
2 => Utility.RandomGreenHue(),
3 => Utility.RandomRedHue(),
4 => Utility.RandomYellowHue(),
5 => Utility.RandomNeutralHue(),
_ => 0
};
}
public override void InitOutfit()

View file

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using Server.Commands;
using Server.Gumps;
using Server.Items;
using Server.Network;
@ -322,18 +321,12 @@ namespace Server.Mobiles
AddItem(new FancyShirt(Utility.RandomBlueHue()));
Item skirt;
switch (Utility.Random(2))
var skirt = Utility.Random(2) switch
{
case 0:
skirt = new Skirt();
break;
default:
case 1:
skirt = new Kilt();
break;
}
0 => (Item)new Skirt(),
1 => new Kilt(),
_ => new Kilt()
};
skirt.Hue = Utility.RandomGreenHue();
@ -341,18 +334,12 @@ namespace Server.Mobiles
AddItem(new FeatheredHat(Utility.RandomGreenHue()));
Item boots;
switch (Utility.Random(2))
var boots = Utility.Random(2) switch
{
case 0:
boots = new Boots();
break;
default:
case 1:
boots = new ThighBoots();
break;
}
0 => (Item)new Boots(),
1 => new ThighBoots(),
_ => new ThighBoots()
};
AddItem(boots);