Browse Source

More itembase refactor

combat-2
MagicBot 8 months ago
parent
commit
03c226f76e
  1. 29
      src/engine/gameManager/ChatManager.java

29
src/engine/gameManager/ChatManager.java

@ -275,7 +275,7 @@ public enum ChatManager {
PlayerCharacter pcSender = null; PlayerCharacter pcSender = null;
if (sender.getObjectType().equals(GameObjectType.PlayerCharacter)) if (sender.getObjectType().equals(GameObjectType.PlayerCharacter))
pcSender = (PlayerCharacter) sender; pcSender = sender;
if (isFlood) { if (isFlood) {
ChatManager.chatSayError(pcSender, FLOOD_USER_ERROR); ChatManager.chatSayError(pcSender, FLOOD_USER_ERROR);
@ -597,7 +597,6 @@ public enum ChatManager {
distroList.remove(awo); distroList.remove(awo);
else if (awo.getObjectUUID() == tar.getObjectUUID()) else if (awo.getObjectUUID() == tar.getObjectUUID())
distroList.remove(awo); distroList.remove(awo);
} }
String textToThief = ""; String textToThief = "";
@ -607,19 +606,18 @@ public enum ChatManager {
if (item != null) //Steal if (item != null) //Steal
if (success) { if (success) {
String name = ""; String name = "";
if (item.getItemBase() != null) if (item.getItemBase().getUUID() == 7)
if (item.getItemBase().getUUID() == 7) name = amount + " gold ";
name = amount + " gold "; else {
else { String vowels = "aeiou";
String vowels = "aeiou"; ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID());
ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID()); String iName = template.item_base_name;
String iName = template.item_base_name; if (iName.length() > 0)
if (iName.length() > 0) if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0)
if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0) name = "an " + iName + ' ';
name = "an " + iName + ' '; else
else name = "a " + iName + ' ';
name = "a " + iName + ' '; }
}
textToThief = "You have stolen " + name + "from " + tar.getFirstName() + '!'; textToThief = "You have stolen " + name + "from " + tar.getFirstName() + '!';
textToVictim = sender.getFirstName() + "is caught with thier hands in your pocket!"; textToVictim = sender.getFirstName() + "is caught with thier hands in your pocket!";
//textToOthers = sender.getFirstName() + " steals " + name + "from " + target.getFirstName() + "."; //textToOthers = sender.getFirstName() + " steals " + name + "from " + target.getFirstName() + ".";
@ -641,6 +639,7 @@ public enum ChatManager {
//Send msg to thief //Send msg to thief
HashSet<AbstractWorldObject> senderList = new HashSet<>(); HashSet<AbstractWorldObject> senderList = new HashSet<>();
senderList.add(sender); senderList.add(sender);
if (!textToThief.isEmpty()) if (!textToThief.isEmpty())
ChatManager.chatSystemSend(senderList, textToThief, 1, 2); ChatManager.chatSystemSend(senderList, textToThief, 1, 2);

Loading…
Cancel
Save