Fixed multi-morphs

This commit is contained in:
Chiss 2014-08-09 23:34:12 +10:00
parent 1a6540b4d0
commit 59859b168f
2 changed files with 20 additions and 2 deletions

View File

@ -174,6 +174,22 @@ public class GadgetManager extends MiniPlugin
}
}
}
public void RemoveMorph(Player player)
{
for (GadgetType gadgetType : _gadgets.keySet())
{
for (Gadget gadget : _gadgets.get(gadgetType))
{
if (gadget instanceof MorphGadget)
{
MorphGadget part = (MorphGadget) gadget;
part.Disable(player);
}
}
}
}
public void DisableAll()
{

View File

@ -34,14 +34,16 @@ public abstract class MorphGadget extends Gadget
public void ApplyArmor(Player player)
{
Manager.RemoveMorph(player);
_active.add(player);
UtilPlayer.message(player, F.main("Gadget", "You put on " + F.elem(GetName()) + "."));
UtilPlayer.message(player, F.main("Gadget", "You morphed into " + F.elem(GetName()) + "."));
}
public void RemoveArmor(Player player)
{
if (_active.remove(player))
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(GetName()) + "."));
UtilPlayer.message(player, F.main("Gadget", "You unmorphed from " + F.elem(GetName()) + "."));
}
}