Skip to content

Commit

Permalink
Fix a Math issue with the Tech discount for Era's
Browse files Browse the repository at this point in the history
  • Loading branch information
ataranlen committed Mar 2, 2016
1 parent a8f1698 commit 6c0231e
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 47 deletions.
Binary file modified civcraft/bin/com/avrgaming/civcraft/config/ConfigTech.class
Binary file not shown.
Binary file modified civcraft/bin/com/avrgaming/civcraft/event/GoodieRepoEvent.class
Binary file not shown.
Binary file modified civcraft/bin/com/avrgaming/civcraft/main/CivMessage.class
Binary file not shown.
Binary file modified civcraft/bin/com/avrgaming/civcraft/structure/TownHall.class
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion civcraft/bin/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CivCraft
main: com.avrgaming.civcraft.main.CivCraft
softdepends: [TitleAPI]
version: 1.76.2
version: 1.76.3

commands:
town:
Expand Down
28 changes: 16 additions & 12 deletions civcraft/localization/default_lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2008,8 +2008,8 @@ var_civ_gift_tooyoung1: "[%0] cannot participate in gifting/merging civs or town

var_civ_debt_endWar: "[%0] was in debt too long and can no longer maintain it's aggressive war with [%1]."

var_cultureEnterMsg: "Entering the civ borders of [%0]"
var_cultureLeaveMsg: "Leaving the civ borders of [%0]"
var_cultureEnterMsg: "Entering civ [%0]. "
var_cultureLeaveMsg: "Leaving civ [%0]. "

# =========================== Resident.java Messages =========================
var_resident_debtmsg: "You are in debt by [%0] [%1]!"
Expand Down Expand Up @@ -2469,7 +2469,8 @@ var_townHall_dynmap_heading: "Town hall of [%0]"
townHall_dynmap_cultureLevel: "Culture Level:"
townHall_dynmap_flatTax: "Flat Tax:"
townHall_dynmap_propertyTax: "Property Tax:"
var_townHall_destroyed_isCap: "The Civilization of [%0] has been conquered by [%1]!"
var_townHall_destroyed_isCap: "[%0] Defeated!"
var_townHall_destroyed_isCap2: "conquered by [%0]!"
var_townHall_victoryOverItem: "Victory Over [%0]!"
var_townHall_victoryOverItem_withCannon: "Victory Over [%0] via Cannons!"
var_townHall_destroyed: "The Town of [%0] in [%1] has been conquered by [%2]!"
Expand Down Expand Up @@ -2570,10 +2571,10 @@ espionage_missionAborted: "You've left the civ borders. Mission Aborted."
var_FoundTownSync_Success: "The town of [%0] has been founded in the Civilization of [%1]!"

#---- playerChunkNotify ----
playerChunkNotify_enterWilderness: "Entering Wilderness - "
var_playerChunkNotify_EnterTown: "Entering the town of [%0] [%1]. "
var_playerChunkNotify_EnterOutpost: "Entering an Outpost of the town of [%0] [%1]. "
var_playerChunkNotify_enterCamp: "Entering the camp called [%0] - "
playerChunkNotify_enterWilderness: "Wilderness - "
var_playerChunkNotify_EnterTown: "[%0] [%1]. "
var_playerChunkNotify_EnterOutpost: "Outpost [%0] [%1]. "
var_playerChunkNotify_enterCamp: "Camp [%0] - "
var_playerChunkNotify_enteredBorderAlert: "[%0] has entered our borders!"

#---- PlayerLoginAsync ----
Expand Down Expand Up @@ -2847,10 +2848,10 @@ war_wartimeBegin_title_length: "War time will last for [%0] hours."

cmd_res_toggle_titleAPIDesc: "Toggles displaying of on screen titles."

var_civ_found_successTitle: "New Civilization of [%0]!"
var_civ_found_successSubTitle: "Capitol: [%0] - Founded by: [%1]"
var_civ_found_successTitle: "[%0] Founded!"
var_civ_found_successSubTitle: "Capitol: [%0] - Leader: [%1]"

general_upkeep_tick: "Starting Daily Upkeep Processing"
general_upkeep_tick: "Daily Upkeep Started"
general_upkeep_tick_finish: "Daily Upkeep Finished"

announce_ancientEra: "The Ancient Era"
Expand All @@ -2861,7 +2862,7 @@ announce_industrialEra: "The Industrial Era"
announce_modernEra: "The Modern Era"
announce_atomicEra: "The Atomic Era"
announce_informationEra: "The Information Era"
var_announce_newEraCiv: "Has been achieved by [%0]."
var_announce_newEraCiv: "Civ: [%0]"

cmd_town_unclaim_errorTownHall: "You cannot unclaim a town chunk containing your town hall."
stable_missingTech_MilitaryScience: "You need the technology 'Military Science' in order to buy this."
Expand All @@ -2882,4 +2883,7 @@ var_missionBook_subvert_errorInTribalism: "[%0] is in Tribalism and has no gover
var_missionBook_subvert_alert1: "[%0] has fallen into Anarchy due to the work of spies"
var_missionBook_subvert_success1: "Mission Accomplished, [%0] is now in Anarchy"
# =========================== END 1.76 =========================
# ----------------------------------------------------------------
# ----------------------------------------------------------------

# 1.76.3
goodieRepoBroadcastTitle: "Trade Goodie Repo"
4 changes: 2 additions & 2 deletions civcraft/src/com/avrgaming/civcraft/config/ConfigTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static double eraRate(Civilization civ) {
public double getAdjustedBeakerCost(Civilization civ) {
double rate = 1.0;
rate -= eraRate(civ);
return Math.floor(this.beaker_cost*=rate);
return Math.floor(this.beaker_cost*Math.max(rate, .01));
}

public double getAdjustedTechCost(Civilization civ) {
Expand All @@ -86,7 +86,7 @@ public double getAdjustedTechCost(Civilization civ) {
rate = Math.max(rate, 0.75);
rate -= eraRate(civ);

return Math.floor(this.cost * rate);
return Math.floor(this.cost * Math.max(rate, .01));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public void run() {
public void process() {
CivLog.info("TimerEvent: GoodieRepo -------------------------------------");
repoProcess();
CivMessage.globalTitle(CivSettings.localize.localizedString("goodieRepoBroadcast"),"");
CivMessage.globalTitle(CivSettings.localize.localizedString("goodieRepoBroadcastTitle"),"");
CivMessage.global(CivSettings.localize.localizedString("goodieRepoBroadcast"));
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion civcraft/src/com/avrgaming/civcraft/main/CivMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public static void globalTitle(String title, String subTitle) {
CivMessage.sendTitle(player, 10, 60, 10, title, subTitle);
} else {
send(player, buildTitle(title));
send(player, subTitle);
if (!subTitle.equals("")) {
send(player, subTitle);
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions civcraft/src/com/avrgaming/civcraft/structure/TownHall.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public void onControlBlockDestroy(ControlPoint cp, World world, Player player, S
if (allDestroyed) {

if (this.getTown().getCiv().getCapitolName().equals(this.getTown().getName())) {
CivMessage.globalTitle(CivColor.LightBlue+ChatColor.BOLD+CivSettings.localize.localizedString("var_townHall_destroyed_isCap",this.getTown().getCiv().getName(),attacker.getCiv().getName()),"");
CivMessage.globalTitle(CivColor.LightBlue+CivSettings.localize.localizedString("var_townHall_destroyed_isCap",this.getTown().getCiv().getName()),CivSettings.localize.localizedString("var_townHall_destroyed_isCap2",attacker.getCiv().getName()));
for (Town town : this.getTown().getCiv().getTowns()) {
town.defeated = true;
}
Expand Down Expand Up @@ -412,7 +412,7 @@ public void onControlBlockCannonDestroy(ControlPoint cp, Player player, Structur
if (allDestroyed) {

if (this.getTown().getCiv().getCapitolName().equals(this.getTown().getName())) {
CivMessage.globalTitle(CivColor.LightBlue+ChatColor.BOLD+CivSettings.localize.localizedString("var_townHall_destroyed_isCap",this.getTown().getCiv().getName(),attacker.getCiv().getName()),"");
CivMessage.globalTitle(CivColor.LightBlue+CivSettings.localize.localizedString("var_townHall_destroyed_isCap",this.getTown().getCiv().getName()),CivSettings.localize.localizedString("var_townHall_destroyed_isCap2",attacker.getCiv().getName()));
for (Town town : this.getTown().getCiv().getTowns()) {
town.defeated = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,12 @@ private void showPlotMoveMessage() {
//We've entered a camp.
if (toCamp != null && toCamp != fromCamp) {
title += CivColor.Gold+CivSettings.localize.localizedString("var_playerChunkNotify_enterCamp",toCamp.getName())+" "+CivColor.Rose+"[PvP]";
}

if (toCamp == null && fromCamp != null) {
} else if (toCamp == null && fromCamp != null) {
title += getToWildMessage();
}

// From Wild, to town
} else if (fromTc != null && toTc == null) {
// From a town... to the wild
title += getToWildMessage();
}
if (fromTc == null && toTc != null) {
// To Town
Town t = toTc.getTown();
Expand All @@ -156,27 +155,21 @@ private void showPlotMoveMessage() {

}

// From a town... to the wild
if (fromTc != null && toTc == null) {
title += getToWildMessage();
}

// To another town(should never happen with culture...)
if (fromTc != null && toTc != null && fromTc.getTown() != toTc.getTown()) {
title += getToTownMessage(toTc.getTown(), toTc);
}

if (toTc != null) {
subTitle += toTc.getOnEnterString(player, fromTc);
}
// // To another town(should never happen with culture...)
// if (fromTc != null && toTc != null && fromTc.getTown() != toTc.getTown()) {
// title += getToTownMessage(toTc.getTown(), toTc);
// }

// if (toTc != null) {
// subTitle += toTc.getOnEnterString(player, fromTc);
// }

// Leaving culture to the wild.
if (fromCc != null && toCc == null) {
title += fromCc.getOnLeaveString();
}

// Leaving wild, entering culture.
if (fromCc == null && toCc != null) {
subTitle += fromCc.getOnLeaveString();
} else if (fromCc == null && toCc != null) { // Leaving wild, entering culture.
title += toCc.getOnEnterString();
if (civilization != null) {
if (civilization == toCc.getCiv()) {
Expand All @@ -185,10 +178,9 @@ private void showPlotMoveMessage() {
subTitle += CivSettings.localize.localizedString("var_civ_border_relation",civilization.getDiplomacyManager().getRelation(toCc.getCiv()).toString());
} }
onCultureEnter(toCc);
}

//Leaving one civ's culture, into another.
if (fromCc != null && toCc !=null && fromCc.getCiv() != toCc.getCiv()) {
}else if (fromCc != null && toCc !=null && fromCc.getCiv() != toCc.getCiv()) {
//Leaving one civ's culture, into another.

title += fromCc.getOnLeaveString() +" | "+ toCc.getOnEnterString();
onCultureEnter(toCc);
if (civilization != null) {
Expand Down
2 changes: 1 addition & 1 deletion civcraft/src/com/avrgaming/sls/SLSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static String getParsedVersion() {
public static void sendHeartbeat() {
try {
InetAddress address = InetAddress.getByName("atlas.civcraft.net");
// String message = gen_id+";<a href=\""+serverURL+"\" title=\""+serverURLDescription+"\" target=\"_blank\" style=\"color: #0012FF\"><strong>"+serverName+"</strong></a>;<strong>"+serverDescription+"</strong>;<strong>"+serverTimezone+"</strong>;<strong>"+serverAddress+"</strong>;"+
// String message = gen_id+";<a href=\""+serverURL+"\" title=\""+serverURLDescription+"\" target=\"_blank\" style=\"color: #0012FF\"><strong>"+serverName+"</strong></a>;<strong>"+serverDescription+"</strong>;<strong>"+serverTimezone+"</strong>;<a href=\""+serverURL+"\" title=\""+serverURLDescription+"\" target=\"_blank\" style=\"color: #0012FF\"><strong>"+serverAddress+"</strong></a>;"+

String message = gen_id+";"+serverName+";"+serverDescription+";"+serverTimezone+";"+serverAddress+";"+
Bukkit.getOnlinePlayers().size()+";"+Bukkit.getMaxPlayers()+";"+getParsedVersion();
Expand Down
2 changes: 1 addition & 1 deletion civcraft/src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CivCraft
main: com.avrgaming.civcraft.main.CivCraft
softdepends: [TitleAPI]
version: 1.76.2
version: 1.76.3

commands:
town:
Expand Down

0 comments on commit 6c0231e

Please sign in to comment.