cleanup: Fixes bugs and cleans up code (#660)

This commit is contained in:
Kamron Batman 2021-07-19 20:49:59 -07:00 • committed by GitHub
parent 1de0b656a9
commit 679e8100f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
99 changed files with 160 additions and 346 deletions

View file

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
using Server.Regions;
using Server.Utilities;
namespace Server.Engines.Doom

View file

@ -123,7 +123,7 @@ namespace Server.Engines.Doom
m_Tiles = new List<LeverPuzzleRegion>();
for (; i < 9; i++)
{
m_Tiles.Add(new LeverPuzzleRegion(this, TA[i]));
m_Tiles.Add(new LeverPuzzleRegion(TA[i]));
}
m_Teles = new List<Item>();
@ -400,7 +400,7 @@ namespace Server.Engines.Doom
{
if ((player = GetOccupant(i)) != null)
{
new RockTimer(player, this).Start();
new RockTimer(player).Start();
}
}
}
@ -570,7 +570,7 @@ namespace Server.Engines.Doom
m_Tiles = new List<LeverPuzzleRegion>();
for (var i = 4; i < 9; i++)
{
m_Tiles.Add(new LeverPuzzleRegion(this, TA[i]));
m_Tiles.Add(new LeverPuzzleRegion(TA[i]));
}
m_LampRoom = new LampRoomRegion(this);
@ -584,14 +584,12 @@ namespace Server.Engines.Doom
{
private readonly Mobile m_Player;
private int Count;
private LeverPuzzleController m_Controller;
public RockTimer(Mobile player, LeverPuzzleController controller)
public RockTimer(Mobile player)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(.25))
{
Count = 0;
m_Player = player;
m_Controller = controller;
}
private int Rock() => 0x1363 + Utility.Random(0, 11);

View file

@ -88,7 +88,7 @@ namespace Server.Engines.Doom
{
public Mobile m_Occupant;
public LeverPuzzleRegion(LeverPuzzleController controller, int[] loc)
public LeverPuzzleRegion(int[] loc)
: base(null, Map.Malas, Find(LeverPuzzleController.lr_Enter, Map.Malas), new Rectangle2D(loc[0], loc[1], 1, 1))
{
Register();