This would be v1.0 beta2. Just live testing on mcteam.org left to do.

This commit is contained in:
Olof Larsson
2011-02-07 21:42:14 +01:00
parent d370dcf8c2
commit 46a814a11e
13 changed files with 71 additions and 106 deletions

View File

@@ -114,10 +114,7 @@ public class Board {
// Get the compass
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.RED, Conf.colorChrome);
// Pad the compass some
asciiCompass.set(0, asciiCompass.get(0));
asciiCompass.set(1, asciiCompass.get(1));
asciiCompass.set(2, asciiCompass.get(2));
// Add the compass
ret.set(1, asciiCompass.get(0)+ret.get(1).substring(3*3));
ret.set(2, asciiCompass.get(1)+ret.get(2).substring(3*3));

View File

@@ -30,7 +30,6 @@ public class Conf {
public static ChatColor colorEnemy;
public static ChatColor colorSystem;
public static ChatColor colorAction;
public static ChatColor colorChrome;
public static ChatColor colorCommand;
public static ChatColor colorParameter;
@@ -43,8 +42,6 @@ public class Conf {
public static List<String> aliasShow = new ArrayList<String>();
public static List<String> aliasMap = new ArrayList<String>();
public static List<String> aliasHere = new ArrayList<String>();
public static List<String> aliasJoin = new ArrayList<String>();
public static List<String> aliasLeave = new ArrayList<String>();
@@ -76,11 +73,9 @@ public class Conf {
public static List<String> aliasTrue = new ArrayList<String>();
// Power
public static double powerPerLand;
public static double powerPerPlayer;
public static double powerPerMinute; // Default health rate
public static double powerPerDeath;
public static double powerDefaultBonus;
// Protected blocks
public static List<Material> territoryProtectedMaterials = new ArrayList<Material>();
@@ -89,15 +84,18 @@ public class Conf {
logThreshold = 10;
prefixAdmin = "**";
prefixMod = "*";
factionNameMinLength = 3;
factionNameMaxLength = 40;
useRelationColoredChat = true;
mapHeight = 8;
mapWidth = 49;
powerPerPlayer = 10; // One player has 10 power
powerPerMinute = 0.2; // Default health rate... it takes 5 min to heal one power
powerPerDeath = 2; //A death makes you loose 2 power
territoryShieldFactor = 0.5;
useRelationColoredChat = true;
territoryProtectedMaterials.add(Material.WOODEN_DOOR);
territoryProtectedMaterials.add(Material.DISPENSER);
territoryProtectedMaterials.add(Material.CHEST);
territoryProtectedMaterials.add(Material.FURNACE);
colorMember = ChatColor.GREEN;
colorAlly = ChatColor.LIGHT_PURPLE;
@@ -105,7 +103,6 @@ public class Conf {
colorEnemy = ChatColor.RED;
colorSystem = ChatColor.YELLOW;
colorAction = ChatColor.LIGHT_PURPLE;
colorChrome = ChatColor.GOLD;
colorCommand = ChatColor.AQUA;
colorParameter = ChatColor.DARK_AQUA;
@@ -128,7 +125,6 @@ public class Conf {
aliasShow.add("who");
aliasMap.add("map");
aliasHere.add("here");
aliasJoin.add("join");
@@ -177,16 +173,11 @@ public class Conf {
aliasTrue.add("on");
aliasTrue.add("+");
powerPerLand = 1; // 1 power grants one land Perhaps this should not even be a config value...
powerPerPlayer = 10; // One player has 10 power
powerPerMinute = 0.2; // Default health rate... it takes 5 min to heal one power
powerPerDeath = 2; //A death makes you loose 2 power
powerDefaultBonus = 0; //A faction normally has a power bonus
factionNameMinLength = 3;
factionNameMaxLength = 40;
territoryProtectedMaterials.add(Material.WOODEN_DOOR);
territoryProtectedMaterials.add(Material.DISPENSER);
territoryProtectedMaterials.add(Material.CHEST);
territoryProtectedMaterials.add(Material.FURNACE);
mapHeight = 8;
mapWidth = 49;
}
//----------------------------------------------//

View File

@@ -36,6 +36,7 @@ public class EM {
.create();
public static void loadAll() {
folderBase.mkdirs();
configLoad();
Log.threshold = Conf.logThreshold;
boardLoad();
@@ -59,11 +60,12 @@ public class EM {
}
}
Log.info("No conf.json found! Creating a new one with the default values");
//configSave(); // FOR DEBUGGING...
configSave();
return true;
}
public static boolean configSave() {
folderBase.mkdirs();
try {
DiscUtil.write(fileConfig, gson.toJson(new Conf()));
Log.debug("Config was saved to disc");
@@ -91,11 +93,12 @@ public class EM {
}
}
Log.info("No board.json found! Creating a new one with the default values");
//boardSave(); // FOR DEBUGGING...
boardSave();
return true;
}
public static boolean boardSave() {
folderBase.mkdirs();
try {
DiscUtil.write(fileBoard, gson.toJson(new Board()));
Log.debug("Board was saved to disc");

View File

@@ -72,19 +72,15 @@ public class Faction {
// Power
//----------------------------------------------//
public double getPower() {
double ret = this.getPowerBonus();
double ret = 0;
for (Follower follower : this.getFollowersAll()) {
ret += follower.getPower();
}
return ret;
}
public double getPowerBonus() {
return Conf.powerDefaultBonus; // TODO this could be modified by commands later on
}
public double getPowerMax() {
double ret = this.getPowerBonus();
double ret = 0;
for (Follower follower : this.getFollowersAll()) {
ret += follower.getPowerMax();
}
@@ -104,7 +100,7 @@ public class Faction {
}
public double getLandMax() {
return this.getPower() / Conf.powerPerLand;
return this.getPower();
}
public int getLandMaxRounded() {

View File

@@ -203,33 +203,6 @@ public class Follower {
return errors;
}
public ArrayList<String> createFaction(String name) {
ArrayList<String> errors = new ArrayList<String>();
if (this.factionId != 0) {
errors.add(Conf.colorSystem+"You must leave your current faction first.");
}
if (Faction.isNameTaken(name)) {
errors.add(Conf.colorSystem+"That name is already in use.");
}
errors.addAll(Faction.validateName(name));
if (errors.size() > 0) {
return errors;
}
Faction faction = EM.factionCreate();
faction.setName(name);
faction.save();
this.join(faction);
this.role = Role.ADMIN;
this.save();
return errors;
}
public ArrayList<String> invite(Follower follower) {
ArrayList<String> errors = new ArrayList<String>();