Changed overclock scaling of tools, re-added lifetime check for plasma bolts, added activation checks for more modules

This commit is contained in:
MachineMuse 2013-01-28 17:18:37 -07:00
parent a779bf56b8
commit 9db8ab4abb
5 changed files with 30 additions and 46 deletions

View file

@ -204,30 +204,30 @@ public class Config {
.setDescription("Shovels are good for soft materials like dirt and sand.")
.addInstallCost(new ItemStack(Item.ingotIron, 3))
.addInstallCost(copyAndResize(ItemComponent.solenoid, 1))
.addBaseProperty(ModularCommon.SHOVEL_ENERGY_CONSUMPTION, 10, "J")
.addBaseProperty(ModularCommon.SHOVEL_HARVEST_SPEED, 2, "%")
.addTradeoffProperty("Overclock", ModularCommon.SHOVEL_ENERGY_CONSUMPTION, 990)
.addTradeoffProperty("Overclock", ModularCommon.SHOVEL_HARVEST_SPEED, 18);
.addBaseProperty(ModularCommon.SHOVEL_ENERGY_CONSUMPTION, 100, "J")
.addBaseProperty(ModularCommon.SHOVEL_HARVEST_SPEED, 8, "x")
.addTradeoffProperty("Overclock", ModularCommon.SHOVEL_ENERGY_CONSUMPTION, 900)
.addTradeoffProperty("Overclock", ModularCommon.SHOVEL_HARVEST_SPEED, 17);
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_AXE, TOOLONLY, MuseIcon.TOOL_AXE, ModularCommon.CATEGORY_TOOL)
.setDescription("Axes are mostly for chopping trees.")
.addInstallCost(new ItemStack(Item.ingotIron, 3))
.addInstallCost(copyAndResize(ItemComponent.solenoid, 1))
.addBaseProperty(ModularCommon.AXE_ENERGY_CONSUMPTION, 10, "J")
.addBaseProperty(ModularCommon.AXE_HARVEST_SPEED, 2, "%")
.addTradeoffProperty("Overclock", ModularCommon.AXE_ENERGY_CONSUMPTION, 990)
.addTradeoffProperty("Overclock", ModularCommon.AXE_HARVEST_SPEED, 18);
.addBaseProperty(ModularCommon.AXE_ENERGY_CONSUMPTION, 100, "J")
.addBaseProperty(ModularCommon.AXE_HARVEST_SPEED, 8, "x")
.addTradeoffProperty("Overclock", ModularCommon.AXE_ENERGY_CONSUMPTION, 900)
.addTradeoffProperty("Overclock", ModularCommon.AXE_HARVEST_SPEED, 17);
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_PICKAXE, TOOLONLY, MuseIcon.TOOL_PICK, ModularCommon.CATEGORY_TOOL)
.setDescription("Picks are good for harder materials like stone and ore.")
.addInstallCost(new ItemStack(Item.ingotIron, 3))
.addInstallCost(copyAndResize(ItemComponent.solenoid, 1))
.addBaseProperty(ModularCommon.PICKAXE_ENERGY_CONSUMPTION, 10, "J")
.addBaseProperty(ModularCommon.PICKAXE_HARVEST_SPEED, 2, "%")
.addTradeoffProperty("Overclock", ModularCommon.PICKAXE_ENERGY_CONSUMPTION, 990)
.addTradeoffProperty("Overclock", ModularCommon.PICKAXE_HARVEST_SPEED, 18);
.addBaseProperty(ModularCommon.PICKAXE_ENERGY_CONSUMPTION, 100, "J")
.addBaseProperty(ModularCommon.PICKAXE_HARVEST_SPEED, 8, "x")
.addTradeoffProperty("Overclock", ModularCommon.PICKAXE_ENERGY_CONSUMPTION, 900)
.addTradeoffProperty("Overclock", ModularCommon.PICKAXE_HARVEST_SPEED, 17);
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_DIAMOND_PICK_UPGRADE, TOOLONLY, MuseIcon.DIAMOND_PICK, ModularCommon.CATEGORY_TOOL_ADDON)

