Moving over to the use of describeTo.

This commit is contained in:
Olof Larsson
2011-10-21 19:20:33 +02:00
parent 51161bbb55
commit 46f5849f9f
26 changed files with 55 additions and 84 deletions

View File

@ -32,7 +32,7 @@ public class CmdAdmin extends FCommand
if (fyou.getFaction() != myFaction)
{
msg("%s<i> is not a member in your faction.", fyou.getNameAndRelevant(fme));
msg("%s<i> is not a member in your faction.", fyou.describeTo(fme, true));
return;
}
@ -48,14 +48,7 @@ public class CmdAdmin extends FCommand
// Inform all players
for (FPlayer fplayer : FPlayers.i.getOnline())
{
if (fplayer.getFaction() == myFaction)
{
fplayer.msg("%s<i> gave %s<i> the leadership of your faction.", fme.getNameAndRelevant(fme), fyou.getNameAndRelevant(fme));
}
else
{
fplayer.msg("%s<i> gave %s<i> the leadership of %s", fme.getNameAndRelevant(fplayer), fyou.getNameAndRelevant(fplayer), myFaction.getTag(fplayer));
}
fplayer.msg("%s<i> gave %s<i> the leadership of %s", fme.describeTo(fplayer, true), fyou.describeTo(fplayer), myFaction.describeTo(fplayer));
}
}

View File

