diff --git a/civcraft/bin/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.class b/civcraft/bin/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.class index e44326edf..c7b6d3089 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.class and b/civcraft/bin/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/components/ConsumeLevelComponent.class b/civcraft/bin/com/avrgaming/civcraft/components/ConsumeLevelComponent.class index f3b839ded..e2765b671 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/components/ConsumeLevelComponent.class and b/civcraft/bin/com/avrgaming/civcraft/components/ConsumeLevelComponent.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/components/TradeLevelComponent.class b/civcraft/bin/com/avrgaming/civcraft/components/TradeLevelComponent.class index 662daf77f..518dbb7b6 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/components/TradeLevelComponent.class and b/civcraft/bin/com/avrgaming/civcraft/components/TradeLevelComponent.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/main/CivMessage.class b/civcraft/bin/com/avrgaming/civcraft/main/CivMessage.class index 88f1c40f4..09775259c 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/main/CivMessage.class and b/civcraft/bin/com/avrgaming/civcraft/main/CivMessage.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/structure/Barracks$1BarracksSyncUpdate.class b/civcraft/bin/com/avrgaming/civcraft/structure/Barracks$1BarracksSyncUpdate.class index 181fa97a3..05ea91e6a 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/structure/Barracks$1BarracksSyncUpdate.class and b/civcraft/bin/com/avrgaming/civcraft/structure/Barracks$1BarracksSyncUpdate.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/structure/Barracks.class b/civcraft/bin/com/avrgaming/civcraft/structure/Barracks.class index 8570c2842..40f3ca9c1 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/structure/Barracks.class and b/civcraft/bin/com/avrgaming/civcraft/structure/Barracks.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.class b/civcraft/bin/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.class index 86e997cd6..b5d3097e8 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.class and b/civcraft/bin/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.class differ diff --git a/civcraft/bin/com/avrgaming/civcraft/threading/tasks/QuarryAsyncTask.class b/civcraft/bin/com/avrgaming/civcraft/threading/tasks/QuarryAsyncTask.class index 82cbf6e4f..ff69b6bb7 100644 Binary files a/civcraft/bin/com/avrgaming/civcraft/threading/tasks/QuarryAsyncTask.class and b/civcraft/bin/com/avrgaming/civcraft/threading/tasks/QuarryAsyncTask.class differ diff --git a/civcraft/bin/plugin.yml b/civcraft/bin/plugin.yml index 857a87d6e..fbb9d6b33 100644 --- a/civcraft/bin/plugin.yml +++ b/civcraft/bin/plugin.yml @@ -1,7 +1,7 @@ name: CivCraft main: com.avrgaming.civcraft.main.CivCraft softdepends: [TitleAPI] -version: 1.76.1 +version: 1.76.2 commands: town: diff --git a/civcraft/data/buffs.yml b/civcraft/data/buffs.yml index 7dab44d87..3969c397e 100644 --- a/civcraft/data/buffs.yml +++ b/civcraft/data/buffs.yml @@ -316,7 +316,7 @@ buffs: - id: 'buff_globe_theatre_culture_from_towns' name: 'Globe Theatre Culture From Towns' description: 'Increase culture by 10 for every town in the world.' - value: '1' + value: '10' stackable: false parent: diff --git a/civcraft/data/materials.yml b/civcraft/data/materials.yml index 15ba88772..f3ec88be9 100644 --- a/civcraft/data/materials.yml +++ b/civcraft/data/materials.yml @@ -1499,31 +1499,6 @@ materials: - " p " - " s " - - id: 'mat_wood_axe' - item_id: 271 - item_data: 0 - name: 'Training Axe' - craftable: true - shaped: true - category: 'Gear Tier 1' - components: - - name: 'Attack' - value: '5' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 5 - data: -1 - letter: 'p' - - type_id: 280 - data: 0 - letter: 's' - shape: - - "ppp" - - "psp" - - " s " - # Checked 10/8/13 - id: 'mat_leather_helmet' item_id: 298 @@ -2102,31 +2077,6 @@ materials: - " c " - " s " - - id: 'mat_stone_axe' - item_id: 275 - item_data: 0 - name: 'Stone Slicer' - craftable: true - shaped: true - category: 'Gear Tier 1' - components: - - name: 'Attack' - value: '6' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 4 - data: 0 - letter: 'c' - - type_id: 280 - data: 0 - letter: 's' - shape: - - "ccc" - - "csc" - - " s " - # Iron Gear recipes ------------------------------------------------- # Checked 10/8/13 @@ -2156,33 +2106,6 @@ materials: - " i " - " s " - # Checked 10/8/13 - - id: 'mat_iron_axe' - item_id: 258 - item_data: 0 - name: 'Iron Cleaver' - craftable: true - required_techs: 'tech_metal_casting' - shaped: true - category: 'Gear Tier 1' - components: - - name: 'Attack' - value: '14' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 265 - data: 0 - letter: 'i' - - type_id: 280 - data: 0 - letter: 's' - shape: - - "iii" - - "isi" - - " s " - # Checked 10/8/13 - id: 'mat_iron_helmet' item_id: 306 @@ -2412,35 +2335,6 @@ materials: - " b " - " h " - # Checked 10/8/13 - - id: 'mat_steel_axe' - item_id: 258 - item_data: 0 - name: 'Steel Double Axe' - craftable: true - required_techs: 'tech_sword_smithing' - shaped: true - category: 'Gear Tier 2' - components: - - name: 'Attack' - value: '22' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 0 - data: 0 - custom_id: 'mat_steel_sword_blade' - letter: 'b' - - type_id: 0 - data: 0 - custom_id: 'mat_steel_sword_hilt' - letter: 'h' - shape: - - "bbb" - - "bhb" - - " h " - ## Carbide steel - -- - ----------------------------------------- # Checked 10/8/13 @@ -2472,35 +2366,6 @@ materials: - " b " - " h " - # Checked 10/8/13 - - id: 'mat_carbide_steel_axe' - item_id: 283 - item_data: 0 - name: 'Carbide Steel Axe' - craftable: true - required_techs: 'tech_folded_steel' - shaped: true - category: 'Gear Tier 3' - components: - - name: 'Attack' - value: '28' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 0 - data: 0 - custom_id: 'mat_carbide_steel_sword_blade' - letter: 'b' - - type_id: 0 - data: 0 - custom_id: 'mat_carbide_steel_sword_hilt' - letter: 'h' - shape: - - "bbb" - - "bhb" - - " h " - # Checked 10/8/13 - id: 'mat_carbide_steel_helmet' item_id: 314 @@ -2632,34 +2497,6 @@ materials: - " b " - " b " - " h " - # Checked 10/8/13 - - id: 'mat_tungsten_axe' - item_id: 279 - item_data: 0 - name: 'Tungsten Broadaxe' - craftable: true - required_techs: 'tech_tempering' - shaped: true - category: 'Gear Tier 4' - components: - - name: 'Attack' - value: '36' - - name: 'NoVanillaDurability' - - name: 'DurabilityOnDeath' - value: '0.1' - ingredients: - - type_id: 0 - data: 0 - custom_id: 'mat_tungsten_sword_blade' - letter: 'b' - - type_id: 0 - data: 0 - custom_id: 'mat_tungsten_sword_hilt' - letter: 'h' - shape: - - "bbb" - - "bhb" - - " h " # Checked 10/8/13 - id: 'mat_tungsten_boots' @@ -4107,7 +3944,7 @@ materials: - name: 'NoRightClick' - name: 'Catalyst' enhancement: 'LoreEnhancementAttack' - allowed_materials: 'mat_iron_sword, mat_hunting_bow, mat_iron_axe' + allowed_materials: 'mat_iron_sword, mat_hunting_bow' chance: '50' amount: '1' ingredients: @@ -4171,7 +4008,7 @@ materials: - name: 'NoRightClick' - name: 'Catalyst' enhancement: 'LoreEnhancementAttack' - allowed_materials: 'mat_steel_sword, mat_recurve_bow, mat_steel_axe' + allowed_materials: 'mat_steel_sword, mat_recurve_bow' chance: '50' amount: '1' ingredients: @@ -4238,7 +4075,7 @@ materials: - name: 'NoRightClick' - name: 'Catalyst' enhancement: 'LoreEnhancementAttack' - allowed_materials: 'mat_carbide_steel_sword, mat_longbow, mat_carbide_steel_axe' + allowed_materials: 'mat_carbide_steel_sword, mat_longbow' chance: '50' amount: '1' ingredients: @@ -4304,7 +4141,7 @@ materials: - name: 'NoRightClick' - name: 'Catalyst' enhancement: 'LoreEnhancementAttack' - allowed_materials: 'mat_tungsten_sword, mat_marksmen_bow, mat_tungsten_axe' + allowed_materials: 'mat_tungsten_sword, mat_marksmen_bow' chance: '50' amount: '1' ingredients: diff --git a/civcraft/src/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.java b/civcraft/src/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.java index 613bf8464..ff4e7417c 100644 --- a/civcraft/src/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.java +++ b/civcraft/src/com/avrgaming/civcraft/command/resident/ResidentToggleCommand.java @@ -38,7 +38,7 @@ public void init() { commands.put("showscout", CivSettings.localize.localizedString("cmd_res_toggle_showscoutDesc")); commands.put("combatinfo", CivSettings.localize.localizedString("cmd_res_toggle_combatinfoDesc")); commands.put("itemdrops", CivSettings.localize.localizedString("cmd_res_toggle_itemdropsDesc")); - commands.put("titles", CivSettings.localize.localizedString("cmd_res_toggle_itemdropsDesc")); + commands.put("titles", CivSettings.localize.localizedString("cmd_res_toggle_titleAPIDesc")); } public void itemdrops_cmd() throws CivException { diff --git a/civcraft/src/com/avrgaming/civcraft/components/TradeLevelComponent.java b/civcraft/src/com/avrgaming/civcraft/components/TradeLevelComponent.java index 92780ad4d..2e78a8528 100644 --- a/civcraft/src/com/avrgaming/civcraft/components/TradeLevelComponent.java +++ b/civcraft/src/com/avrgaming/civcraft/components/TradeLevelComponent.java @@ -293,7 +293,7 @@ private void processItemsFromStack(ItemStack stack) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_metallic_crystal_4"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_ionic_crystal_4"))); if (itemID.contains("creeper") || itemID.contains("skeleton") || itemID.contains("spider") || itemID.equals("zombie") || itemID.contains("slime") || itemID.contains("enderman")) { - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_tungsten_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_tungsten_sword"))); } else if (itemID.contains("pig") || itemID.contains("cow") || itemID.contains("chicken") || itemID.contains("sheep")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_marksmen_bow"))); } @@ -302,7 +302,7 @@ private void processItemsFromStack(ItemStack stack) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_metallic_crystal_3"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_ionic_crystal_3"))); if (itemID.contains("creeper") || itemID.contains("skeleton") || itemID.contains("spider") || itemID.equals("zombie") || itemID.contains("slime") || itemID.contains("enderman")) { - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_carbide_steel_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_carbide_steel_sword"))); } else if (itemID.contains("pig") || itemID.contains("cow") || itemID.contains("chicken") || itemID.contains("sheep")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_longbow"))); } @@ -311,7 +311,7 @@ private void processItemsFromStack(ItemStack stack) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_metallic_crystal_2"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_ionic_crystal_2"))); if (itemID.contains("creeper") || itemID.contains("skeleton") || itemID.contains("spider") || itemID.equals("zombie") || itemID.contains("slime") || itemID.contains("enderman")) { - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_steel_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_steel_sword"))); } else if (itemID.contains("pig") || itemID.contains("cow") || itemID.contains("chicken") || itemID.contains("sheep")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_recurve_bow"))); } @@ -320,7 +320,7 @@ private void processItemsFromStack(ItemStack stack) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_metallic_crystal_1"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_ionic_crystal_1"))); if (itemID.contains("creeper") || itemID.contains("skeleton") || itemID.contains("spider") || itemID.equals("zombie") || itemID.contains("slime") || itemID.contains("enderman")) { - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_iron_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_iron_sword"))); } else if (itemID.contains("pig") || itemID.contains("cow") || itemID.contains("chicken") || itemID.contains("sheep")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_hunting_bow"))); } diff --git a/civcraft/src/com/avrgaming/civcraft/main/CivMessage.java b/civcraft/src/com/avrgaming/civcraft/main/CivMessage.java index 26fc07057..3e3a6f2b4 100644 --- a/civcraft/src/com/avrgaming/civcraft/main/CivMessage.java +++ b/civcraft/src/com/avrgaming/civcraft/main/CivMessage.java @@ -101,10 +101,10 @@ public static void sendTitle(Object sender, int fadeIn, int show, int fadeOut, S TitleAPI.sendTitle(player, fadeIn, show, fadeOut, title, subTitle); } } -// send(sender, title); -// if (subTitle != "") { -// send(sender, subTitle); -// } + send(sender, title); + if (subTitle != "") { + send(sender, subTitle); + } } @@ -205,9 +205,10 @@ public static void globalTitle(String title, String subTitle) { Resident resident = CivGlobal.getResident(player); if (CivSettings.hasTitleAPI && resident.isTitleAPI()) { CivMessage.sendTitle(player, 10, 60, 10, title, subTitle); - } - send(player, buildTitle(title)); - send(player, subTitle); + } else { + send(player, buildTitle(title)); + send(player, subTitle); + } } } diff --git a/civcraft/src/com/avrgaming/civcraft/structure/Barracks.java b/civcraft/src/com/avrgaming/civcraft/structure/Barracks.java index ff3941306..b5b480872 100644 --- a/civcraft/src/com/avrgaming/civcraft/structure/Barracks.java +++ b/civcraft/src/com/avrgaming/civcraft/structure/Barracks.java @@ -88,8 +88,22 @@ private String getUnitSignText(int index) throws IndexOutOfBoundsException { ConfigUnit unit = unitList.get(index); String out = "\n"; + int previousSettlers = 1; + double coinCost = unit.cost; + if (unit.id.equals("u_settler")) { + + ArrayList entries = CivGlobal.getSessionDB().lookup("settlers:"+this.getCiv().getName()); + if (entries != null) { + for (SessionEntry entry : entries) { + previousSettlers += Integer.parseInt(entry.value); + } + } + + coinCost *= previousSettlers; + } + out += CivColor.LightPurple+unit.name+"\n"; - out += CivColor.Yellow+unit.cost+"\n"; + out += CivColor.Yellow+coinCost+"\n"; out += CivColor.Yellow+CivSettings.CURRENCY_NAME; return out; @@ -130,28 +144,44 @@ private void train(Resident whoClicked) throws CivException { if (this.trainingUnit != null) { throw new CivException(CivSettings.localize.localizedString("var_barracks_inProgress",this.trainingUnit.name)); } - + + int previousSettlers = 1; + double coinCost = unit.cost; if (unit.id.equals("u_settler")) { if (!this.getCiv().getLeaderGroup().hasMember(whoClicked) && !this.getCiv().getAdviserGroup().hasMember(whoClicked)) { throw new CivException(CivSettings.localize.localizedString("barracks_trainSettler_NoPerms")); } + + ArrayList entries = CivGlobal.getSessionDB().lookup("settlers:"+this.getCiv().getName()); + if (entries != null) { + CivLog.debug("entries: "+entries.size()); + for (SessionEntry entry : entries) { + CivLog.debug("value: "+entry.value); + previousSettlers += Integer.parseInt(entry.value); + } + } - unit.cost *= this.getCiv().getTownCount(); - unit.hammer_cost *= this.getCiv().getTownCount(); + CivLog.debug("previousSettlers: "+previousSettlers); + coinCost *= previousSettlers; + CivLog.debug("unit.cost: "+coinCost); } - if (!getTown().getTreasury().hasEnough(unit.cost)) { - throw new CivException(CivSettings.localize.localizedString("var_barracks_tooPoor",unit.name,unit.cost,CivSettings.CURRENCY_NAME)); + if (!getTown().getTreasury().hasEnough(coinCost)) { + throw new CivException(CivSettings.localize.localizedString("var_barracks_tooPoor",unit.name,coinCost,CivSettings.CURRENCY_NAME)); } - getTown().getTreasury().withdraw(unit.cost); + getTown().getTreasury().withdraw(coinCost); this.setCurrentHammers(0.0); this.setTrainingUnit(unit); CivMessage.sendTown(getTown(), CivSettings.localize.localizedString("var_barracks_begin",unit.name)); this.updateTraining(); + if (unit.id.equals("u_settler")) { + CivGlobal.getSessionDB().add("settlers:"+this.getCiv().getName(), "1" , this.getCiv().getId(), this.getCiv().getId(), this.getId()); + } + this.onTechUpdate(); } @Override diff --git a/civcraft/src/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.java b/civcraft/src/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.java index d1ccb696a..a526717df 100644 --- a/civcraft/src/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.java +++ b/civcraft/src/com/avrgaming/civcraft/threading/tasks/MobGrinderAsyncTask.java @@ -152,7 +152,7 @@ public void processMobGrinderUpdate() { } else if (itemID.contains("slime")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_tungsten_sword"))); } else if (itemID.contains("enderman")) { - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_tungsten_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_tungsten_sword"))); } else if (itemID.contains("pig")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_composite_leather_leggings"))); } else if (itemID.contains("cow")) { @@ -237,7 +237,7 @@ public void processMobGrinderUpdate() { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_carbide_steel_sword"))); } else if (itemID.contains("enderman")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_enderman_egg_4"))); - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_carbide_steel_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_carbide_steel_sword"))); } else if (itemID.contains("pig")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_pig_egg_4"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_hardened_leather_leggings"))); @@ -327,7 +327,7 @@ public void processMobGrinderUpdate() { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_steel_sword"))); } else if (itemID.contains("enderman")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_enderman_egg_3"))); - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_steel_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_steel_sword"))); } else if (itemID.contains("pig")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_pig_egg_3"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_refined_leather_leggings"))); @@ -417,7 +417,7 @@ else if (rand1 < ((int)((mobGrinder.getMineralChance(Crystal.BIGPACK))*10000))) newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_iron_sword"))); } else if (itemID.contains("enderman")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_enderman_egg_2"))); - newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_iron_axe"))); + newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_iron_sword"))); } else if (itemID.contains("pig")) { newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_pig_egg_2"))); newItems.add(LoreMaterial.spawn(LoreMaterial.materialMap.get("mat_leather_leggings"))); diff --git a/civcraft/src/plugin.yml b/civcraft/src/plugin.yml index 857a87d6e..fbb9d6b33 100644 --- a/civcraft/src/plugin.yml +++ b/civcraft/src/plugin.yml @@ -1,7 +1,7 @@ name: CivCraft main: com.avrgaming.civcraft.main.CivCraft softdepends: [TitleAPI] -version: 1.76.1 +version: 1.76.2 commands: town: