chore: Fixes variable types for possible performance issues (#2172)
This commit is contained in:
parent
6d43f2549c
commit
da517f56c4
82 changed files with 332 additions and 343 deletions
|
|
@ -163,8 +163,8 @@ namespace Server.Engines.Doom
|
|||
|
||||
public static BaseDoor CreateDoorSet(int xDoor, int yDoor, bool doorEastToWest, int hue)
|
||||
{
|
||||
BaseDoor hiDoor = new MetalDoor(doorEastToWest ? DoorFacing.NorthCCW : DoorFacing.WestCW);
|
||||
BaseDoor loDoor = new MetalDoor(doorEastToWest ? DoorFacing.SouthCW : DoorFacing.EastCCW);
|
||||
var hiDoor = new MetalDoor(doorEastToWest ? DoorFacing.NorthCCW : DoorFacing.WestCW);
|
||||
var loDoor = new MetalDoor(doorEastToWest ? DoorFacing.SouthCW : DoorFacing.EastCCW);
|
||||
|
||||
hiDoor.MoveToWorld(new Point3D(xDoor, yDoor, -1), Map.Malas);
|
||||
loDoor.MoveToWorld(
|
||||
|
|
|
|||
|
|
@ -321,8 +321,8 @@ public partial class LeverPuzzleController : Item
|
|||
{
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
Item l;
|
||||
if ((l = GetLever(i)) != null)
|
||||
var l = GetLever(i);
|
||||
if (l != null)
|
||||
{
|
||||
l.ItemID = 0x108E;
|
||||
Effects.PlaySound(l.Location, Map, 0x3E8);
|
||||
|
|
@ -361,43 +361,41 @@ public partial class LeverPuzzleController : Item
|
|||
{
|
||||
PuzzleStatus(1050004); // The circle is the key...
|
||||
}
|
||||
else if (TheirKey == MyKey)
|
||||
{
|
||||
GenKey();
|
||||
Successful = GetOccupant(0);
|
||||
if (Successful != null)
|
||||
{
|
||||
SendLocationEffect(lp_Center, 0x1153, 0, 60, 1);
|
||||
PlaySounds(lp_Center, cs1);
|
||||
|
||||
Effects.SendBoltEffect(Successful);
|
||||
Successful.MoveToWorld(lr_Enter, Map.Malas);
|
||||
|
||||
m_Timer = new LampRoomTimer(this);
|
||||
m_Timer.Start();
|
||||
Enabled = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Mobile player;
|
||||
if (TheirKey == MyKey)
|
||||
for (var i = 0; i < 16; i++) /* Count matching SET bits, ie correct codes */
|
||||
{
|
||||
GenKey();
|
||||
if ((Successful = player = GetOccupant(0)) != null)
|
||||
if (((MyKey >> i) & 1) == 1 && ((TheirKey >> i) & 1) == 1)
|
||||
{
|
||||
SendLocationEffect(lp_Center, 0x1153, 0, 60, 1);
|
||||
PlaySounds(lp_Center, cs1);
|
||||
|
||||
Effects.SendBoltEffect(player);
|
||||
player.MoveToWorld(lr_Enter, Map.Malas);
|
||||
|
||||
m_Timer = new LampRoomTimer(this);
|
||||
m_Timer.Start();
|
||||
Enabled = false;
|
||||
correct++;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
PuzzleStatus(Statue_Msg[correct], correct > 0 ? correct.ToString() : null);
|
||||
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
for (var i = 0; i < 16; i++) /* Count matching SET bits, ie correct codes */
|
||||
var player = GetOccupant(i);
|
||||
if (player != null)
|
||||
{
|
||||
if (((MyKey >> i) & 1) == 1 && ((TheirKey >> i) & 1) == 1)
|
||||
{
|
||||
correct++;
|
||||
}
|
||||
}
|
||||
|
||||
PuzzleStatus(Statue_Msg[correct], correct > 0 ? correct.ToString() : null);
|
||||
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
if ((player = GetOccupant(i)) != null)
|
||||
{
|
||||
new RockTimer(player).Start();
|
||||
}
|
||||
new RockTimer(player).Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public partial class LampRoomBox : Item
|
|||
{
|
||||
[SerializableField(0)]
|
||||
private LeverPuzzleController _controller;
|
||||
private Mobile _wanderer;
|
||||
private WandererOfTheVoid _wanderer;
|
||||
|
||||
public LampRoomBox(LeverPuzzleController controller) : base(0xe80)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2158,9 +2158,10 @@ public partial class Landy : BaseCreature
|
|||
AddItem(new ShortPants(Utility.RandomYellowHue()));
|
||||
AddItem(new Tunic(Utility.RandomYellowHue()));
|
||||
|
||||
Item gloves = new LeafGloves();
|
||||
gloves.Hue = Utility.RandomYellowHue();
|
||||
AddItem(gloves);
|
||||
AddItem(new LeafGloves
|
||||
{
|
||||
Hue = Utility.RandomYellowHue()
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -2720,11 +2721,10 @@ public partial class Tholef : BaseCreature
|
|||
AddItem(new ShortPants(0x28C));
|
||||
AddItem(new Shirt(0x28C));
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafArms();
|
||||
item.Hue = 0x28C;
|
||||
AddItem(item);
|
||||
AddItem(new LeafArms
|
||||
{
|
||||
Hue = 0x28C
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -2807,11 +2807,10 @@ public partial class Waelian : BaseCreature
|
|||
AddItem(new LongPants(0x340));
|
||||
AddItem(new GemmedCirclet());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafChest();
|
||||
item.Hue = 0x344;
|
||||
AddItem(item);
|
||||
AddItem(new LeafChest
|
||||
{
|
||||
Hue = 0x344
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -3057,11 +3056,10 @@ public partial class Lohn : BaseCreature
|
|||
AddItem(new SmithHammer());
|
||||
AddItem(new GemmedCirclet());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafChest();
|
||||
item.Hue = 0x359;
|
||||
AddItem(item);
|
||||
AddItem(new LeafChest
|
||||
{
|
||||
Hue = 0x359
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -3405,11 +3403,10 @@ public partial class ElderVicaie : BaseCreature
|
|||
AddItem(new ElvenBoots());
|
||||
AddItem(new Tunic(0x732));
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafLegs();
|
||||
item.Hue = 0x3B2;
|
||||
AddItem(item);
|
||||
AddItem(new LeafLegs
|
||||
{
|
||||
Hue = 0x3B2
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -3573,11 +3570,10 @@ public partial class Bolaevin : BaseCreature
|
|||
AddItem(new LeafChest());
|
||||
AddItem(new LeafArms());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafLegs();
|
||||
item.Hue = 0x1BB;
|
||||
AddItem(item);
|
||||
AddItem(new LeafLegs
|
||||
{
|
||||
Hue = 0x1BB
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
|
|||
|
|
@ -1274,11 +1274,10 @@ public partial class Mithneral : BaseCreature
|
|||
AddItem(new Backpack());
|
||||
AddItem(new Sandals());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new GustarShroud();
|
||||
item.Hue = 0x51C;
|
||||
AddItem(item);
|
||||
AddItem(new GustarShroud
|
||||
{
|
||||
Hue = 0x51C
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -1876,10 +1875,9 @@ public partial class GeorgeHephaestus : Blacksmith
|
|||
AddItem(new Bascinet());
|
||||
AddItem(new FullApron(0x8AB));
|
||||
|
||||
Item item;
|
||||
|
||||
item = new SmithHammer();
|
||||
item.Hue = 0x8AB;
|
||||
AddItem(item);
|
||||
AddItem(new SmithHammer
|
||||
{
|
||||
Hue = 0x8AB
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -472,11 +472,10 @@ public partial class Gervis : BaseCreature
|
|||
AddItem(new Doublet(0x652));
|
||||
AddItem(new SmithHammer());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeatherGloves();
|
||||
item.Hue = 0x3B2;
|
||||
AddItem(item);
|
||||
AddItem(new LeatherGloves
|
||||
{
|
||||
Hue = 0x3B2
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -750,11 +749,10 @@ public partial class Hargrove : BaseCreature
|
|||
AddItem(new Bandana(0x20));
|
||||
AddItem(new BattleAxe());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new PlateGloves();
|
||||
item.Hue = 0x21E;
|
||||
AddItem(item);
|
||||
AddItem(new PlateGloves
|
||||
{
|
||||
Hue = 0x21E
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
|
|||
|
|
@ -784,11 +784,10 @@ public partial class Beotham : BaseCreature
|
|||
AddItem(new ShortPants(0x522));
|
||||
AddItem(new FancyShirt(0x515));
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafGloves();
|
||||
item.Hue = 0x901;
|
||||
AddItem(item);
|
||||
AddItem(new LeafGloves
|
||||
{
|
||||
Hue = 0x901
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
@ -1014,11 +1013,10 @@ public partial class LorekeeperRollarn : BaseCreature
|
|||
AddItem(new Circlet());
|
||||
AddItem(new LeafChest());
|
||||
|
||||
Item item;
|
||||
|
||||
item = new LeafLegs();
|
||||
item.Hue = 0x71A;
|
||||
AddItem(item);
|
||||
AddItem(new LeafLegs
|
||||
{
|
||||
Hue = 0x71A
|
||||
});
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
|
|
|||
|
|
@ -599,9 +599,10 @@ public partial class Synaeva : BaseCreature
|
|||
SetSkill(SkillName.Meditation, 60.0, 80.0);
|
||||
SetSkill(SkillName.Focus, 60.0, 80.0);
|
||||
|
||||
Item item = new RavenHelm();
|
||||
item.Hue = Utility.RandomGreenHue();
|
||||
AddItem(item);
|
||||
AddItem(new RavenHelm
|
||||
{
|
||||
Hue = Utility.RandomGreenHue()
|
||||
});
|
||||
|
||||
AddItem(new FemaleLeafChest());
|
||||
AddItem(new LeafArms());
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ public class FurrowsGreenThornsEffect : GreenThornsEffect
|
|||
// * A magical bunny leaps out of its hole, disturbed by the thorn's effect! *
|
||||
dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114428);
|
||||
|
||||
BaseCreature spawn = new VorpalBunny();
|
||||
var spawn = new VorpalBunny();
|
||||
if (!SpawnCreature(spawn))
|
||||
{
|
||||
spawn.Delete();
|
||||
|
|
@ -564,7 +564,7 @@ public class SwampGreenThornsEffect : GreenThornsEffect
|
|||
dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114429);
|
||||
Effects.PlaySound(Location, Map, 0x2B0);
|
||||
|
||||
BaseCreature spawn = new WhippingVine();
|
||||
var spawn = new WhippingVine();
|
||||
if (!SpawnCreature(spawn))
|
||||
{
|
||||
spawn.Delete();
|
||||
|
|
@ -618,7 +618,7 @@ public class SnowGreenThornsEffect : GreenThornsEffect
|
|||
// * Slithering ice serpents rise to the surface to investigate the disturbance! *
|
||||
dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114430);
|
||||
|
||||
BaseCreature spawn = new GiantIceWorm();
|
||||
var spawn = new GiantIceWorm();
|
||||
if (!SpawnCreature(spawn))
|
||||
{
|
||||
spawn.Delete();
|
||||
|
|
@ -626,7 +626,7 @@ public class SnowGreenThornsEffect : GreenThornsEffect
|
|||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
BaseCreature snake = new IceSnake();
|
||||
var snake = new IceSnake();
|
||||
if (!SpawnCreature(snake))
|
||||
{
|
||||
snake.Delete();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Server.Engines.Quests.Ambitious
|
|||
{
|
||||
if (bagOfSending)
|
||||
{
|
||||
Item reward = new BagOfSending();
|
||||
var reward = new BagOfSending();
|
||||
|
||||
if (player.PlaceInBackpack(reward))
|
||||
{
|
||||
|
|
@ -85,7 +85,7 @@ namespace Server.Engines.Quests.Ambitious
|
|||
|
||||
if (powderOfTranslocation)
|
||||
{
|
||||
Item reward = new PowderOfTranslocation(Utility.RandomMinMax(10, 12));
|
||||
var reward = new PowderOfTranslocation(Utility.RandomMinMax(10, 12));
|
||||
|
||||
if (player.PlaceInBackpack(reward))
|
||||
{
|
||||
|
|
@ -100,7 +100,7 @@ namespace Server.Engines.Quests.Ambitious
|
|||
|
||||
if (gold)
|
||||
{
|
||||
Item reward = new Gold(Utility.RandomMinMax(250, 350));
|
||||
var reward = new Gold(Utility.RandomMinMax(250, 350));
|
||||
|
||||
if (player.PlaceInBackpack(reward))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public partial class KronusScrollBox : MetalBox
|
|||
|
||||
if (obj?.Completed == false || DarkTidesQuest.HasLostCallingScroll(from))
|
||||
{
|
||||
Item scroll = new KronusScroll();
|
||||
var scroll = new KronusScroll();
|
||||
|
||||
if (pm.PlaceInBackpack(scroll))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,13 +64,15 @@ public partial class Mardoth : BaseQuester
|
|||
HairItemID = 0x203C;
|
||||
HairHue = 0x482;
|
||||
|
||||
Item gloves = new BoneGloves();
|
||||
gloves.Hue = 0x66D;
|
||||
AddItem(gloves);
|
||||
AddItem(new BoneGloves
|
||||
{
|
||||
Hue = 0x66D
|
||||
});
|
||||
|
||||
Item gorget = new PlateGorget();
|
||||
gorget.Hue = 0x1;
|
||||
AddItem(gorget);
|
||||
AddItem(new PlateGorget
|
||||
{
|
||||
Hue = 0x1
|
||||
});
|
||||
}
|
||||
|
||||
public override int GetAutoTalkRange(PlayerMobile m) => 3;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public partial class EminosKatanaChest : WoodenChest
|
|||
{
|
||||
if (EminosUndertakingQuest.HasLostEminosKatana(from))
|
||||
{
|
||||
Item katana = new EminosKatana();
|
||||
var katana = new EminosKatana();
|
||||
|
||||
if (!player.PlaceInBackpack(katana))
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ public partial class EminosKatanaChest : WoodenChest
|
|||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
Item katana = new EminosKatana();
|
||||
var katana = new EminosKatana();
|
||||
|
||||
if (player.PlaceInBackpack(katana))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public partial class Emino : BaseQuester
|
|||
|
||||
if (EminosUndertakingQuest.HasLostNoteForZoel(player))
|
||||
{
|
||||
Item note = new NoteForZoel();
|
||||
var note = new NoteForZoel();
|
||||
|
||||
if (player.PlaceInBackpack(note))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public partial class HaochisKatanaGenerator : Item
|
|||
|
||||
if (HaochisTrialsQuest.HasLostHaochisKatana(player))
|
||||
{
|
||||
Item katana = new HaochisKatana();
|
||||
var katana = new HaochisKatana();
|
||||
|
||||
if (!player.PlaceInBackpack(katana))
|
||||
{
|
||||
|
|
@ -46,7 +46,7 @@ public partial class HaochisKatanaGenerator : Item
|
|||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
Item katana = new HaochisKatana();
|
||||
var katana = new HaochisKatana();
|
||||
|
||||
if (player.PlaceInBackpack(katana))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public partial class DaemonBloodChest : MetalChest
|
|||
return;
|
||||
}
|
||||
|
||||
Item vial = new QuestDaemonBlood();
|
||||
var vial = new QuestDaemonBlood();
|
||||
|
||||
if (player.PlaceInBackpack(vial))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public partial class Dryad : BaseQuester
|
|||
{
|
||||
FocusTo(player);
|
||||
|
||||
Item fertileDirt = new QuestFertileDirt();
|
||||
var fertileDirt = new QuestFertileDirt();
|
||||
|
||||
if (!player.PlaceInBackpack(fertileDirt))
|
||||
{
|
||||
|
|
@ -111,7 +111,7 @@ public partial class Dryad : BaseQuester
|
|||
|
||||
FocusTo(from);
|
||||
|
||||
Item fertileDirt = new QuestFertileDirt();
|
||||
var fertileDirt = new QuestFertileDirt();
|
||||
|
||||
if (!player.PlaceInBackpack(fertileDirt))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ namespace Server.Engines.Quests.Haven
|
|||
1049330
|
||||
); // You have been ambushed! Fight for your honor!!!
|
||||
|
||||
BaseCreature creature = new HordeMinion();
|
||||
var creature = new HordeMinion();
|
||||
creature.MoveToWorld(new Point3D(x, y, z), Map.Trammel);
|
||||
creature.Combatant = player;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Server.Engines.Quests.Hag
|
|||
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10);
|
||||
Effects.PlaySound(m_CorpseLocation, map, 0x1FE);
|
||||
|
||||
Mobile imp = new Zeefzorpul();
|
||||
var imp = new Zeefzorpul();
|
||||
imp.MoveToWorld(m_CorpseLocation, map);
|
||||
|
||||
// * You see a strange imp stealing a scrap of paper from the bloodied corpse *
|
||||
|
|
@ -216,7 +216,7 @@ namespace Server.Engines.Quests.Hag
|
|||
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10);
|
||||
Effects.PlaySound(ImpLocation, map, 0x1FE);
|
||||
|
||||
Mobile imp = new Zeefzorpul();
|
||||
var imp = new Zeefzorpul();
|
||||
imp.MoveToWorld(ImpLocation, map);
|
||||
|
||||
imp.Direction = imp.GetDirectionTo(from);
|
||||
|
|
|
|||
|
|
@ -279,10 +279,10 @@ namespace Server.Mobiles
|
|||
AddItem(new Backpack());
|
||||
AddItem(new Kamishimo(0x483));
|
||||
|
||||
Item item = new LightPlateJingasa();
|
||||
item.Hue = 0x711;
|
||||
|
||||
AddItem(item);
|
||||
AddItem(new LightPlateJingasa
|
||||
{
|
||||
Hue = 0x711
|
||||
});
|
||||
}
|
||||
|
||||
public override bool CanBeDamaged() => false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue