diff --git a/Change Log.txt b/Change Log.txt index fdc4a12c..8c6019da 100644 --- a/Change Log.txt +++ b/Change Log.txt @@ -1,3 +1,10 @@ +######## 1.0.2a ######## +-updated manual-zh_CN.json (Thankyou https://github.com/sfmiyuki for that) +-draconic sword and staff of power now have an unlimited hit rate. (that was supposed to be a thing from the beginning) +-increased the energy cost of the shields last stand ability from 5M RF to 10M RF. +-added support for Avaritia's "Sword of the Cosmos" It will now deal a significant amount of damage to the draconic shield. As it should. +-Note to devs. Please try to avoid bypassing the vanilla damage system. If you want your extremely expensive op weapon to deal a lot of damage then just make it deal a lot of damage. + ######## 1.0.2 ######## -fixed HUD not working with Dual Hotbars installed. -draconic magnet now also accelerates the collection of XP orbs. diff --git a/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java b/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java index 19c60233..0a55e0aa 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java @@ -12,6 +12,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.util.MovingObjectPosition; @@ -46,7 +47,7 @@ public class HudHandler { @SideOnly(Side.CLIENT) public void drawHUD(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getMinecraft(); - if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo) return; + if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo || mc.currentScreen instanceof GuiChat) return; ScaledResolution resolution = event.resolution; width = resolution.getScaledWidth(); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java index cd0c8167..fbd7af9b 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java @@ -7,6 +7,7 @@ import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.network.ShieldHitPacket; import com.brandon3055.draconicevolution.common.utills.IUpgradableItem; import com.brandon3055.draconicevolution.common.utills.LogHelper; +import com.brandon3055.draconicevolution.integration.ModHelper; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.NetworkRegistry; import net.minecraft.entity.SharedMonsterAttributes; @@ -76,7 +77,9 @@ public class CustomArmorHandler { } public static void onPlayerAttacked(LivingAttackEvent event){ - EntityPlayer player = (EntityPlayer)event.entityLiving; + float hitAmount = ModHelper.applyModDamageAdjustments(event); + + EntityPlayer player = (EntityPlayer)event.entityLiving; ArmorSummery summery = new ArmorSummery().getSummery(player); if (applyArmorDamageBlocking(event, summery)) return; @@ -84,13 +87,15 @@ public class CustomArmorHandler { if (summery == null || summery.protectionPoints <= 0 || event.source == ADMIN_KILL) return; event.setCanceled(true); //Ensure that the /kill command can still kill the player - if (event.ammount == Float.MAX_VALUE && !event.source.damageType.equals(ADMIN_KILL.damageType)){ + if (hitAmount == Float.MAX_VALUE && !event.source.damageType.equals(ADMIN_KILL.damageType)){ player.attackEntityFrom(ADMIN_KILL, Float.MAX_VALUE); return; } if ((float)player.hurtResistantTime > (float)player.maxHurtResistantTime / 2.0F) return; - float newEntropy = Math.min(summery.entropy + Math.min(2, event.ammount/5) + player.worldObj.rand.nextFloat(), 100F); + com.brandon3055.brandonscore.common.utills.LogHelper.info(1 + (hitAmount / 10)); + + float newEntropy = Math.min(summery.entropy + 1 + (hitAmount / 20), 100F); //Divide the damage between the armor peaces based on how many of the protection points each peace has float totalAbsorbed = 0; @@ -100,7 +105,7 @@ public class CustomArmorHandler { ItemStack armorPeace = summery.armorStacks[i]; float dmgShear = summery.allocation[i] / summery.protectionPoints; - float dmg = dmgShear * event.ammount; + float dmg = dmgShear * hitAmount; float absorbed = Math.min(dmg, summery.allocation[i]); totalAbsorbed += absorbed; @@ -118,8 +123,8 @@ public class CustomArmorHandler { if (remainingPoints > 0) { player.hurtResistantTime = 20; } - else if (event.ammount-totalAbsorbed > 0){ - player.attackEntityFrom(event.source, event.ammount-totalAbsorbed); + else if (hitAmount-totalAbsorbed > 0){ + player.attackEntityFrom(event.source, hitAmount-totalAbsorbed); } } @@ -147,11 +152,11 @@ public class CustomArmorHandler { } } - if (totalCharge < 5000000) return; + if (totalCharge < 10000000) return; for (int i = 0; i < summery.armorStacks.length; i++){ if (summery.armorStacks[i] != null) { - ((IEnergyContainerItem)summery.armorStacks[i].getItem()).extractEnergy(summery.armorStacks[i], (int) ((charge[i] / (double) totalCharge) * 5000000D), false); + ((IEnergyContainerItem)summery.armorStacks[i].getItem()).extractEnergy(summery.armorStacks[i], (int) ((charge[i] / (double) totalCharge) * 10000000), false); } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java index 2269137c..44f565b7 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java @@ -75,6 +75,7 @@ public class DraconicDistructionStaff extends MiningTool implements IInventoryTo @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { + entity.hurtResistantTime = 0; ToolHandler.damageEntityBasedOnHealth(entity, player, 0.3F); ToolHandler.AOEAttack(player, entity, stack, IConfigurableItem.ProfileHelper.getInteger(stack, References.ATTACK_AOE, 0)); return true; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java index 4dcd7747..c072f7b4 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java @@ -84,6 +84,7 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem, II @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { + entity.hurtResistantTime = 0; ToolHandler.AOEAttack(player, entity, stack, IConfigurableItem.ProfileHelper.getInteger(stack, References.ATTACK_AOE, 0)); ToolHandler.damageEntityBasedOnHealth(entity, player, 0.2F); return true; diff --git a/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java b/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java index 3829d461..902dc46e 100644 --- a/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java +++ b/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java @@ -4,18 +4,21 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraftforge.event.entity.living.LivingAttackEvent; /** * Created by brandon3055 on 29/9/2015. */ public class ModHelper { - public static boolean isTConInstalled; - private static Item cleaver; + public static boolean isTConInstalled; + public static boolean isAvaritiaInstalled; + private static Item cleaver; + private static Item avaritiaSword; public static void init(){ isTConInstalled = Loader.isModLoaded("TConstruct"); - + isAvaritiaInstalled = Loader.isModLoaded("Avaritia"); } public static boolean isHoldingCleaver(EntityPlayer player){ @@ -25,5 +28,23 @@ public class ModHelper { return cleaver != null && player.getHeldItem() != null && player.getHeldItem().getItem().equals(cleaver); } + public static boolean isHoldingAvaritiaSword(EntityPlayer player){ + if (!isAvaritiaInstalled) return false; + else if (avaritiaSword == null) avaritiaSword = GameRegistry.findItem("Avaritia", "Infinity_Sword"); + + return avaritiaSword != null && player.getHeldItem() != null && player.getHeldItem().getItem().equals(avaritiaSword); + } + + public static float applyModDamageAdjustments(LivingAttackEvent event){ + EntityPlayer attacker = event.source.getEntity() instanceof EntityPlayer ? (EntityPlayer) event.source.getEntity() : null; + + if (attacker != null && isHoldingAvaritiaSword(attacker)){ + event.entityLiving.hurtResistantTime = 0; + return 300F; + } + + + return event.ammount; + } } diff --git a/src/main/resources/assets/draconicevolution/manual/manual-en_US.json b/src/main/resources/assets/draconicevolution/manual/manual-en_US.json index b4ac2977..b59e8697 100644 --- a/src/main/resources/assets/draconicevolution/manual/manual-en_US.json +++ b/src/main/resources/assets/draconicevolution/manual/manual-en_US.json @@ -751,7 +751,8 @@ "Structural Setup:", "The Reactor consists of 6 main components. Four Reactor Stabilizers, the Reactor Core and an Energy Injector. You will also need at least two Flux Gates to regulate the reactor.", "Place the Reactor Core at the intended center of the structure.", - "Place the four Stabilizers in a ring around the Core, each facing inwards. The Stabilizers do not need to be in a horizontal ring. You may place one Stabilizer above and one below the Core, all set they can be up to 8 blocks away. They must also be far enough away that they will not be consumed by the expansion of the Core as you continue to energize it. The Core will expand to twice its original size when at full temperature. So, if you intend for the Core to reach maximum capacity, the Stabilizers will need to be placed a minimum of 4 blocks away. To test for adequate Stabilizer linkage to the Core, simply right click the Core and the Reactor GUI will open. If all 4 stabilizers are setup correctly the Reactor status should show as \"OFFLINE\". Otherwise, status will read \"INVALID SETUP\" and require you to make changes in Stabilizer placement before continuing.", + "Place the four Stabilizers in a ring around the Core, each facing inwards. The Stabilizers do not need to be in a horizontal ring. You may place one Stabilizer above and one below the Core, all set they can be up to 8 blocks away. They must also be far enough away that they will not be consumed by the expansion of the Core as you continue to energize it. The Core will expand to twice its original size when at max temperature. So, if you intend for the Core to reach maximum capacity, the Stabilizers will need to be placed a minimum of 4 blocks away. To test for adequate Stabilizer linkage to the Core, simply right click onr of the stabilizers and the Reactor GUI will open. If all 4 stabilizers are setup correctly the Reactor status should show as \"OFFLINE\". Otherwise, status will read \"INVALID SETUP\" and require you to make changes in Stabilizer placement before continuing.", + "If the GUI dose not open at all break and replace the stabilizer making sure there are no blocks between the core and the stabilizer when it is placed. If you can access the gui from all 4 stabilizers they are good to go. This also applies to the energy injector. You can not access the gui from the injector but it is important to make sure there are no blocks obstructing its link to the core when it is placed.", "Once you have Stabilizers and the Core positioned accurately, place the Energy Injector on one of the remaining two sides of the Reactor Core.", "Component Functions:", @@ -977,7 +978,8 @@ "The HUD shows three stats. Shield points (Large Red-Green bar), Entropy (Small Green bar) and the total remaining RF stored in your armor (Small Blue bar). The Numerical values for these stats will also be shown if enabled in the HUD config.", "The Shield Points or Capacity is the number of damage points (Half a heart) the armor can absorb and this will drop when you take damage. As long as any piece of armor has power your shield points will regenerate at the cost of RF. The base regeneration rate is the equivalent of the entire capacity every 3 seconds.", "Entropy ranges from 0 to 100%. It will increase each time you receive damage and will slowly decrease when you are not taking damage. Entropy reduces the rate at which your shield points regenerate. If your entropy reaches 100% your shield will not regenerate at all.", - "The shield can be upgraded using Upgrade Modifiers. Upgrading Shield Capacity will increase your shield points and upgrading Shield Recovery will increase the rate at which Entropy recovers. Note that the recovery rate is calculated by averaging the Recovery Points of all equipped armor pieces." + "The shield can be upgraded using Upgrade Modifiers. Upgrading Shield Capacity will increase your shield points and upgrading Shield Recovery will increase the rate at which Entropy recovers. Note that the recovery rate is calculated by averaging the Recovery Points of all equipped armor pieces.", + "The shield also has a last stand ability. It is capable of blocking any fatal blow at the cost of 10 million RF. If you have less then 10MRF total stored in your armor this ability will not work at all and you will die. " ] }, {