@ -59,6 +59,7 @@ public class CmdCreate extends FCommand
Faction faction = Factions.i.create();
// TODO: Why would this even happen???
if (faction == null)
{
msg("<b>There was an internal error while trying to create your faction. Please try again.");
@ -71,7 +72,7 @@ public class CmdCreate extends FCommand
for (FPlayer follower : FPlayers.i.getOnline())
{
follower.msg("%s<i> created a new faction %s", fme.getNameAndRelevant(follower), faction.getTag(follower));
follower.msg("%s<i> created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower));
}
msg("<i>You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate());

View File

@ -39,8 +39,9 @@ public class CmdDeinvite extends FCommand
myFaction.deinvite(you);
you.msg("%s<i> revoked your invitation to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.msg("%s<i> revoked %s's<i> invitation.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
you.msg("%s<i> revoked your invitation to <h>%s<i>.", fme.describeTo(you), myFaction.describeTo(you));
myFaction.msg("%s<i> revoked %s's<i> invitation.", fme.describeTo(myFaction), you.describeTo(myFaction));
}
}

View File

@ -37,7 +37,7 @@ public class CmdDescription extends FCommand
// Broadcast the description to everyone
for (FPlayer fplayer : FPlayers.i.getOnline())
{
fplayer.msg("<i>The faction "+fplayer.getRelationColor(fme)+myFaction.getTag()+"<i> changed their description to:");
fplayer.msg("<i>The faction %s<i> changed their description to:", myFaction.describeTo(fplayer));
fplayer.msg("<h>"+myFaction.getDescription());
}
}

View File

@ -59,7 +59,7 @@ public class CmdDisband extends FCommand
// Inform all players
for (FPlayer fplayer : FPlayers.i.getOnline())
{
String who = senderIsConsole ? "A server admin" : fme.getNameAndRelevant(fplayer);
String who = senderIsConsole ? "A server admin" : fme.describeTo(fplayer);
if (fplayer.getFaction() == faction)
{
fplayer.msg("<h>%s<i> disbanded your faction.", who);

View File

@ -42,8 +42,8 @@ public class CmdInvite extends FCommand
myFaction.invite(you);
you.msg("%s<i> invited you to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.msg("%s<i> invited %s<i> to your faction.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
you.msg("%s<i> invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you));
myFaction.msg("%s<i> invited %s<i> to your faction.", fme.describeTo(myFaction, true), you.describeTo(myFaction));
}
}

View File

@ -56,7 +56,7 @@ public class CmdJoin extends FCommand
if( ! (faction.getOpen() || faction.isInvited(fme) || fme.isAdminBypassing()))
{
msg("<i>This faction requires invitation.");
faction.msg("%s<i> tried to join your faction.", fme.getNameAndRelevant(faction));
faction.msg("%s<i> tried to join your faction.", fme.describeTo(faction, true));
return;
}
@ -64,7 +64,7 @@ public class CmdJoin extends FCommand
if ( ! payForCommand(Conf.econCostJoin, "to join a faction", "for joining a faction")) return;
fme.msg("<i>You successfully joined %s", faction.getTag(fme));
faction.msg("<i>%s joined your faction.", fme.getNameAndRelevant(faction));
faction.msg("<i>%s joined your faction.", fme.describeTo(faction, true));
fme.resetFactionData();
fme.setFaction(faction);

View File

@ -46,7 +46,7 @@ public class CmdKick extends FCommand
{
if (yourFaction != myFaction)
{
msg("%s<b> is not a member of %s", you.getNameAndRelevant(fme), myFaction.getTag(fme));
msg("%s<b> is not a member of %s", you.describeTo(fme, true), myFaction.describeTo(fme));
return;
}
@ -67,11 +67,11 @@ public class CmdKick extends FCommand
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if ( ! payForCommand(Conf.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) return;
yourFaction.msg("%s<i> kicked %s<i> from the faction! :O", fme.getNameAndRelevant(yourFaction), you.getNameAndRelevant(yourFaction));
you.msg("%s<i> kicked you from %s<i>! :O", fme.getNameAndRelevant(you), yourFaction.getTag(you));
yourFaction.msg("%s<i> kicked %s<i> from the faction! :O", fme.describeTo(yourFaction, true), you.describeTo(yourFaction, true));
you.msg("%s<i> kicked you from %s<i>! :O", fme.describeTo(you, true), yourFaction.describeTo(you));
if (yourFaction != myFaction)
{
fme.msg("<i>You kicked %s<i> from the faction %s<i>!", you.getNameAndRelevant(myFaction), yourFaction.getTag(fme));
fme.msg("<i>You kicked %s<i> from the faction %s<i>!", you.describeTo(fme), yourFaction.describeTo(fme));
}
yourFaction.deinvite(you);

View File

@ -32,7 +32,7 @@ public class CmdMod extends FCommand
if (you.getFaction() != myFaction)
{
msg("%s<b> is not a member in your faction.", you.getNameAndRelevant(fme));
msg("%s<b> is not a member in your faction.", you.describeTo(fme, true));
return;
}
@ -46,13 +46,13 @@ public class CmdMod extends FCommand
{
// Revoke
you.setRole(Role.NORMAL);
myFaction.msg("%s<i> is no longer moderator in your faction.", you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> is no longer moderator in your faction.", you.describeTo(myFaction, true));
}
else
{
// Give
you.setRole(Role.MODERATOR);
myFaction.msg("%s<i> was promoted to moderator in your faction.", you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> was promoted to moderator in your faction.", you.describeTo(myFaction, true));
}
}

View File

@ -35,7 +35,7 @@ public class CmdOpen extends FCommand
String open = myFaction.getOpen() ? "open" : "closed";
// Inform
myFaction.msg("%s<i> changed the faction to <h>%s<i>.", fme.getNameAndRelevant(myFaction), open);
myFaction.msg("%s<i> changed the faction to <h>%s<i>.", fme.describeTo(myFaction, true), open);
for (Faction faction : Factions.i.get())
{
if (faction == myFaction)

View File

@ -49,11 +49,11 @@ public class CmdPeaceful extends FCommand
{
if (fplayer.getFaction() == faction)
{
fplayer.msg((fme == null ? "A server admin" : fme.getNameAndRelevant(fplayer))+"<i> has "+change+" your faction.");
fplayer.msg((fme == null ? "A server admin" : fme.describeTo(fplayer, true))+"<i> has "+change+" your faction.");
}
else
{
fplayer.msg((fme == null ? "A server admin" : fme.getNameAndRelevant(fplayer))+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
fplayer.msg((fme == null ? "A server admin" : fme.describeTo(fplayer, true))+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
}
}

View File

@ -48,11 +48,11 @@ public class CmdPermanent extends FCommand
{
if (fplayer.getFaction() == faction)
{
fplayer.msg((fme == null ? "A server admin" : fme.getNameAndRelevant(fplayer))+"<i> has "+change+" your faction.");
fplayer.msg((fme == null ? "A server admin" : fme.describeTo(fplayer, true))+"<i> has "+change+" your faction.");
}
else
{
fplayer.msg((fme == null ? "A server admin" : fme.getNameAndRelevant(fplayer))+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
fplayer.msg((fme == null ? "A server admin" : fme.describeTo(fplayer, true))+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
}
}
}

View File

@ -36,7 +36,7 @@ public class CmdPower extends FCommand
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if ( ! payForCommand(Conf.econCostPower, "to show player power info", "for showing player power info")) return;
msg("%s<a> - Power / Maxpower: <i>%d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded());
msg("%s<a> - Power / Maxpower: <i>%d / %d", target.describeTo(fme, true), target.getPowerRounded(), target.getPowerMaxRounded());
}
}

View File

@ -66,7 +66,7 @@ public class CmdSethome extends FCommand
faction.setHome(me.getLocation());
faction.msg("%s<i> set the home for your faction. You can now use:", fme.getNameAndRelevant(myFaction));
faction.msg("%s<i> set the home for your faction. You can now use:", fme.describeTo(myFaction, true));
faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate());
if (faction != myFaction)
{

View File

@ -55,7 +55,7 @@ public class CmdTag extends FCommand
myFaction.setTag(tag);
// Inform
myFaction.msg("%s<i> changed your faction tag to %s", fme.getNameAndRelevant(myFaction), myFaction.getTag(myFaction));
myFaction.msg("%s<i> changed your faction tag to %s", fme.describeTo(myFaction, true), myFaction.getTag(myFaction));
for (Faction faction : Factions.i.get())
{
if (faction == myFaction)

View File

@ -41,7 +41,7 @@ public class CmdTitle extends FCommand
you.setTitle(title);
// Inform
myFaction.msg("%s<i> changed a title: %s", fme.getNameAndRelevant(myFaction), you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> changed a title: %s", fme.describeTo(myFaction, true), you.describeTo(myFaction, true));
if (Conf.spoutFactionTitlesOverNames)
{

View File

@ -64,7 +64,7 @@ public class CmdUnclaim extends FCommand
{
Board.removeAt(flocation);
otherFaction.msg("%s<i> unclaimed some of your land.", fme.getNameAndRelevant(otherFaction));
otherFaction.msg("%s<i> unclaimed some of your land.", fme.describeTo(otherFaction, true));
msg("<i>You unclaimed this land.");
return;
}
@ -148,7 +148,7 @@ public class CmdUnclaim extends FCommand
}
Board.removeAt(flocation);
myFaction.msg("%s<i> unclaimed some land.", fme.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> unclaimed some land.", fme.describeTo(myFaction, true));
}
}

View File

@ -88,7 +88,7 @@ public class CmdUnclaimall extends FCommand
}*/
Board.unclaimAll(myFaction.getId());
myFaction.msg("%s<i> unclaimed ALL of your faction's land.", fme.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> unclaimed ALL of your faction's land.", fme.describeTo(myFaction, true));
}
}

View File

@ -258,7 +258,7 @@ public abstract class FCommand extends MCommand<P>
{
if ( ! i.getFaction().equals(you.getFaction()))
{
i.sendMessage(p.txt.parse("%s <b>is not in the same faction as you.",you.getNameAndRelevant(i)));
i.sendMessage(p.txt.parse("%s <b>is not in the same faction as you.",you.describeTo(i, true)));
return false;
}