Started to implement special faction behavior
This commit is contained in:
@ -7,7 +7,7 @@ import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
|
||||
@ -51,7 +51,7 @@ public class CmdDisband extends FCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (faction.getFlag(FactionFlag.PERMANENT))
|
||||
if (faction.getFlag(FFlag.PERMANENT))
|
||||
{
|
||||
msg("<i>This faction is designated as permanent, so you cannot disband it.");
|
||||
return;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
|
||||
@ -41,14 +41,14 @@ public class CmdFlag extends FCommand
|
||||
|
||||
if ( ! this.argIsSet(1))
|
||||
{
|
||||
for (FactionFlag flag : FactionFlag.values())
|
||||
for (FFlag flag : FFlag.values())
|
||||
{
|
||||
msg(flag.getStateInfo(faction.getFlag(flag), true));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
FactionFlag flag = this.argAsFactionFlag(1);
|
||||
FFlag flag = this.argAsFactionFlag(1);
|
||||
if (flag == null) return;
|
||||
if ( ! this.argIsSet(2))
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
import com.massivecraft.factions.zcore.util.SmokeUtil;
|
||||
@ -80,7 +80,7 @@ public class CmdHome extends FCommand
|
||||
(
|
||||
Conf.homesTeleportAllowedEnemyDistance > 0
|
||||
&&
|
||||
faction.getFlag(FactionFlag.PVP)
|
||||
faction.getFlag(FFlag.PVP)
|
||||
&&
|
||||
(
|
||||
! fme.isInOwnTerritory()
|
||||
|
@ -30,11 +30,11 @@ public class CmdJoin extends FCommand
|
||||
Faction faction = this.argAsFaction(0);
|
||||
if (faction == null) return;
|
||||
|
||||
if ( ! faction.isNormal())
|
||||
/*if ( ! faction.isNormal())
|
||||
{
|
||||
msg("<b>You may only join normal factions. This is a system faction.");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (faction == myFaction)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
|
||||
public class CmdKick extends FCommand
|
||||
@ -82,7 +82,7 @@ public class CmdKick extends FCommand
|
||||
if (Conf.logFactionKick)
|
||||
P.p.log(fme.getName()+" kicked "+you.getName()+" from the faction: "+yourFaction.getTag());
|
||||
|
||||
if (yourFaction.getFPlayers().isEmpty() && !yourFaction.getFlag(FactionFlag.PERMANENT))
|
||||
if (yourFaction.getFPlayers().isEmpty() && !yourFaction.getFlag(FFlag.PERMANENT))
|
||||
{
|
||||
// Remove this faction
|
||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
||||
|
@ -38,9 +38,11 @@ public class CmdList extends FCommand
|
||||
if ( ! payForCommand(Conf.econCostList, "to list the factions", "for listing the factions")) return;
|
||||
|
||||
ArrayList<Faction> factionList = new ArrayList<Faction>(Factions.i.get());
|
||||
|
||||
factionList.remove(Factions.i.getNone());
|
||||
factionList.remove(Factions.i.getSafeZone());
|
||||
factionList.remove(Factions.i.getWarZone());
|
||||
// TODO: Add flag SECRET To factions instead.
|
||||
//factionList.remove(Factions.i.getSafeZone());
|
||||
//factionList.remove(Factions.i.getWarZone());
|
||||
|
||||
// Sort by total followers first
|
||||
Collections.sort(factionList, new Comparator<Faction>(){
|
||||
|
@ -61,7 +61,6 @@ public class CmdPerm extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Awesomesause parser for deltas...
|
||||
Set<Rel> targetValue = FPerm.parseRelDeltas(TextUtil.implode(args.subList(2, args.size()), " "), faction.getPermittedRelations(perm));
|
||||
|
||||
// Do the sender have the right to change perms for this faction?
|
||||
|
@ -7,7 +7,7 @@ import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
|
||||
@ -50,13 +50,13 @@ public class CmdShow extends FCommand
|
||||
|
||||
msg(p.txt.titleize(faction.getTag(fme)));
|
||||
msg("<a>Description: <i>%s", faction.getDescription());
|
||||
if ( ! faction.isNormal())
|
||||
/*if ( ! faction.isNormal())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
String peaceStatus = "";
|
||||
if (faction.getFlag(FactionFlag.PEACEFUL))
|
||||
if (faction.getFlag(FFlag.PEACEFUL))
|
||||
{
|
||||
peaceStatus = " "+Conf.colorTruce+"This faction is Peaceful";
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class CmdShow extends FCommand
|
||||
msg("<a>Joining: <i>"+(faction.getOpen() ? "no invitation is needed" : "invitation is required")+peaceStatus);
|
||||
msg("<a>Land / Power / Maxpower: <i> %d/%d/%d", faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded());
|
||||
|
||||
if (faction.getFlag(FactionFlag.PERMANENT))
|
||||
if (faction.getFlag(FFlag.PERMANENT))
|
||||
{
|
||||
msg("<a>This faction is permanent, remaining even with no members.");
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.FPerm;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
import com.massivecraft.factions.zcore.MCommand;
|
||||
@ -276,13 +276,13 @@ public abstract class FCommand extends MCommand<P>
|
||||
}
|
||||
|
||||
// FACTION FLAG ======================
|
||||
public FactionFlag strAsFactionFlag(String name, FactionFlag def, boolean msg)
|
||||
public FFlag strAsFactionFlag(String name, FFlag def, boolean msg)
|
||||
{
|
||||
FactionFlag ret = def;
|
||||
FFlag ret = def;
|
||||
|
||||
if (name != null)
|
||||
{
|
||||
FactionFlag flag = FactionFlag.parse(name);
|
||||
FFlag flag = FFlag.parse(name);
|
||||
if (flag != null)
|
||||
{
|
||||
ret = flag;
|
||||
@ -296,15 +296,15 @@ public abstract class FCommand extends MCommand<P>
|
||||
|
||||
return ret;
|
||||
}
|
||||
public FactionFlag argAsFactionFlag(int idx, FactionFlag def, boolean msg)
|
||||
public FFlag argAsFactionFlag(int idx, FFlag def, boolean msg)
|
||||
{
|
||||
return this.strAsFactionFlag(this.argAsString(idx), def, msg);
|
||||
}
|
||||
public FactionFlag argAsFactionFlag(int idx, FactionFlag def)
|
||||
public FFlag argAsFactionFlag(int idx, FFlag def)
|
||||
{
|
||||
return this.argAsFactionFlag(idx, def, true);
|
||||
}
|
||||
public FactionFlag argAsFactionFlag(int idx)
|
||||
public FFlag argAsFactionFlag(int idx)
|
||||
{
|
||||
return this.argAsFactionFlag(idx, null);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.ChatColor;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
import com.massivecraft.factions.struct.FactionFlag;
|
||||
import com.massivecraft.factions.struct.FFlag;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Rel;
|
||||
|
||||
@ -34,11 +34,11 @@ public abstract class FRelationCommand extends FCommand
|
||||
Faction them = this.argAsFaction(0);
|
||||
if (them == null) return;
|
||||
|
||||
if ( ! them.isNormal())
|
||||
/*if ( ! them.isNormal())
|
||||
{
|
||||
msg("<b>Nope! You can't.");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (them == myFaction)
|
||||
{
|
||||
@ -64,13 +64,13 @@ public abstract class FRelationCommand extends FCommand
|
||||
myFaction.msg(currentRelationColor+them.getTag()+"<i> were informed that you wish to be "+targetRelation.getColor()+targetRelation);
|
||||
}
|
||||
|
||||
if ( targetRelation != Rel.NEUTRAL && them.getFlag(FactionFlag.PEACEFUL))
|
||||
if ( targetRelation != Rel.NEUTRAL && them.getFlag(FFlag.PEACEFUL))
|
||||
{
|
||||
them.msg("<i>This will have no effect while your faction is peaceful.");
|
||||
myFaction.msg("<i>This will have no effect while their faction is peaceful.");
|
||||
}
|
||||
|
||||
if ( targetRelation != Rel.NEUTRAL && myFaction.getFlag(FactionFlag.PEACEFUL))
|
||||
if ( targetRelation != Rel.NEUTRAL && myFaction.getFlag(FFlag.PEACEFUL))
|
||||
{
|
||||
them.msg("<i>This will have no effect while their faction is peaceful.");
|
||||
myFaction.msg("<i>This will have no effect while your faction is peaceful.");
|
||||
|
Reference in New Issue
Block a user