View file

@ -123,7 +123,7 @@ public class ModularPowersuits {
Config.loadPowerModules();
EntityRegistry.registerModEntity(EntityPlasmaBolt.class, "entityPlasmaBolt", 2477, this, 128, 20, true);
EntityRegistry.registerModEntity(EntityPlasmaBolt.class, "entityPlasmaBolt", 2477, this, 64, 20, true);
proxy.registerHandlers();
proxy.registerRenderers();
NetworkRegistry.instance().registerGuiHandler(this, guiHandler);

View file

@ -54,6 +54,9 @@ public class EntityPlasmaBolt extends EntityThrowable {
@Override
public void onEntityUpdate() {
super.onEntityUpdate();
if (this.ticksExisted > this.getMaxLifetime()) {
this.setDead();
}
this.size = dataWatcher.getWatchableObjectByte(SIZE);
if (this.isInWater()) {
this.setDead();
@ -69,7 +72,7 @@ public class EntityPlasmaBolt extends EntityThrowable {
public int getMaxLifetime()
{
return 1200;
return 200;
}
/**
@ -98,18 +101,7 @@ public class EntityPlasmaBolt extends EntityThrowable {
@Override
protected void entityInit() {
if (shootingEntity != null) {
Vec3 direction = shootingEntity.getLookVec().normalize();
double scale = 0.1;
this.motionX = direction.xCoord * scale;
this.motionY = direction.yCoord * scale;
this.motionZ = direction.zCoord * scale;
this.posX = shootingEntity.posX;
this.posY = shootingEntity.posY;
this.posZ = shootingEntity.posZ;
}
this.renderDistanceWeight = 10.0D;
lifespan = 100;
}
@Override

View file

@ -60,7 +60,7 @@ public class EventHandler {
}
if (harvestSpeed > 1
&& player.isInsideOfMaterial(Material.water)
&& ItemUtils.itemHasModule(stack, ModularCommon.MODULE_AQUA_AFFINITY)
&& ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_AQUA_AFFINITY)
&& energy > ModuleManager.computeModularProperty(stack, ModularCommon.AQUA_AFFINITY_ENERGY_CONSUMPTION)) {
harvestSpeed *= 5 * ModuleManager.computeModularProperty(stack, ModularCommon.UNDERWATER_HARVEST_SPEED);
}
@ -75,7 +75,7 @@ public class EventHandler {
EntityPlayer player = (EntityPlayer) event.entityLiving;
ItemStack helmet = player.getCurrentArmor(3);
if (helmet != null && helmet.getItem() instanceof IModularItem
&& ItemUtils.itemHasModule(helmet, ModularCommon.MODULE_WATER_ELECTROLYZER)) {
&& ItemUtils.itemHasActiveModule(helmet, ModularCommon.MODULE_WATER_ELECTROLYZER)) {
double energy = ItemUtils.getPlayerEnergy(player);
double energyConsumption = ModuleManager.computeModularProperty(helmet, ModularCommon.WATERBREATHING_ENERGY_CONSUMPTION);
if (energy > energyConsumption && player.getAir() < 10) {
@ -85,11 +85,11 @@ public class EventHandler {
}
ItemStack legs = player.getCurrentArmor(1);
if (legs != null && legs.getItem() instanceof IModularItem
&& ItemUtils.itemHasModule(legs,
&& ItemUtils.itemHasActiveModule(legs,
ModularCommon.MODULE_CLIMB_ASSIST)) {
player.stepHeight = 1.01F;
} else if (player.stepHeight == 1.01F) {
player.stepHeight = 0.5F;
player.stepHeight = 0F;
}
}
}

View file

@ -89,24 +89,16 @@ public class ItemPowerTool extends ItemTool
public static boolean canHarvestBlock(ItemStack stack, Block block, int meta, EntityPlayer player) {
if (player != null) {
double energy = ItemUtils.getPlayerEnergy(player);
if ((ForgeHooks.canToolHarvestBlock(block, meta, ironPickaxe)
|| (!ForgeHooks.canToolHarvestBlock(block, meta, diamondPick) && (
block.blockMaterial == Material.iron
|| block.blockMaterial == Material.anvil
|| block.blockMaterial == Material.rock)))
&& ItemUtils.itemHasModule(stack, ModularCommon.MODULE_PICKAXE)
if (useIronPickaxe(stack, block, meta)
&& energy > ModuleManager.computeModularProperty(stack, ModularCommon.PICKAXE_ENERGY_CONSUMPTION)) {
return true;
} else if ((ForgeHooks.canToolHarvestBlock(block, meta, ironShovel)
|| block == Block.snow)
&& ItemUtils.itemHasModule(stack, ModularCommon.MODULE_SHOVEL)
} else if (useIronShovel(stack, block, meta)
&& energy > ModuleManager.computeModularProperty(stack, ModularCommon.SHOVEL_ENERGY_CONSUMPTION)) {
return true;
} else if (ForgeHooks.canToolHarvestBlock(block, meta, ironAxe) && ItemUtils.itemHasModule(stack, ModularCommon.MODULE_AXE)
} else if (useIronAxe(stack, block, meta)
&& energy > ModuleManager.computeModularProperty(stack, ModularCommon.AXE_ENERGY_CONSUMPTION)) {
return true;
} else if (ForgeHooks.canToolHarvestBlock(block, meta, diamondPick)
&& ItemUtils.itemHasModule(stack, ModularCommon.MODULE_DIAMOND_PICK_UPGRADE)
} else if (useDiamondPickaxe(stack, block, meta)
&& energy > ModuleManager.computeModularProperty(stack, ModularCommon.PICKAXE_ENERGY_CONSUMPTION)) {
return true;
} else {
@ -168,7 +160,7 @@ public class ItemPowerTool extends ItemTool
}
if (drain > 0 && entity.isInsideOfMaterial(Material.water)
&& ItemUtils.itemHasModule(stack, ModularCommon.MODULE_AQUA_AFFINITY)) {
&& ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_AQUA_AFFINITY)) {
drain += ModuleManager.computeModularProperty(stack, ModularCommon.AQUA_AFFINITY_ENERGY_CONSUMPTION);
}
if (entity instanceof EntityPlayer) {
@ -181,7 +173,7 @@ public class ItemPowerTool extends ItemTool
}
public static boolean useIronPickaxe(ItemStack stack, Block block, int meta) {
if (ItemUtils.itemHasModule(stack, ModularCommon.MODULE_PICKAXE)) {
if (ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_PICKAXE)) {
if (ForgeHooks.isToolEffective(ironPickaxe, block, meta)) {
return true;
} else if ((!ForgeHooks.isToolEffective(diamondPick, block, meta)) && (block.blockMaterial == Material.iron
@ -194,7 +186,7 @@ public class ItemPowerTool extends ItemTool
}
public static boolean useIronShovel(ItemStack stack, Block block, int meta) {
if (ItemUtils.itemHasModule(stack, ModularCommon.MODULE_SHOVEL)) {
if (ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_SHOVEL)) {
if (ForgeHooks.isToolEffective(ironShovel, block, meta)) {
return true;
} else if (block.blockMaterial == Material.snow) {
@ -205,7 +197,7 @@ public class ItemPowerTool extends ItemTool
}
public static boolean useIronAxe(ItemStack stack, Block block, int meta) {
if (ItemUtils.itemHasModule(stack, ModularCommon.MODULE_AXE)) {
if (ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_AXE)) {
if (ForgeHooks.isToolEffective(ironAxe, block, meta)) {
return true;
} else if (block.blockMaterial == Material.wood
@ -218,7 +210,7 @@ public class ItemPowerTool extends ItemTool
}
public static boolean useDiamondPickaxe(ItemStack stack, Block block, int meta) {
if (ItemUtils.itemHasModule(stack, ModularCommon.MODULE_DIAMOND_PICK_UPGRADE)) {
if (ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_DIAMOND_PICK_UPGRADE)) {
if (ForgeHooks.isToolEffective(diamondPick, block, meta)) {
return true;
} else if (block.blockMaterial == Material.iron