mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-21 04:32:12 +00:00
Added config options for weapons.
This commit is contained in:
1 parent
7978a50267
commit
dcba0e1071
11 files changed
+172
-80
No files matched your search
+33
@@ -22,6 +22,15 @@ public class BalanceConfigHandler
|
||||
public static int draconicCapacitorStoragePerUpgrade = 50000000;
|
||||
public static int draconicCapacitorMaxReceive = 10000000;
|
||||
public static int draconicCapacitorMaxExtract = 100000000;
|
||||
public static int wyvernWeaponsBaseStorage = 1000000;
|
||||
public static int wyvernWeaponsStoragePerUpgrade = 500000;
|
||||
public static int wyvernWeaponsMaxTransfer = 50000;
|
||||
public static int wyvernWeaponsEnergyPerAttack = 250;
|
||||
public static int draconicWeaponsBaseStorage = 10000000;
|
||||
public static int draconicWeaponsStoragePerUpgrade = 5000000;
|
||||
public static int draconicWeaponsMaxTransfer = 500000;
|
||||
public static int draconicWeaponsEnergyPerAttack = 250;
|
||||
public static int draconicFireEnergyCostMultiptier = 30;
|
||||
private static Configuration config;
|
||||
public static void init(File modConfigurationDirectory)
|
||||
{
|
||||
@@ -76,6 +85,30 @@ public class BalanceConfigHandler
|
||||
draconicCapacitorMaxExtract =
|
||||
getInteger("energy.tools", "Draconic Flux Capacitor: Maximum energy extraction rate (RF/t)",
|
||||
draconicCapacitorMaxExtract);
|
||||
wyvernWeaponsBaseStorage =
|
||||
getInteger("energy.weapons", "Wyvern Weapons: Base energy storage (RF)", wyvernWeaponsBaseStorage);
|
||||
wyvernWeaponsStoragePerUpgrade =
|
||||
getInteger("energy.weapons", "Wyvern Weapons: Additional energy storage per upgrade installed (RF)",
|
||||
wyvernWeaponsStoragePerUpgrade);
|
||||
wyvernWeaponsMaxTransfer = getInteger("energy.weapons", "Wyvern Weapons: Maximum energy transfer rate (RF/t)",
|
||||
wyvernWeaponsMaxTransfer);
|
||||
wyvernWeaponsEnergyPerAttack =
|
||||
getInteger("energy.weapons", "Wyvern Weapons: Amount of energy required to perform attack (RF)",
|
||||
wyvernWeaponsEnergyPerAttack);
|
||||
draconicWeaponsBaseStorage =
|
||||
getInteger("energy.weapons", "Draconic Weapons: Base energy storage (RF)", draconicWeaponsBaseStorage);
|
||||
draconicWeaponsStoragePerUpgrade =
|
||||
getInteger("energy.weapons", "Draconic Weapons: Additional energy storage per upgrade installed (RF)",
|
||||
draconicWeaponsStoragePerUpgrade);
|
||||
draconicWeaponsMaxTransfer =
|
||||
getInteger("energy.weapons", "Draconic Weapons: Maximum energy transfer rate (RF/t)",
|
||||
draconicWeaponsMaxTransfer);
|
||||
draconicWeaponsEnergyPerAttack =
|
||||
getInteger("energy.weapons", "Draconic Weapons: Amount of energy required to perform attack (RF)",
|
||||
draconicWeaponsEnergyPerAttack);
|
||||
draconicFireEnergyCostMultiptier =
|
||||
getInteger("energy.weapons", "Arrow of Draconic Fire: Energy cost multiplier",
|
||||
draconicFireEnergyCostMultiptier);
|
||||
if (config.hasChanged())
|
||||
{
|
||||
config.save();
|
||||
|
||||
+12
-6
@@ -8,6 +8,7 @@ import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.MiningTool;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.IEnergyContainerWeaponItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
@@ -28,8 +29,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class DraconicDistructionStaff extends MiningTool implements IInventoryTool, IRenderTweak {
|
||||
|
||||
public class DraconicDistructionStaff extends MiningTool implements IInventoryTool, IRenderTweak, IEnergyContainerWeaponItem {
|
||||
|
||||
public DraconicDistructionStaff() {
|
||||
super(ModItems.CHAOTIC);
|
||||
@@ -37,9 +37,9 @@ public class DraconicDistructionStaff extends MiningTool implements IInventoryTo
|
||||
this.setHarvestLevel("pickaxe", 10);
|
||||
this.setHarvestLevel("shovel", 10);
|
||||
this.setHarvestLevel("axe", 10);
|
||||
this.setCapacity(BalanceConfigHandler.draconicToolsBaseStorage * 3);
|
||||
this.setMaxExtract(BalanceConfigHandler.draconicToolsMaxTransfer * 3);
|
||||
this.setMaxReceive(BalanceConfigHandler.draconicToolsMaxTransfer * 3);
|
||||
this.setCapacity(BalanceConfigHandler.draconicToolsBaseStorage * 2 + BalanceConfigHandler.draconicWeaponsBaseStorage);
|
||||
this.setMaxExtract(BalanceConfigHandler.draconicToolsMaxTransfer * 2 + BalanceConfigHandler.draconicWeaponsMaxTransfer);
|
||||
this.setMaxReceive(BalanceConfigHandler.draconicToolsMaxTransfer * 2 + BalanceConfigHandler.draconicWeaponsMaxTransfer);
|
||||
this.energyPerOperation = BalanceConfigHandler.draconicToolsEnergyPerAction;
|
||||
ModItems.register(this);
|
||||
}
|
||||
@@ -152,7 +152,8 @@ public class DraconicDistructionStaff extends MiningTool implements IInventoryTo
|
||||
@Override
|
||||
public int getCapacity(ItemStack stack) {
|
||||
int points = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return BalanceConfigHandler.draconicToolsBaseStorage * 3 + points * BalanceConfigHandler.draconicToolsStoragePerUpgrade;
|
||||
return BalanceConfigHandler.draconicToolsBaseStorage * 2 + BalanceConfigHandler.draconicWeaponsBaseStorage +
|
||||
points * (BalanceConfigHandler.draconicToolsStoragePerUpgrade + BalanceConfigHandler.draconicWeaponsStoragePerUpgrade);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,4 +172,9 @@ public class DraconicDistructionStaff extends MiningTool implements IInventoryTo
|
||||
list.add(InfoHelper.ITC()+StatCollector.translateToLocal("info.de.attackDamage.txt")+": "+ InfoHelper.HITC()+ToolHandler.getBaseAttackDamage(stack));
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public int getEnergyPerAttack()
|
||||
{
|
||||
return BalanceConfigHandler.draconicWeaponsEnergyPerAttack;
|
||||
}
|
||||
}
|
||||
-5
@@ -293,11 +293,6 @@ public abstract class MiningTool extends ToolBase implements IUpgradableItem {
|
||||
}};
|
||||
}
|
||||
|
||||
public int getCapacity(ItemStack stack){
|
||||
int i = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return i * 5000000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEfficiency(ItemStack stack) {
|
||||
int i = EnumUpgrade.DIG_SPEED.getUpgradePoints(stack);
|
||||
|
||||
+25
-16
@@ -1,9 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.common.items.tools.baseclasses;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.IEnergyContainerWeaponItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
@@ -22,8 +23,6 @@ import net.minecraft.network.play.server.S23PacketBlockChange;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ToolHandler {
|
||||
// public static Block[] destroyList = {Blocks.cobblestone, Blocks.stone, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.grass, Blocks.netherrack};
|
||||
//
|
||||
@@ -138,12 +137,12 @@ public class ToolHandler {
|
||||
|
||||
public static void damageEntityBasedOnHealth(Entity entity, EntityPlayer player, float dmgMult) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack == null || !(stack.getItem() instanceof IEnergyContainerItem)){
|
||||
if (stack == null || !(stack.getItem() instanceof IEnergyContainerWeaponItem)){
|
||||
LogHelper.error("[ToolHandler.java:147] WTF? I don't get it... Player "+player.getCommandSenderName()+" whacked something with a DE weapon but that they are not holding? Ok someone is messing with my shit...");
|
||||
return;
|
||||
}
|
||||
|
||||
IEnergyContainerItem item = (IEnergyContainerItem) stack.getItem();
|
||||
IEnergyContainerWeaponItem item = (IEnergyContainerWeaponItem) stack.getItem();
|
||||
float baseAttack = getDamageAgainstEntity(stack, entity);
|
||||
|
||||
if (entity instanceof EntityLivingBase)
|
||||
@@ -162,14 +161,17 @@ public class ToolHandler {
|
||||
}
|
||||
}
|
||||
|
||||
int rf = (int)baseAttack * References.ENERGYPERATTACK;
|
||||
if (rf > item.getEnergyStored(stack)) baseAttack = item.getEnergyStored(stack) / References.ENERGYPERATTACK;
|
||||
int rf = (int)baseAttack * item.getEnergyPerAttack();
|
||||
if (rf > item.getEnergyStored(stack)) {
|
||||
baseAttack = item.getEnergyStored(stack) / item.getEnergyPerAttack();
|
||||
rf = item.getEnergyStored(stack);
|
||||
}
|
||||
if (baseAttack <= 0) baseAttack = 1;
|
||||
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage(player), baseAttack);
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, stack) > 0) entity.setFire(EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, stack) * 15);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) item.extractEnergy(stack, (int)baseAttack * References.ENERGYPERATTACK, false);
|
||||
if (!player.capabilities.isCreativeMode) item.extractEnergy(stack, rf, false);
|
||||
|
||||
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
@@ -209,20 +211,23 @@ public class ToolHandler {
|
||||
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range).expand(1.0D, 1.0D, 1.0D);
|
||||
List list = world.getEntitiesWithinAABBExcludingEntity(player, box);
|
||||
if (range == 0) return;
|
||||
IEnergyContainerItem item = (IEnergyContainerItem)stack.getItem();
|
||||
IEnergyContainerWeaponItem item = (IEnergyContainerWeaponItem)stack.getItem();
|
||||
|
||||
for (Object entityObject : list) {
|
||||
if (item.getEnergyStored(stack) < References.ENERGYPERATTACK) break;
|
||||
if (item.getEnergyStored(stack) < item.getEnergyPerAttack()) break;
|
||||
if (entityObject instanceof EntityLivingBase) {
|
||||
EntityLivingBase entityLivingBase = (EntityLivingBase) entityObject;
|
||||
if (entityLivingBase.getEntityId() == entity.getEntityId()) continue;
|
||||
|
||||
float dmg = getDamageAgainstEntity(stack, entityLivingBase);
|
||||
int rf = (int)dmg * References.ENERGYPERATTACK;
|
||||
if (rf > item.getEnergyStored(stack)) dmg = item.getEnergyStored(stack) / References.ENERGYPERATTACK;
|
||||
int rf = (int)dmg * item.getEnergyPerAttack();
|
||||
if (rf > item.getEnergyStored(stack)) {
|
||||
dmg = item.getEnergyStored(stack) / item.getEnergyPerAttack();
|
||||
rf = item.getEnergyStored(stack);
|
||||
}
|
||||
|
||||
entityLivingBase.attackEntityFrom(DamageSource.causePlayerDamage(player), dmg);
|
||||
item.extractEnergy(stack, ((int) dmg) * References.ENERGYPERATTACK, false);
|
||||
item.extractEnergy(stack, rf, false);
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, stack) > 0) entityLivingBase.setFire(EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, stack) * 15);
|
||||
|
||||
|
||||
@@ -252,10 +257,14 @@ public class ToolHandler {
|
||||
}
|
||||
else if (entityObject instanceof EntityDragonProjectile) {
|
||||
float dmg = getDamageAgainstEntity(stack, ((Entity)entityObject));
|
||||
int rf = (int)dmg * References.ENERGYPERATTACK;
|
||||
if (rf > item.getEnergyStored(stack)) dmg = item.getEnergyStored(stack) / References.ENERGYPERATTACK;
|
||||
int rf = (int)dmg * item.getEnergyPerAttack();
|
||||
if (rf > item.getEnergyStored(stack)) {
|
||||
dmg = item.getEnergyStored(stack) / item.getEnergyPerAttack();
|
||||
rf = item.getEnergyStored(stack);
|
||||
}
|
||||
|
||||
((Entity)entityObject).attackEntityFrom(DamageSource.causePlayerDamage(player), dmg);
|
||||
item.extractEnergy(stack, rf, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-8
@@ -1,9 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomArrow;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityEnderArrow;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
@@ -18,8 +21,6 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BowHandler {
|
||||
|
||||
public static ItemStack onBowRightClick(Item bow, ItemStack stack, World world, EntityPlayer player){
|
||||
@@ -156,13 +157,14 @@ public class BowHandler {
|
||||
|
||||
public int calculateEnergyCost(){
|
||||
updateValues();
|
||||
double rfCost = 80;
|
||||
double rfCost = (bow.getItem() instanceof IEnergyContainerWeaponItem) ?
|
||||
((IEnergyContainerWeaponItem) bow.getItem()).getEnergyPerAttack() : 80;
|
||||
|
||||
rfCost *= 1 + arrowDamage;
|
||||
rfCost *= (1 + arrowSpeed) * (1 + arrowSpeed) * (1 + arrowSpeed);
|
||||
rfCost *= 1 + explosionPower * 20;
|
||||
rfCost *= 1 + shockWavePower * 10;
|
||||
if (energyBolt) rfCost *= 30;
|
||||
if (energyBolt) rfCost *= BalanceConfigHandler.draconicFireEnergyCostMultiptier;
|
||||
|
||||
return (int)rfCost;
|
||||
}
|
||||
@@ -171,7 +173,7 @@ public class BowHandler {
|
||||
updateValues();
|
||||
|
||||
if (player == null) return false;
|
||||
if (!(bow.getItem() instanceof IEnergyContainerItem)){
|
||||
if (!(bow.getItem() instanceof IEnergyContainerWeaponItem)){
|
||||
cantFireMessage = "[Error] This bow is not a valid energy container (This is a bug, Please report on the Draconic Evolution github)";
|
||||
return false;
|
||||
}
|
||||
@@ -183,7 +185,7 @@ public class BowHandler {
|
||||
cantFireMessage = "msg.de.explosiveNotForEnergyBolts.txt";
|
||||
return false;
|
||||
}
|
||||
else if (calculateEnergyCost() > ((IEnergyContainerItem)bow.getItem()).getEnergyStored(bow) && !player.capabilities.isCreativeMode){
|
||||
else if (calculateEnergyCost() > ((IEnergyContainerWeaponItem)bow.getItem()).getEnergyStored(bow) && !player.capabilities.isCreativeMode){
|
||||
cantFireMessage = "msg.de.insufficientPowerToFire.txt";
|
||||
return false;
|
||||
}
|
||||
@@ -198,7 +200,7 @@ public class BowHandler {
|
||||
}
|
||||
|
||||
private void updateValues(){
|
||||
arrowDamage = (float)IConfigurableItem.ProfileHelper.getFloat(bow, "BowArrowDamage", IUpgradableItem.EnumUpgrade.ARROW_DAMAGE.getUpgradePoints(bow));
|
||||
arrowDamage = IConfigurableItem.ProfileHelper.getFloat(bow, "BowArrowDamage", IUpgradableItem.EnumUpgrade.ARROW_DAMAGE.getUpgradePoints(bow));
|
||||
arrowSpeed = 1F + IConfigurableItem.ProfileHelper.getFloat(bow, "BowArrowSpeedModifier", 0F);
|
||||
explosionPower = IConfigurableItem.ProfileHelper.getFloat(bow, "BowExplosionPower", 0F);
|
||||
shockWavePower = IConfigurableItem.ProfileHelper.getFloat(bow, "BowShockWavePower", 0F);
|
||||
@@ -218,7 +220,7 @@ public class BowHandler {
|
||||
* */
|
||||
public boolean consumeArrowAndEnergy(){
|
||||
|
||||
if (!player.capabilities.isCreativeMode)((IEnergyContainerItem)bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
|
||||
if (!player.capabilities.isCreativeMode)((IEnergyContainerWeaponItem)bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
|
||||
|
||||
if (!energyBolt && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, bow) == 0 && !player.capabilities.isCreativeMode) {
|
||||
player.inventory.consumeInventoryItem(Items.arrow);
|
||||
|
||||
+26
-11
@@ -1,6 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.BrandonsCore;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
@@ -8,6 +10,7 @@ import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
@@ -33,12 +36,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableItem, IEnergyContainerItem, IHudDisplayItem
|
||||
public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem
|
||||
{
|
||||
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
||||
|
||||
protected int capacity = BalanceConfigHandler.draconicWeaponsBaseStorage;
|
||||
protected int maxReceive = BalanceConfigHandler.draconicWeaponsMaxTransfer;
|
||||
protected int maxExtract = BalanceConfigHandler.draconicWeaponsMaxTransfer;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] iconArray;
|
||||
|
||||
@@ -132,7 +136,7 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 10000000));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", capacity));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,7 +246,7 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
|
||||
@Override
|
||||
public int getBaseUpgradePoints(int upgradeIndex) {
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 2;
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 0;
|
||||
else if (upgradeIndex == EnumUpgrade.DRAW_SPEED.index) return 4;
|
||||
else if (upgradeIndex == EnumUpgrade.ARROW_SPEED.index) return 3;
|
||||
else if (upgradeIndex == EnumUpgrade.ARROW_DAMAGE.index) return 3;
|
||||
@@ -269,8 +273,11 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = ItemNBTHelper.getInteger(container, "Energy", 0);
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(References.DRACONICTRANSFER, maxReceive));
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
@@ -282,8 +289,11 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = ItemNBTHelper.getInteger(container, "Energy", 0);
|
||||
int energyExtracted = Math.min(energy, maxExtract);
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
@@ -299,8 +309,8 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack stack) {
|
||||
int i = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return i * 5000000;
|
||||
int points = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return BalanceConfigHandler.draconicWeaponsBaseStorage + points * BalanceConfigHandler.draconicWeaponsStoragePerUpgrade;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -331,6 +341,11 @@ public class DraconicBow extends ItemBow implements IInventoryTool, IUpgradableI
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public int getEnergyPerAttack()
|
||||
{
|
||||
return BalanceConfigHandler.draconicWeaponsEnergyPerAttack;
|
||||
}
|
||||
|
||||
//endregion
|
||||
}
|
||||
+16
-11
@@ -1,6 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.BrandonsCore;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
@@ -9,6 +11,7 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolBase;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
@@ -36,13 +39,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DraconicSword extends ItemSword implements IEnergyContainerItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem {
|
||||
protected int capacity = References.DRACONICCAPACITY;
|
||||
protected int maxReceive = References.DRACONICTRANSFER;
|
||||
protected int maxExtract = References.DRACONICTRANSFER * 50;
|
||||
public class DraconicSword extends ItemSword implements IEnergyContainerWeaponItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem {
|
||||
protected int capacity = BalanceConfigHandler.draconicWeaponsBaseStorage;
|
||||
protected int maxReceive = BalanceConfigHandler.draconicWeaponsMaxTransfer;
|
||||
protected int maxExtract = BalanceConfigHandler.draconicWeaponsMaxTransfer;
|
||||
|
||||
public DraconicSword() {
|
||||
super(ModItems.AWAKENED);
|
||||
@@ -155,8 +155,8 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem, II
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
int i = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(container);
|
||||
return i * 5000000;
|
||||
int points = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(container);
|
||||
return BalanceConfigHandler.draconicWeaponsBaseStorage + points * BalanceConfigHandler.draconicWeaponsStoragePerUpgrade;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,7 +260,7 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem, II
|
||||
|
||||
@Override
|
||||
public int getBaseUpgradePoints(int upgradeIndex) {
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 2;
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 0;
|
||||
else if (upgradeIndex == EnumUpgrade.ATTACK_AOE.index) return 2;
|
||||
return 0;
|
||||
}
|
||||
@@ -305,4 +305,9 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem, II
|
||||
public boolean hasProfiles() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getEnergyPerAttack()
|
||||
{
|
||||
return BalanceConfigHandler.draconicWeaponsEnergyPerAttack;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
public interface IEnergyContainerWeaponItem extends IEnergyContainerItem
|
||||
{
|
||||
int getEnergyPerAttack();
|
||||
}
|
||||
+26
-11
@@ -1,6 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.BrandonsCore;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
@@ -8,6 +10,7 @@ import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
@@ -33,12 +36,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableItem, IEnergyContainerItem, IHudDisplayItem {
|
||||
public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem {
|
||||
|
||||
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
||||
|
||||
protected int capacity = BalanceConfigHandler.wyvernWeaponsBaseStorage;
|
||||
protected int maxReceive = BalanceConfigHandler.wyvernWeaponsMaxTransfer;
|
||||
protected int maxExtract = BalanceConfigHandler.wyvernWeaponsMaxTransfer;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] iconArray;
|
||||
|
||||
@@ -141,7 +145,7 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 1000000));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", capacity));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,7 +247,7 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
|
||||
@Override
|
||||
public int getBaseUpgradePoints(int upgradeIndex) {
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 2;
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 0;
|
||||
else if (upgradeIndex == EnumUpgrade.DRAW_SPEED.index) return 3;
|
||||
else if (upgradeIndex == EnumUpgrade.ARROW_SPEED.index) return 1;
|
||||
else if (upgradeIndex == EnumUpgrade.ARROW_DAMAGE.index) return 2;
|
||||
@@ -265,8 +269,11 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = ItemNBTHelper.getInteger(container, "Energy", 0);
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(References.WYVERNTRANSFER, maxReceive));
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
@@ -278,8 +285,11 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = ItemNBTHelper.getInteger(container, "Energy", 0);
|
||||
int energyExtracted = Math.min(energy, maxExtract);
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
@@ -295,8 +305,8 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack stack) {
|
||||
int i = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return i * 500000;
|
||||
int points = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(stack);
|
||||
return BalanceConfigHandler.wyvernWeaponsBaseStorage + points * BalanceConfigHandler.wyvernWeaponsStoragePerUpgrade;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -328,6 +338,11 @@ public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableIte
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public int getEnergyPerAttack()
|
||||
{
|
||||
return BalanceConfigHandler.wyvernWeaponsEnergyPerAttack;
|
||||
}
|
||||
//endregion
|
||||
}
|
||||
|
||||
+16
-11
@@ -1,6 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.BrandonsCore;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
@@ -9,6 +11,7 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolBase;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
@@ -37,14 +40,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class WyvernSword extends ItemSword implements IEnergyContainerWeaponItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem{
|
||||
|
||||
public class WyvernSword extends ItemSword implements IEnergyContainerItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem{
|
||||
|
||||
protected int capacity = References.WYVERNCAPACITY;
|
||||
protected int maxReceive = References.WYVERNTRANSFER;
|
||||
protected int maxExtract = References.WYVERNTRANSFER;
|
||||
protected int capacity = BalanceConfigHandler.wyvernWeaponsBaseStorage;
|
||||
protected int maxReceive = BalanceConfigHandler.wyvernWeaponsMaxTransfer;
|
||||
protected int maxExtract = BalanceConfigHandler.wyvernWeaponsMaxTransfer;
|
||||
|
||||
public WyvernSword() {
|
||||
super(ModItems.WYVERN);
|
||||
@@ -164,8 +164,8 @@ public class WyvernSword extends ItemSword implements IEnergyContainerItem, IInv
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
int i = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(container);
|
||||
return i * 500000;
|
||||
int points = IUpgradableItem.EnumUpgrade.RF_CAPACITY.getUpgradePoints(container);
|
||||
return BalanceConfigHandler.wyvernWeaponsBaseStorage + points * BalanceConfigHandler.wyvernWeaponsStoragePerUpgrade;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -264,7 +264,7 @@ public class WyvernSword extends ItemSword implements IEnergyContainerItem, IInv
|
||||
|
||||
@Override
|
||||
public int getBaseUpgradePoints(int upgradeIndex) {
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 2;
|
||||
if (upgradeIndex == EnumUpgrade.RF_CAPACITY.index) return 0;
|
||||
else if (upgradeIndex == EnumUpgrade.ATTACK_AOE.index) return 1;
|
||||
|
||||
return 0;
|
||||
@@ -310,5 +310,10 @@ public class WyvernSword extends ItemSword implements IEnergyContainerItem, IInv
|
||||
public boolean hasProfiles() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getEnergyPerAttack()
|
||||
{
|
||||
return BalanceConfigHandler.wyvernWeaponsEnergyPerAttack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ public final class References {
|
||||
public static final int WYVERNTRANSFER = 50000;
|
||||
public static final int DRACONICCAPACITY = 10000000;
|
||||
public static final int DRACONICTRANSFER = 500000;
|
||||
public static final int ENERGYPERATTACK = 250;
|
||||
|
||||
public static final int MAX_WYVERN_UPGRADES = 3;
|
||||
public static final int MAX_DRACONIC_UPGRADES = 6;
|
||||
|
||||
Reference in new issue
Block a user