From ecbee1769087f6ec7293eceb9f5209901642665d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 2 Jun 2022 10:09:53 -0700 Subject: [PATCH] fix: Optimizes OPL using string interpolation (#1041) ## Breaking Changes (New API) ObjectPropertyList supports the following API: ```cs list.Add(500000); list.Add(500001, stringArgument); list.Add("Some text"); list.Add($"Some text with {argument}"); list.Add(500002, $"{arg1}\t{arg2}"); ``` ## Notes 1. All API uses that require a formatter like this: ```cs list.Add(500002, "{0}\t{1}", arg1, arg2); ``` Should be changed to use string interpolation, for example: ```cs list.Add(500002, $"{arg1}\t{arg2}"); ``` 2. The following paradigm should no longer be used: ```cs list.Add(1061170, prop.ToString()); // strength requirement ~1_val~ ``` The new string interpolation API will avoid having to convert the argument to a string before writing it to the packet. Instead use the following: ```cs list.Add(1061170, $"{prop}"); // strength requirement ~1_val~ ``` ### Benchmarks ```cs | Method | Mean | Error | StdDev | Gen 0 | Allocated | |------------------------------- |---------:|--------:|--------:|-------:|----------:| | BenchmarkOldOPL | 241.0 ns | 0.56 ns | 0.47 ns | 0.0105 | 88 B | | BenchmarkStringInterpolatedOPL | 199.9 ns | 2.44 ns | 2.39 ns | - | - | ``` ### Changes - [X] Removes crash in STArray.Return when array is null. - [X] Fixes NPE in OPL when entity is null. Serial in packet will be 0 when entity is null. - [X] Fixes NPE in AosAttributes when Parent is null. - [X] Changes OPL to use string interpolation. - [X] Introduces `IPropertyList` to allow extending PropertyList for other uses. --- .../Buffers/RawInterpolatedStringHandler.cs | 2 +- Projects/Server/Buffers/STArrayPool.cs | 2 +- Projects/Server/Items/Container.cs | 15 +- Projects/Server/Items/Item.cs | 56 +- Projects/Server/Items/VirtualCheck.cs | 2 +- Projects/Server/Mobiles/Mobile.cs | 54 +- .../Network/Packets/OutgoingEntityPackets.cs | 2 +- Projects/Server/ObjectPropertyList.cs | 184 ------- .../PropertyList/IObjectPropertyListEntity.cs | 23 + Projects/Server/PropertyList/IPropertyList.cs | 30 ++ .../Server/PropertyList/ObjectPropertyList.cs | 508 ++++++++++++++++++ .../Text/ISelfInterpolatedStringHandler.cs | 71 +++ Projects/Server/Text/StringHelpers.cs | 18 + Projects/Server/Utilities/Utility.cs | 15 +- .../Bulk Orders/Books/BulkOrderBook.cs | 4 +- .../UOContent/Engines/Bulk Orders/LargeBOD.cs | 7 +- .../UOContent/Engines/Bulk Orders/SmallBOD.cs | 6 +- .../Engines/CannedEvil/ChampionSpawn.cs | 15 +- .../Engines/ConPVP/Gumps/AcceptTeamGump.cs | 21 +- .../Engines/ConPVP/Gumps/ConfirmSignupGump.cs | 21 +- .../ConPVP/Gumps/TournamentBracketGump.cs | 21 +- .../UOContent/Engines/Factions/Items/Sigil.cs | 2 +- .../Items/Traps/FactionTrapRemovalKit.cs | 4 +- .../Mobiles/Guards/BaseFactionGuard.cs | 2 +- .../Items/APersonalLetterAddressedToAhie.cs | 2 +- .../ML Quests/Items/AlchemistsBandage.cs | 2 +- .../Items/BasinOfCrystalClearWater.cs | 2 +- .../Engines/ML Quests/Items/BridesLetter.cs | 2 +- .../CompletedTuitionReimbursementForm.cs | 2 +- .../Engines/ML Quests/Items/CrateForSledge.cs | 2 +- .../ML Quests/Items/DreadSpiderSilk.cs | 2 +- .../ML Quests/Items/FragmentOfAMapDelivery.cs | 2 +- .../Items/FriendsOfTheLibraryApplication.cs | 2 +- .../Engines/ML Quests/Items/GiftForArielle.cs | 2 +- .../ML Quests/Items/NotarizedApplication.cs | 2 +- .../ML Quests/Items/OfficialSealingWax.cs | 2 +- .../ML Quests/Items/PortraitOfTheBride.cs | 2 +- .../Engines/ML Quests/Items/PrismaticAmber.cs | 2 +- .../Engines/ML Quests/Items/QuestGiverItem.cs | 4 +- .../Engines/ML Quests/Items/ReginasLetter.cs | 2 +- .../Engines/ML Quests/Items/ReginasRing.cs | 2 +- .../ML Quests/Items/SealedNotesForJamal.cs | 2 +- .../Items/SealingWaxOrderAddressedToPetrus.cs | 2 +- .../Items/SignedTuitionReimbursementForm.cs | 2 +- .../Engines/ML Quests/Items/SpiritBottle.cs | 2 +- .../ML Quests/Items/TaintedTreeSample.cs | 2 +- .../Engines/ML Quests/Items/Teleporters.cs | 4 +- .../Items/TuitionReimbursementForm.cs | 2 +- .../UOContent/Engines/Plants/PlantItem.cs | 2 +- Projects/UOContent/Engines/Plants/Seed.cs | 2 +- .../Quests/Collector/Items/Obsidian.cs | 2 +- .../Quests/Collector/Items/PaintedImage.cs | 2 +- .../Quests/Core/Items/HornOfRetreat.cs | 4 +- .../Items/SchmendrickApprenticeCorpse.cs | 2 +- .../Uzeraan Turmoil/Mobiles/MilitiaFighter.cs | 2 +- .../Items/HagApprenticeCorpse.cs | 2 +- .../UOContent/Engines/Spawners/BaseSpawner.cs | 21 +- .../Engines/Spawners/RegionSpawner.cs | 4 +- .../BasePigmentsOfTokuno.cs | 4 +- .../Treasures of Tokuno/LesserArtifacts.cs | 4 +- .../Character Statue Maker/CharacterStatue.cs | 4 +- .../CharacterStatueMaker.cs | 2 +- .../Halloween/2006/Items/TwilightLantern.cs | 2 +- .../Valentine/2011/Items/StValentinesBears.cs | 4 +- .../Valentine/2012/Items/CupidsArrow.cs | 2 +- .../UOContent/Items/Addons/AddonComponent.cs | 2 +- .../Items/Addons/AddonContainerComponent.cs | 2 +- .../Items/Addons/BaseAddonContainer.cs | 2 +- .../Items/Addons/BaseAddonContainerDeed.cs | 2 +- Projects/UOContent/Items/Aquarium/Aquarium.cs | 34 +- .../Items/Aquarium/AquariumFishingNet.cs | 2 +- Projects/UOContent/Items/Aquarium/BaseFish.cs | 2 +- Projects/UOContent/Items/Aquarium/FishBowl.cs | 4 +- .../Items/Aquarium/Rewards/AquariumMessage.cs | 2 +- .../Rewards/CaptainBlackheartsFishingPole.cs | 2 +- .../Aquarium/Rewards/CraftysFishingHat.cs | 2 +- .../Items/Aquarium/Rewards/FishBones.cs | 2 +- .../Items/Aquarium/Rewards/IslandStatue.cs | 2 +- .../UOContent/Items/Aquarium/Rewards/Shell.cs | 2 +- .../Items/Aquarium/Rewards/ToyBoat.cs | 2 +- .../Aquarium/Rewards/WaterloggedBoots.cs | 2 +- .../UOContent/Items/Aquarium/VacationWafer.cs | 4 +- Projects/UOContent/Items/Armor/BaseArmor.cs | 99 ++-- .../Items/Armor/Glasses/ElvenGlasses.cs | 32 +- .../Items/Armor/Leather/LeafGloves.cs | 4 +- .../Items/Armor/Leather/LeatherGloves.cs | 4 +- Projects/UOContent/Items/Books/BaseBook.cs | 2 +- .../Items/Books/Defined/FropozJournal.cs | 2 +- .../Items/Books/Defined/KaburJournal.cs | 2 +- .../Defined/TranslatedGargoyleJournal.cs | 2 +- .../UOContent/Items/Clothing/BaseClothing.cs | 70 +-- Projects/UOContent/Items/Clothing/Cloaks.cs | 6 +- Projects/UOContent/Items/Clothing/Hats.cs | 2 +- .../UOContent/Items/Clothing/OuterTorso.cs | 8 +- Projects/UOContent/Items/Clothing/Shoes.cs | 4 +- .../Items/Construction/Signs/SubtextSign.cs | 2 +- .../UOContent/Items/Containers/Container.cs | 2 +- .../Items/Containers/LockableContainer.cs | 2 +- .../Items/Containers/ParagonChest.cs | 2 +- .../UOContent/Items/Containers/Strongbox.cs | 2 +- .../BaseDecorationArtifact.cs | 8 +- .../UOContent/Items/Deeds/CommodityDeed.cs | 2 +- .../Items/Deeds/DragonBardingDeed.cs | 2 +- .../UOContent/Items/Deeds/NewPlayerTicket.cs | 2 +- .../Items/Deeds/VendorRentalContract.cs | 2 +- Projects/UOContent/Items/Food/Beverage.cs | 2 +- .../Items/Games/Mahjong/MahjongGame.cs | 2 +- Projects/UOContent/Items/Guilds/Guildstone.cs | 4 +- Projects/UOContent/Items/Jewels/BaseJewel.cs | 50 +- Projects/UOContent/Items/Lights/Candelabra.cs | 2 +- Projects/UOContent/Items/Maps/TreasureMap.cs | 2 +- Projects/UOContent/Items/Misc/BankCheck.cs | 2 +- .../Blighted Grove/MelisandesFermentedWine.cs | 2 +- .../Misc/Blighted Grove/MelisandesHairDye.cs | 2 +- .../Items/Misc/CommunicationCrystals.cs | 8 +- .../UOContent/Items/Misc/Corpses/Corpse.cs | 2 +- .../Items/Misc/Corpses/DecayedCorpse.cs | 2 +- .../UOContent/Items/Misc/InteriorDecorator.cs | 2 +- Projects/UOContent/Items/Misc/Key.cs | 2 +- .../UOContent/Items/Misc/PromotionalToken.cs | 4 +- Projects/UOContent/Items/Misc/Teleporter.cs | 26 +- Projects/UOContent/Items/Misc/WindChimes.cs | 2 +- .../UOContent/Items/Quivers/BaseQuiver.cs | 78 ++- .../Items/Resources/Blacksmithing/Ingots.cs | 6 +- .../Items/Resources/Blacksmithing/Ore.cs | 6 +- .../Items/Resources/Fishing/BigFish.cs | 4 +- .../Items/Resources/Masonry/Granite.cs | 2 +- .../UOContent/Items/Resources/Tailor/Hides.cs | 6 +- .../Items/Resources/Tailor/Leathers.cs | 6 +- .../Skill Items/Carpenter Items/Board.cs | 2 +- .../Carpenter Items/TaxidermyKit.cs | 8 +- .../Fishing/Misc/ShipwreckedItem.cs | 2 +- .../Fishing/Misc/SpecialFishingNet.cs | 6 +- .../Harvest Tools/BaseHarvestTool.cs | 4 +- .../Items/Skill Items/Lumberjack/Log.cs | 2 +- .../Skill Items/Magical/Misc/PotionKeg.cs | 2 +- .../Skill Items/Magical/Misc/RecallRune.cs | 28 +- .../Items/Skill Items/Magical/Runebook.cs | 2 +- .../Items/Skill Items/Magical/Spellbook.cs | 48 +- .../Items/Skill Items/Misc/RecipeScroll.cs | 4 +- .../Items/Skill Items/Misc/RepairDeed.cs | 4 +- .../Musical Instruments/BaseInstrument.cs | 4 +- .../Items/Skill Items/Ninjitsu/Fukiya.cs | 4 +- .../Items/Skill Items/Ninjitsu/FukiyaDarts.cs | 4 +- .../Skill Items/Ninjitsu/LeatherNinjaBelt.cs | 4 +- .../Items/Skill Items/Ninjitsu/Shuriken.cs | 4 +- .../Tailor Items/Dyetubs/FurnitureDyeTub.cs | 2 +- .../Tailor Items/Dyetubs/LeatherDyeTub.cs | 2 +- .../Dyetubs/MetallicLeatherDyeTub.cs | 2 +- .../Tailor Items/Dyetubs/RewardBlackDyeTub.cs | 2 +- .../Tailor Items/Dyetubs/RunebookDyeTub.cs | 2 +- .../Tailor Items/Dyetubs/SpecialDyeTub.cs | 2 +- .../Tailor Items/Dyetubs/StatuetteDyeTub.cs | 2 +- .../Items/Skill Items/Tools/BaseTool.cs | 4 +- .../Items/Skill Items/Tools/RunicHammer.cs | 2 +- .../Items/Skill Items/Tools/RunicSewingKit.cs | 2 +- .../Dawn's Music Box/DawnsMusicBox.cs | 8 +- .../Dawn's Music Box/DawnsMusicGear.cs | 2 +- .../8th Anniversary Items/FountainOfLife.cs | 6 +- .../8th Anniversary Items/Talismans.cs | 2 +- .../Blacksmithy/AncientSmithyHammer.cs | 4 +- .../Blacksmithy/GlovesOfMining.cs | 4 +- .../Blacksmithy/PowderOfTemperament.cs | 4 +- .../Items/Special/Gifts/RoseOfTrinsic.cs | 4 +- .../UOContent/Items/Special/HeritageToken.cs | 2 +- .../Items/Special/Holiday/Snowman.cs | 2 +- .../Special/House Raffle/HouseRaffleDeed.cs | 13 +- .../Special/House Raffle/HouseRaffleStone.cs | 14 +- .../UOContent/Items/Special/MiniHouses.cs | 2 +- .../Items/Special/MonsterStatuette.cs | 2 +- .../Rares/Containers/BaseWaterContainer.cs | 2 +- .../Items/Special/Solen Items/BagOfSending.cs | 4 +- .../Special/Solen Items/BallOfSummoning.cs | 2 +- .../Special/Solen Items/BraceletOfBinding.cs | 2 +- Projects/UOContent/Items/Special/SoulStone.cs | 18 +- .../Special/Special Scrolls/PowerScroll.cs | 6 +- .../Special Scrolls/ScrollofAlacrity.cs | 4 +- .../Special Scrolls/ScrollofTranscendence.cs | 2 +- .../Special/Special Scrolls/StatScroll.cs | 8 +- .../Special/Valentines/2007/ValentinesCard.cs | 2 +- .../Veteran Rewards/AnkhOfSacrifice.cs | 2 +- .../Items/Special/Veteran Rewards/Banner.cs | 4 +- .../Veteran Rewards/BloodyPentagram.cs | 2 +- .../Items/Special/Veteran Rewards/Brazier.cs | 4 +- .../Items/Special/Veteran Rewards/Cannon.cs | 8 +- .../Veteran Rewards/CommodityDeedBox.cs | 2 +- .../Veteran Rewards/ContestMiniHouse.cs | 2 +- .../Veteran Rewards/DecorativeShield.cs | 4 +- .../Special/Veteran Rewards/FlamingHead.cs | 4 +- .../Veteran Rewards/HangingSkeleton.cs | 4 +- .../Special/Veteran Rewards/MiningCart.cs | 2 +- .../Special/Veteran Rewards/MinotaurStatue.cs | 2 +- .../Special/Veteran Rewards/PottedCactus.cs | 2 +- .../Special/Veteran Rewards/StoneAnkh.cs | 6 +- .../Special/Veteran Rewards/TreeStump.cs | 2 +- .../Special/Veteran Rewards/WallBanner.cs | 2 +- .../Veteran Rewards/WeaponEngravingTool.cs | 4 +- .../UOContent/Items/Talismans/BaseTalisman.cs | 84 ++- Projects/UOContent/Items/Wands/BaseWand.cs | 24 +- .../UOContent/Items/Weapons/BaseWeapon.cs | 122 ++--- .../Weapons/ML Weapons/ButchersWarCleaver.cs | 2 +- .../Items/Weapons/Maces/FireworksWand.cs | 4 +- Projects/UOContent/Misc/AOS.cs | 8 +- .../Gifts/Winter2004/DecorativeTopiary.cs | 2 +- .../Misc/Gifts/Winter2004/FestiveCactus.cs | 2 +- .../Winter2004/LightOfTheWinterSolstice.cs | 2 +- .../Misc/Gifts/Winter2004/Mistletoe.cs | 2 +- .../Gifts/Winter2004/PileOfGlacialSnow.cs | 2 +- .../Misc/Gifts/Winter2004/SnowyTree.cs | 2 +- Projects/UOContent/Misc/TextDefinition.cs | 2 +- Projects/UOContent/Mobiles/AI/BaseAI.cs | 2 +- .../Mobiles/Animals/Mounts/Ethereals.cs | 2 +- .../Mobiles/Animals/Mounts/SwampDragon.cs | 2 +- Projects/UOContent/Mobiles/BaseCreature.cs | 2 +- .../Monsters/LBR/Meers/EnragedCreatures.cs | 2 +- Projects/UOContent/Mobiles/PlayerMobile.cs | 24 +- .../Mobiles/Special/ServantOfSemidar.cs | 2 +- .../UOContent/Mobiles/Vendors/BaseVendor.cs | 16 +- .../UOContent/Mobiles/Vendors/PlayerVendor.cs | 8 +- .../UOContent/Multis/Boats/BaseDockedBoat.cs | 2 +- Projects/UOContent/Multis/Boats/TillerMan.cs | 4 +- Projects/UOContent/Multis/Houses/BaseHouse.cs | 2 +- Projects/UOContent/Multis/Houses/HouseSign.cs | 4 +- .../Items/Stones/GamblingStone.cs | 6 +- .../Spells/Spellweaving/Items/ArcaneFocus.cs | 4 +- .../Spellweaving/Items/TransientItem.cs | 4 +- version.json | 2 +- 227 files changed, 1426 insertions(+), 1008 deletions(-) delete mode 100644 Projects/Server/ObjectPropertyList.cs create mode 100644 Projects/Server/PropertyList/IObjectPropertyListEntity.cs create mode 100644 Projects/Server/PropertyList/IPropertyList.cs create mode 100644 Projects/Server/PropertyList/ObjectPropertyList.cs create mode 100644 Projects/Server/Text/ISelfInterpolatedStringHandler.cs diff --git a/Projects/Server/Buffers/RawInterpolatedStringHandler.cs b/Projects/Server/Buffers/RawInterpolatedStringHandler.cs index 20c996ead..699b61792 100644 --- a/Projects/Server/Buffers/RawInterpolatedStringHandler.cs +++ b/Projects/Server/Buffers/RawInterpolatedStringHandler.cs @@ -78,7 +78,7 @@ public ref struct RawInterpolatedStringHandler /// The number of interpolation expressions in the interpolated string. [MethodImpl(MethodImplOptions.AggressiveInlining)] // becomes a constant when inputs are constant internal static int GetDefaultLength(int literalLength, int formattedCount) => - Math.Max(MinimumArrayPoolLength, literalLength + (formattedCount * GuessedLengthPerHole)); + Math.Max(MinimumArrayPoolLength, literalLength + formattedCount * GuessedLengthPerHole); /// Clears the handler, returning any rented array to the pool. [MethodImpl(MethodImplOptions.AggressiveInlining)] // used only on a few hot paths diff --git a/Projects/Server/Buffers/STArrayPool.cs b/Projects/Server/Buffers/STArrayPool.cs index 8210aa3de..65e8a9d6c 100644 --- a/Projects/Server/Buffers/STArrayPool.cs +++ b/Projects/Server/Buffers/STArrayPool.cs @@ -78,7 +78,7 @@ public class STArrayPool : ArrayPool { if (array is null) { - throw new ArgumentNullException(nameof(array)); + return; } var bucketIndex = SelectBucketIndex(array.Length); diff --git a/Projects/Server/Items/Container.cs b/Projects/Server/Items/Container.cs index 1b8375553..1d06752cc 100644 --- a/Projects/Server/Items/Container.cs +++ b/Projects/Server/Items/Container.cs @@ -755,7 +755,7 @@ namespace Server.Items public virtual void SendContentTo(NetState state) => state.SendContainerContent(state.Mobile, this); - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -767,21 +767,14 @@ namespace Server.Items { list.Add( 1073841, // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~ stones - "{0}\t{1}\t{2}", - TotalItems, - MaxItems, - TotalWeight + $"{TotalItems}\t{MaxItems}\t{TotalWeight}" ); } else { list.Add( 1072241, // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones - "{0}\t{1}\t{2}\t{3}", - TotalItems, - MaxItems, - TotalWeight, - MaxWeight + $"{TotalItems}\t{MaxItems}\t{TotalWeight}\t{MaxWeight}" ); } @@ -790,7 +783,7 @@ namespace Server.Items else { // ~1_COUNT~ items, ~2_WEIGHT~ stones - list.Add(1050044, "{0}\t{1}", TotalItems, TotalWeight); + list.Add(1050044, $"{TotalItems}\t{TotalWeight}"); } } } diff --git a/Projects/Server/Items/Item.cs b/Projects/Server/Items/Item.cs index 188bafc47..80c1ee96b 100644 --- a/Projects/Server/Items/Item.cs +++ b/Projects/Server/Items/Item.cs @@ -176,7 +176,7 @@ namespace Server Spawner = 0x100 } - public class Item : IHued, IComparable, ISpawnable, IPropertyListObject + public class Item : IHued, IComparable, ISpawnable, IObjectPropertyListEntity { private static readonly ILogger logger = LogFactory.GetLogger(typeof(Item)); @@ -769,7 +769,7 @@ namespace Server /// custom /// properties. /// - public virtual void GetProperties(ObjectPropertyList list) + public virtual void GetProperties(IPropertyList list) { AddNameProperties(list); } @@ -1817,7 +1817,7 @@ namespace Server /// Overridable. Adds the name of this item to the given . This method should be overridden /// if the item requires a complex naming format. /// - public virtual void AddNameProperty(ObjectPropertyList list) + public virtual void AddNameProperty(IPropertyList list) { var name = Name; @@ -1829,7 +1829,7 @@ namespace Server } else { - list.Add(1050039, "{0}\t#{1}", m_Amount, LabelNumber); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{m_Amount}\t#{LabelNumber}"); // ~1_NUMBER~ ~2_ITEMNAME~ } } else @@ -1840,7 +1840,7 @@ namespace Server } else { - list.Add(1050039, "{0}\t{1}", m_Amount, Name); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{m_Amount}\t{Name}"); // ~1_NUMBER~ ~2_ITEMNAME~ } } } @@ -1849,7 +1849,7 @@ namespace Server /// Overridable. Adds the loot type of this item to the given . By default, this will be /// either 'blessed', 'cursed', or 'insured'. /// - public virtual void AddLootTypeProperty(ObjectPropertyList list) + public virtual void AddLootTypeProperty(IPropertyList list) { if (m_LootType == LootType.Blessed) { @@ -1868,59 +1868,51 @@ namespace Server /// /// Overridable. Adds any elemental resistances of this item to the given . /// - public virtual void AddResistanceProperties(ObjectPropertyList list) + public virtual void AddResistanceProperties(IPropertyList list) { var v = PhysicalResistance; if (v != 0) { - list.Add(1060448, v.ToString()); // physical resist ~1_val~% + list.Add(1060448, $"{v}"); // physical resist ~1_val~% } v = FireResistance; if (v != 0) { - list.Add(1060447, v.ToString()); // fire resist ~1_val~% + list.Add(1060447, $"{v}"); // fire resist ~1_val~% } v = ColdResistance; if (v != 0) { - list.Add(1060445, v.ToString()); // cold resist ~1_val~% + list.Add(1060445, $"{v}"); // cold resist ~1_val~% } v = PoisonResistance; if (v != 0) { - list.Add(1060449, v.ToString()); // poison resist ~1_val~% + list.Add(1060449, $"{v}"); // poison resist ~1_val~% } v = EnergyResistance; if (v != 0) { - list.Add(1060446, v.ToString()); // energy resist ~1_val~% + list.Add(1060446, $"{v}"); // energy resist ~1_val~% } } /// /// Overridable. Displays cliloc 1072788-1072789. /// - public virtual void AddWeightProperty(ObjectPropertyList list) + public virtual void AddWeightProperty(IPropertyList list) { var weight = PileWeight + TotalWeight; - - if (weight == 1) - { - list.Add(1072788, weight.ToString()); // Weight: ~1_WEIGHT~ stone - } - else - { - list.Add(1072789, weight.ToString()); // Weight: ~1_WEIGHT~ stones - } + list.Add(weight == 1 ? 1072788 : 1072789, $"{weight}"); } /// @@ -1928,7 +1920,7 @@ namespace Server /// (if applicable), and (if /// ). /// - public virtual void AddNameProperties(ObjectPropertyList list) + public virtual void AddNameProperties(IPropertyList list) { AddNameProperty(list); @@ -1969,7 +1961,7 @@ namespace Server /// /// Overridable. Adds the "Quest Item" property to the given . /// - public virtual void AddQuestItemProperty(ObjectPropertyList list) + public virtual void AddQuestItemProperty(IPropertyList list) { list.Add(1072351); // Quest Item } @@ -1977,7 +1969,7 @@ namespace Server /// /// Overridable. Adds the "Locked Down & Secure" property to the given . /// - public virtual void AddSecureProperty(ObjectPropertyList list) + public virtual void AddSecureProperty(IPropertyList list) { list.Add(501644); // locked down & secure } @@ -1985,7 +1977,7 @@ namespace Server /// /// Overridable. Adds the "Locked Down" property to the given . /// - public virtual void AddLockedDownProperty(ObjectPropertyList list) + public virtual void AddLockedDownProperty(IPropertyList list) { list.Add(501643); // locked down } @@ -1993,9 +1985,9 @@ namespace Server /// /// Overridable. Adds the "Blessed for ~1_NAME~" property to the given . /// - public virtual void AddBlessedForProperty(ObjectPropertyList list, Mobile m) + public virtual void AddBlessedForProperty(IPropertyList list, Mobile m) { - list.Add(1062203, "{0}", m.Name); // Blessed for ~1_NAME~ + list.Add(1062203, m.Name); // Blessed for ~1_NAME~ } /// @@ -2003,7 +1995,7 @@ namespace Server /// Recursively calls Item.GetChildProperties or /// Mobile.GetChildProperties. /// - public virtual void GetChildProperties(ObjectPropertyList list, Item item) + public virtual void GetChildProperties(IPropertyList list, Item item) { if (m_Parent is Item parentItem) { @@ -2021,7 +2013,7 @@ namespace Server /// . Recursively calls Item.GetChildNameProperties or /// Mobile.GetChildNameProperties. /// - public virtual void GetChildNameProperties(ObjectPropertyList list, Item item) + public virtual void GetChildNameProperties(IPropertyList list, Item item) { if (m_Parent is Item parentItem) { @@ -2377,7 +2369,7 @@ namespace Server return bounds; } - public virtual void AppendChildProperties(ObjectPropertyList list) + public virtual void AppendChildProperties(IPropertyList list) { if (m_Parent is Item item) { @@ -2389,7 +2381,7 @@ namespace Server } } - public virtual void AppendChildNameProperties(ObjectPropertyList list) + public virtual void AppendChildNameProperties(IPropertyList list) { if (m_Parent is Item item) { diff --git a/Projects/Server/Items/VirtualCheck.cs b/Projects/Server/Items/VirtualCheck.cs index da952aaef..c72866f20 100644 --- a/Projects/Server/Items/VirtualCheck.cs +++ b/Projects/Server/Items/VirtualCheck.cs @@ -120,7 +120,7 @@ namespace Server.Items LabelTo(from, "Offer: {0:#,0} platinum, {1:#,0} gold", Plat, Gold); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index 8a953447c..92f007906 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -403,7 +403,7 @@ namespace Server /// /// Base class representing players, npcs, and creatures. /// - public class Mobile : IHued, IComparable, ISpawnable, IPropertyListObject + public class Mobile : IHued, IComparable, ISpawnable, IObjectPropertyListEntity { // Allow four warmode changes in 0.5 seconds, any more will be delay for two seconds private const int WarmodeCatchCount = 4; @@ -2476,7 +2476,7 @@ namespace Server public virtual int HuedItemID => m_Female ? 0x2107 : 0x2106; public ObjectPropertyList PropertyList => m_PropertyList ??= InitializePropertyList(new ObjectPropertyList(this)); - public virtual void GetProperties(ObjectPropertyList list) + public virtual void GetProperties(IPropertyList list) { AddNameProperties(list); } @@ -3445,57 +3445,51 @@ namespace Server public virtual string ApplyNameSuffix(string suffix) => suffix; - public virtual void AddNameProperties(ObjectPropertyList list) + public virtual void AddNameProperties(IPropertyList list) { - var name = Name ?? ""; + var name = Name ?? " "; string prefix; if (ShowFameTitle && (m_Player || m_Body.IsHuman) && m_Fame >= 10000) { - prefix = m_Female ? "Lady" : "Lord"; + prefix = m_Female ? "Lady " : "Lord "; } else { - prefix = ""; + prefix = " "; } - var suffix = ""; - - if (PropertyTitle && !string.IsNullOrEmpty(Title)) - { - suffix = Title; - } + var title = PropertyTitle && !string.IsNullOrEmpty(Title) ? Title : ""; + string suffix; var guild = m_Guild; - if (guild != null && (m_Player || m_DisplayGuildTitle)) { - suffix = suffix.Length > 0 - ? $"{suffix} [{Utility.FixHtml(guild.Abbreviation)}]" + suffix = title.Length > 0 + ? $"{title} [{Utility.FixHtml(guild.Abbreviation)}]" : $"[{Utility.FixHtml(guild.Abbreviation)}]"; } + else + { + suffix = " "; + } - suffix = ApplyNameSuffix(suffix); - - list.Add(1050045, "{0} \t{1}\t {2}", prefix, name, suffix); // ~1_PREFIX~~2_NAME~~3_SUFFIX~ + list.Add(1050045, $"{prefix}\t{name}\t{ApplyNameSuffix(suffix)}"); // ~1_PREFIX~~2_NAME~~3_SUFFIX~ if (guild != null && (m_DisplayGuildTitle || m_Player && guild.Type != GuildType.Regular)) { var type = guild.Type >= 0 && (int)guild.Type < m_GuildTypes.Length ? m_GuildTypes[(int)guild.Type] : ""; - var title = GuildTitle?.Trim() ?? ""; + var guildTitle = GuildTitle?.Trim() ?? ""; - if (title.Length > 0) + if (guildTitle.Length > 0) { - if (NewGuildDisplay) - { - list.Add("{0}, {1}", Utility.FixHtml(title), Utility.FixHtml(guild.Name)); - } - else - { - list.Add("{0}, {1} Guild{2}", Utility.FixHtml(title), Utility.FixHtml(guild.Name), type); - } + list.Add( + NewGuildDisplay + ? $"{Utility.FixHtml(guildTitle)}, {Utility.FixHtml(guild.Name)}" + : $"{Utility.FixHtml(guildTitle)}, {Utility.FixHtml(guild.Name)} Guild{type}" + ); } else { @@ -3504,11 +3498,11 @@ namespace Server } } - public virtual void GetChildProperties(ObjectPropertyList list, Item item) + public virtual void GetChildProperties(IPropertyList list, Item item) { } - public virtual void GetChildNameProperties(ObjectPropertyList list, Item item) + public virtual void GetChildNameProperties(IPropertyList list, Item item) { } diff --git a/Projects/Server/Network/Packets/OutgoingEntityPackets.cs b/Projects/Server/Network/Packets/OutgoingEntityPackets.cs index cf84157e2..1e546c962 100644 --- a/Projects/Server/Network/Packets/OutgoingEntityPackets.cs +++ b/Projects/Server/Network/Packets/OutgoingEntityPackets.cs @@ -41,7 +41,7 @@ public static class OutgoingEntityPackets writer.Write(hash); } - public static void SendOPLInfo(this NetState ns, IPropertyListObject obj) => + public static void SendOPLInfo(this NetState ns, IObjectPropertyListEntity obj) => ns.SendOPLInfo(obj.Serial, obj.PropertyList.Hash); public static void SendOPLInfo(this NetState ns, Serial serial, int hash) diff --git a/Projects/Server/ObjectPropertyList.cs b/Projects/Server/ObjectPropertyList.cs deleted file mode 100644 index 369cfd2ef..000000000 --- a/Projects/Server/ObjectPropertyList.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Buffers; -using System.IO; -using System.Runtime.CompilerServices; -using Server.Network; - -namespace Server -{ - public interface IPropertyListObject : IEntity - { - ObjectPropertyList PropertyList { get; } - - void GetProperties(ObjectPropertyList list); - } - - public sealed class ObjectPropertyList - { - // Each of these are localized to "~1_NOTHING~" which allows the string argument to be used - private static readonly int[] m_StringNumbers = - { - 1042971, - 1070722 - }; - - private int _hash; - private int _strings; - private byte[] _buffer; - private int _position; - - public ObjectPropertyList(IEntity e) - { - Entity = e; - _buffer = GC.AllocateUninitializedArray(64); - - var writer = new SpanWriter(_buffer); - writer.Write((byte)0xD6); // Packet ID - writer.Seek(2, SeekOrigin.Current); - writer.Write((ushort)1); - writer.Write(e.Serial); - writer.Write((ushort)0); - _position = writer.Position + 4; // Hash - } - - public IEntity Entity { get; } - - public int Hash => 0x40000000 + _hash; - - public int Header { get; set; } - - public string HeaderArgs { get; set; } - - public static bool Enabled { get; set; } - - public byte[] Buffer => _buffer; - - public void Reset() - { - _position = 15; - _hash = 0; - _strings = 0; - Header = 0; - HeaderArgs = null; - } - - public void Flush() - { - Resize(_buffer.Length * 2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void Resize(int amount) - { - var newBuffer = GC.AllocateUninitializedArray(amount); - _buffer.AsSpan(0, Math.Min(amount, _buffer.Length)).CopyTo(newBuffer); - _buffer = newBuffer; - } - - public void Terminate() - { - int length = _position + 4; - if (length != _buffer.Length) - { - Resize(length); - } - - var writer = new SpanWriter(_buffer); - writer.Seek(_position, SeekOrigin.Begin); - writer.Write(0); - - writer.Seek(11, SeekOrigin.Begin); - writer.Write(_hash); - writer.WritePacketLength(); - } - - public void AddHash(int val) - { - _hash ^= val & 0x3FFFFFF; - _hash ^= (val >> 26) & 0x3F; - } - - public void Add(int number, string arguments = null) - { - if (number == 0) - { - return; - } - - arguments ??= ""; - - if (Header == 0) - { - Header = number; - HeaderArgs = arguments; - } - - AddHash(number); - if (arguments.Length > 0) - { - AddHash(arguments.GetHashCode(StringComparison.Ordinal)); - } - - int strLength = arguments.Length * 2; - int length = _position + 6 + strLength; - while (length > _buffer.Length) - { - Flush(); - } - - var writer = new SpanWriter(_buffer.AsSpan(_position)); - writer.Write(number); - writer.Write((ushort)strLength); - writer.WriteLittleUni(arguments); - - _position += writer.BytesWritten; - } - - public void Add(int number, string format, object arg0) - { - Add(number, string.Format(format, arg0)); - } - - public void Add(int number, string format, object arg0, object arg1) - { - Add(number, string.Format(format, arg0, arg1)); - } - - public void Add(int number, string format, object arg0, object arg1, object arg2) - { - Add(number, string.Format(format, arg0, arg1, arg2)); - } - - public void Add(int number, string format, params object[] args) - { - Add(number, string.Format(format, args)); - } - - private int GetStringNumber() => m_StringNumbers[_strings++ % m_StringNumbers.Length]; - - public void Add(string text) - { - Add(GetStringNumber(), text); - } - - public void Add(string format, string arg0) - { - Add(GetStringNumber(), string.Format(format, arg0)); - } - - public void Add(string format, string arg0, string arg1) - { - Add(GetStringNumber(), string.Format(format, arg0, arg1)); - } - - public void Add(string format, string arg0, string arg1, string arg2) - { - Add(GetStringNumber(), string.Format(format, arg0, arg1, arg2)); - } - - public void Add(string format, params object[] args) - { - Add(GetStringNumber(), string.Format(format, args)); - } - } -} diff --git a/Projects/Server/PropertyList/IObjectPropertyListEntity.cs b/Projects/Server/PropertyList/IObjectPropertyListEntity.cs new file mode 100644 index 000000000..4ba8d3735 --- /dev/null +++ b/Projects/Server/PropertyList/IObjectPropertyListEntity.cs @@ -0,0 +1,23 @@ +/************************************************************************* + * ModernUO * + * Copyright 2019-2022 - ModernUO Development Team * + * Email: hi@modernuo.com * + * File: IObjectPropertyListEntity.cs * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *************************************************************************/ + +namespace Server; + +public interface IObjectPropertyListEntity : IEntity +{ + ObjectPropertyList PropertyList { get; } + + void GetProperties(IPropertyList list); +} diff --git a/Projects/Server/PropertyList/IPropertyList.cs b/Projects/Server/PropertyList/IPropertyList.cs new file mode 100644 index 000000000..59d9a57d7 --- /dev/null +++ b/Projects/Server/PropertyList/IPropertyList.cs @@ -0,0 +1,30 @@ +/************************************************************************* + * ModernUO * + * Copyright 2019-2022 - ModernUO Development Team * + * Email: hi@modernuo.com * + * File: IPropertyList.cs * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *************************************************************************/ + +using System.Runtime.CompilerServices; +using Server.Text; + +namespace Server; + +public interface IPropertyList : ISelfInterpolatedStringHandler +{ + public void Reset(); + public void Terminate(); + public void Add(int number, string argument = null); + public void Add(string text); + + // String Interpolation + public void Add(int number, [InterpolatedStringHandlerArgument("")] ref InterpolatedStringHandler handler); +} diff --git a/Projects/Server/PropertyList/ObjectPropertyList.cs b/Projects/Server/PropertyList/ObjectPropertyList.cs new file mode 100644 index 000000000..834afffd8 --- /dev/null +++ b/Projects/Server/PropertyList/ObjectPropertyList.cs @@ -0,0 +1,508 @@ +/************************************************************************* + * ModernUO * + * Copyright 2019-2022 - ModernUO Development Team * + * Email: hi@modernuo.com * + * File: ObjectPropertyList.cs * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *************************************************************************/ + +#nullable enable +using System; +using System.Buffers; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using Server.Buffers; +using Server.Network; +using Server.Text; + +namespace Server; + +public sealed class ObjectPropertyList : IPropertyList, IDisposable +{ + // Each of these are localized to "~1_NOTHING~" which allows the string argument to be used + private static readonly int[] _stringNumbers = + { + 1042971, + 1070722, + 1114057, // ~1_val~ + 1114778, // ~1_val~ + 1114779 // ~1_val~ + }; + + private int _hash; + private int _stringNumbersIndex; + private byte[] _buffer; + private int _bufferPos; + + // For string interpolation + private int _pos; + private char[]? _arrayToReturnToPool; + + public ObjectPropertyList(IEntity? e) + { + Entity = e; + _buffer = GC.AllocateUninitializedArray(64); + + var writer = new SpanWriter(_buffer); + writer.Write((byte)0xD6); // Packet ID + writer.Seek(2, SeekOrigin.Current); + writer.Write((ushort)1); + writer.Write(e?.Serial ?? Serial.Zero); + writer.Write((ushort)0); + _bufferPos = writer.Position + 4; // Hash + } + + public IEntity? Entity { get; } + + public int Hash => 0x40000000 + _hash; + + public int Header { get; set; } + + public string HeaderArgs { get; set; } + + public static bool Enabled { get; set; } + + public byte[] Buffer => _buffer; + + public void Reset() + { + _bufferPos = 15; + _hash = 0; + _stringNumbersIndex = 0; + Header = 0; + HeaderArgs = null; + STArrayPool.Shared.Return(_arrayToReturnToPool); + _pos = 0; + } + + private void Flush() + { + Resize(_buffer.Length * 2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void Resize(int amount) + { + var newBuffer = GC.AllocateUninitializedArray(amount); + _buffer.AsSpan(0, Math.Min(amount, _buffer.Length)).CopyTo(newBuffer); + _buffer = newBuffer; + } + + public void Terminate() + { + int length = _bufferPos + 4; + if (length != _buffer.Length) + { + Resize(length); + } + + var writer = new SpanWriter(_buffer); + writer.Seek(_bufferPos, SeekOrigin.Begin); + writer.Write(0); + + writer.Seek(11, SeekOrigin.Begin); + writer.Write(_hash); + writer.WritePacketLength(); + } + + private void AddHash(int val) + { + _hash ^= val & 0x3FFFFFF; + _hash ^= (val >> 26) & 0x3F; + } + + public void Add(int number, string? arguments = null) + { + if (number == 0) + { + return; + } + + arguments ??= ""; + + if (Header == 0) + { + Header = number; + HeaderArgs = arguments; + } + + AddHash(number); + if (arguments.Length > 0) + { + AddHash(arguments.GetHashCode(StringComparison.Ordinal)); + } + + int strLength = arguments.Length * 2; + int length = _bufferPos + 6 + strLength; + while (length > _buffer.Length) + { + Flush(); + } + + var writer = new SpanWriter(_buffer.AsSpan(_bufferPos)); + writer.Write(number); + writer.Write((ushort)strLength); + writer.WriteLittleUni(arguments); + + _bufferPos += writer.BytesWritten; + _pos = 0; + } + + private int GetStringNumber() => _stringNumbers[_stringNumbersIndex++ % _stringNumbers.Length]; + + public void Add(string argument) => Add(GetStringNumber(), argument); + + public void Add( + [InterpolatedStringHandlerArgument("")] + ref IPropertyList.InterpolatedStringHandler handler + ) => Add(GetStringNumber(), ref handler); + + // String Interpolation + public void Add( + int number, + [InterpolatedStringHandlerArgument("")] + ref IPropertyList.InterpolatedStringHandler handler) + { + if (number == 0) + { + return; + } + + var chars = _arrayToReturnToPool.AsSpan(0, _pos); + + if (Header == 0) + { + Header = number; + HeaderArgs = chars.ToString(); + HeaderArgs.GetHashCode(StringComparison.Ordinal); + } + + AddHash(number); + if (chars.Length > 0) + { + AddHash(string.GetHashCode(chars, StringComparison.Ordinal)); + } + + int strLength = chars.Length * 2; + int length = _bufferPos + 6 + strLength; + while (length > _buffer.Length) + { + Flush(); + } + + var writer = new SpanWriter(_buffer.AsSpan(_bufferPos)); + writer.Write(number); + writer.Write((ushort)strLength); + writer.Write(chars, TextEncoding.UnicodeLE); + + _bufferPos += writer.BytesWritten; + } + + public void InitializeInterpolation(int literalLength, int formattedCount) + { + _arrayToReturnToPool ??= STArrayPool.Shared.Rent(GetDefaultLength(literalLength, formattedCount)); + _pos = 0; + } + + // Copied from RawInterpolatedStringHandler + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static int GetDefaultLength(int literalLength, int formattedCount) => + Math.Max(256, literalLength + formattedCount * 11); + + public void AppendLiteral(string value) + { + if (value.Length == 1) + { + Span chars = _arrayToReturnToPool.AsSpan(); + int pos = _pos; + if ((uint)pos < (uint)chars.Length) + { + chars[pos] = value[0]; + _pos = pos + 1; + } + else + { + GrowThenCopyString(value); + } + return; + } + + AppendStringDirect(value); + } + + private void AppendStringDirect(string value) + { + if (value.TryCopyTo(_arrayToReturnToPool.AsSpan(_pos..))) + { + _pos += value.Length; + } + else + { + GrowThenCopyString(value); + } + } + + public void AppendFormatted(T value) + { + + string? s; + if (value is IFormattable) + { + if (value is ISpanFormattable) + { + int charsWritten; + while (!((ISpanFormattable)value).TryFormat(_arrayToReturnToPool.AsSpan(_pos..), out charsWritten, default, null)) + { + Grow(); + } + + _pos += charsWritten; + return; + } + + s = ((IFormattable)value).ToString(format: null, null); + } + else + { + s = value?.ToString(); + } + + if (s is not null) + { + AppendStringDirect(s); + } + } + + public void AppendFormatted(T value, string? format) + { + string? s; + if (value is IFormattable) + { + if (value is ISpanFormattable) + { + int charsWritten; + while (!((ISpanFormattable)value).TryFormat(_arrayToReturnToPool.AsSpan(_pos..), out charsWritten, format, null)) + { + Grow(); + } + + _pos += charsWritten; + return; + } + + s = ((IFormattable)value).ToString(format, null); + } + else + { + s = value?.ToString(); + } + + if (s is not null) + { + AppendStringDirect(s); + } + } + + public void AppendFormatted(T value, int alignment) + { + int startingPos = _pos; + AppendFormatted(value); + if (alignment != 0) + { + AppendOrInsertAlignmentIfNeeded(startingPos, alignment); + } + } + + public void AppendFormatted(T value, int alignment, string? format) + { + int startingPos = _pos; + AppendFormatted(value, format); + if (alignment != 0) + { + AppendOrInsertAlignmentIfNeeded(startingPos, alignment); + } + } + + public void AppendFormatted(ReadOnlySpan value) + { + if (value.TryCopyTo(_arrayToReturnToPool.AsSpan(_pos..))) + { + _pos += value.Length; + } + else + { + GrowThenCopySpan(value); + } + } + + public void AppendFormatted(ReadOnlySpan value, int alignment = 0, string? format = null) + { + bool leftAlign = false; + if (alignment < 0) + { + leftAlign = true; + alignment = -alignment; + } + + int paddingRequired = alignment - value.Length; + if (paddingRequired <= 0) + { + AppendFormatted(value); + return; + } + + EnsureCapacityForAdditionalChars(value.Length + paddingRequired); + var chars = _arrayToReturnToPool.AsSpan(); + if (leftAlign) + { + value.CopyTo(chars[_pos..]); + _pos += value.Length; + chars.Slice(_pos, paddingRequired).Fill(' '); + _pos += paddingRequired; + } + else + { + chars.Slice(_pos, paddingRequired).Fill(' '); + _pos += paddingRequired; + value.CopyTo(chars[_pos..]); + _pos += value.Length; + } + } + + public void AppendFormatted(string? value) + { + if (value?.TryCopyTo(_arrayToReturnToPool.AsSpan(_pos..)) == true) + { + _pos += value.Length; + } + else + { + AppendFormattedSlow(value); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void AppendFormattedSlow(string? value) + { + if (value is not null) + { + EnsureCapacityForAdditionalChars(value.Length); + value.CopyTo(_arrayToReturnToPool.AsSpan(_pos..)); + _pos += value.Length; + } + } + + public void AppendFormatted(string? value, int alignment = 0, string? format = null) => + AppendFormatted(value, alignment, format); + + public void AppendFormatted(object? value, int alignment = 0, string? format = null) => + AppendFormatted(value, alignment, format); + + private void AppendOrInsertAlignmentIfNeeded(int startingPos, int alignment) + { + Debug.Assert(startingPos >= 0 && startingPos <= _pos); + Debug.Assert(alignment != 0); + + int charsWritten = _pos - startingPos; + + bool leftAlign = false; + if (alignment < 0) + { + leftAlign = true; + alignment = -alignment; + } + + int paddingNeeded = alignment - charsWritten; + if (paddingNeeded > 0) + { + EnsureCapacityForAdditionalChars(paddingNeeded); + + var chars = _arrayToReturnToPool.AsSpan(); + if (leftAlign) + { + chars.Slice(_pos, paddingNeeded).Fill(' '); + } + else + { + chars.Slice(startingPos, charsWritten).CopyTo(chars[(startingPos + paddingNeeded)..]); + chars.Slice(startingPos, paddingNeeded).Fill(' '); + } + + _pos += paddingNeeded; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureCapacityForAdditionalChars(int additionalChars) + { + if (_arrayToReturnToPool.Length - _pos < additionalChars) + { + Grow(additionalChars); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void GrowThenCopyString(string value) + { + Grow(value.Length); + value.CopyTo(_arrayToReturnToPool.AsSpan(_pos..)); + _pos += value.Length; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void GrowThenCopySpan(ReadOnlySpan value) + { + Grow(value.Length); + value.CopyTo(_arrayToReturnToPool.AsSpan(_pos..)); + _pos += value.Length; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void Grow(int additionalChars) + { + Debug.Assert(additionalChars > _arrayToReturnToPool.Length - _pos); + GrowCore((uint)_pos + (uint)additionalChars); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void Grow() + { + GrowCore((uint)_arrayToReturnToPool.Length + 1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void GrowCore(uint requiredMinCapacity) + { + uint newCapacity = Math.Max(requiredMinCapacity, Math.Min((uint)_arrayToReturnToPool.Length * 2, 0x3FFFFFDF)); + int arraySize = (int)Math.Clamp(newCapacity, 256, int.MaxValue); + + char[] newArray = STArrayPool.Shared.Rent(arraySize); + _arrayToReturnToPool.AsSpan(.._pos).CopyTo(newArray); + + char[] toReturn = _arrayToReturnToPool; + _arrayToReturnToPool = newArray; + + STArrayPool.Shared.Return(toReturn); + } + + public void Dispose() + { + STArrayPool.Shared.Return(_arrayToReturnToPool); + _arrayToReturnToPool = null; + } + + ~ObjectPropertyList() + { + STArrayPool.Shared.Return(_arrayToReturnToPool); + _arrayToReturnToPool = null; + } +} diff --git a/Projects/Server/Text/ISelfInterpolatedStringHandler.cs b/Projects/Server/Text/ISelfInterpolatedStringHandler.cs new file mode 100644 index 000000000..d9beb2635 --- /dev/null +++ b/Projects/Server/Text/ISelfInterpolatedStringHandler.cs @@ -0,0 +1,71 @@ +/************************************************************************* + * ModernUO * + * Copyright 2019-2022 - ModernUO Development Team * + * Email: hi@modernuo.com * + * File: ISelfInterpolatedStringHandler.cs * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *************************************************************************/ + +using System; +using System.Runtime.CompilerServices; + +namespace Server.Text; + +public interface ISelfInterpolatedStringHandler +{ + public void Add([InterpolatedStringHandlerArgument("")] ref InterpolatedStringHandler handler); + public void InitializeInterpolation(int literalLength, int formattedCount); + public void AppendLiteral(string value); + public void AppendFormatted(T value); + public void AppendFormatted(T value, string? format); + public void AppendFormatted(T value, int alignment); + public void AppendFormatted(T value, int alignment, string? format); + public void AppendFormatted(ReadOnlySpan value); + public void AppendFormatted(ReadOnlySpan value, int alignment, string? format = null); + public void AppendFormatted(object? value, int alignment = 0, string? format = null); + public void AppendFormatted(string? value); + public void AppendFormatted(string? value, int alignment, string? format = null); + + [InterpolatedStringHandler] + public ref struct InterpolatedStringHandler + { + private ISelfInterpolatedStringHandler _parent; + + public InterpolatedStringHandler(int literalLength, int formattedCount, ISelfInterpolatedStringHandler parent) + { + _parent = parent; + _parent.InitializeInterpolation(literalLength, formattedCount); + } + + public void AppendLiteral(string value) => _parent.AppendLiteral(value); + + public void AppendFormatted(T value) => _parent.AppendFormatted(value); + + public void AppendFormatted(T value, string? format) => _parent.AppendFormatted(value, format); + + public void AppendFormatted(T value, int alignment) => _parent.AppendFormatted(value, alignment); + + public void AppendFormatted(T value, int alignment, string? format) => + _parent.AppendFormatted(value, alignment, format); + + public void AppendFormatted(ReadOnlySpan value) => _parent.AppendFormatted(value); + + public void AppendFormatted(ReadOnlySpan value, int alignment, string? format = null) => + _parent.AppendFormatted(value, alignment, format); + + public void AppendFormatted(object? value, int alignment = 0, string? format = null) => + _parent.AppendFormatted(value, alignment, format); + + public void AppendFormatted(string? value) => _parent.AppendFormatted(value); + + public void AppendFormatted(string? value, int alignment, string? format = null) => + _parent.AppendFormatted(value, alignment, format); + } +} diff --git a/Projects/Server/Text/StringHelpers.cs b/Projects/Server/Text/StringHelpers.cs index ab87a90bb..7e22c6341 100644 --- a/Projects/Server/Text/StringHelpers.cs +++ b/Projects/Server/Text/StringHelpers.cs @@ -285,4 +285,22 @@ public static class StringHelpers 4 => MemoryMarshal.Cast(buffer).IndexOf((uint)0) * 4, _ => buffer.IndexOf((byte)0) }; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ReplaceAny(this Span chars, ReadOnlySpan invalidChars, ReadOnlySpan replacementChars) + { + while (true) + { + var indexOf = chars.IndexOfAny(invalidChars); + if (indexOf == -1) + { + break; + } + + var chr = chars[indexOf]; + + chars[indexOf] = replacementChars[invalidChars.IndexOf(chr)]; + chars = chars[(indexOf + 1)..]; + } + } } diff --git a/Projects/Server/Utilities/Utility.cs b/Projects/Server/Utilities/Utility.cs index 34e90c4d1..347568c98 100644 --- a/Projects/Server/Utilities/Utility.cs +++ b/Projects/Server/Utilities/Utility.cs @@ -560,7 +560,7 @@ namespace Server return str; } - using var sb = new ValueStringBuilder(str, stackalloc char[Math.Min(40960, str.Length)]); + using var sb = new ValueStringBuilder(str, stackalloc char[Math.Min(128, str.Length)]); ReadOnlySpan invalid = stackalloc []{ '<', '>', '#' }; ReadOnlySpan replacement = stackalloc []{ '(', ')', '-' }; sb.ReplaceAny(invalid, replacement, 0, sb.Length); @@ -568,6 +568,19 @@ namespace Server return sb.ToString(); } + public static void FixHtml(Span chars) + { + if (chars.Length == 0) + { + return; + } + + ReadOnlySpan invalid = stackalloc []{ '<', '>', '#' }; + ReadOnlySpan replacement = stackalloc []{ '(', ')', '-' }; + + chars.ReplaceAny(invalid, replacement); + } + public static int InsensitiveCompare(string first, string second) => first.InsensitiveCompare(second); public static bool InsensitiveStartsWith(string first, string second) => first.InsensitiveStartsWith(second); diff --git a/Projects/UOContent/Engines/Bulk Orders/Books/BulkOrderBook.cs b/Projects/UOContent/Engines/Bulk Orders/Books/BulkOrderBook.cs index 6ad18909a..b05ede58c 100644 --- a/Projects/UOContent/Engines/Bulk Orders/Books/BulkOrderBook.cs +++ b/Projects/UOContent/Engines/Bulk Orders/Books/BulkOrderBook.cs @@ -258,11 +258,11 @@ namespace Server.Engines.BulkOrders } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~ + list.Add(1062344, $"{Entries.Count}"); // Deeds in book: ~1_val~ if (!string.IsNullOrEmpty(m_BookName)) { diff --git a/Projects/UOContent/Engines/Bulk Orders/LargeBOD.cs b/Projects/UOContent/Engines/Bulk Orders/LargeBOD.cs index c20ec4e86..d16cdc5c6 100644 --- a/Projects/UOContent/Engines/Bulk Orders/LargeBOD.cs +++ b/Projects/UOContent/Engines/Bulk Orders/LargeBOD.cs @@ -38,7 +38,7 @@ namespace Server.Engines.BulkOrders public override int LabelNumber => 1045151; // a bulk order deed - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -54,11 +54,12 @@ namespace Server.Engines.BulkOrders list.Add(LargeBODGump.GetMaterialNumberFor(Material)); // All items must be made with x material. } - list.Add(1060656, AmountMax.ToString()); // amount to make: ~1_val~ + list.Add(1060656, $"{AmountMax}"); // amount to make: ~1_val~ for (var i = 0; i < _entries.Length; ++i) { - list.Add(1060658 + i, "#{0}\t{1}", _entries[i].Details.Number, _entries[i].Amount); // ~1_val~: ~2_val~ + var entry = _entries[i]; + list.Add(1060658 + i, $"#{entry.Details.Number}\t{entry.Amount}"); // ~1_val~: ~2_val~ } } diff --git a/Projects/UOContent/Engines/Bulk Orders/SmallBOD.cs b/Projects/UOContent/Engines/Bulk Orders/SmallBOD.cs index 8f0489aa1..206a2d4e0 100644 --- a/Projects/UOContent/Engines/Bulk Orders/SmallBOD.cs +++ b/Projects/UOContent/Engines/Bulk Orders/SmallBOD.cs @@ -61,7 +61,7 @@ namespace Server.Engines.BulkOrders public override int LabelNumber => 1045151; // a bulk order deed - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -77,8 +77,8 @@ namespace Server.Engines.BulkOrders list.Add(SmallBODGump.GetMaterialNumberFor(Material)); // All items must be made with x material. } - list.Add(1060656, AmountMax.ToString()); // amount to make: ~1_val~ - list.Add(1060658, "#{0}\t{1}", m_Number, m_AmountCur); // ~1_val~: ~2_val~ + list.Add(1060656, $"{AmountMax}"); // amount to make: ~1_val~ + list.Add(1060658, $"#{m_Number}\t{m_AmountCur}"); // ~1_val~: ~2_val~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Engines/CannedEvil/ChampionSpawn.cs b/Projects/UOContent/Engines/CannedEvil/ChampionSpawn.cs index e4a68b0c5..d98063e56 100755 --- a/Projects/UOContent/Engines/CannedEvil/ChampionSpawn.cs +++ b/Projects/UOContent/Engines/CannedEvil/ChampionSpawn.cs @@ -934,21 +934,22 @@ namespace Server.Engines.CannedEvil return new Point3D(X + x, Y + y, Z - 15); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add("champion spawn"); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (m_Active) { list.Add(1060742); // active - list.Add(1060658, "Type\t{0}", m_Type); // ~1_val~: ~2_val~ - list.Add(1060659, "Level\t{0}", Level); // ~1_val~: ~2_val~ - list.Add(1060660, "Kills\t{0} of {1} ({2:F1}%)", m_Kills, MaxKills, 100.0 * ((double)m_Kills / MaxKills)); // ~1_val~: ~2_val~ + list.Add(1060658, $"Type\t{m_Type}"); // ~1_val~: ~2_val~ + list.Add(1060659, $"Level\t{Level}"); // ~1_val~: ~2_val~ + var killRatio = 100.0 * ((double)m_Kills / MaxKills); + list.Add(1060660, $"Kills\t{m_Kills} of {MaxKills} ({killRatio:F1}%)"); // ~1_val~: ~2_val~ //list.Add(1060661, "Spawn Range\t{0}", m_SpawnRange); // ~1_val~: ~2_val~ } else @@ -961,11 +962,11 @@ namespace Server.Engines.CannedEvil { if (m_Active) { - LabelTo(from, "{0} (Active; Level: {1}; Kills: {2}/{3})", m_Type, Level, m_Kills, MaxKills); + LabelTo(from, $"{m_Type} (Active; Level: {Level}; Kills: {m_Kills}/{MaxKills})"); } else { - LabelTo(from, "{0} (Inactive)", m_Type); + LabelTo(from, $"{m_Type} (Inactive)"); } } diff --git a/Projects/UOContent/Engines/ConPVP/Gumps/AcceptTeamGump.cs b/Projects/UOContent/Engines/ConPVP/Gumps/AcceptTeamGump.cs index 28a6c2794..f470806bf 100644 --- a/Projects/UOContent/Engines/ConPVP/Gumps/AcceptTeamGump.cs +++ b/Projects/UOContent/Engines/ConPVP/Gumps/AcceptTeamGump.cs @@ -163,23 +163,20 @@ namespace Server.Engines.ConPVP AddBorderedText(35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32); y += 20; - var sdText = "Off"; + string sdText; if (tourney.SuddenDeath > TimeSpan.Zero) { - sdText = $"{(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2}"; - - if (tourney.SuddenDeathRounds > 0) - { - sdText = $"{sdText} (first {tourney.SuddenDeathRounds} rounds)"; - } - else - { - sdText = $"{sdText} (all rounds)"; - } + sdText = tourney.SuddenDeathRounds > 0 ? + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (first {tourney.SuddenDeathRounds} rounds)" : + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (all rounds)"; + } + else + { + sdText = "Sudden Death: Off"; } - AddBorderedText(35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32); + AddBorderedText(35, y, 240, 20, sdText, LabelColor32, BlackColor32); y += 20; y += 6; diff --git a/Projects/UOContent/Engines/ConPVP/Gumps/ConfirmSignupGump.cs b/Projects/UOContent/Engines/ConPVP/Gumps/ConfirmSignupGump.cs index 04e235ac6..1bd50b67a 100644 --- a/Projects/UOContent/Engines/ConPVP/Gumps/ConfirmSignupGump.cs +++ b/Projects/UOContent/Engines/ConPVP/Gumps/ConfirmSignupGump.cs @@ -169,23 +169,20 @@ namespace Server.Engines.ConPVP AddBorderedText(35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32); y += 20; - var sdText = "Off"; + string sdText; if (tourney.SuddenDeath > TimeSpan.Zero) { - sdText = $"{(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2}"; - - if (tourney.SuddenDeathRounds > 0) - { - sdText = $"{sdText} (first {tourney.SuddenDeathRounds} rounds)"; - } - else - { - sdText = $"{sdText} (all rounds)"; - } + sdText = tourney.SuddenDeathRounds > 0 ? + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (first {tourney.SuddenDeathRounds} rounds)" : + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (all rounds)"; + } + else + { + sdText = "Sudden Death: Off"; } - AddBorderedText(35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32); + AddBorderedText(35, y, 240, 20, sdText, LabelColor32, BlackColor32); y += 20; y += 6; diff --git a/Projects/UOContent/Engines/ConPVP/Gumps/TournamentBracketGump.cs b/Projects/UOContent/Engines/ConPVP/Gumps/TournamentBracketGump.cs index 9dc149ce8..8ff340ed0 100644 --- a/Projects/UOContent/Engines/ConPVP/Gumps/TournamentBracketGump.cs +++ b/Projects/UOContent/Engines/ConPVP/Gumps/TournamentBracketGump.cs @@ -214,23 +214,20 @@ namespace Server.Engines.ConPVP AddHtml(35, y, 190, 20, $"Tiebreaker: {tieText}"); y += 20; - var sdText = "Off"; + string sdText; if (tourney.SuddenDeath > TimeSpan.Zero) { - sdText = $"{(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2}"; - - if (tourney.SuddenDeathRounds > 0) - { - sdText = $"{sdText} (first {tourney.SuddenDeathRounds} rounds)"; - } - else - { - sdText = $"{sdText} (all rounds)"; - } + sdText = tourney.SuddenDeathRounds > 0 ? + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (first {tourney.SuddenDeathRounds} rounds)" : + $"Sudden Death: {(int)tourney.SuddenDeath.TotalMinutes}:{tourney.SuddenDeath.Seconds:D2} (all rounds)"; + } + else + { + sdText = "Sudden Death: Off"; } - AddHtml(35, y, 240, 20, $"Sudden Death: {sdText}"); + AddHtml(35, y, 240, 20, sdText); y += 20; y += 8; diff --git a/Projects/UOContent/Engines/Factions/Items/Sigil.cs b/Projects/UOContent/Engines/Factions/Items/Sigil.cs index 66606eef3..8fab6abd9 100644 --- a/Projects/UOContent/Engines/Factions/Items/Sigil.cs +++ b/Projects/UOContent/Engines/Factions/Items/Sigil.cs @@ -128,7 +128,7 @@ namespace Server.Factions InvalidateProperties(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Engines/Factions/Items/Traps/FactionTrapRemovalKit.cs b/Projects/UOContent/Engines/Factions/Items/Traps/FactionTrapRemovalKit.cs index 78dd3c488..364c98c3a 100644 --- a/Projects/UOContent/Engines/Factions/Items/Traps/FactionTrapRemovalKit.cs +++ b/Projects/UOContent/Engines/Factions/Items/Traps/FactionTrapRemovalKit.cs @@ -30,12 +30,12 @@ namespace Server.Factions } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); // NOTE: OSI does not list uses remaining; intentional difference - list.Add(1060584, Charges.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{Charges}"); // uses remaining: ~1_val~ } public override void Serialize(IGenericWriter writer) diff --git a/Projects/UOContent/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs b/Projects/UOContent/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs index 5b59ecb6f..c5fe00653 100644 --- a/Projects/UOContent/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs +++ b/Projects/UOContent/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs @@ -308,7 +308,7 @@ namespace Server.Factions } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/APersonalLetterAddressedToAhie.cs b/Projects/UOContent/Engines/ML Quests/Items/APersonalLetterAddressedToAhie.cs index 5dccf5f17..fbb09aab1 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/APersonalLetterAddressedToAhie.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/APersonalLetterAddressedToAhie.cs @@ -15,7 +15,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/AlchemistsBandage.cs b/Projects/UOContent/Engines/ML Quests/Items/AlchemistsBandage.cs index 116550434..03526c475 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/AlchemistsBandage.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/AlchemistsBandage.cs @@ -17,7 +17,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/BasinOfCrystalClearWater.cs b/Projects/UOContent/Engines/ML Quests/Items/BasinOfCrystalClearWater.cs index b4f725563..0f2068339 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/BasinOfCrystalClearWater.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/BasinOfCrystalClearWater.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/BridesLetter.cs b/Projects/UOContent/Engines/ML Quests/Items/BridesLetter.cs index 83f043636..12f897720 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/BridesLetter.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/BridesLetter.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/CompletedTuitionReimbursementForm.cs b/Projects/UOContent/Engines/ML Quests/Items/CompletedTuitionReimbursementForm.cs index 04f706bf7..efc18c8db 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/CompletedTuitionReimbursementForm.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/CompletedTuitionReimbursementForm.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/CrateForSledge.cs b/Projects/UOContent/Engines/ML Quests/Items/CrateForSledge.cs index 033da30ef..5127ee830 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/CrateForSledge.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/CrateForSledge.cs @@ -15,7 +15,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/DreadSpiderSilk.cs b/Projects/UOContent/Engines/ML Quests/Items/DreadSpiderSilk.cs index 8583a7ce3..29788c71f 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/DreadSpiderSilk.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/DreadSpiderSilk.cs @@ -17,7 +17,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/FragmentOfAMapDelivery.cs b/Projects/UOContent/Engines/ML Quests/Items/FragmentOfAMapDelivery.cs index 18b52b92f..54a62d187 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/FragmentOfAMapDelivery.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/FragmentOfAMapDelivery.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/FriendsOfTheLibraryApplication.cs b/Projects/UOContent/Engines/ML Quests/Items/FriendsOfTheLibraryApplication.cs index 8bde0ff1f..b2eeb94d8 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/FriendsOfTheLibraryApplication.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/FriendsOfTheLibraryApplication.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/GiftForArielle.cs b/Projects/UOContent/Engines/ML Quests/Items/GiftForArielle.cs index a3fe7a704..414d24622 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/GiftForArielle.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/GiftForArielle.cs @@ -14,7 +14,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/NotarizedApplication.cs b/Projects/UOContent/Engines/ML Quests/Items/NotarizedApplication.cs index 06d7d5b6e..c27d26f5a 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/NotarizedApplication.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/NotarizedApplication.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/OfficialSealingWax.cs b/Projects/UOContent/Engines/ML Quests/Items/OfficialSealingWax.cs index e540a50d5..9378ebea6 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/OfficialSealingWax.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/OfficialSealingWax.cs @@ -17,7 +17,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/PortraitOfTheBride.cs b/Projects/UOContent/Engines/ML Quests/Items/PortraitOfTheBride.cs index 9f2ca6e75..f95740802 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/PortraitOfTheBride.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/PortraitOfTheBride.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/PrismaticAmber.cs b/Projects/UOContent/Engines/ML Quests/Items/PrismaticAmber.cs index dcf074ddd..cae5ea63a 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/PrismaticAmber.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/PrismaticAmber.cs @@ -13,7 +13,7 @@ namespace Server.Items public override int LabelNumber => 1075299; // Prismatic Amber - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/QuestGiverItem.cs b/Projects/UOContent/Engines/ML Quests/Items/QuestGiverItem.cs index 4389efdaa..652de737e 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/QuestGiverItem.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/QuestGiverItem.cs @@ -27,7 +27,7 @@ namespace Server.Engines.MLQuests.Items public List MLQuests => m_MLQuests ?? (m_MLQuests = MLQuestSystem.FindQuestList(GetType()) ?? MLQuestSystem.EmptyList); - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); @@ -105,7 +105,7 @@ namespace Server.Engines.MLQuests.Items { } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/ReginasLetter.cs b/Projects/UOContent/Engines/ML Quests/Items/ReginasLetter.cs index aaf62201b..1759d5b0e 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/ReginasLetter.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/ReginasLetter.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/ReginasRing.cs b/Projects/UOContent/Engines/ML Quests/Items/ReginasRing.cs index d7a40fb3c..2af14cacd 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/ReginasRing.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/ReginasRing.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/SealedNotesForJamal.cs b/Projects/UOContent/Engines/ML Quests/Items/SealedNotesForJamal.cs index 6cdf61405..488be1a84 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/SealedNotesForJamal.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/SealedNotesForJamal.cs @@ -14,7 +14,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/SealingWaxOrderAddressedToPetrus.cs b/Projects/UOContent/Engines/ML Quests/Items/SealingWaxOrderAddressedToPetrus.cs index 59b4eb59a..e1783bdd6 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/SealingWaxOrderAddressedToPetrus.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/SealingWaxOrderAddressedToPetrus.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/SignedTuitionReimbursementForm.cs b/Projects/UOContent/Engines/ML Quests/Items/SignedTuitionReimbursementForm.cs index 3094e5769..66c86bbef 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/SignedTuitionReimbursementForm.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/SignedTuitionReimbursementForm.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/SpiritBottle.cs b/Projects/UOContent/Engines/ML Quests/Items/SpiritBottle.cs index 86767928b..e24768807 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/SpiritBottle.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/SpiritBottle.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/TaintedTreeSample.cs b/Projects/UOContent/Engines/ML Quests/Items/TaintedTreeSample.cs index 545aa65ff..f18a0bb99 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/TaintedTreeSample.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/TaintedTreeSample.cs @@ -17,7 +17,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/Teleporters.cs b/Projects/UOContent/Engines/ML Quests/Items/Teleporters.cs index dc7262333..e7abdc648 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/Teleporters.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/Teleporters.cs @@ -71,7 +71,7 @@ namespace Server.Engines.MLQuests.Items return false; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -179,7 +179,7 @@ namespace Server.Engines.MLQuests.Items return true; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Engines/ML Quests/Items/TuitionReimbursementForm.cs b/Projects/UOContent/Engines/ML Quests/Items/TuitionReimbursementForm.cs index 7daaa8b72..16740b154 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/TuitionReimbursementForm.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/TuitionReimbursementForm.cs @@ -13,7 +13,7 @@ namespace Server.Items public override bool Nontransferable => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); AddQuestItemProperty(list); diff --git a/Projects/UOContent/Engines/Plants/PlantItem.cs b/Projects/UOContent/Engines/Plants/PlantItem.cs index b99a0f7c7..22061af38 100644 --- a/Projects/UOContent/Engines/Plants/PlantItem.cs +++ b/Projects/UOContent/Engines/Plants/PlantItem.cs @@ -248,7 +248,7 @@ namespace Server.Engines.Plants InvalidateProperties(); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (m_PlantStatus >= PlantStatus.DeadTwigs) { diff --git a/Projects/UOContent/Engines/Plants/Seed.cs b/Projects/UOContent/Engines/Plants/Seed.cs index bb67f9e4b..ef05f343d 100644 --- a/Projects/UOContent/Engines/Plants/Seed.cs +++ b/Projects/UOContent/Engines/Plants/Seed.cs @@ -124,7 +124,7 @@ namespace Server.Engines.Plants return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(GetLabel(out var args), args); } diff --git a/Projects/UOContent/Engines/Quests/Collector/Items/Obsidian.cs b/Projects/UOContent/Engines/Quests/Collector/Items/Obsidian.cs index 7806d403d..d70818d0e 100644 --- a/Projects/UOContent/Engines/Quests/Collector/Items/Obsidian.cs +++ b/Projects/UOContent/Engines/Quests/Collector/Items/Obsidian.cs @@ -141,7 +141,7 @@ namespace Server.Engines.Quests.Collector public static string RandomName(Mobile from) => m_Names.RandomElement() ?? from.Name; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (m_Quantity < m_Partial) { diff --git a/Projects/UOContent/Engines/Quests/Collector/Items/PaintedImage.cs b/Projects/UOContent/Engines/Quests/Collector/Items/PaintedImage.cs index afd44311f..659036097 100644 --- a/Projects/UOContent/Engines/Quests/Collector/Items/PaintedImage.cs +++ b/Projects/UOContent/Engines/Quests/Collector/Items/PaintedImage.cs @@ -31,7 +31,7 @@ namespace Server.Engines.Quests.Collector } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var info = ImageTypeInfo.Get(m_Image); list.Add(1060847, $"#1055126\t#{info.Name}"); // a painted image of: diff --git a/Projects/UOContent/Engines/Quests/Core/Items/HornOfRetreat.cs b/Projects/UOContent/Engines/Quests/Core/Items/HornOfRetreat.cs index 97774aaa1..a16779d0f 100644 --- a/Projects/UOContent/Engines/Quests/Core/Items/HornOfRetreat.cs +++ b/Projects/UOContent/Engines/Quests/Core/Items/HornOfRetreat.cs @@ -43,11 +43,11 @@ namespace Server.Engines.Quests public virtual bool ValidateUse(Mobile from) => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~ + list.Add(1060741, $"{m_Charges}"); // charges: ~1_val~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickApprenticeCorpse.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickApprenticeCorpse.cs index 9dfd386d6..1731abbee 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickApprenticeCorpse.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickApprenticeCorpse.cs @@ -70,7 +70,7 @@ namespace Server.Engines.Quests.Haven return new FacialHairInfo(Race.Human.RandomFacialHair(false), m_HairHue); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (ItemID == 0x2006) // Corpse form { diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaFighter.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaFighter.cs index 34b3947a6..cf30f30b9 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaFighter.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaFighter.cs @@ -108,7 +108,7 @@ namespace Server.Engines.Quests.Haven { } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (ItemID == 0x2006) // Corpse form { diff --git a/Projects/UOContent/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs b/Projects/UOContent/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs index dfaa2e6ad..acc83cd2d 100644 --- a/Projects/UOContent/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs +++ b/Projects/UOContent/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs @@ -39,7 +39,7 @@ namespace Server.Engines.Quests.Hag private static List GetEquipment() => new(); - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add("a charred corpse"); } diff --git a/Projects/UOContent/Engines/Spawners/BaseSpawner.cs b/Projects/UOContent/Engines/Spawners/BaseSpawner.cs index 239b34072..dd1d7a71f 100644 --- a/Projects/UOContent/Engines/Spawners/BaseSpawner.cs +++ b/Projects/UOContent/Engines/Spawners/BaseSpawner.cs @@ -353,11 +353,11 @@ namespace Server.Engines.Spawners from.SendGump(new SpawnerGump(this)); } - public virtual void GetSpawnerProperties(ObjectPropertyList list) + public virtual void GetSpawnerProperties(IPropertyList list) { } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -365,18 +365,19 @@ namespace Server.Engines.Spawners { list.Add(1060742); // active - list.Add(1060656, m_Count.ToString()); // amount to make: ~1_val~ - list.Add(1061169, m_HomeRange.ToString()); // range ~1_val~ - list.Add(1050039, "walking range:\t{0}", m_WalkingRange); // ~1_NUMBER~ ~2_ITEMNAME~ - list.Add(1053099, "group:\t{0}", m_Group); // ~1_oretype~: ~2_armortype~ - list.Add(1060847, "team:\t{0}", m_Team); // ~1_val~ ~2_val~ - list.Add(1063483, "delay:\t{0} to {1}", m_MinDelay, m_MaxDelay); // ~1_MATERIAL~: ~2_ITEMNAME~ + list.Add(1060656, $"{m_Count}"); // amount to make: ~1_val~ + list.Add(1061169, $"{m_HomeRange}"); // range ~1_val~ + list.Add(1050039, $"walking range:\t{m_WalkingRange}"); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1053099, $"group:\t{m_Group}"); // ~1_oretype~: ~2_armortype~ + list.Add(1060847, $"team:\t{m_Team}"); // ~1_val~ ~2_val~ + list.Add(1063483, $"delay:\t{m_MinDelay} to {m_MaxDelay}"); // ~1_MATERIAL~: ~2_ITEMNAME~ GetSpawnerProperties(list); for (var i = 0; i < 6 && i < Entries.Count; ++i) { - list.Add(1060658 + i, "\t{0}\t{1}", Entries[i].SpawnedName, CountSpawns(Entries[i])); + var entry = Entries[i]; + list.Add(1060658 + i, $"\t{entry.SpawnedName}\t{CountSpawns(entry)}"); } } else @@ -794,7 +795,7 @@ namespace Server.Engines.Spawners } else { - m_Timer?.Stop(); + m_Timer.Stop(); m_Timer.Delay = delay; } diff --git a/Projects/UOContent/Engines/Spawners/RegionSpawner.cs b/Projects/UOContent/Engines/Spawners/RegionSpawner.cs index a7296cee9..f12a332fe 100644 --- a/Projects/UOContent/Engines/Spawners/RegionSpawner.cs +++ b/Projects/UOContent/Engines/Spawners/RegionSpawner.cs @@ -88,13 +88,13 @@ namespace Server.Engines.Spawners json.SetProperty("region", options, SpawnRegion.Name); } - public override void GetSpawnerProperties(ObjectPropertyList list) + public override void GetSpawnerProperties(IPropertyList list) { base.GetSpawnerProperties(list); if (Running && m_SpawnRegion != null) { - list.Add(1076228, "region:\t{0}", m_SpawnRegion.Name); // ~1_DUMMY~ ~2_DUMMY~ + list.Add(1076228, $"region:\t{m_SpawnRegion.Name}"); // ~1_DUMMY~ ~2_DUMMY~ } } diff --git a/Projects/UOContent/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs b/Projects/UOContent/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs index af63c592b..8fbd3a1d6 100644 --- a/Projects/UOContent/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs +++ b/Projects/UOContent/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs @@ -113,7 +113,7 @@ namespace Server.Items set { } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -122,7 +122,7 @@ namespace Server.Items TextDefinition.AddTo(list, m_Label); } - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Engines/Treasures of Tokuno/LesserArtifacts.cs b/Projects/UOContent/Engines/Treasures of Tokuno/LesserArtifacts.cs index e7412891c..9289fa0e7 100644 --- a/Projects/UOContent/Engines/Treasures of Tokuno/LesserArtifacts.cs +++ b/Projects/UOContent/Engines/Treasures of Tokuno/LesserArtifacts.cs @@ -713,7 +713,7 @@ namespace Server.Items Utility.Intern(ref m_UrnName); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(1070935, m_UrnName); // Ancient Urn of ~1_name~ } @@ -772,7 +772,7 @@ namespace Server.Items Utility.Intern(ref m_SwordsName); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(1070936, m_SwordsName); // Honorable Swords of ~1_name~ } diff --git a/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatue.cs b/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatue.cs index 1ce3132cb..12a279ea2 100644 --- a/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatue.cs +++ b/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatue.cs @@ -128,7 +128,7 @@ namespace Server.Mobiles DisplayPaperdollTo(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -496,7 +496,7 @@ namespace Server.Mobiles } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatueMaker.cs b/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatueMaker.cs index d1f2ab359..b9e7315cd 100644 --- a/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatueMaker.cs +++ b/Projects/UOContent/Engines/Veteran Rewards/Character Statue Maker/CharacterStatueMaker.cs @@ -71,7 +71,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs b/Projects/UOContent/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs index 5152901d2..039092fac 100644 --- a/Projects/UOContent/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs +++ b/Projects/UOContent/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs @@ -12,7 +12,7 @@ namespace Server.Items public override bool AllowEquippedCast(Mobile from) => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs b/Projects/UOContent/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs index 700080df4..ad60231bd 100644 --- a/Projects/UOContent/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs +++ b/Projects/UOContent/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs @@ -47,7 +47,7 @@ namespace Server.Items public bool CanSign => !IsSigned || Core.Now <= EditLimit; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (_owner != null) { @@ -63,7 +63,7 @@ namespace Server.Items AddLine(list, 1150303, _line3); // [ ~1_LINE2~ ] } - private static void AddLine(ObjectPropertyList list, int cliloc, string line) + private static void AddLine(IPropertyList list, int cliloc, string line) { if (line != null) { diff --git a/Projects/UOContent/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs b/Projects/UOContent/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs index 7b302e836..3c292ceda 100644 --- a/Projects/UOContent/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs +++ b/Projects/UOContent/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs @@ -27,7 +27,7 @@ namespace Server.Items public bool IsSigned => _from != null && _to != null; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { base.AddNameProperty(list); diff --git a/Projects/UOContent/Items/Addons/AddonComponent.cs b/Projects/UOContent/Items/Addons/AddonComponent.cs index 3cf10fc20..f07f3da2e 100644 --- a/Projects/UOContent/Items/Addons/AddonComponent.cs +++ b/Projects/UOContent/Items/Addons/AddonComponent.cs @@ -160,7 +160,7 @@ namespace Server.Items } } /* - public override void GetProperties(ObjectPropertyList list) => _addon?.GetProperties(list); + public override void GetProperties(IPropertyList list) => _addon?.GetProperties(list); public override void GetContextMenuEntries(Mobile from, List list) => _addon?.GetContextMenuEntries(from, list); diff --git a/Projects/UOContent/Items/Addons/AddonContainerComponent.cs b/Projects/UOContent/Items/Addons/AddonContainerComponent.cs index 7c612fd03..6e7bf4b08 100644 --- a/Projects/UOContent/Items/Addons/AddonContainerComponent.cs +++ b/Projects/UOContent/Items/Addons/AddonContainerComponent.cs @@ -77,7 +77,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) => _addon?.GetProperties(list); + public override void GetProperties(IPropertyList list) => _addon?.GetProperties(list); public override void GetContextMenuEntries(Mobile from, List list) => _addon?.GetContextMenuEntries(from, list); diff --git a/Projects/UOContent/Items/Addons/BaseAddonContainer.cs b/Projects/UOContent/Items/Addons/BaseAddonContainer.cs index 547c4900c..3cf06af23 100644 --- a/Projects/UOContent/Items/Addons/BaseAddonContainer.cs +++ b/Projects/UOContent/Items/Addons/BaseAddonContainer.cs @@ -168,7 +168,7 @@ namespace Server.Items base.OnDelete(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Addons/BaseAddonContainerDeed.cs b/Projects/UOContent/Items/Addons/BaseAddonContainerDeed.cs index dc751fe0a..17c9fba16 100644 --- a/Projects/UOContent/Items/Addons/BaseAddonContainerDeed.cs +++ b/Projects/UOContent/Items/Addons/BaseAddonContainerDeed.cs @@ -97,7 +97,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Aquarium.cs b/Projects/UOContent/Items/Aquarium/Aquarium.cs index d69041f5d..1671139bd 100644 --- a/Projects/UOContent/Items/Aquarium/Aquarium.cs +++ b/Projects/UOContent/Items/Aquarium/Aquarium.cs @@ -364,18 +364,18 @@ namespace Server.Items } } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); if (_vacationLeft > 0) { - list.Add(1074430, _vacationLeft.ToString()); // Vacation days left: ~1_DAYS + list.Add(1074430, $"{_vacationLeft}"); // Vacation days left: ~1_DAYS } if (_events.Count > 0) { - list.Add(1074426, _events.Count.ToString()); // ~1_NUM~ event(s) to view! + list.Add(1074426, $"{_events.Count}"); // ~1_NUM~ event(s) to view! } if (_rewardAvailable) @@ -383,60 +383,54 @@ namespace Server.Items list.Add(1074362); // A reward is available! } - list.Add(1074247, "{0}\t{1}", LiveCreatures, MaxLiveCreatures); // Live Creatures: ~1_NUM~ / ~2_MAX~ + list.Add(1074247, $"{LiveCreatures}\t{MaxLiveCreatures}"); // Live Creatures: ~1_NUM~ / ~2_MAX~ var dead = DeadCreatures; if (dead > 0) { - list.Add(1074248, dead.ToString()); // Dead Creatures: ~1_NUM~ + list.Add(1074248, $"{dead}"); // Dead Creatures: ~1_NUM~ } var decorations = Items.Count - LiveCreatures - dead; if (decorations > 0) { - list.Add(1074249, decorations.ToString()); // Decorations: ~1_NUM~ + list.Add(1074249, $"{decorations}"); // Decorations: ~1_NUM~ } - list.Add(1074250, "#{0}", FoodNumber()); // Food state: ~1_STATE~ - list.Add(1074251, "#{0}", WaterNumber()); // Water state: ~1_STATE~ + list.Add(1074250, $"#{FoodNumber()}"); // Food state: ~1_STATE~ + list.Add(1074251, $"#{WaterNumber()}"); // Water state: ~1_STATE~ if (_food.State == (int)FoodState.Dead) { - list.Add(1074577, "{0}\t{1}", _food.Added, _food.Improve); // Food Added: ~1_CUR~ Needed: ~2_NEED~ + list.Add(1074577, $"{_food.Added}\t{_food.Improve}"); // Food Added: ~1_CUR~ Needed: ~2_NEED~ } else if (_food.State == (int)FoodState.Overfed) { - list.Add(1074577, "{0}\t{1}", _food.Added, _food.Maintain); // Food Added: ~1_CUR~ Needed: ~2_NEED~ + list.Add(1074577, $"{_food.Added}\t{_food.Maintain}"); // Food Added: ~1_CUR~ Needed: ~2_NEED~ } else { list.Add( 1074253, // Food Added: ~1_CUR~ Feed: ~2_NEED~ Improve: ~3_GROW~ - "{0}\t{1}\t{2}", - _food.Added, - _food.Maintain, - _food.Improve + $"{_food.Added}\t{_food.Maintain}\t{_food.Improve}" ); } if (_water.State == (int)WaterState.Dead) { - list.Add(1074578, "{0}\t{1}", _water.Added, _water.Improve); // Water Added: ~1_CUR~ Needed: ~2_NEED~ + list.Add(1074578, $"{_water.Added}\t{_water.Improve}"); // Water Added: ~1_CUR~ Needed: ~2_NEED~ } else if (_water.State == (int)WaterState.Strong) { - list.Add(1074578, "{0}\t{1}", _water.Added, _water.Maintain); // Water Added: ~1_CUR~ Needed: ~2_NEED~ + list.Add(1074578, $"{_water.Added}\t{_water.Maintain}"); // Water Added: ~1_CUR~ Needed: ~2_NEED~ } else { list.Add( 1074254, // Water Added: ~1_CUR~ Maintain: ~2_NEED~ Improve: ~3_GROW~ - "{0}\t{1}\t{2}", - _water.Added, - _water.Maintain, - _water.Improve + $"{_water.Added}\t{_water.Maintain}\t{_water.Improve}" ); } } diff --git a/Projects/UOContent/Items/Aquarium/AquariumFishingNet.cs b/Projects/UOContent/Items/Aquarium/AquariumFishingNet.cs index 363351a13..d1da09a97 100644 --- a/Projects/UOContent/Items/Aquarium/AquariumFishingNet.cs +++ b/Projects/UOContent/Items/Aquarium/AquariumFishingNet.cs @@ -15,7 +15,7 @@ namespace Server.Items public override bool RequireDeepWater => false; - protected override void AddNetProperties(ObjectPropertyList list) + protected override void AddNetProperties(IPropertyList list) { } diff --git a/Projects/UOContent/Items/Aquarium/BaseFish.cs b/Projects/UOContent/Items/Aquarium/BaseFish.cs index a3bfdc2aa..358bd3b4b 100644 --- a/Projects/UOContent/Items/Aquarium/BaseFish.cs +++ b/Projects/UOContent/Items/Aquarium/BaseFish.cs @@ -60,7 +60,7 @@ namespace Server.Items return Dead ? 1073623 : 1073622; // A [dead/live] aquarium creature } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/FishBowl.cs b/Projects/UOContent/Items/Aquarium/FishBowl.cs index d180b85fb..810078b3a 100644 --- a/Projects/UOContent/Items/Aquarium/FishBowl.cs +++ b/Projects/UOContent/Items/Aquarium/FishBowl.cs @@ -78,7 +78,7 @@ namespace Server.Items return base.CheckLift(from, item, ref reject); } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); @@ -88,7 +88,7 @@ namespace Server.Items if (fish != null) { - list.Add(1074494, "#{0}", fish.LabelNumber); // Contains: ~1_CREATURE~ + list.Add(1074494, $"#{fish.LabelNumber}"); // Contains: ~1_CREATURE~ } } } diff --git a/Projects/UOContent/Items/Aquarium/Rewards/AquariumMessage.cs b/Projects/UOContent/Items/Aquarium/Rewards/AquariumMessage.cs index 86d5dadb8..219135b62 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/AquariumMessage.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/AquariumMessage.cs @@ -12,7 +12,7 @@ namespace Server.Items public override int LabelNumber => 1073894; // Message in a Bottle - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/CaptainBlackheartsFishingPole.cs b/Projects/UOContent/Items/Aquarium/Rewards/CaptainBlackheartsFishingPole.cs index ede935971..f46d8d9ac 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/CaptainBlackheartsFishingPole.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/CaptainBlackheartsFishingPole.cs @@ -12,7 +12,7 @@ namespace Server.Items public override int LabelNumber => 1074571; // Captain Blackheart's Fishing Pole - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/CraftysFishingHat.cs b/Projects/UOContent/Items/Aquarium/Rewards/CraftysFishingHat.cs index 01dd1366f..fb5b91174 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/CraftysFishingHat.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/CraftysFishingHat.cs @@ -21,7 +21,7 @@ namespace Server.Items public override int InitMinHits => 20; public override int InitMaxHits => 30; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/FishBones.cs b/Projects/UOContent/Items/Aquarium/Rewards/FishBones.cs index d87e24503..149802bfc 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/FishBones.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/FishBones.cs @@ -13,7 +13,7 @@ namespace Server.Items public override int LabelNumber => 1074601; // Fish bones public override double DefaultWeight => 1.0; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/IslandStatue.cs b/Projects/UOContent/Items/Aquarium/Rewards/IslandStatue.cs index c78a92cb5..cd4362581 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/IslandStatue.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/IslandStatue.cs @@ -13,7 +13,7 @@ namespace Server.Items public override int LabelNumber => 1074600; // An island statue public override double DefaultWeight => 1.0; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/Shell.cs b/Projects/UOContent/Items/Aquarium/Rewards/Shell.cs index c5ffeb1bb..451c20fef 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/Shell.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/Shell.cs @@ -13,7 +13,7 @@ namespace Server.Items public override int LabelNumber => 1074598; // A shell public override double DefaultWeight => 1.0; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/ToyBoat.cs b/Projects/UOContent/Items/Aquarium/Rewards/ToyBoat.cs index fa28f994f..be2346c4a 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/ToyBoat.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/ToyBoat.cs @@ -14,7 +14,7 @@ namespace Server.Items public override int LabelNumber => 1074363; // A toy boat public override double DefaultWeight => 1.0; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/Rewards/WaterloggedBoots.cs b/Projects/UOContent/Items/Aquarium/Rewards/WaterloggedBoots.cs index 973207bc2..ae50b2e81 100644 --- a/Projects/UOContent/Items/Aquarium/Rewards/WaterloggedBoots.cs +++ b/Projects/UOContent/Items/Aquarium/Rewards/WaterloggedBoots.cs @@ -24,7 +24,7 @@ namespace Server.Items public override int LabelNumber => 1074364; // Waterlogged boots - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Aquarium/VacationWafer.cs b/Projects/UOContent/Items/Aquarium/VacationWafer.cs index 9f4f5707a..b12494255 100644 --- a/Projects/UOContent/Items/Aquarium/VacationWafer.cs +++ b/Projects/UOContent/Items/Aquarium/VacationWafer.cs @@ -14,11 +14,11 @@ namespace Server.Items public override int LabelNumber => 1074431; // An aquarium flake sphere - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); - list.Add(1074432, VacationDays.ToString()); // Vacation days: ~1_DAYS~ + list.Add(1074432, $"{VacationDays}"); // Vacation days: ~1_DAYS~ } } } diff --git a/Projects/UOContent/Items/Armor/BaseArmor.cs b/Projects/UOContent/Items/Armor/BaseArmor.cs index ae821b7ee..026eb0dc2 100644 --- a/Projects/UOContent/Items/Armor/BaseArmor.cs +++ b/Projects/UOContent/Items/Armor/BaseArmor.cs @@ -1223,9 +1223,7 @@ namespace Server.Items base.OnRemoved(parent); } - private string GetNameString() => Name ?? $"#{LabelNumber}"; - - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var oreType = _rawResource switch { @@ -1249,31 +1247,26 @@ namespace Server.Items _ => 0 }; - if (_quality == ArmorQuality.Exceptional) + var name = Name; + + if (oreType != 0) { - if (oreType != 0) - { - list.Add(1053100, "#{0}\t{1}", oreType, GetNameString()); // exceptional ~1_oretype~ ~2_armortype~ - } - else - { - list.Add(1050040, GetNameString()); // exceptional ~1_ITEMNAME~ - } + list.Add( + _quality == ArmorQuality.Exceptional ? 1053100 : 1053099, + name != null ? $"#{oreType}\t{Name}" : $"#{oreType}\t#{LabelNumber}" + ); + } + else if (_quality == ArmorQuality.Exceptional) + { + list.Add(1050040, name ?? $"#{LabelNumber}"); // exceptional ~1_ITEMNAME~ + } + else if (name == null) + { + list.Add(LabelNumber); } else { - if (oreType != 0) - { - list.Add(1053099, "#{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~ - } - else if (Name == null) - { - list.Add(LabelNumber); - } - else - { - list.Add(Name); - } + list.Add(Name); } } @@ -1289,7 +1282,7 @@ namespace Server.Items public virtual int GetLuckBonus() => CraftResources.GetInfo(_rawResource)?.AttributeInfo?.ArmorLuck ?? 0; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -1319,72 +1312,72 @@ namespace Server.Items if ((prop = ArtifactRarity) > 0) { - list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{prop}"); // artifact rarity ~1_val~ } if ((prop = Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = GetLowerStatReq()) != 0) { - list.Add(1060435, prop.ToString()); // lower requirements ~1_val~% + list.Add(1060435, $"{prop}"); // lower requirements ~1_val~% } if ((prop = GetLuckBonus() + Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if (ArmorAttributes.MageArmor != 0) @@ -1394,12 +1387,12 @@ namespace Server.Items if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -1409,22 +1402,22 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if ((prop = ArmorAttributes.SelfRepair) != 0) { - list.Add(1060450, prop.ToString()); // self repair ~1_val~ + list.Add(1060450, $"{prop}"); // self repair ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -1434,44 +1427,44 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } AddResistanceProperties(list); if ((prop = GetDurabilityBonus()) > 0) { - list.Add(1060410, prop.ToString()); // durability ~1_val~% + list.Add(1060410, $"{prop}"); // durability ~1_val~% } if ((prop = ComputeStatReq(StatType.Str)) > 0) { - list.Add(1061170, prop.ToString()); // strength requirement ~1_val~ + list.Add(1061170, $"{prop}"); // strength requirement ~1_val~ } if (_hitPoints >= 0 && _maxHitPoints > 0) { - list.Add(1060639, "{0}\t{1}", _hitPoints, _maxHitPoints); // durability ~1_val~ / ~2_val~ + list.Add(1060639, $"{_hitPoints}\t{_maxHitPoints}"); // durability ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Armor/Glasses/ElvenGlasses.cs b/Projects/UOContent/Items/Armor/Glasses/ElvenGlasses.cs index c9140977a..3469820c0 100644 --- a/Projects/UOContent/Items/Armor/Glasses/ElvenGlasses.cs +++ b/Projects/UOContent/Items/Armor/Glasses/ElvenGlasses.cs @@ -42,7 +42,7 @@ namespace Server.Items [SerializableFieldDefault(0)] private AosWeaponAttributes WeaponAttributesDefaultValue() => new(this); - public override void AppendChildNameProperties(ObjectPropertyList list) + public override void AppendChildNameProperties(IPropertyList list) { base.AppendChildNameProperties(list); @@ -50,77 +50,77 @@ namespace Server.Items if ((prop = _weaponAttributes.HitColdArea) != 0) { - list.Add(1060416, prop.ToString()); // hit cold area ~1_val~% + list.Add(1060416, $"{prop}"); // hit cold area ~1_val~% } if ((prop = _weaponAttributes.HitDispel) != 0) { - list.Add(1060417, prop.ToString()); // hit dispel ~1_val~% + list.Add(1060417, $"{prop}"); // hit dispel ~1_val~% } if ((prop = _weaponAttributes.HitEnergyArea) != 0) { - list.Add(1060418, prop.ToString()); // hit energy area ~1_val~% + list.Add(1060418, $"{prop}"); // hit energy area ~1_val~% } if ((prop = _weaponAttributes.HitFireArea) != 0) { - list.Add(1060419, prop.ToString()); // hit fire area ~1_val~% + list.Add(1060419, $"{prop}"); // hit fire area ~1_val~% } if ((prop = _weaponAttributes.HitFireball) != 0) { - list.Add(1060420, prop.ToString()); // hit fireball ~1_val~% + list.Add(1060420, $"{prop}"); // hit fireball ~1_val~% } if ((prop = _weaponAttributes.HitHarm) != 0) { - list.Add(1060421, prop.ToString()); // hit harm ~1_val~% + list.Add(1060421, $"{prop}"); // hit harm ~1_val~% } if ((prop = _weaponAttributes.HitLeechHits) != 0) { - list.Add(1060422, prop.ToString()); // hit life leech ~1_val~% + list.Add(1060422, $"{prop}"); // hit life leech ~1_val~% } if ((prop = _weaponAttributes.HitLightning) != 0) { - list.Add(1060423, prop.ToString()); // hit lightning ~1_val~% + list.Add(1060423, $"{prop}"); // hit lightning ~1_val~% } if ((prop = _weaponAttributes.HitLowerAttack) != 0) { - list.Add(1060424, prop.ToString()); // hit lower attack ~1_val~% + list.Add(1060424, $"{prop}"); // hit lower attack ~1_val~% } if ((prop = _weaponAttributes.HitLowerDefend) != 0) { - list.Add(1060425, prop.ToString()); // hit lower defense ~1_val~% + list.Add(1060425, $"{prop}"); // hit lower defense ~1_val~% } if ((prop = _weaponAttributes.HitMagicArrow) != 0) { - list.Add(1060426, prop.ToString()); // hit magic arrow ~1_val~% + list.Add(1060426, $"{prop}"); // hit magic arrow ~1_val~% } if ((prop = _weaponAttributes.HitLeechMana) != 0) { - list.Add(1060427, prop.ToString()); // hit mana leech ~1_val~% + list.Add(1060427, $"{prop}"); // hit mana leech ~1_val~% } if ((prop = _weaponAttributes.HitPhysicalArea) != 0) { - list.Add(1060428, prop.ToString()); // hit physical area ~1_val~% + list.Add(1060428, $"{prop}"); // hit physical area ~1_val~% } if ((prop = _weaponAttributes.HitPoisonArea) != 0) { - list.Add(1060429, prop.ToString()); // hit poison area ~1_val~% + list.Add(1060429, $"{prop}"); // hit poison area ~1_val~% } if ((prop = _weaponAttributes.HitLeechStam) != 0) { - list.Add(1060430, prop.ToString()); // hit stamina leech ~1_val~% + list.Add(1060430, $"{prop}"); // hit stamina leech ~1_val~% } } } diff --git a/Projects/UOContent/Items/Armor/Leather/LeafGloves.cs b/Projects/UOContent/Items/Armor/Leather/LeafGloves.cs index 5698e6cd9..fc8028be6 100644 --- a/Projects/UOContent/Items/Armor/Leather/LeafGloves.cs +++ b/Projects/UOContent/Items/Armor/Leather/LeafGloves.cs @@ -89,13 +89,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (IsArcane) { - list.Add(1061837, "{0}\t{1}", _curArcaneCharges, _maxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~ + list.Add(1061837, $"{_curArcaneCharges}\t{_maxArcaneCharges}"); // arcane charges: ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Armor/Leather/LeatherGloves.cs b/Projects/UOContent/Items/Armor/Leather/LeatherGloves.cs index 7b0a8a2c0..ef8005160 100644 --- a/Projects/UOContent/Items/Armor/Leather/LeatherGloves.cs +++ b/Projects/UOContent/Items/Armor/Leather/LeatherGloves.cs @@ -88,13 +88,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (IsArcane) { - list.Add(1061837, "{0}\t{1}", _curArcaneCharges, _maxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~ + list.Add(1061837, $"{_curArcaneCharges}\t{_maxArcaneCharges}"); // arcane charges: ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Books/BaseBook.cs b/Projects/UOContent/Items/Books/BaseBook.cs index 85f62eee1..ffd4ddd0b 100644 --- a/Projects/UOContent/Items/Books/BaseBook.cs +++ b/Projects/UOContent/Items/Books/BaseBook.cs @@ -174,7 +174,7 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (!string.IsNullOrEmpty(_title)) { diff --git a/Projects/UOContent/Items/Books/Defined/FropozJournal.cs b/Projects/UOContent/Items/Books/Defined/FropozJournal.cs index 9051e678a..5fdbf1640 100644 --- a/Projects/UOContent/Items/Books/Defined/FropozJournal.cs +++ b/Projects/UOContent/Items/Books/Defined/FropozJournal.cs @@ -137,7 +137,7 @@ namespace Server.Items public override BookContent DefaultContent => Content; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add("Fropoz's Journal"); } diff --git a/Projects/UOContent/Items/Books/Defined/KaburJournal.cs b/Projects/UOContent/Items/Books/Defined/KaburJournal.cs index fbbad7317..7fa55e582 100644 --- a/Projects/UOContent/Items/Books/Defined/KaburJournal.cs +++ b/Projects/UOContent/Items/Books/Defined/KaburJournal.cs @@ -216,7 +216,7 @@ namespace Server.Items public override BookContent DefaultContent => Content; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add("Khabur's Journal"); } diff --git a/Projects/UOContent/Items/Books/Defined/TranslatedGargoyleJournal.cs b/Projects/UOContent/Items/Books/Defined/TranslatedGargoyleJournal.cs index 735ecc9e0..f7f46ad6f 100644 --- a/Projects/UOContent/Items/Books/Defined/TranslatedGargoyleJournal.cs +++ b/Projects/UOContent/Items/Books/Defined/TranslatedGargoyleJournal.cs @@ -118,7 +118,7 @@ namespace Server.Items public override BookContent DefaultContent => Content; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add("Translated Gargoyle Journal"); } diff --git a/Projects/UOContent/Items/Clothing/BaseClothing.cs b/Projects/UOContent/Items/Clothing/BaseClothing.cs index e993de5ed..0de3beadc 100644 --- a/Projects/UOContent/Items/Clothing/BaseClothing.cs +++ b/Projects/UOContent/Items/Clothing/BaseClothing.cs @@ -662,9 +662,7 @@ namespace Server.Items }; } - private string GetNameString() => Name ?? $"#{LabelNumber}"; - - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var oreType = _rawResource switch { @@ -688,21 +686,23 @@ namespace Server.Items _ => 0 }; + var name = Name; + if (oreType != 0) { - list.Add(1053099, "#{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~ + list.Add(1053099, name != null ? $"#{oreType}\t{name}" : $"#{oreType}\t#{LabelNumber}"); // ~1_oretype~ ~2_armortype~ } - else if (Name == null) + else if (name == null) { list.Add(LabelNumber); } else { - list.Add(Name); + list.Add(name); } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -737,72 +737,72 @@ namespace Server.Items if ((prop = ArtifactRarity) > 0) { - list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{prop}"); // artifact rarity ~1_val~ } if ((prop = Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = ClothingAttributes.LowerStatReq) != 0) { - list.Add(1060435, prop.ToString()); // lower requirements ~1_val~% + list.Add(1060435, $"{prop}"); // lower requirements ~1_val~% } if ((prop = Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if (ClothingAttributes.MageArmor != 0) @@ -812,12 +812,12 @@ namespace Server.Items if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -827,22 +827,22 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if ((prop = ClothingAttributes.SelfRepair) != 0) { - list.Add(1060450, prop.ToString()); // self repair ~1_val~ + list.Add(1060450, $"{prop}"); // self repair ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -852,44 +852,44 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } AddResistanceProperties(list); if ((prop = ClothingAttributes.DurabilityBonus) > 0) { - list.Add(1060410, prop.ToString()); // durability ~1_val~% + list.Add(1060410, $"{prop}"); // durability ~1_val~% } if ((prop = ComputeStatReq(StatType.Str)) > 0) { - list.Add(1061170, prop.ToString()); // strength requirement ~1_val~ + list.Add(1061170, $"{prop}"); // strength requirement ~1_val~ } if (_hitPoints >= 0 && _maxHitPoints > 0) { - list.Add(1060639, "{0}\t{1}", _hitPoints, _maxHitPoints); // durability ~1_val~ / ~2_val~ + list.Add(1060639, $"{_hitPoints}\t{_maxHitPoints}"); // durability ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Clothing/Cloaks.cs b/Projects/UOContent/Items/Clothing/Cloaks.cs index 8b6ff62e5..d5356dde2 100644 --- a/Projects/UOContent/Items/Clothing/Cloaks.cs +++ b/Projects/UOContent/Items/Clothing/Cloaks.cs @@ -80,13 +80,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (IsArcane) { - list.Add(1061837, "{0}\t{1}", _curArcaneCharges, _maxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~ + list.Add(1061837, $"{_curArcaneCharges}\t{_maxArcaneCharges}"); // arcane charges: ~1_val~ / ~2_val~ } } @@ -163,7 +163,7 @@ namespace Server.Items return false; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Clothing/Hats.cs b/Projects/UOContent/Items/Clothing/Hats.cs index 80b4d7580..d6a9167d7 100644 --- a/Projects/UOContent/Items/Clothing/Hats.cs +++ b/Projects/UOContent/Items/Clothing/Hats.cs @@ -28,7 +28,7 @@ namespace Server.Items } } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Clothing/OuterTorso.cs b/Projects/UOContent/Items/Clothing/OuterTorso.cs index e05a7ff43..edd737c2f 100644 --- a/Projects/UOContent/Items/Clothing/OuterTorso.cs +++ b/Projects/UOContent/Items/Clothing/OuterTorso.cs @@ -193,7 +193,7 @@ namespace Server.Items return false; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -275,7 +275,7 @@ namespace Server.Items return false; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -374,13 +374,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (IsArcane) { - list.Add(1061837, "{0}\t{1}", _curArcaneCharges, _maxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~ + list.Add(1061837, $"{_curArcaneCharges}\t{_maxArcaneCharges}"); // arcane charges: ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Clothing/Shoes.cs b/Projects/UOContent/Items/Clothing/Shoes.cs index 03fcd4436..0615335d9 100644 --- a/Projects/UOContent/Items/Clothing/Shoes.cs +++ b/Projects/UOContent/Items/Clothing/Shoes.cs @@ -120,13 +120,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (IsArcane) { - list.Add(1061837, "{0}\t{1}", _curArcaneCharges, _maxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~ + list.Add(1061837, $"{_curArcaneCharges}\t{_maxArcaneCharges}"); // arcane charges: ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Construction/Signs/SubtextSign.cs b/Projects/UOContent/Items/Construction/Signs/SubtextSign.cs index 7541fdfed..9b7b63e1d 100644 --- a/Projects/UOContent/Items/Construction/Signs/SubtextSign.cs +++ b/Projects/UOContent/Items/Construction/Signs/SubtextSign.cs @@ -40,7 +40,7 @@ namespace Server.Items } } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Containers/Container.cs b/Projects/UOContent/Items/Containers/Container.cs index c634237fc..c3112705b 100644 --- a/Projects/UOContent/Items/Containers/Container.cs +++ b/Projects/UOContent/Items/Containers/Container.cs @@ -172,7 +172,7 @@ public partial class CreatureBackpack : Backpack // Used on BaseCreature Weight = 3.0; } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (Name != null) { diff --git a/Projects/UOContent/Items/Containers/LockableContainer.cs b/Projects/UOContent/Items/Containers/LockableContainer.cs index 1bbad4d64..a65670256 100644 --- a/Projects/UOContent/Items/Containers/LockableContainer.cs +++ b/Projects/UOContent/Items/Containers/LockableContainer.cs @@ -214,7 +214,7 @@ public abstract partial class LockableContainer : TrappableContainer, ILockable, base.OnSnoop(from); } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Containers/ParagonChest.cs b/Projects/UOContent/Items/Containers/ParagonChest.cs index 8f95fbfa4..d6c730dff 100644 --- a/Projects/UOContent/Items/Containers/ParagonChest.cs +++ b/Projects/UOContent/Items/Containers/ParagonChest.cs @@ -35,7 +35,7 @@ public partial class ParagonChest : LockableContainer LabelTo(from, 1063449, _name); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Containers/Strongbox.cs b/Projects/UOContent/Items/Containers/Strongbox.cs index 245bbd9c9..e6e1eec3e 100644 --- a/Projects/UOContent/Items/Containers/Strongbox.cs +++ b/Projects/UOContent/Items/Containers/Strongbox.cs @@ -59,7 +59,7 @@ public partial class StrongBox : BaseContainer, IChoppable } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (_owner != null) { diff --git a/Projects/UOContent/Items/Decoration Artifacts/BaseDecorationArtifact.cs b/Projects/UOContent/Items/Decoration Artifacts/BaseDecorationArtifact.cs index 079bb9d30..69719ab90 100644 --- a/Projects/UOContent/Items/Decoration Artifacts/BaseDecorationArtifact.cs +++ b/Projects/UOContent/Items/Decoration Artifacts/BaseDecorationArtifact.cs @@ -11,11 +11,11 @@ public abstract partial class BaseDecorationArtifact : Item public override bool ForceShowProperties => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1061078, ArtifactRarity.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{ArtifactRarity}"); // artifact rarity ~1_val~ } } @@ -28,10 +28,10 @@ public abstract partial class BaseDecorationContainerArtifact : BaseContainer public override bool ForceShowProperties => true; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); - list.Add(1061078, ArtifactRarity.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{ArtifactRarity}"); // artifact rarity ~1_val~ } } diff --git a/Projects/UOContent/Items/Deeds/CommodityDeed.cs b/Projects/UOContent/Items/Deeds/CommodityDeed.cs index 25ddf29e3..87772006a 100644 --- a/Projects/UOContent/Items/Deeds/CommodityDeed.cs +++ b/Projects/UOContent/Items/Deeds/CommodityDeed.cs @@ -62,7 +62,7 @@ public partial class CommodityDeed : Item base.OnDelete(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Deeds/DragonBardingDeed.cs b/Projects/UOContent/Items/Deeds/DragonBardingDeed.cs index 0cb85790a..78a13404e 100644 --- a/Projects/UOContent/Items/Deeds/DragonBardingDeed.cs +++ b/Projects/UOContent/Items/Deeds/DragonBardingDeed.cs @@ -65,7 +65,7 @@ public partial class DragonBardingDeed : Item, ICraftable return quality; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Deeds/NewPlayerTicket.cs b/Projects/UOContent/Items/Deeds/NewPlayerTicket.cs index d19fdf762..36c2eea7a 100644 --- a/Projects/UOContent/Items/Deeds/NewPlayerTicket.cs +++ b/Projects/UOContent/Items/Deeds/NewPlayerTicket.cs @@ -23,7 +23,7 @@ public partial class NewPlayerTicket : Item public override bool DisplayLootType => false; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Deeds/VendorRentalContract.cs b/Projects/UOContent/Items/Deeds/VendorRentalContract.cs index ea2dc6cfc..8a1134014 100644 --- a/Projects/UOContent/Items/Deeds/VendorRentalContract.cs +++ b/Projects/UOContent/Items/Deeds/VendorRentalContract.cs @@ -76,7 +76,7 @@ public partial class VendorRentalContract : Item } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Food/Beverage.cs b/Projects/UOContent/Items/Food/Beverage.cs index 10f71c6a6..305440fcb 100644 --- a/Projects/UOContent/Items/Food/Beverage.cs +++ b/Projects/UOContent/Items/Food/Beverage.cs @@ -322,7 +322,7 @@ public abstract partial class BaseBeverage : Item, IHasQuantity }; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Games/Mahjong/MahjongGame.cs b/Projects/UOContent/Items/Games/Mahjong/MahjongGame.cs index ab2fa1a63..4bd778ee2 100644 --- a/Projects/UOContent/Items/Games/Mahjong/MahjongGame.cs +++ b/Projects/UOContent/Items/Games/Mahjong/MahjongGame.cs @@ -162,7 +162,7 @@ namespace Server.Engines.Mahjong BuildVerticalWall(ref i, 115, 165, 1, MahjongPieceDirection.Right, typeGenerator); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Guilds/Guildstone.cs b/Projects/UOContent/Items/Guilds/Guildstone.cs index f002a89b2..89a53b6c6 100644 --- a/Projects/UOContent/Items/Guilds/Guildstone.cs +++ b/Projects/UOContent/Items/Guilds/Guildstone.cs @@ -178,7 +178,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -379,7 +379,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Jewels/BaseJewel.cs b/Projects/UOContent/Items/Jewels/BaseJewel.cs index ac7503be4..cbce3546d 100644 --- a/Projects/UOContent/Items/Jewels/BaseJewel.cs +++ b/Projects/UOContent/Items/Jewels/BaseJewel.cs @@ -255,7 +255,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -265,77 +265,77 @@ namespace Server.Items if ((prop = ArtifactRarity) > 0) { - list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{prop}"); // artifact rarity ~1_val~ } if ((prop = Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -345,17 +345,17 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -365,34 +365,34 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } AddResistanceProperties(list); if (m_HitPoints >= 0 && m_MaxHitPoints > 0) { - list.Add(1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints); // durability ~1_val~ / ~2_val~ + list.Add(1060639, $"{m_HitPoints}\t{m_MaxHitPoints}"); // durability ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Lights/Candelabra.cs b/Projects/UOContent/Items/Lights/Candelabra.cs index 81889c01e..30d3b98e8 100644 --- a/Projects/UOContent/Items/Lights/Candelabra.cs +++ b/Projects/UOContent/Items/Lights/Candelabra.cs @@ -46,7 +46,7 @@ namespace Server.Items } } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Maps/TreasureMap.cs b/Projects/UOContent/Items/Maps/TreasureMap.cs index be5ca3039..ed4c61ca3 100644 --- a/Projects/UOContent/Items/Maps/TreasureMap.cs +++ b/Projects/UOContent/Items/Maps/TreasureMap.cs @@ -523,7 +523,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/BankCheck.cs b/Projects/UOContent/Items/Misc/BankCheck.cs index 8cce66288..db1517471 100644 --- a/Projects/UOContent/Items/Misc/BankCheck.cs +++ b/Projects/UOContent/Items/Misc/BankCheck.cs @@ -68,7 +68,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); list.Add(1060738, Core.ML ? $"{m_Worth:N0}" : m_Worth.ToString()); // value: ~1_val~) diff --git a/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesFermentedWine.cs b/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesFermentedWine.cs index 4a292c615..080783aab 100644 --- a/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesFermentedWine.cs +++ b/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesFermentedWine.cs @@ -24,7 +24,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesHairDye.cs b/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesHairDye.cs index 24a51b8f8..c8a40859b 100644 --- a/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesHairDye.cs +++ b/Projects/UOContent/Items/Misc/Blighted Grove/MelisandesHairDye.cs @@ -28,7 +28,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/CommunicationCrystals.cs b/Projects/UOContent/Items/Misc/CommunicationCrystals.cs index 357720994..02997aa56 100644 --- a/Projects/UOContent/Items/Misc/CommunicationCrystals.cs +++ b/Projects/UOContent/Items/Misc/CommunicationCrystals.cs @@ -91,17 +91,17 @@ namespace Server.Items public override bool HandlesOnSpeech => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); list.Add(Active ? 1060742 : 1060743); // active / inactive list.Add(1060745); // broadcast - list.Add(1060741, Charges.ToString()); // charges: ~1_val~ + list.Add(1060741, $"{Charges}"); // charges: ~1_val~ if (Receivers.Count > 0) { - list.Add(1060746, Receivers.Count.ToString()); // links: ~1_val~ + list.Add(1060746, $"{Receivers.Count}"); // links: ~1_val~ } } @@ -338,7 +338,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs index f3ea9e7b6..15eb2ca25 100644 --- a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs +++ b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs @@ -1130,7 +1130,7 @@ namespace Server.Items public override bool CheckContentDisplay(Mobile from) => false; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (ItemID == 0x2006) // Corpse form { diff --git a/Projects/UOContent/Items/Misc/Corpses/DecayedCorpse.cs b/Projects/UOContent/Items/Misc/Corpses/DecayedCorpse.cs index 9eb2da8ac..a38c910aa 100644 --- a/Projects/UOContent/Items/Misc/Corpses/DecayedCorpse.cs +++ b/Projects/UOContent/Items/Misc/Corpses/DecayedCorpse.cs @@ -43,7 +43,7 @@ namespace Server.Items // Do not display (x items, y stones) public override bool CheckContentDisplay(Mobile from) => false; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(1046414, Name); // the remains of ~1_NAME~ } diff --git a/Projects/UOContent/Items/Misc/InteriorDecorator.cs b/Projects/UOContent/Items/Misc/InteriorDecorator.cs index 8e40f2f12..953b19c21 100644 --- a/Projects/UOContent/Items/Misc/InteriorDecorator.cs +++ b/Projects/UOContent/Items/Misc/InteriorDecorator.cs @@ -41,7 +41,7 @@ namespace Server.Items public override int LabelNumber => 1041280; // an interior decorator - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/Key.cs b/Projects/UOContent/Items/Misc/Key.cs index 263a9ac03..0f362d47b 100644 --- a/Projects/UOContent/Items/Misc/Key.cs +++ b/Projects/UOContent/Items/Misc/Key.cs @@ -218,7 +218,7 @@ public class Key : Item from.Target = t; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/PromotionalToken.cs b/Projects/UOContent/Items/Misc/PromotionalToken.cs index 264c5e6bd..857e7548b 100644 --- a/Projects/UOContent/Items/Misc/PromotionalToken.cs +++ b/Projects/UOContent/Items/Misc/PromotionalToken.cs @@ -23,11 +23,11 @@ namespace Server.Items public override int LabelNumber => 1070997; // A promotional token public abstract Item CreateItemFor(Mobile from); - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1070998, ItemName.ToString()); // Use this to redeem
your ~1_PROMO~ + list.Add(1070998, $"{ItemName}"); // Use this to redeem
your ~1_PROMO~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Items/Misc/Teleporter.cs b/Projects/UOContent/Items/Misc/Teleporter.cs index 88b689899..ec505662d 100644 --- a/Projects/UOContent/Items/Misc/Teleporter.cs +++ b/Projects/UOContent/Items/Misc/Teleporter.cs @@ -153,7 +153,7 @@ namespace Server.Items public override int LabelNumber => 1026095; // teleporter - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -168,15 +168,15 @@ namespace Server.Items if (m_MapDest != null) { - list.Add(1060658, "Map\t{0}", m_MapDest); + list.Add(1060658, $"Map\t{m_MapDest}"); } if (m_PointDest != Point3D.Zero) { - list.Add(1060659, "Coords\t{0}", m_PointDest); + list.Add(1060659, $"Coords\t{m_PointDest}"); } - list.Add(1060660, "Creatures\t{0}", m_Creatures ? "Yes" : "No"); + list.Add(1060660, $"Creatures\t{(m_Creatures ? "Yes" : "No")}"); } public override void OnSingleClick(Mobile from) @@ -463,7 +463,7 @@ namespace Server.Items return true; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -479,15 +479,15 @@ namespace Server.Items skillName = "(Invalid)"; } - list.Add(1060661, "{0}\t{1:F1}", skillName, m_Required); + list.Add(1060661, $"{skillName}\t{m_Required:F1}"); if (m_MessageString != null) { - list.Add(1060662, "Message\t{0}", m_MessageString); + list.Add(1060662, $"Message\t{m_MessageString}"); } else if (m_MessageNumber != 0) { - list.Add(1060662, "Message\t#{0}", m_MessageNumber); + list.Add(1060662, $"Message\t#{m_MessageNumber}"); } } @@ -621,20 +621,20 @@ namespace Server.Items public override bool OnMoveOver(Mobile m) => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060661, "Range\t{0}", m_Range); + list.Add(1060661, $"Range\t{m_Range}"); if (m_Keyword >= 0) { - list.Add(1060662, "Keyword\t{0}", m_Keyword); + list.Add(1060662, $"Keyword\t{m_Keyword}"); } if (m_Substring != null) { - list.Add(1060663, "Substring\t{0}", m_Substring); + list.Add(1060663, $"Substring\t{m_Substring}"); } } @@ -1176,7 +1176,7 @@ namespace Server.Items return true; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Misc/WindChimes.cs b/Projects/UOContent/Items/Misc/WindChimes.cs index 06eb62e8d..6e1d5e0ef 100644 --- a/Projects/UOContent/Items/Misc/WindChimes.cs +++ b/Projects/UOContent/Items/Misc/WindChimes.cs @@ -42,7 +42,7 @@ namespace Server.Items base.OnMovement(m, oldLocation); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Quivers/BaseQuiver.cs b/Projects/UOContent/Items/Quivers/BaseQuiver.cs index 6234087bd..ca0c191b9 100644 --- a/Projects/UOContent/Items/Quivers/BaseQuiver.cs +++ b/Projects/UOContent/Items/Quivers/BaseQuiver.cs @@ -236,7 +236,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -256,23 +256,23 @@ namespace Server.Items { if (ammo is Arrow) { - list.Add(1075265, "{0}\t{1}", ammo.Amount, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows + list.Add(1075265, $"{ammo.Amount}\t{Capacity}"); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows } else if (ammo is Bolt) { - list.Add(1075266, "{0}\t{1}", ammo.Amount, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts + list.Add(1075266, $"{ammo.Amount}\t{Capacity}"); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts } } else { - list.Add(1075265, "{0}\t{1}", 0, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows + list.Add(1075265, $"0\t{Capacity}"); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows } int prop; if ((prop = m_DamageIncrease) != 0) { - list.Add(1074762, prop.ToString()); // Damage modifier: ~1_PERCENT~% + list.Add(1074762, $"{prop}"); // Damage modifier: ~1_PERCENT~% } int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0, chaos = 0, direct = 0; @@ -281,104 +281,104 @@ namespace Server.Items if (phys != 0) { - list.Add(1060403, phys.ToString()); // physical damage ~1_val~% + list.Add(1060403, $"{phys}"); // physical damage ~1_val~% } if (fire != 0) { - list.Add(1060405, fire.ToString()); // fire damage ~1_val~% + list.Add(1060405, $"{fire}"); // fire damage ~1_val~% } if (cold != 0) { - list.Add(1060404, cold.ToString()); // cold damage ~1_val~% + list.Add(1060404, $"{cold}"); // cold damage ~1_val~% } if (pois != 0) { - list.Add(1060406, pois.ToString()); // poison damage ~1_val~% + list.Add(1060406, $"{pois}"); // poison damage ~1_val~% } if (nrgy != 0) { - list.Add(1060407, nrgy.ToString()); // energy damage ~1_val + list.Add(1060407, $"{nrgy}"); // energy damage ~1_val } if (chaos != 0) { - list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~% + list.Add(1072846, $"{chaos}"); // chaos damage ~1_val~% } if (direct != 0) { - list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~% + list.Add(1079978, $"{direct}"); // Direct Damage: ~1_PERCENT~% } list.Add(1075085); // Requirement: Mondain's Legacy if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -388,58 +388,54 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if ((prop = m_LowerAmmoCost) > 0) { - list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~% + list.Add(1075208, $"{prop}"); // Lower Ammo Cost ~1_Percentage~% } var weight = ammo != null ? ammo.Weight + ammo.Amount : 0; list.Add( - 1072241, - "{0}\t{1}\t{2}\t{3}", - Items.Count, - DefaultMaxItems, - (int)weight, - DefaultMaxWeight - ); // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones + 1072241, // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones + $"{Items.Count}\t{DefaultMaxItems}\t{(int)weight}\t{DefaultMaxWeight}" + ); if ((prop = m_WeightReduction) != 0) { - list.Add(1072210, prop.ToString()); // Weight reduction: ~1_PERCENTAGE~% + list.Add(1072210, $"{prop}"); // Weight reduction: ~1_PERCENTAGE~% } } diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs index 1d034e0cc..bcf624f90 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs @@ -68,11 +68,11 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (Amount > 1) { - list.Add(1050039, "{0}\t#{1}", Amount, 1027154); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{Amount}\t#{1027154}"); // ~1_NUMBER~ ~2_ITEMNAME~ } else { @@ -80,7 +80,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs index d5f26bb55..093d30d25 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs @@ -83,11 +83,11 @@ namespace Server.Items dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.Hue == Hue && dropped.Name == Name && dropped.Amount + Amount <= 60000 && dropped != this; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (Amount > 1) { - list.Add(1050039, "{0}\t#{1}", Amount, 1026583); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{Amount}\t#{1026583}"); // ~1_NUMBER~ ~2_ITEMNAME~ } else { @@ -95,7 +95,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Resources/Fishing/BigFish.cs b/Projects/UOContent/Items/Resources/Fishing/BigFish.cs index 7ccaef1ea..49dc2bc76 100644 --- a/Projects/UOContent/Items/Resources/Fishing/BigFish.cs +++ b/Projects/UOContent/Items/Resources/Fishing/BigFish.cs @@ -26,7 +26,7 @@ namespace Server.Items ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -37,7 +37,7 @@ namespace Server.Items list.Add(1070857, _fisher.Name); // Caught by ~1_fisherman~ } - list.Add(1070858, ((int)Weight).ToString()); // ~1_weight~ stones + list.Add(1070858, $"{(int)Weight}"); // ~1_weight~ stones } } diff --git a/Projects/UOContent/Items/Resources/Masonry/Granite.cs b/Projects/UOContent/Items/Resources/Masonry/Granite.cs index 6b473ac20..c24cb757f 100644 --- a/Projects/UOContent/Items/Resources/Masonry/Granite.cs +++ b/Projects/UOContent/Items/Resources/Masonry/Granite.cs @@ -62,7 +62,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Resources/Tailor/Hides.cs b/Projects/UOContent/Items/Resources/Tailor/Hides.cs index 39acdc6c7..6c28ac235 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Hides.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Hides.cs @@ -55,11 +55,11 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (Amount > 1) { - list.Add(1050039, "{0}\t#{1}", Amount, 1024216); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{Amount}\t#1024216"); // ~1_NUMBER~ ~2_ITEMNAME~ } else { @@ -67,7 +67,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Resources/Tailor/Leathers.cs b/Projects/UOContent/Items/Resources/Tailor/Leathers.cs index 3ed3f4a7c..1d44a86ea 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Leathers.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Leathers.cs @@ -55,11 +55,11 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (Amount > 1) { - list.Add(1050039, "{0}\t#{1}", Amount, 1024199); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(1050039, $"{Amount}\t#1024199"); // ~1_NUMBER~ ~2_ITEMNAME~ } else { @@ -67,7 +67,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs index 2eac48b20..c5185bb7d 100644 --- a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs +++ b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs @@ -59,7 +59,7 @@ namespace Server.Items bool ICommodity.IsDeedable => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs index 6a6a1dab4..82c2a2aca 100644 --- a/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs +++ b/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs @@ -253,7 +253,7 @@ namespace Server.Items public Item Deed => new TrophyDeed(WestID, NorthID, DeedNumber, m_AddonNumber, m_Hunter, m_AnimalWeight); - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -264,7 +264,7 @@ namespace Server.Items list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~ } - list.Add(1070858, m_AnimalWeight.ToString()); // ~1_weight~ stones + list.Add(1070858, $"{m_AnimalWeight}"); // ~1_weight~ stones } } @@ -428,7 +428,7 @@ namespace Server.Items public override int LabelNumber => m_DeedNumber; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -439,7 +439,7 @@ namespace Server.Items list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~ } - list.Add(1070858, m_AnimalWeight.ToString()); // ~1_weight~ stones + list.Add(1070858, $"{m_AnimalWeight}"); // ~1_weight~ stones } } diff --git a/Projects/UOContent/Items/Skill Items/Fishing/Misc/ShipwreckedItem.cs b/Projects/UOContent/Items/Skill Items/Fishing/Misc/ShipwreckedItem.cs index b848e9070..6643e1507 100644 --- a/Projects/UOContent/Items/Skill Items/Fishing/Misc/ShipwreckedItem.cs +++ b/Projects/UOContent/Items/Skill Items/Fishing/Misc/ShipwreckedItem.cs @@ -51,7 +51,7 @@ namespace Server.Items LabelTo(from, 1050039, $"#{LabelNumber}\t#1041645"); } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); list.Add(1041645); // recovered from a shipwreck diff --git a/Projects/UOContent/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs b/Projects/UOContent/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs index 8d3f3e515..e49ebba19 100644 --- a/Projects/UOContent/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs +++ b/Projects/UOContent/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs @@ -63,14 +63,14 @@ namespace Server.Items public virtual bool RequireDeepWater => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); AddNetProperties(list); } - protected virtual void AddNetProperties(ObjectPropertyList list) + protected virtual void AddNetProperties(IPropertyList list) { // as if the name wasn't enough.. list.Add(1017410); // Special Fishing Net @@ -435,7 +435,7 @@ namespace Server.Items public override int LabelNumber => 1063451; // a fabled fishing net - protected override void AddNetProperties(ObjectPropertyList list) + protected override void AddNetProperties(IPropertyList list) { } diff --git a/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs b/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs index 66a98318f..cb79d1891 100644 --- a/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs +++ b/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs @@ -109,7 +109,7 @@ namespace Server.Items return 100; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -122,7 +122,7 @@ namespace Server.Items list.Add(1060636); // exceptional } - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } public virtual void DisplayDurabilityTo(Mobile m) diff --git a/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs b/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs index 19db4c169..e3a37d000 100644 --- a/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs +++ b/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs @@ -40,7 +40,7 @@ namespace Server.Items bool ICommodity.IsDeedable => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Magical/Misc/PotionKeg.cs b/Projects/UOContent/Items/Skill Items/Magical/Misc/PotionKeg.cs index e8a633fab..4b09592df 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Misc/PotionKeg.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Misc/PotionKeg.cs @@ -98,7 +98,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Magical/Misc/RecallRune.cs b/Projects/UOContent/Items/Skill Items/Magical/Misc/RecallRune.cs index d7d6d56fb..e04e97d16 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Misc/RecallRune.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Misc/RecallRune.cs @@ -217,7 +217,7 @@ namespace Server.Items InvalidateProperties(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -232,23 +232,23 @@ namespace Server.Items if (m_TargetMap == Map.Tokuno) { - list.Add(House != null ? 1063260 : 1063259, RuneFormat, desc); // ~1_val~ (Tokuno Islands)[(House)] + list.Add(House != null ? 1063260 : 1063259, $"a recall rune for {desc}"); // ~1_val~ (Tokuno Islands)[(House)] } else if (m_TargetMap == Map.Malas) { - list.Add(House != null ? 1062454 : 1060804, RuneFormat, desc); // ~1_val~ (Malas)[(House)] + list.Add(House != null ? 1062454 : 1060804, $"a recall rune for {desc}"); // ~1_val~ (Malas)[(House)] } else if (m_TargetMap == Map.Felucca) { - list.Add(House != null ? 1062452 : 1060805, RuneFormat, desc); // ~1_val~ (Felucca)[(House)] + list.Add(House != null ? 1062452 : 1060805, $"a recall rune for {desc}"); // ~1_val~ (Felucca)[(House)] } else if (m_TargetMap == Map.Trammel) { - list.Add(House != null ? 1062453 : 1060806, RuneFormat, desc); // ~1_val~ (Trammel)[(House)] + list.Add(House != null ? 1062453 : 1060806, $"a recall rune for {desc}"); // ~1_val~ (Trammel)[(House)] } else { - list.Add(House != null ? "{0} ({1})(House)" : "{0} ({1})", string.Format(RuneFormat, desc), m_TargetMap); + list.Add(House != null ? $"a recall rune for {desc} ({m_TargetMap})(House)" : $"a recall rune for {desc} ({m_TargetMap})"); } } } @@ -263,33 +263,33 @@ namespace Server.Items { LabelTo( from, - House != null ? 1063260 : 1063259, + House != null ? 1063260 : 1063259, // ~1_val~ (Tokuno Islands)[(House)] string.Format(RuneFormat, desc) - ); // ~1_val~ (Tokuno Islands)[(House)] + ); } else if (m_TargetMap == Map.Malas) { LabelTo( from, - House != null ? 1062454 : 1060804, + House != null ? 1062454 : 1060804, // ~1_val~ (Malas)[(House)] string.Format(RuneFormat, desc) - ); // ~1_val~ (Malas)[(House)] + ); } else if (m_TargetMap == Map.Felucca) { LabelTo( from, - House != null ? 1062452 : 1060805, + House != null ? 1062452 : 1060805, // ~1_val~ (Felucca)[(House)] string.Format(RuneFormat, desc) - ); // ~1_val~ (Felucca)[(House)] + ); } else if (m_TargetMap == Map.Trammel) { LabelTo( from, - House != null ? 1062453 : 1060806, + House != null ? 1062453 : 1060806, // ~1_val~ (Trammel)[(House)] string.Format(RuneFormat, desc) - ); // ~1_val~ (Trammel)[(House)] + ); } else { diff --git a/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs b/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs index 2088180cb..3d1ac368c 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs @@ -276,7 +276,7 @@ namespace Server.Items return false; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Magical/Spellbook.cs b/Projects/UOContent/Items/Skill Items/Magical/Spellbook.cs index cbb60611b..b8b6ef6be 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Spellbook.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Spellbook.cs @@ -695,7 +695,7 @@ namespace Server.Items to.NetState.SendSpellbookContent(Serial, ItemID, BookOffset + 1, m_Content); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -738,72 +738,72 @@ namespace Server.Items if ((prop = Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -813,17 +813,17 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -833,30 +833,30 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } - list.Add(1042886, SpellCount.ToString()); // ~1_NUMBERS_OF_SPELLS~ Spells + list.Add(1042886, $"{SpellCount}"); // ~1_NUMBERS_OF_SPELLS~ Spells } public override void OnSingleClick(Mobile from) diff --git a/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs b/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs index 31eeddc8c..13673cedc 100644 --- a/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs +++ b/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs @@ -42,7 +42,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -50,7 +50,7 @@ namespace Server.Items if (r != null) { - list.Add(1049644, r.TextDefinition.ToString()); // [~1_stuff~] + list.Add(1049644, $"{r.TextDefinition}"); // [~1_stuff~] } } diff --git a/Projects/UOContent/Items/Skill Items/Misc/RepairDeed.cs b/Projects/UOContent/Items/Skill Items/Misc/RepairDeed.cs index cf99c201c..671506b55 100644 --- a/Projects/UOContent/Items/Skill Items/Misc/RepairDeed.cs +++ b/Projects/UOContent/Items/Skill Items/Misc/RepairDeed.cs @@ -92,7 +92,7 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add( 1061133, @@ -100,7 +100,7 @@ namespace Server.Items ); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~. } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Musical Instruments/BaseInstrument.cs b/Projects/UOContent/Items/Skill Items/Musical Instruments/BaseInstrument.cs index d0faa631e..ce7a15a73 100644 --- a/Projects/UOContent/Items/Skill Items/Musical Instruments/BaseInstrument.cs +++ b/Projects/UOContent/Items/Skill Items/Musical Instruments/BaseInstrument.cs @@ -359,7 +359,7 @@ namespace Server.Items m_Instruments[from] = item; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { var oldUses = m_UsesRemaining; CheckReplenishUses(false); @@ -376,7 +376,7 @@ namespace Server.Items list.Add(1060636); // exceptional } - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ if (m_ReplenishesCharges) { diff --git a/Projects/UOContent/Items/Skill Items/Ninjitsu/Fukiya.cs b/Projects/UOContent/Items/Skill Items/Ninjitsu/Fukiya.cs index 45b78a979..9411c8efe 100644 --- a/Projects/UOContent/Items/Skill Items/Ninjitsu/Fukiya.cs +++ b/Projects/UOContent/Items/Skill Items/Ninjitsu/Fukiya.cs @@ -87,11 +87,11 @@ namespace Server.Items from.MovingEffect(to, 0x2804, 5, 0, false, false); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ if (m_Poison != null && m_PoisonCharges > 0) { diff --git a/Projects/UOContent/Items/Skill Items/Ninjitsu/FukiyaDarts.cs b/Projects/UOContent/Items/Skill Items/Ninjitsu/FukiyaDarts.cs index 858e9c1a7..3bdd5ca95 100644 --- a/Projects/UOContent/Items/Skill Items/Ninjitsu/FukiyaDarts.cs +++ b/Projects/UOContent/Items/Skill Items/Ninjitsu/FukiyaDarts.cs @@ -73,11 +73,11 @@ namespace Server.Items set { } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ if (m_Poison != null && m_PoisonCharges > 0) { diff --git a/Projects/UOContent/Items/Skill Items/Ninjitsu/LeatherNinjaBelt.cs b/Projects/UOContent/Items/Skill Items/Ninjitsu/LeatherNinjaBelt.cs index 5e58cc004..2f26f70bf 100644 --- a/Projects/UOContent/Items/Skill Items/Ninjitsu/LeatherNinjaBelt.cs +++ b/Projects/UOContent/Items/Skill Items/Ninjitsu/LeatherNinjaBelt.cs @@ -89,11 +89,11 @@ namespace Server.Items from.MovingEffect(to, 0x27AC, 1, 0, false, false); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ if (m_Poison != null && m_PoisonCharges > 0) { diff --git a/Projects/UOContent/Items/Skill Items/Ninjitsu/Shuriken.cs b/Projects/UOContent/Items/Skill Items/Ninjitsu/Shuriken.cs index 5f07c665f..8e800e9cd 100644 --- a/Projects/UOContent/Items/Skill Items/Ninjitsu/Shuriken.cs +++ b/Projects/UOContent/Items/Skill Items/Ninjitsu/Shuriken.cs @@ -74,11 +74,11 @@ namespace Server.Items set { } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ if (m_Poison != null && m_PoisonCharges > 0) { diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs index 615661514..8b403c3f7 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs @@ -29,7 +29,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs index 85c65be00..2e94d43e7 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs @@ -30,7 +30,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs index 28c81f2ae..18056ff06 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs @@ -14,7 +14,7 @@ namespace Server.Items public override bool MetallicHues => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RewardBlackDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RewardBlackDyeTub.cs index a0f75f358..c8c0ef7c1 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RewardBlackDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RewardBlackDyeTub.cs @@ -30,7 +30,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs index 7adee4071..6d202d49a 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs @@ -30,7 +30,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs index ec30f803d..34630ac87 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs @@ -26,7 +26,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs index a988c8d0a..9fa04835a 100644 --- a/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs +++ b/Projects/UOContent/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs @@ -30,7 +30,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tools/BaseTool.cs b/Projects/UOContent/Items/Skill Items/Tools/BaseTool.cs index e484fc193..5565c1cf7 100644 --- a/Projects/UOContent/Items/Skill Items/Tools/BaseTool.cs +++ b/Projects/UOContent/Items/Skill Items/Tools/BaseTool.cs @@ -114,7 +114,7 @@ namespace Server.Items return 100; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -127,7 +127,7 @@ namespace Server.Items list.Add(1060636); // exceptional } - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } public virtual void DisplayDurabilityTo(Mobile m) diff --git a/Projects/UOContent/Items/Skill Items/Tools/RunicHammer.cs b/Projects/UOContent/Items/Skill Items/Tools/RunicHammer.cs index f3051982f..5a1604b83 100644 --- a/Projects/UOContent/Items/Skill Items/Tools/RunicHammer.cs +++ b/Projects/UOContent/Items/Skill Items/Tools/RunicHammer.cs @@ -42,7 +42,7 @@ namespace Server.Items } } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Items/Skill Items/Tools/RunicSewingKit.cs b/Projects/UOContent/Items/Skill Items/Tools/RunicSewingKit.cs index f980d2391..16a2d49b2 100644 --- a/Projects/UOContent/Items/Skill Items/Tools/RunicSewingKit.cs +++ b/Projects/UOContent/Items/Skill Items/Tools/RunicSewingKit.cs @@ -24,7 +24,7 @@ namespace Server.Items public override CraftSystem CraftSystem => DefTailoring.CraftSystem; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var v = " "; diff --git a/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs b/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs index bff115f2b..206712650 100644 --- a/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs +++ b/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs @@ -141,7 +141,7 @@ namespace Server.Items box.Tracks.AddRange(Tracks); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -169,17 +169,17 @@ namespace Server.Items if (commonSongs > 0) { - list.Add(1075234, commonSongs.ToString()); // ~1_NUMBER~ Common Tracks + list.Add(1075234, $"{commonSongs}"); // ~1_NUMBER~ Common Tracks } if (uncommonSongs > 0) { - list.Add(1075235, uncommonSongs.ToString()); // ~1_NUMBER~ Uncommon Tracks + list.Add(1075235, $"{uncommonSongs}"); // ~1_NUMBER~ Uncommon Tracks } if (rareSongs > 0) { - list.Add(1075236, rareSongs.ToString()); // ~1_NUMBER~ Rare Tracks + list.Add(1075236, $"{rareSongs}"); // ~1_NUMBER~ Rare Tracks } } diff --git a/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs b/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs index 502673f23..85105db91 100644 --- a/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs +++ b/Projects/UOContent/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs @@ -32,7 +32,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public MusicName Music { get; set; } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var info = DawnsMusicBox.GetInfo(Music); diff --git a/Projects/UOContent/Items/Special/8th Anniversary Items/FountainOfLife.cs b/Projects/UOContent/Items/Special/8th Anniversary Items/FountainOfLife.cs index a6e2d7e86..8ffa9aaf1 100644 --- a/Projects/UOContent/Items/Special/8th Anniversary Items/FountainOfLife.cs +++ b/Projects/UOContent/Items/Special/8th Anniversary Items/FountainOfLife.cs @@ -20,7 +20,7 @@ namespace Server.Items public override bool Dye(Mobile from, DyeTub sender) => false; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); @@ -121,11 +121,11 @@ namespace Server.Items return false; } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); - list.Add(1075217, m_Charges.ToString()); // ~1_val~ charges remaining + list.Add(1075217, $"{m_Charges}"); // ~1_val~ charges remaining } public override void OnDelete() diff --git a/Projects/UOContent/Items/Special/8th Anniversary Items/Talismans.cs b/Projects/UOContent/Items/Special/8th Anniversary Items/Talismans.cs index 8a50d7b88..7c8e49129 100644 --- a/Projects/UOContent/Items/Special/8th Anniversary Items/Talismans.cs +++ b/Projects/UOContent/Items/Special/8th Anniversary Items/Talismans.cs @@ -27,7 +27,7 @@ namespace Server.Items public virtual TalismanForm Form => TalismanForm.Squirrel; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(1075200, $"#{(int)Form}"); } diff --git a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/AncientSmithyHammer.cs b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/AncientSmithyHammer.cs index 0a053bc94..b30e7b83d 100644 --- a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/AncientSmithyHammer.cs +++ b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/AncientSmithyHammer.cs @@ -73,13 +73,13 @@ namespace Server.Items m_SkillMod = null; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (m_Bonus != 0) { - list.Add(1060451, "#1042354\t{0}", m_Bonus.ToString()); // ~1_skillname~ +~2_val~ + list.Add(1060451, $"#1042354\t{m_Bonus}"); // ~1_skillname~ +~2_val~ } } diff --git a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs index e34c1f0ce..959aeca8c 100644 --- a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs +++ b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs @@ -196,13 +196,13 @@ namespace Server.Items m_SkillMod = null; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (m_Bonus != 0) { - list.Add(1062005, m_Bonus.ToString()); // mining bonus +~1_val~ + list.Add(1062005, $"{m_Bonus}"); // mining bonus +~1_val~ } } diff --git a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs index cb64a2583..c08ed66ae 100644 --- a/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs +++ b/Projects/UOContent/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs @@ -62,11 +62,11 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } public virtual void DisplayDurabilityTo(Mobile m) diff --git a/Projects/UOContent/Items/Special/Gifts/RoseOfTrinsic.cs b/Projects/UOContent/Items/Special/Gifts/RoseOfTrinsic.cs index 33bb6fd86..1fe6f266d 100644 --- a/Projects/UOContent/Items/Special/Gifts/RoseOfTrinsic.cs +++ b/Projects/UOContent/Items/Special/Gifts/RoseOfTrinsic.cs @@ -65,11 +65,11 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public SecureLevel Level { get; set; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1062925, Petals.ToString()); // Petals: ~1_COUNT~ + list.Add(1062925, $"{Petals}"); // Petals: ~1_COUNT~ } public override void GetContextMenuEntries(Mobile from, List list) diff --git a/Projects/UOContent/Items/Special/HeritageToken.cs b/Projects/UOContent/Items/Special/HeritageToken.cs index 2f84d86c5..bf3273dc2 100644 --- a/Projects/UOContent/Items/Special/HeritageToken.cs +++ b/Projects/UOContent/Items/Special/HeritageToken.cs @@ -30,7 +30,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Holiday/Snowman.cs b/Projects/UOContent/Items/Special/Holiday/Snowman.cs index f94f8d02b..5033f162e 100644 --- a/Projects/UOContent/Items/Special/Holiday/Snowman.cs +++ b/Projects/UOContent/Items/Special/Holiday/Snowman.cs @@ -117,7 +117,7 @@ namespace Server.Items public static string GetRandomTitle() => titles.RandomElement(); - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleDeed.cs b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleDeed.cs index 92238b11a..5d9ccd8dd 100644 --- a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleDeed.cs +++ b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleDeed.cs @@ -85,19 +85,18 @@ namespace Server.Items public bool ValidLocation() => m_PlotLocation != Point3D.Zero && m_Facet != null && m_Facet != Map.Internal; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (ValidLocation()) { list.Add( - 1060658, - "location\t{0}", - HouseRaffleStone.FormatLocation(m_PlotLocation, m_Facet, false) - ); // ~1_val~: ~2_val~ - list.Add(1060659, "facet\t{0}", m_Facet); // ~1_val~: ~2_val~ - list.Add(1150486); // [Marked Item] + 1060658, // ~1_val~: ~2_val~ + $"location\t{HouseRaffleStone.FormatLocation(m_PlotLocation, m_Facet, false)}" + ); + list.Add(1060659, $"facet\t{m_Facet}"); // ~1_val~: ~2_val~ + list.Add(1150486); // [Marked Item] } if (IsExpired) diff --git a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs index 248b24751..57f76efa7 100644 --- a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs +++ b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs @@ -398,7 +398,7 @@ namespace Server.Items public string FormatPrice() => m_TicketPrice == 0 ? "FREE" : $"{m_TicketPrice} gold"; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -411,13 +411,13 @@ namespace Server.Items { case HouseRaffleState.Active: { - list.Add(1060658, "ticket price\t{0}", FormatPrice()); // ~1_val~: ~2_val~ - list.Add(1060659, "ends\t{0}", m_Started + m_Duration); // ~1_val~: ~2_val~ + list.Add(1060658, $"ticket price\t{FormatPrice()}"); // ~1_val~: ~2_val~ + list.Add(1060659, $"ends\t{m_Started + m_Duration}"); // ~1_val~: ~2_val~ break; } case HouseRaffleState.Completed: { - list.Add(1060658, "winner\t{0}", m_Winner == null ? "unknown" : m_Winner.Name); // ~1_val~: ~2_val~ + list.Add(1060658, $"winner\t{m_Winner?.Name ?? "Unknown"}"); // ~1_val~: ~2_val~ break; } } @@ -438,9 +438,9 @@ namespace Server.Items { LabelTo( from, - 1060658, - $"Winner\t{(m_Winner == null ? "Unknown" : m_Winner.Name)}" - ); // ~1_val~: ~2_val~ + 1060658, // ~1_val~: ~2_val~ + $"Winner\t{m_Winner?.Name ?? "Unknown"}" + ); break; } } diff --git a/Projects/UOContent/Items/Special/MiniHouses.cs b/Projects/UOContent/Items/Special/MiniHouses.cs index 651f6d3f3..cf18f61d4 100644 --- a/Projects/UOContent/Items/Special/MiniHouses.cs +++ b/Projects/UOContent/Items/Special/MiniHouses.cs @@ -115,7 +115,7 @@ namespace Server.Items public override BaseAddon Addon => new MiniHouseAddon(m_Type); public override int LabelNumber => 1062096; // a mini house deed - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/MonsterStatuette.cs b/Projects/UOContent/Items/Special/MonsterStatuette.cs index 1767b0df0..ec7c8e887 100644 --- a/Projects/UOContent/Items/Special/MonsterStatuette.cs +++ b/Projects/UOContent/Items/Special/MonsterStatuette.cs @@ -227,7 +227,7 @@ namespace Server.Items base.OnMovement(m, oldLocation); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Rares/Containers/BaseWaterContainer.cs b/Projects/UOContent/Items/Special/Rares/Containers/BaseWaterContainer.cs index 9c353c6b5..6c427bb1c 100644 --- a/Projects/UOContent/Items/Special/Rares/Containers/BaseWaterContainer.cs +++ b/Projects/UOContent/Items/Special/Rares/Containers/BaseWaterContainer.cs @@ -101,7 +101,7 @@ } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { if (IsEmpty) { diff --git a/Projects/UOContent/Items/Special/Solen Items/BagOfSending.cs b/Projects/UOContent/Items/Special/Solen Items/BagOfSending.cs index 6deb51f52..710c31b94 100644 --- a/Projects/UOContent/Items/Special/Solen Items/BagOfSending.cs +++ b/Projects/UOContent/Items/Special/Solen Items/BagOfSending.cs @@ -102,11 +102,11 @@ namespace Server.Items }; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~ + list.Add(1060741, $"{m_Charges}"); // charges: ~1_val~ } public override void OnSingleClick(Mobile from) diff --git a/Projects/UOContent/Items/Special/Solen Items/BallOfSummoning.cs b/Projects/UOContent/Items/Special/Solen Items/BallOfSummoning.cs index 9f21565a7..ecc6bf688 100644 --- a/Projects/UOContent/Items/Special/Solen Items/BallOfSummoning.cs +++ b/Projects/UOContent/Items/Special/Solen Items/BallOfSummoning.cs @@ -85,7 +85,7 @@ namespace Server.Items public string TranslocationItemName => "crystal ball of pet summoning"; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add( 1054131, diff --git a/Projects/UOContent/Items/Special/Solen Items/BraceletOfBinding.cs b/Projects/UOContent/Items/Special/Solen Items/BraceletOfBinding.cs index 8cd5832cf..8bec81198 100644 --- a/Projects/UOContent/Items/Special/Solen Items/BraceletOfBinding.cs +++ b/Projects/UOContent/Items/Special/Solen Items/BraceletOfBinding.cs @@ -89,7 +89,7 @@ namespace Server.Items public string TranslocationItemName => "bracelet of binding"; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add( 1054000, diff --git a/Projects/UOContent/Items/Special/SoulStone.cs b/Projects/UOContent/Items/Special/SoulStone.cs index 15ffc2862..08c1dabb3 100644 --- a/Projects/UOContent/Items/Special/SoulStone.cs +++ b/Projects/UOContent/Items/Special/SoulStone.cs @@ -121,21 +121,19 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public SecureLevel Level { get; set; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); if (!IsEmpty) { list.Add( - 1070721, - "#{0}\t{1:F1}", - AosSkillBonuses.GetLabel(Skill), - SkillValue - ); // Skill stored: ~1_skillname~ ~2_skillamount~ + 1070721, // Skill stored: ~1_skillname~ ~2_skillamount~ + $"#{AosSkillBonuses.GetLabel(Skill)}\t{SkillValue:F1}" + ); } - list.Add(1041602, "{0}", LastUserName ?? $"#{1074235}"); // Owner: ~1_val~ + list.Add(1041602, LastUserName ?? $"#{1074235}"); // Owner: ~1_val~ } private static bool CheckCombat(Mobile m, TimeSpan time) @@ -966,11 +964,11 @@ namespace Server.Items set { } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } public override void Serialize(IGenericWriter writer) @@ -1094,7 +1092,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Special Scrolls/PowerScroll.cs b/Projects/UOContent/Items/Special/Special Scrolls/PowerScroll.cs index 1dd35b8f3..e15007091 100644 --- a/Projects/UOContent/Items/Special/Special Scrolls/PowerScroll.cs +++ b/Projects/UOContent/Items/Special/Special Scrolls/PowerScroll.cs @@ -160,7 +160,7 @@ namespace Server.Items return new PowerScroll(skillName, 100 + Utility.RandomMinMax(min, max) * 5); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var level = (Value - 105.0) / 5.0; @@ -175,7 +175,7 @@ namespace Server.Items } else { - list.Add("a power scroll of {0} ({1} Skill)", GetName(), Value); + list.Add($"a power scroll of {GetName()} ({Value} Skill)"); } } @@ -189,7 +189,7 @@ namespace Server.Items } else { - LabelTo(from, "a power scroll of {0} ({1} Skill)", GetName(), Value); + LabelTo(from, $"a power scroll of {GetName()} ({Value} Skill)"); } } diff --git a/Projects/UOContent/Items/Special/Special Scrolls/ScrollofAlacrity.cs b/Projects/UOContent/Items/Special/Special Scrolls/ScrollofAlacrity.cs index d6b5453c6..39e346c7f 100644 --- a/Projects/UOContent/Items/Special/Special Scrolls/ScrollofAlacrity.cs +++ b/Projects/UOContent/Items/Special/Special Scrolls/ScrollofAlacrity.cs @@ -29,11 +29,11 @@ namespace Server.Items public override string DefaultTitle => "Scroll of Alacrity:"; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1071345, "{0} 15 Minutes", GetName()); // Skill: ~1_val~ + list.Add(1071345, $"{GetName()} 15 Minutes"); // Skill: ~1_val~ } public override bool CanUse(Mobile from) diff --git a/Projects/UOContent/Items/Special/Special Scrolls/ScrollofTranscendence.cs b/Projects/UOContent/Items/Special/Special Scrolls/ScrollofTranscendence.cs index 80f44cc3e..e013aa399 100644 --- a/Projects/UOContent/Items/Special/Special Scrolls/ScrollofTranscendence.cs +++ b/Projects/UOContent/Items/Special/Special Scrolls/ScrollofTranscendence.cs @@ -32,7 +32,7 @@ namespace Server.Items public static ScrollofTranscendence CreateRandom(int min, int max) => new(Utility.RandomSkill(), Utility.RandomMinMax(min, max) * 0.1); - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); list.Add(1076759, $"{GetName()}\t{Value:0.#} Skill Points"); diff --git a/Projects/UOContent/Items/Special/Special Scrolls/StatScroll.cs b/Projects/UOContent/Items/Special/Special Scrolls/StatScroll.cs index eabd749db..2b16cf501 100644 --- a/Projects/UOContent/Items/Special/Special Scrolls/StatScroll.cs +++ b/Projects/UOContent/Items/Special/Special Scrolls/StatScroll.cs @@ -43,7 +43,7 @@ namespace Server.Items public override string DefaultTitle => $"Power Scroll ({((int)Value - 225 >= 0 ? "+" : "")}{(int)Value - 225} Maximum Stats):"; - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var level = ((int)Value - 230) / 5; @@ -59,7 +59,8 @@ namespace Server.Items } else { - list.Add("a scroll of power ({0}{1} Maximum Stats)", Value - 225 >= 0 ? "+" : "", Value - 225); + var diff = Value - 225; + list.Add($"a scroll of power ({(diff >= 0 ? "+" : "")}{diff} Maximum Stats)"); } } @@ -73,7 +74,8 @@ namespace Server.Items } else { - LabelTo(from, "a scroll of power ({0}{1} Maximum Stats)", Value - 225 >= 0 ? "+" : "", Value - 225); + var diff = Value - 225; + LabelTo(from, $"a scroll of power ({(diff >= 0 ? "+" : "")}{diff} Maximum Stats)"); } } diff --git a/Projects/UOContent/Items/Special/Valentines/2007/ValentinesCard.cs b/Projects/UOContent/Items/Special/Valentines/2007/ValentinesCard.cs index 7e851da24..27dff00b5 100644 --- a/Projects/UOContent/Items/Special/Valentines/2007/ValentinesCard.cs +++ b/Projects/UOContent/Items/Special/Valentines/2007/ValentinesCard.cs @@ -52,7 +52,7 @@ namespace Server.Items * */ - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(m_LabelNumber, $"{m_To ?? Unsigned}\t{m_From ?? Unsigned}"); } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs b/Projects/UOContent/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs index 1bd7ce1bc..ff7b6527a 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs @@ -338,7 +338,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs index f102d7441..6cf4d1125 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs @@ -74,7 +74,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -155,7 +155,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/BloodyPentagram.cs b/Projects/UOContent/Items/Special/Veteran Rewards/BloodyPentagram.cs index be9f47b1d..5d5e420db 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/BloodyPentagram.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/BloodyPentagram.cs @@ -168,7 +168,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Brazier.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Brazier.cs index ad6232377..31086b084 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Brazier.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Brazier.cs @@ -107,7 +107,7 @@ namespace Server.Items m_Fire?.MoveToWorld(new Point3D(X, Y, Z + ItemData.Height), Map); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -184,7 +184,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Cannon.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Cannon.cs index 4f55b12a1..50034e814 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Cannon.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Cannon.cs @@ -16,7 +16,7 @@ namespace Server.Items public override int LabelNumber => 1076157; // Decorative Cannon - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -27,7 +27,7 @@ namespace Server.Items list.Add(1076223); // 7th Year Veteran Reward } - list.Add(1076207, addon.Charges.ToString()); // Remaining Charges: ~1_val~ + list.Add(1076207, $"{addon.Charges}"); // Remaining Charges: ~1_val~ } } @@ -462,7 +462,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -471,7 +471,7 @@ namespace Server.Items list.Add(1076223); // 7th Year Veteran Reward } - list.Add(1076207, m_Charges.ToString()); // Remaining Charges: ~1_val~ + list.Add(1076207, $"{m_Charges}"); // Remaining Charges: ~1_val~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/CommodityDeedBox.cs b/Projects/UOContent/Items/Special/Veteran Rewards/CommodityDeedBox.cs index a9d99e5a0..8496a9ed4 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/CommodityDeedBox.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/CommodityDeedBox.cs @@ -32,7 +32,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/ContestMiniHouse.cs b/Projects/UOContent/Items/Special/Veteran Rewards/ContestMiniHouse.cs index 753ae19ec..e978d9956 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/ContestMiniHouse.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/ContestMiniHouse.cs @@ -111,7 +111,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs b/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs index 71f5da8f8..dfebe6dfa 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs @@ -59,7 +59,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -140,7 +140,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs b/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs index 5e1752e6a..fdc58513b 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs @@ -73,7 +73,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -154,7 +154,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs index b46114ff2..b1f53b2ac 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs @@ -73,7 +73,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -154,7 +154,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/MiningCart.cs b/Projects/UOContent/Items/Special/Veteran Rewards/MiningCart.cs index 0cb2917e8..116d7f54e 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/MiningCart.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/MiningCart.cs @@ -359,7 +359,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/MinotaurStatue.cs b/Projects/UOContent/Items/Special/Veteran Rewards/MinotaurStatue.cs index 3e8129b20..9cf8086a0 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/MinotaurStatue.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/MinotaurStatue.cs @@ -160,7 +160,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/PottedCactus.cs b/Projects/UOContent/Items/Special/Veteran Rewards/PottedCactus.cs index 80647576c..1c9ac09cb 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/PottedCactus.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/PottedCactus.cs @@ -102,7 +102,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs index 33aa414b7..bde1d8e2f 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs @@ -15,7 +15,7 @@ namespace Server.Items public override bool ForceShowProperties => ObjectPropertyList.Enabled; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -90,7 +90,7 @@ namespace Server.Items from.SendLocalizedMessage(500489); // You can't use an axe on that. } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -202,7 +202,7 @@ namespace Server.Items base.OnDoubleClick(m); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/TreeStump.cs b/Projects/UOContent/Items/Special/Veteran Rewards/TreeStump.cs index c9c32ede4..01bef3ce5 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/TreeStump.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/TreeStump.cs @@ -250,7 +250,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/WallBanner.cs b/Projects/UOContent/Items/Special/Veteran Rewards/WallBanner.cs index cced8f9cb..132b9ae39 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/WallBanner.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/WallBanner.cs @@ -302,7 +302,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/WeaponEngravingTool.cs b/Projects/UOContent/Items/Special/Veteran Rewards/WeaponEngravingTool.cs index a9603d6af..14dacdb02 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/WeaponEngravingTool.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/WeaponEngravingTool.cs @@ -99,7 +99,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -110,7 +110,7 @@ namespace Server.Items if (ShowUsesRemaining) { - list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{m_UsesRemaining}"); // uses remaining: ~1_val~ } } diff --git a/Projects/UOContent/Items/Talismans/BaseTalisman.cs b/Projects/UOContent/Items/Talismans/BaseTalisman.cs index fe338037f..5b0ffe5b0 100644 --- a/Projects/UOContent/Items/Talismans/BaseTalisman.cs +++ b/Projects/UOContent/Items/Talismans/BaseTalisman.cs @@ -549,7 +549,7 @@ namespace Server.Items } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (ForceShowName) { @@ -572,7 +572,7 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -595,7 +595,7 @@ namespace Server.Items { if (m_ChargeTime > 0) { - list.Add(1074884, m_ChargeTime.ToString()); // Charge time left: ~1_val~ + list.Add(1074884, $"{m_ChargeTime}"); // Charge time left: ~1_val~ } else { @@ -608,41 +608,33 @@ namespace Server.Items if (m_Killer?.IsEmpty == false && m_Killer.Amount > 0) { list.Add( - 1072388, - "{0}\t{1}", - m_Killer.Name?.ToString() ?? "Unknown", - m_Killer.Amount - ); // ~1_NAME~ Killer: +~2_val~% + 1072388, // ~1_NAME~ Killer: +~2_val~% + $"{m_Killer.Name ?? "Unknown"}\t{m_Killer.Amount}" + ); } if (m_Protection?.IsEmpty == false && m_Protection.Amount > 0) { list.Add( - 1072387, - "{0}\t{1}", - m_Protection.Name?.ToString() ?? "Unknown", - m_Protection.Amount - ); // ~1_NAME~ Protection: +~2_val~% + 1072387, // ~1_NAME~ Protection: +~2_val~% + $"{m_Protection.Name ?? "Unknown"}\t{m_Protection.Amount}" + ); } if (m_ExceptionalBonus != 0) { list.Add( - 1072395, - "#{0}\t{1}", - AosSkillBonuses.GetLabel(m_Skill), - m_ExceptionalBonus - ); // ~1_NAME~ Exceptional Bonus: ~2_val~% + 1072395, // ~1_NAME~ Exceptional Bonus: ~2_val~% + $"#{AosSkillBonuses.GetLabel(m_Skill)}\t{m_ExceptionalBonus}" + ); } if (m_SuccessBonus != 0) { list.Add( - 1072394, - "#{0}\t{1}", - AosSkillBonuses.GetLabel(m_Skill), - m_SuccessBonus - ); // ~1_NAME~ Bonus: ~2_val~% + 1072394, // ~1_NAME~ Bonus: ~2_val~% + $"#{AosSkillBonuses.GetLabel(m_Skill)}\t{m_SuccessBonus}" + ); } SkillBonuses.GetProperties(list); @@ -651,72 +643,72 @@ namespace Server.Items if ((prop = Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -726,17 +718,17 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -746,32 +738,32 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } if (m_MaxCharges > 0) { - list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~ + list.Add(1060741, $"{m_Charges}"); // charges: ~1_val~ } if (m_Slayer != TalismanSlayerName.None) diff --git a/Projects/UOContent/Items/Wands/BaseWand.cs b/Projects/UOContent/Items/Wands/BaseWand.cs index 7d404413f..0549b7a6c 100644 --- a/Projects/UOContent/Items/Wands/BaseWand.cs +++ b/Projects/UOContent/Items/Wands/BaseWand.cs @@ -123,44 +123,44 @@ namespace Server.Items _charges = reader.ReadInt(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); switch (_wandEffect) { case WandEffect.Clumsiness: - list.Add(1017326, _charges.ToString()); + list.Add(1017326, $"{_charges}"); break; // clumsiness charges: ~1_val~ case WandEffect.Identification: - list.Add(1017350, _charges.ToString()); + list.Add(1017350, $"{_charges}"); break; // identification charges: ~1_val~ case WandEffect.Healing: - list.Add(1017329, _charges.ToString()); + list.Add(1017329, $"{_charges}"); break; // healing charges: ~1_val~ case WandEffect.Feeblemindedness: - list.Add(1017327, _charges.ToString()); + list.Add(1017327, $"{_charges}"); break; // feeblemind charges: ~1_val~ case WandEffect.Weakness: - list.Add(1017328, _charges.ToString()); + list.Add(1017328, $"{_charges}"); break; // weakness charges: ~1_val~ case WandEffect.MagicArrow: - list.Add(1060492, _charges.ToString()); + list.Add(1060492, $"{_charges}"); break; // magic arrow charges: ~1_val~ case WandEffect.Harming: - list.Add(1017334, _charges.ToString()); + list.Add(1017334, $"{_charges}"); break; // harm charges: ~1_val~ case WandEffect.Fireball: - list.Add(1060487, _charges.ToString()); + list.Add(1060487, $"{_charges}"); break; // fireball charges: ~1_val~ case WandEffect.GreaterHealing: - list.Add(1017330, _charges.ToString()); + list.Add(1017330, $"{_charges}"); break; // greater healing charges: ~1_val~ case WandEffect.Lightning: - list.Add(1060491, _charges.ToString()); + list.Add(1060491, $"{_charges}"); break; // lightning charges: ~1_val~ case WandEffect.ManaDraining: - list.Add(1017339, _charges.ToString()); + list.Add(1017339, $"{_charges}"); break; // mana drain charges: ~1_val~ } } diff --git a/Projects/UOContent/Items/Weapons/BaseWeapon.cs b/Projects/UOContent/Items/Weapons/BaseWeapon.cs index ad0bf9863..a89e8e7c0 100644 --- a/Projects/UOContent/Items/Weapons/BaseWeapon.cs +++ b/Projects/UOContent/Items/Weapons/BaseWeapon.cs @@ -2716,8 +2716,6 @@ namespace Server.Items from.Animate(action, 7, 1, true, false, 0); } - private string GetNameString() => Name ?? $"#{LabelNumber}"; - public int GetElementalDamageHue() { GetDamageTypes(null, out _, out var fire, out var cold, out var pois, out var nrgy, out _, out _); @@ -2752,7 +2750,7 @@ namespace Server.Items return hue; } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { var oreType = m_Resource switch { @@ -2776,17 +2774,19 @@ namespace Server.Items _ => 0 }; + var name = Name; + if (oreType != 0) { - list.Add(1053099, "#{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~ + list.Add(1053099, name != null ? $"#{oreType}\t{name}" : $"#{oreType}\t#{LabelNumber}"); // ~1_oretype~ ~2_armortype~ } - else if (Name == null) + else if (name == null) { list.Add(LabelNumber); } else { - list.Add(Name); + list.Add(name); } /* @@ -2815,7 +2815,7 @@ namespace Server.Items public virtual int GetLuckBonus() => CraftResources.GetInfo(m_Resource)?.AttributeInfo?.WeaponLuck ?? 0; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -2848,12 +2848,12 @@ namespace Server.Items if (ArtifactRarity > 0) { - list.Add(1061078, ArtifactRarity.ToString()); // artifact rarity ~1_val~ + list.Add(1061078, $"{ArtifactRarity}"); // artifact rarity ~1_val~ } if (this is IUsesRemaining usesRemaining && usesRemaining.ShowUsesRemaining) { - list.Add(1060584, usesRemaining.UsesRemaining.ToString()); // uses remaining: ~1_val~ + list.Add(1060584, $"{usesRemaining.UsesRemaining}"); // uses remaining: ~1_val~ } if (m_Poison != null && m_PoisonCharges > 0) @@ -2897,107 +2897,107 @@ namespace Server.Items if ((prop = GetDamageBonus() + Attributes.WeaponDamage) != 0) { - list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + list.Add(1060401, $"{prop}"); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { - list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + list.Add(1060408, $"{prop}"); // defense chance increase ~1_val~% } if ((prop = Attributes.EnhancePotions) != 0) { - list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + list.Add(1060411, $"{prop}"); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { - list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + list.Add(1060412, $"{prop}"); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { - list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + list.Add(1060413, $"{prop}"); // faster casting ~1_val~ } if ((prop = GetHitChanceBonus() + Attributes.AttackChance) != 0) { - list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + list.Add(1060415, $"{prop}"); // hit chance increase ~1_val~% } if ((prop = WeaponAttributes.HitColdArea) != 0) { - list.Add(1060416, prop.ToString()); // hit cold area ~1_val~% + list.Add(1060416, $"{prop}"); // hit cold area ~1_val~% } if ((prop = WeaponAttributes.HitDispel) != 0) { - list.Add(1060417, prop.ToString()); // hit dispel ~1_val~% + list.Add(1060417, $"{prop}"); // hit dispel ~1_val~% } if ((prop = WeaponAttributes.HitEnergyArea) != 0) { - list.Add(1060418, prop.ToString()); // hit energy area ~1_val~% + list.Add(1060418, $"{prop}"); // hit energy area ~1_val~% } if ((prop = WeaponAttributes.HitFireArea) != 0) { - list.Add(1060419, prop.ToString()); // hit fire area ~1_val~% + list.Add(1060419, $"{prop}"); // hit fire area ~1_val~% } if ((prop = WeaponAttributes.HitFireball) != 0) { - list.Add(1060420, prop.ToString()); // hit fireball ~1_val~% + list.Add(1060420, $"{prop}"); // hit fireball ~1_val~% } if ((prop = WeaponAttributes.HitHarm) != 0) { - list.Add(1060421, prop.ToString()); // hit harm ~1_val~% + list.Add(1060421, $"{prop}"); // hit harm ~1_val~% } if ((prop = WeaponAttributes.HitLeechHits) != 0) { - list.Add(1060422, prop.ToString()); // hit life leech ~1_val~% + list.Add(1060422, $"{prop}"); // hit life leech ~1_val~% } if ((prop = WeaponAttributes.HitLightning) != 0) { - list.Add(1060423, prop.ToString()); // hit lightning ~1_val~% + list.Add(1060423, $"{prop}"); // hit lightning ~1_val~% } if ((prop = WeaponAttributes.HitLowerAttack) != 0) { - list.Add(1060424, prop.ToString()); // hit lower attack ~1_val~% + list.Add(1060424, $"{prop}"); // hit lower attack ~1_val~% } if ((prop = WeaponAttributes.HitLowerDefend) != 0) { - list.Add(1060425, prop.ToString()); // hit lower defense ~1_val~% + list.Add(1060425, $"{prop}"); // hit lower defense ~1_val~% } if ((prop = WeaponAttributes.HitMagicArrow) != 0) { - list.Add(1060426, prop.ToString()); // hit magic arrow ~1_val~% + list.Add(1060426, $"{prop}"); // hit magic arrow ~1_val~% } if ((prop = WeaponAttributes.HitLeechMana) != 0) { - list.Add(1060427, prop.ToString()); // hit mana leech ~1_val~% + list.Add(1060427, $"{prop}"); // hit mana leech ~1_val~% } if ((prop = WeaponAttributes.HitPhysicalArea) != 0) { - list.Add(1060428, prop.ToString()); // hit physical area ~1_val~% + list.Add(1060428, $"{prop}"); // hit physical area ~1_val~% } if ((prop = WeaponAttributes.HitPoisonArea) != 0) { - list.Add(1060429, prop.ToString()); // hit poison area ~1_val~% + list.Add(1060429, $"{prop}"); // hit poison area ~1_val~% } if ((prop = WeaponAttributes.HitLeechStam) != 0) { - list.Add(1060430, prop.ToString()); // hit stamina leech ~1_val~% + list.Add(1060430, $"{prop}"); // hit stamina leech ~1_val~% } if (ImmolatingWeaponSpell.IsImmolating(this)) @@ -3007,42 +3007,42 @@ namespace Server.Items if (Core.ML && (ranged?.Velocity ?? 0) != 0) { - list.Add(1072793, prop.ToString()); // Velocity ~1_val~% + list.Add(1072793, $"{prop}"); // Velocity ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { - list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + list.Add(1060409, $"{prop}"); // dexterity bonus ~1_val~ } if ((prop = Attributes.BonusHits) != 0) { - list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + list.Add(1060431, $"{prop}"); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { - list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + list.Add(1060432, $"{prop}"); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { - list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + list.Add(1060433, $"{prop}"); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { - list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + list.Add(1060434, $"{prop}"); // lower reagent cost ~1_val~% } if ((prop = GetLowerStatReq()) != 0) { - list.Add(1060435, prop.ToString()); // lower requirements ~1_val~% + list.Add(1060435, $"{prop}"); // lower requirements ~1_val~% } if ((prop = GetLuckBonus() + Attributes.Luck) != 0) { - list.Add(1060436, prop.ToString()); // luck ~1_val~ + list.Add(1060436, $"{prop}"); // luck ~1_val~ } if ((prop = WeaponAttributes.MageWeapon) != 0) @@ -3052,12 +3052,12 @@ namespace Server.Items if ((prop = Attributes.BonusMana) != 0) { - list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + list.Add(1060439, $"{prop}"); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { - list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + list.Add(1060440, $"{prop}"); // mana regeneration ~1_val~ } if (Attributes.NightSight != 0) @@ -3067,22 +3067,22 @@ namespace Server.Items if ((prop = Attributes.ReflectPhysical) != 0) { - list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + list.Add(1060442, $"{prop}"); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { - list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + list.Add(1060443, $"{prop}"); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { - list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + list.Add(1060444, $"{prop}"); // hit point regeneration ~1_val~ } if ((prop = WeaponAttributes.SelfRepair) != 0) { - list.Add(1060450, prop.ToString()); // self repair ~1_val~ + list.Add(1060450, $"{prop}"); // self repair ~1_val~ } if (Attributes.SpellChanneling != 0) @@ -3092,27 +3092,27 @@ namespace Server.Items if ((prop = Attributes.SpellDamage) != 0) { - list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + list.Add(1060483, $"{prop}"); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { - list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + list.Add(1060484, $"{prop}"); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { - list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{prop}"); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { - list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + list.Add(1060486, $"{prop}"); // swing speed increase ~1_val~% } if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0) { - list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% + list.Add(1075210, $"{prop}"); // Increased Karma Loss ~1val~% } GetDamageTypes( @@ -3128,40 +3128,40 @@ namespace Server.Items if (phys != 0) { - list.Add(1060403, phys.ToString()); // physical damage ~1_val~% + list.Add(1060403, $"{phys}"); // physical damage ~1_val~% } if (fire != 0) { - list.Add(1060405, fire.ToString()); // fire damage ~1_val~% + list.Add(1060405, $"{fire}"); // fire damage ~1_val~% } if (cold != 0) { - list.Add(1060404, cold.ToString()); // cold damage ~1_val~% + list.Add(1060404, $"{cold}"); // cold damage ~1_val~% } if (pois != 0) { - list.Add(1060406, pois.ToString()); // poison damage ~1_val~% + list.Add(1060406, $"{pois}"); // poison damage ~1_val~% } if (nrgy != 0) { - list.Add(1060407, nrgy.ToString()); // energy damage ~1_val + list.Add(1060407, $"{nrgy}"); // energy damage ~1_val } if (Core.ML && chaos != 0) { - list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~% + list.Add(1072846, $"{chaos}"); // chaos damage ~1_val~% } if (Core.ML && direct != 0) { - list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~% + list.Add(1079978, $"{direct}"); // Direct Damage: ~1_PERCENT~% } - list.Add(1061168, "{0}\t{1}", MinDamage.ToString(), MaxDamage.ToString()); // weapon damage ~1_val~ - ~2_val~ + list.Add(1061168, $"{MinDamage}\t{MaxDamage}"); // weapon damage ~1_val~ - ~2_val~ if (Core.ML) { @@ -3169,19 +3169,19 @@ namespace Server.Items } else { - list.Add(1061167, Speed.ToString()); + list.Add(1061167, $"{Speed}"); } if (MaxRange > 1) { - list.Add(1061169, MaxRange.ToString()); // range ~1_val~ + list.Add(1061169, $"{MaxRange}"); // range ~1_val~ } var strReq = AOS.Scale(StrRequirement, 100 - GetLowerStatReq()); if (strReq > 0) { - list.Add(1061170, strReq.ToString()); // strength requirement ~1_val~ + list.Add(1061170, $"{strReq}"); // strength requirement ~1_val~ } if (Layer == Layer.TwoHanded) @@ -3222,7 +3222,7 @@ namespace Server.Items if (m_Hits >= 0 && m_MaxHits > 0) { - list.Add(1060639, "{0}\t{1}", m_Hits, m_MaxHits); // durability ~1_val~ / ~2_val~ + list.Add(1060639, $"{m_Hits}\t{m_MaxHits}"); // durability ~1_val~ / ~2_val~ } } diff --git a/Projects/UOContent/Items/Weapons/ML Weapons/ButchersWarCleaver.cs b/Projects/UOContent/Items/Weapons/ML Weapons/ButchersWarCleaver.cs index 30ccfb29b..13cb86c65 100644 --- a/Projects/UOContent/Items/Weapons/ML Weapons/ButchersWarCleaver.cs +++ b/Projects/UOContent/Items/Weapons/ML Weapons/ButchersWarCleaver.cs @@ -12,7 +12,7 @@ namespace Server.Items public override int LabelNumber => 1073526; // butcher's war cleaver - public override void AppendChildNameProperties(ObjectPropertyList list) + public override void AppendChildNameProperties(IPropertyList list) { base.AppendChildNameProperties(list); diff --git a/Projects/UOContent/Items/Weapons/Maces/FireworksWand.cs b/Projects/UOContent/Items/Weapons/Maces/FireworksWand.cs index 916a5a6be..c28b20f8f 100644 --- a/Projects/UOContent/Items/Weapons/Maces/FireworksWand.cs +++ b/Projects/UOContent/Items/Weapons/Maces/FireworksWand.cs @@ -20,11 +20,11 @@ namespace Server.Items public override int LabelNumber => 1041424; // a fireworks wand - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); - list.Add(1060741, _charges.ToString()); // charges: ~1_val~ + list.Add(1060741, $"{_charges}"); // charges: ~1_val~ } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Misc/AOS.cs b/Projects/UOContent/Misc/AOS.cs index 79e49c57b..527c46d8d 100644 --- a/Projects/UOContent/Misc/AOS.cs +++ b/Projects/UOContent/Misc/AOS.cs @@ -1035,13 +1035,13 @@ namespace Server set => SetSkill(4, value); } - public void GetProperties(ObjectPropertyList list) + public void GetProperties(IPropertyList list) { for (var i = 0; i < 5; ++i) { if (GetValues(i, out var skill, out var bonus)) { - list.Add(1060451 + i, "#{0}\t{1}", GetLabel(skill), bonus); + list.Add(1060451 + i, $"#{GetLabel(skill)}\t{bonus}"); } } } @@ -1459,7 +1459,7 @@ namespace Server } } - if (Owner.Parent is Mobile m) + if (Owner?.Parent is Mobile m) { m.CheckStatTimers(); m.UpdateResistances(); @@ -1475,7 +1475,7 @@ namespace Server } } - Owner.InvalidateProperties(); + Owner?.InvalidateProperties(); } private int GetIndex(uint mask) diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/DecorativeTopiary.cs b/Projects/UOContent/Misc/Gifts/Winter2004/DecorativeTopiary.cs index 3e7f3c02b..22862e652 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/DecorativeTopiary.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/DecorativeTopiary.cs @@ -20,7 +20,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/FestiveCactus.cs b/Projects/UOContent/Misc/Gifts/Winter2004/FestiveCactus.cs index e347b2ada..ff92515af 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/FestiveCactus.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/FestiveCactus.cs @@ -20,7 +20,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/LightOfTheWinterSolstice.cs b/Projects/UOContent/Misc/Gifts/Winter2004/LightOfTheWinterSolstice.cs index 8103c7c00..c65cf69d4 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/LightOfTheWinterSolstice.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/LightOfTheWinterSolstice.cs @@ -49,7 +49,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/Mistletoe.cs b/Projects/UOContent/Misc/Gifts/Winter2004/Mistletoe.cs index 004f2fb43..67645e105 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/Mistletoe.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/Mistletoe.cs @@ -202,7 +202,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs b/Projects/UOContent/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs index 69e09d85a..47335b9d5 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs @@ -47,7 +47,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/Gifts/Winter2004/SnowyTree.cs b/Projects/UOContent/Misc/Gifts/Winter2004/SnowyTree.cs index c9c038acc..329240a50 100644 --- a/Projects/UOContent/Misc/Gifts/Winter2004/SnowyTree.cs +++ b/Projects/UOContent/Misc/Gifts/Winter2004/SnowyTree.cs @@ -20,7 +20,7 @@ namespace Server.Items LabelTo(from, 1070880); // Winter 2004 } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Misc/TextDefinition.cs b/Projects/UOContent/Misc/TextDefinition.cs index 8fbb4407c..97d71507b 100644 --- a/Projects/UOContent/Misc/TextDefinition.cs +++ b/Projects/UOContent/Misc/TextDefinition.cs @@ -66,7 +66,7 @@ namespace Server }; } - public static void AddTo(ObjectPropertyList list, TextDefinition def) + public static void AddTo(IPropertyList list, TextDefinition def) { if (def == null) { diff --git a/Projects/UOContent/Mobiles/AI/BaseAI.cs b/Projects/UOContent/Mobiles/AI/BaseAI.cs index 4b8a4772a..d5a5b5466 100644 --- a/Projects/UOContent/Mobiles/AI/BaseAI.cs +++ b/Projects/UOContent/Mobiles/AI/BaseAI.cs @@ -2861,7 +2861,7 @@ namespace Server.Mobiles Delete(); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs b/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs index 83edbf3e2..079736046 100644 --- a/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs +++ b/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs @@ -128,7 +128,7 @@ namespace Server.Mobiles [CommandProperty(AccessLevel.GameMaster)] public bool IsRewardItem { get; set; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Mobiles/Animals/Mounts/SwampDragon.cs b/Projects/UOContent/Mobiles/Animals/Mounts/SwampDragon.cs index 64671c8d5..984e8bedf 100644 --- a/Projects/UOContent/Mobiles/Animals/Mounts/SwampDragon.cs +++ b/Projects/UOContent/Mobiles/Animals/Mounts/SwampDragon.cs @@ -152,7 +152,7 @@ namespace Server.Mobiles public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Mobiles/BaseCreature.cs b/Projects/UOContent/Mobiles/BaseCreature.cs index 602955362..f0d7a5c77 100644 --- a/Projects/UOContent/Mobiles/BaseCreature.cs +++ b/Projects/UOContent/Mobiles/BaseCreature.cs @@ -2784,7 +2784,7 @@ namespace Server.Mobiles base.OnDoubleClick(from); } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs b/Projects/UOContent/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs index 2a09bf7b9..3bf779bc5 100644 --- a/Projects/UOContent/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs +++ b/Projects/UOContent/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs @@ -219,7 +219,7 @@ namespace Server.Mobiles PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1060768, from.NetState); // enraged } - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); list.Add(1060768); // enraged diff --git a/Projects/UOContent/Mobiles/PlayerMobile.cs b/Projects/UOContent/Mobiles/PlayerMobile.cs index c8f0e000c..02648f607 100644 --- a/Projects/UOContent/Mobiles/PlayerMobile.cs +++ b/Projects/UOContent/Mobiles/PlayerMobile.cs @@ -3511,7 +3511,7 @@ namespace Server.Mobiles DisguiseTimers.RemoveTimer(this); } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -3531,32 +3531,26 @@ namespace Server.Mobiles { list.Add( 1042734, - "{0}\t{1}", - pl.Sheriff.Definition.FriendlyName, - faction.Definition.PropName + $"{pl.Sheriff.Definition.FriendlyName}\t{faction.Definition.PropName}" ); // The Sheriff of ~1_CITY~, ~2_FACTION_NAME~ } else if (pl.Finance != null) { list.Add( - 1042735, - "{0}\t{1}", - pl.Finance.Definition.FriendlyName, - faction.Definition.PropName - ); // The Finance Minister of ~1_CITY~, ~2_FACTION_NAME~ + 1042735, // The Finance Minister of ~1_CITY~, ~2_FACTION_NAME~ + $"{pl.Finance.Definition.FriendlyName}\t{faction.Definition.PropName}" + ); } else if (pl.MerchantTitle != MerchantTitle.None) { list.Add( - 1060776, - "{0}\t{1}", - MerchantTitles.GetInfo(pl.MerchantTitle).Title, - faction.Definition.PropName - ); // ~1_val~, ~2_val~ + 1060776, // ~1_val~, ~2_val~ + $"{MerchantTitles.GetInfo(pl.MerchantTitle).Title}\t{faction.Definition.PropName}" + ); } else { - list.Add(1060776, "{0}\t{1}", pl.Rank.Title, faction.Definition.PropName); // ~1_val~, ~2_val~ + list.Add(1060776, $"{pl.Rank.Title}\t{faction.Definition.PropName}"); // ~1_val~, ~2_val~ } } } diff --git a/Projects/UOContent/Mobiles/Special/ServantOfSemidar.cs b/Projects/UOContent/Mobiles/Special/ServantOfSemidar.cs index 8aec98cf3..cf9836831 100644 --- a/Projects/UOContent/Mobiles/Special/ServantOfSemidar.cs +++ b/Projects/UOContent/Mobiles/Special/ServantOfSemidar.cs @@ -17,7 +17,7 @@ namespace Server.Mobiles public override bool CanBeDamaged() => false; - public override void AddNameProperties(ObjectPropertyList list) + public override void AddNameProperties(IPropertyList list) { base.AddNameProperties(list); diff --git a/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs b/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs index 0266aa7b0..f9e05c63a 100644 --- a/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs +++ b/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Server.Collections; using Server.ContextMenus; using Server.Engines.BulkOrders; using Server.Factions; @@ -876,7 +877,7 @@ namespace Server.Mobiles var list = new List(buyInfo.Length); var cont = BuyPack; - var opls = EnableVendorBuyOPL ? new List(buyInfo.Length) : null; + using var opls = PooledRefQueue.Create(EnableVendorBuyOPL ? buyInfo.Length : 0); for (var idx = 0; idx < buyInfo.Length; idx++) { @@ -906,9 +907,9 @@ namespace Server.Mobiles ) ); - if (disp is IPropertyListObject obj) + if (disp is IObjectPropertyListEntity obj) { - opls?.Add(obj.PropertyList); + opls.Enqueue(obj.PropertyList); } } @@ -949,7 +950,7 @@ namespace Server.Mobiles if (name != null && list.Count < 250) { list.Add(new BuyItemState(name, cont.Serial, item.Serial, price, item.Amount, item.ItemID, item.Hue)); - opls?.Add(item.PropertyList); + opls.Enqueue(item.PropertyList); } } @@ -978,12 +979,9 @@ namespace Server.Mobiles from.NetState.SendDisplayBuyList(Serial); from.NetState.SendMobileStatus(from); // make sure their gold amount is sent - if (opls != null) + while (opls.Count > 0) { - for (var i = 0; i < opls.Count; ++i) - { - from.NetState?.Send(opls[i].Buffer); - } + from.NetState?.Send(opls.Dequeue().Buffer); } SayTo(from, 500186); // Greetings. Have a look around. diff --git a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs index 11c3e340d..6bb78d9c5 100644 --- a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs +++ b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs @@ -155,7 +155,7 @@ namespace Server.Mobiles } } - public override void GetChildNameProperties(ObjectPropertyList list, Item item) + public override void GetChildNameProperties(IPropertyList list, Item item) { base.GetChildNameProperties(list, item); @@ -182,7 +182,7 @@ namespace Server.Mobiles } } - public override void GetChildProperties(ObjectPropertyList list, Item item) + public override void GetChildProperties(IPropertyList list, Item item) { base.GetChildProperties(list, item); @@ -735,7 +735,7 @@ namespace Server.Mobiles public override bool IsSnoop(Mobile from) => false; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -1652,7 +1652,7 @@ namespace Server.Mobiles [CommandProperty(AccessLevel.GameMaster)] public PlayerVendor Vendor { get; private set; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Multis/Boats/BaseDockedBoat.cs b/Projects/UOContent/Multis/Boats/BaseDockedBoat.cs index 6a7a86d85..f2b18daa5 100644 --- a/Projects/UOContent/Multis/Boats/BaseDockedBoat.cs +++ b/Projects/UOContent/Multis/Boats/BaseDockedBoat.cs @@ -102,7 +102,7 @@ namespace Server.Multis } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (m_ShipName != null) { diff --git a/Projects/UOContent/Multis/Boats/TillerMan.cs b/Projects/UOContent/Multis/Boats/TillerMan.cs index be04517b2..cef485f9c 100644 --- a/Projects/UOContent/Multis/Boats/TillerMan.cs +++ b/Projects/UOContent/Multis/Boats/TillerMan.cs @@ -29,7 +29,7 @@ namespace Server.Items }; } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); @@ -46,7 +46,7 @@ namespace Server.Items PublicOverheadMessage(MessageType.Regular, 0x3B2, number, args); } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { if (m_Boat?.ShipName != null) { diff --git a/Projects/UOContent/Multis/Houses/BaseHouse.cs b/Projects/UOContent/Multis/Houses/BaseHouse.cs index 272bba2cf..dd480e427 100644 --- a/Projects/UOContent/Multis/Houses/BaseHouse.cs +++ b/Projects/UOContent/Multis/Houses/BaseHouse.cs @@ -3700,7 +3700,7 @@ namespace Server.Multis public override string DefaultName => "a house transfer contract"; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Multis/Houses/HouseSign.cs b/Projects/UOContent/Multis/Houses/HouseSign.cs index 9341915e4..ab8a35180 100644 --- a/Projects/UOContent/Multis/Houses/HouseSign.cs +++ b/Projects/UOContent/Multis/Houses/HouseSign.cs @@ -52,12 +52,12 @@ namespace Server.Multis } } - public override void AddNameProperty(ObjectPropertyList list) + public override void AddNameProperty(IPropertyList list) { list.Add(1061638); // A House Sign } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); diff --git a/Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs b/Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs index 076ef0d77..f33a1197f 100644 --- a/Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs +++ b/Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs @@ -30,17 +30,17 @@ namespace Server.Items public override string DefaultName => "a gambling stone"; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add("Jackpot: {0}gp", m_GamblePot); + list.Add($"Jackpot: {m_GamblePot}gp"); } public override void OnSingleClick(Mobile from) { base.OnSingleClick(from); - LabelTo(from, "Jackpot: {0}gp", m_GamblePot); + LabelTo(from, $"Jackpot: {m_GamblePot}gp"); } public override void OnDoubleClick(Mobile from) diff --git a/Projects/UOContent/Spells/Spellweaving/Items/ArcaneFocus.cs b/Projects/UOContent/Spells/Spellweaving/Items/ArcaneFocus.cs index f38d180d2..44f987401 100644 --- a/Projects/UOContent/Spells/Spellweaving/Items/ArcaneFocus.cs +++ b/Projects/UOContent/Spells/Spellweaving/Items/ArcaneFocus.cs @@ -34,11 +34,11 @@ namespace Server.Items public override TextDefinition InvalidTransferMessage => 1073480; // Your arcane focus disappears. public override bool Nontransferable => true; - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); - list.Add(1060485, StrengthBonus.ToString()); // strength bonus ~1_val~ + list.Add(1060485, $"{StrengthBonus}"); // strength bonus ~1_val~ } public override void Serialize(IGenericWriter writer) diff --git a/Projects/UOContent/Spells/Spellweaving/Items/TransientItem.cs b/Projects/UOContent/Spells/Spellweaving/Items/TransientItem.cs index 49781eae5..4755e5ed1 100644 --- a/Projects/UOContent/Spells/Spellweaving/Items/TransientItem.cs +++ b/Projects/UOContent/Spells/Spellweaving/Items/TransientItem.cs @@ -76,13 +76,13 @@ namespace Server.Items } } - public override void GetProperties(ObjectPropertyList list) + public override void GetProperties(IPropertyList list) { base.GetProperties(list); var remaining = CreationTime + LifeSpan - Core.Now; - list.Add(1072517, ((int)remaining.TotalSeconds).ToString()); // Lifespan: ~1_val~ seconds + list.Add(1072517, $"{(int)remaining.TotalSeconds}"); // Lifespan: ~1_val~ seconds } public override void Serialize(IGenericWriter writer) diff --git a/version.json b/version.json index ea27bd978..b5377358e 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.9.1" + "version": "0.9.2" }