Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Server.Gumps;
using Server.Items;
using Server.Network;
@ -381,8 +380,7 @@ namespace Server.Engines.Plants
}
else
{
int message;
if (m_Plant.ApplyPotion(effects[0], true, out message))
if (m_Plant.ApplyPotion(effects[0], true, out int message))
{
from.SendLocalizedMessage(1061884); // You don't have any strong potions of that type in your pack.

View file

@ -35,7 +35,7 @@ namespace Server.Items
return;
}
if (!from.CanBeginAction(typeof(GreenThorns)))
if (!from.CanBeginAction<GreenThorns>())
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2,
1061908); // * You must wait a while before planting another thorn. *
@ -80,7 +80,7 @@ namespace Server.Items
return;
}
if (!from.CanBeginAction(typeof(GreenThorns)))
if (!from.CanBeginAction<GreenThorns>())
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2,
1061908); // * You must wait a while before planting another thorn. *
@ -117,7 +117,7 @@ namespace Server.Items
from.NonlocalOverheadMessage(MessageType.Emote, 0x961, 1061915,
from.Name); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *
from.BeginAction(typeof(GreenThorns));
from.BeginAction<GreenThorns>();
new EndActionTimer(from).Start();
effect.Start();
@ -143,7 +143,7 @@ namespace Server.Items
protected override void OnTick()
{
m_From.EndAction(typeof(GreenThorns));
m_From.EndAction<GreenThorns>();
}
}
}

View file

@ -1,12 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
namespace Server.Items
{
public class OrangePetals : Item
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, OrangePetalsContext> m_Table = new Dictionary<Mobile, OrangePetalsContext>();
[Constructible]
public OrangePetals() : this(1)
@ -137,4 +138,4 @@ namespace Server.Items
public Timer Timer{ get; }
}
}
}
}

View file

@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Gumps;
@ -150,14 +149,7 @@ namespace Server.Engines.Plants
if (!(RootParent is Mobile owner))
return false;
if (owner.Backpack != null && IsChildOf(owner.Backpack))
return true;
BankBox bank = owner.FindBankNoCreate();
if (bank != null && IsChildOf(bank))
return true;
return false;
return IsChildOf(owner.Backpack) || IsChildOf(owner.FindBankNoCreate());
}
}
@ -170,7 +162,7 @@ namespace Server.Engines.Plants
[CommandProperty(AccessLevel.GameMaster)]
public bool Reproduces => PlantHueInfo.CanReproduce(PlantHue) && PlantTypeInfo.CanReproduce(PlantType);
public static ArrayList Plants{ get; } = new ArrayList();
public static List<PlantItem> Plants{ get; } = new List<PlantItem>();
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level{ get; set; }

View file

@ -22,8 +22,8 @@ namespace Server.Engines.Plants
if (!m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant &&
from.InRange(m_Plant.GetWorldLocation(), 3) && m_Plant.IsUsableBy(from))
{
if (from.HasGump(typeof(MainPlantGump)))
from.CloseGump(typeof(MainPlantGump));
if (from.HasGump<MainPlantGump>())
from.CloseGump<MainPlantGump>();
from.SendGump(new MainPlantGump(m_Plant));
}

View file

@ -1,7 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Misc;
namespace Server.Engines.Plants
@ -428,12 +426,12 @@ namespace Server.Engines.Plants
public static void GrowAll()
{
ArrayList plants = PlantItem.Plants;
List<PlantItem> plants = PlantItem.Plants;
DateTime now = DateTime.UtcNow;
for (int i = plants.Count - 1; i >= 0; --i)
{
PlantItem plant = (PlantItem)plants[i];
PlantItem plant = plants[i];
if (plant.IsGrowable && !(plant.RootParent is Mobile) && now >= plant.PlantSystem.NextGrowth)
plant.PlantSystem.DoGrowthCheck();
@ -476,7 +474,7 @@ namespace Server.Engines.Plants
return;
}
ApplyBeneficEffects();
ApplyBeneficialEffects();
if (!ApplyMaladiesEffects()) // Dead
return;
@ -486,7 +484,7 @@ namespace Server.Engines.Plants
UpdateMaladies();
}
private void ApplyBeneficEffects()
private void ApplyBeneficialEffects()
{
if (PoisonPotion >= Infestation)
{