Skip to content

Commit

Permalink
- New Config Option: economy.price_town_neutrality_charges_per_plot
Browse files Browse the repository at this point in the history
    - Default: false
    - When it is true, the peaceful cost is multiplied by the town's
number of claimed townblocks.
    - Note that the base peacful cost is calculated by the
price_town_neutrality X town_level peacefulCostMultiplier.
    - Closes #6486.
  - New Config Option: economy.price_nation_neutrality_charges_per_town
    - Default: false
    - When it is true, the peaceful cost is multiplied by the nation's
number of towns.
    - Note that the base peacful cost is calculated by the
price_nation_neutrality X nation_level peacefulCostMultiplier.
  • Loading branch information
LlmDl committed Feb 16, 2023
1 parent b46b6ef commit a123cbb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
11 changes: 10 additions & 1 deletion resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8344,4 +8344,13 @@ v0.92.0.11:
- New Command: Add buy subcommand to /ta town NAME.
- Closes #6100.
0.98.6.6:
- Replace world with weakref in WorldCoord, courtesy of Warriorrrr with PR #6451.
- Replace world with weakref in WorldCoord, courtesy of Warriorrrr with PR #6451.
- New Config Option: economy.price_town_neutrality_charges_per_plot
- Default: false
- When it is true, the peaceful cost is multiplied by the town's number of claimed townblocks.
- Note that the base peacful cost is calculated by the price_town_neutrality X town_level peacefulCostMultiplier.
- Closes #6486.
- New Config Option: economy.price_nation_neutrality_charges_per_town
- Default: false
- When it is true, the peaceful cost is multiplied by the nation's number of towns.
- Note that the base peacful cost is calculated by the price_nation_neutrality X nation_level peacefulCostMultiplier.
18 changes: 16 additions & 2 deletions src/com/palmergames/bukkit/config/ConfigNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2143,14 +2143,28 @@ public enum ConfigNodes {
"100.0",
"",
"# The daily upkeep to remain neutral, paid by the Nation bank. If unable to pay, neutral/peaceful status is lost.",
"# This cost is multiplied by the nation_level peacefulCostMultiplier.",
"# Neutrality will exclude you from a war event, as well as deterring enemies."),
ECO_PRICE_NATION_NEUTRALITY_CHARGES_PER_TOWN(
"economy.price_nation_neutrality_charges_per_town",
"false",
"",
"# When it is true, the peaceful cost is multiplied by the nation's number of towns.",
"# Note that the base peacful cost is calculated by the price_nation_neutrality X nation_level peacefulCostMultiplier."),

ECO_PRICE_TOWN_NEUTRALITY(
"economy.price_town_neutrality",
"25.0",
"",
"# The daily upkeep to remain neutral, paid by the Town bank. If unable to pay, neutral/peaceful status is lost."),
"# The daily upkeep to remain neutral, paid by the Town bank. If unable to pay, neutral/peaceful status is lost.",
"# This cost is multiplied by the town_level peacefulCostMultiplier."),
ECO_PRICE_TOWN_NEUTRALITY_CHARGES_PER_PLOT(
"economy.price_town_neutrality_charges_per_plot",
"false",
"",
"# When it is true, the peaceful cost is multiplied by the town's number of claimed townblocks.",
"# Note that the base peacful cost is calculated by the price_town_neutrality X town_level peacefulCostMultiplier."),


ECO_NEW_EXPAND("economy.new_expand", "", ""),
ECO_PRICE_NEW_NATION(
"economy.new_expand.price_new_nation",
Expand Down
14 changes: 12 additions & 2 deletions src/com/palmergames/bukkit/towny/TownySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1546,23 +1546,33 @@ public static boolean isTownSpawnPaidToTown() {
}

public static double getNationNeutralityCost(Nation nation) {
return getNationLevel(nation, nation.getNumResidents()).peacefulCostMultiplier() * getNationNeutralityCost();
double cost = getNationLevel(nation, nation.getNumResidents()).peacefulCostMultiplier() * getNationNeutralityCost();
return isNationNeutralityCostMultipliedByNationTownAmount() ? cost * nation.getTowns().size() : cost;
}

public static double getNationNeutralityCost() {

return getDouble(ConfigNodes.ECO_PRICE_NATION_NEUTRALITY);
}

public static boolean isNationNeutralityCostMultipliedByNationTownAmount() {
return getBoolean(ConfigNodes.ECO_PRICE_NATION_NEUTRALITY_CHARGES_PER_TOWN);
}

public static double getTownNeutralityCost(Town town) {
return getTownLevel(town, town.getNumResidents()).peacefulCostMultiplier() * getTownNeutralityCost();
double cost = getTownLevel(town, town.getNumResidents()).peacefulCostMultiplier() * getTownNeutralityCost();
return isTownNeutralityCostMultipliedByTownClaimsSize() ? cost * town.getTownBlocks().size() : cost;
}

public static double getTownNeutralityCost() {

return getDouble(ConfigNodes.ECO_PRICE_TOWN_NEUTRALITY);
}

public static boolean isTownNeutralityCostMultipliedByTownClaimsSize() {
return getBoolean(ConfigNodes.ECO_PRICE_TOWN_NEUTRALITY_CHARGES_PER_PLOT);
}

public static boolean isAllowingOutposts() {

return getBoolean(ConfigNodes.GTOWN_SETTINGS_ALLOW_OUTPOSTS);
Expand Down

0 comments on commit a123cbb

Please sign in to comment.