chore(content): Updates to C# 9 syntax (#373)
This commit is contained in:
parent
a59fda6a3a
commit
1e2242bb1a
25 changed files with 155 additions and 405 deletions
|
|
@ -1284,30 +1284,30 @@ namespace Server.Mobiles
|
|||
(int)((useBaseSkill ? m.Skills.AnimalTaming.Base : m.Skills.AnimalTaming.Value) * 10);
|
||||
var lore =
|
||||
(int)((useBaseSkill ? m.Skills.AnimalLore.Base : m.Skills.AnimalLore.Value) * 10);
|
||||
int bonus, chance = 700;
|
||||
int bonus;
|
||||
|
||||
if (Core.ML)
|
||||
{
|
||||
var SkillBonus = taming - (int)(dMinTameSkill * 10);
|
||||
var LoreBonus = lore - (int)(dMinTameSkill * 10);
|
||||
var skillBonus = taming - (int)(dMinTameSkill * 10);
|
||||
var loreBonus = lore - (int)(dMinTameSkill * 10);
|
||||
|
||||
var SkillMod = 6;
|
||||
var LoreMod = 6;
|
||||
var skillMod = 6;
|
||||
var loreMod = 6;
|
||||
|
||||
if (SkillBonus < 0)
|
||||
if (skillBonus < 0)
|
||||
{
|
||||
SkillMod = 28;
|
||||
skillMod = 28;
|
||||
}
|
||||
|
||||
if (LoreBonus < 0)
|
||||
if (loreBonus < 0)
|
||||
{
|
||||
LoreMod = 14;
|
||||
loreMod = 14;
|
||||
}
|
||||
|
||||
SkillBonus *= SkillMod;
|
||||
LoreBonus *= LoreMod;
|
||||
skillBonus *= skillMod;
|
||||
loreBonus *= loreMod;
|
||||
|
||||
bonus = (SkillBonus + LoreBonus) / 2;
|
||||
bonus = (skillBonus + loreBonus) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1325,16 +1325,16 @@ namespace Server.Mobiles
|
|||
}
|
||||
}
|
||||
|
||||
chance += bonus;
|
||||
var chance = 700 + bonus;
|
||||
|
||||
if (chance >= 0 && chance < 200)
|
||||
{
|
||||
chance = 200;
|
||||
}
|
||||
else if (chance > 990)
|
||||
if (chance > 990)
|
||||
{
|
||||
chance = 990;
|
||||
}
|
||||
else if (chance >= 0)
|
||||
{
|
||||
chance = 220;
|
||||
}
|
||||
|
||||
chance -= (MaxLoyalty - m_Loyalty) * 10;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ namespace Server.Mobiles
|
|||
KarmaLocked = 0x00000020,
|
||||
AutoRenewInsurance = 0x00000040,
|
||||
UseOwnFilter = 0x00000080,
|
||||
PublicMyRunUO = 0x00000100,
|
||||
PagingSquelched = 0x00000200,
|
||||
Young = 0x00000400,
|
||||
AcceptGuildInvites = 0x00000800,
|
||||
|
|
@ -562,13 +561,6 @@ namespace Server.Mobiles
|
|||
set => SetFlag(PlayerFlag.UseOwnFilter, value);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool PublicMyRunUO
|
||||
{
|
||||
get => GetFlag(PlayerFlag.PublicMyRunUO);
|
||||
set => SetFlag(PlayerFlag.PublicMyRunUO, value);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool AcceptGuildInvites
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,17 +15,14 @@ namespace Server.Mobiles
|
|||
|
||||
if (item is BaseArmor armor)
|
||||
{
|
||||
if (armor.Quality == ArmorQuality.Low)
|
||||
price = armor.Quality switch
|
||||
{
|
||||
price = (int)(price * 0.60);
|
||||
}
|
||||
else if (armor.Quality == ArmorQuality.Exceptional)
|
||||
{
|
||||
price = (int)(price * 1.25);
|
||||
}
|
||||
ArmorQuality.Low => (int)(price * 0.60),
|
||||
ArmorQuality.Exceptional => (int)(price * 1.25),
|
||||
_ => price
|
||||
};
|
||||
|
||||
price += 100 * (int)armor.Durability;
|
||||
|
||||
price += 100 * (int)armor.ProtectionLevel;
|
||||
|
||||
if (price < 1)
|
||||
|
|
@ -35,17 +32,14 @@ namespace Server.Mobiles
|
|||
}
|
||||
else if (item is BaseWeapon weapon)
|
||||
{
|
||||
if (weapon.Quality == WeaponQuality.Low)
|
||||
price = weapon.Quality switch
|
||||
{
|
||||
price = (int)(price * 0.60);
|
||||
}
|
||||
else if (weapon.Quality == WeaponQuality.Exceptional)
|
||||
{
|
||||
price = (int)(price * 1.25);
|
||||
}
|
||||
WeaponQuality.Low => (int)(price * 0.60),
|
||||
WeaponQuality.Exceptional => (int)(price * 1.25),
|
||||
_ => price
|
||||
};
|
||||
|
||||
price += 100 * (int)weapon.DurabilityLevel;
|
||||
|
||||
price += 100 * (int)weapon.DamageLevel;
|
||||
|
||||
if (price < 1)
|
||||
|
|
|
|||
|
|
@ -126,66 +126,30 @@ namespace Server.Mobiles
|
|||
|
||||
public int ComputePriceFor(HouseDeed deed)
|
||||
{
|
||||
var price = 0;
|
||||
|
||||
if (deed is SmallBrickHouseDeed || deed is StonePlasterHouseDeed || deed is FieldStoneHouseDeed ||
|
||||
deed is WoodHouseDeed || deed is WoodPlasterHouseDeed ||
|
||||
deed is ThatchedRoofCottageDeed)
|
||||
var price = deed switch
|
||||
{
|
||||
price = 43800;
|
||||
}
|
||||
else if (deed is BrickHouseDeed)
|
||||
{
|
||||
price = 144500;
|
||||
}
|
||||
else if (deed is TwoStoryWoodPlasterHouseDeed || deed is TwoStoryStonePlasterHouseDeed)
|
||||
{
|
||||
price = 192400;
|
||||
}
|
||||
else if (deed is TowerDeed)
|
||||
{
|
||||
price = 433200;
|
||||
}
|
||||
else if (deed is KeepDeed)
|
||||
{
|
||||
price = 665200;
|
||||
}
|
||||
else if (deed is CastleDeed)
|
||||
{
|
||||
price = 1022800;
|
||||
}
|
||||
else if (deed is LargePatioDeed)
|
||||
{
|
||||
price = 152800;
|
||||
}
|
||||
else if (deed is LargeMarbleDeed)
|
||||
{
|
||||
price = 192800;
|
||||
}
|
||||
else if (deed is SmallTowerDeed)
|
||||
{
|
||||
price = 88500;
|
||||
}
|
||||
else if (deed is LogCabinDeed)
|
||||
{
|
||||
price = 97800;
|
||||
}
|
||||
else if (deed is SandstonePatioDeed)
|
||||
{
|
||||
price = 90900;
|
||||
}
|
||||
else if (deed is VillaDeed)
|
||||
{
|
||||
price = 136500;
|
||||
}
|
||||
else if (deed is StoneWorkshopDeed)
|
||||
{
|
||||
price = 60600;
|
||||
}
|
||||
else if (deed is MarbleWorkshopDeed)
|
||||
{
|
||||
price = 60300;
|
||||
}
|
||||
SmallBrickHouseDeed => 43800,
|
||||
StonePlasterHouseDeed => 43800,
|
||||
FieldStoneHouseDeed => 43800,
|
||||
WoodHouseDeed => 43800,
|
||||
WoodPlasterHouseDeed => 43800,
|
||||
ThatchedRoofCottageDeed => 43800,
|
||||
BrickHouseDeed => 144500,
|
||||
TwoStoryWoodPlasterHouseDeed => 192400,
|
||||
TwoStoryStonePlasterHouseDeed => 192400,
|
||||
TowerDeed => 433200,
|
||||
KeepDeed => 665200,
|
||||
CastleDeed => 1022800,
|
||||
LargePatioDeed => 152800,
|
||||
LargeMarbleDeed => 192800,
|
||||
SmallTowerDeed => 88500,
|
||||
LogCabinDeed => 97800,
|
||||
SandstonePatioDeed => 90900,
|
||||
VillaDeed => 136500,
|
||||
StoneWorkshopDeed => 60600,
|
||||
MarbleWorkshopDeed => 60300,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
return AOS.Scale(price, 80); // refunds 80% of the purchase price
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,18 +50,12 @@ namespace Server.Mobiles
|
|||
{
|
||||
var theirSkill = pm.Skills.Tailoring.Base;
|
||||
|
||||
if (theirSkill >= 70.1)
|
||||
pm.NextTailorBulkOrder = theirSkill switch
|
||||
{
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(6.0);
|
||||
}
|
||||
else if (theirSkill >= 50.1)
|
||||
{
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(2.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(1.0);
|
||||
}
|
||||
>= 70.1 => TimeSpan.FromHours(6.0),
|
||||
>= 50.1 => TimeSpan.FromHours(2.0),
|
||||
_ => TimeSpan.FromHours(1.0)
|
||||
};
|
||||
|
||||
if (theirSkill >= 70.1 && (theirSkill - 40.0) / 300.0 > Utility.RandomDouble())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -702,42 +702,22 @@ namespace Server.Mobiles
|
|||
{
|
||||
var item = Items[i];
|
||||
|
||||
if (item is BaseHat)
|
||||
item.Layer = item switch
|
||||
{
|
||||
item.Layer = Layer.Helm;
|
||||
}
|
||||
else if (item is BaseMiddleTorso)
|
||||
{
|
||||
item.Layer = Layer.MiddleTorso;
|
||||
}
|
||||
else if (item is BaseOuterLegs)
|
||||
{
|
||||
item.Layer = Layer.OuterLegs;
|
||||
}
|
||||
else if (item is BaseOuterTorso)
|
||||
{
|
||||
item.Layer = Layer.OuterTorso;
|
||||
}
|
||||
else if (item is BasePants)
|
||||
{
|
||||
item.Layer = Layer.Pants;
|
||||
}
|
||||
else if (item is BaseShirt)
|
||||
{
|
||||
item.Layer = Layer.Shirt;
|
||||
}
|
||||
else if (item is BaseWaist)
|
||||
{
|
||||
item.Layer = Layer.Waist;
|
||||
}
|
||||
else if (item is BaseShoes)
|
||||
{
|
||||
if (item is Sandals)
|
||||
{
|
||||
item.Hue = 0;
|
||||
}
|
||||
BaseHat => Layer.Helm,
|
||||
BaseMiddleTorso => Layer.MiddleTorso,
|
||||
BaseOuterLegs => Layer.OuterLegs,
|
||||
BaseOuterTorso => Layer.OuterTorso,
|
||||
BasePants => Layer.Pants,
|
||||
BaseShirt => Layer.Shirt,
|
||||
BaseWaist => Layer.Waist,
|
||||
BaseShoes => Layer.Shoes,
|
||||
_ => item.Layer
|
||||
};
|
||||
|
||||
item.Layer = Layer.Shoes;
|
||||
if (item is Sandals)
|
||||
{
|
||||
item.Hue = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue