Added melee assist module and new icon
This commit is contained in:
parent
ee78a97e4e
commit
345d362348
4 changed files with 45 additions and 13 deletions
|
@ -94,7 +94,8 @@ public class MuseIcon {
|
|||
public static final MuseIcon ALIEN = new MuseIcon(WC_ICON_PATH, 78);
|
||||
public static final MuseIcon NETHERSTAR = new MuseIcon(WC_ICON_PATH, 94);
|
||||
public static final MuseIcon ARCREACTOR = new MuseIcon(WC_ICON_PATH, 110);
|
||||
|
||||
public static final MuseIcon PUNCHY = new MuseIcon(WC_ICON_PATH, 233);
|
||||
|
||||
String texturefile;
|
||||
int index;
|
||||
|
||||
|
|
|
@ -156,16 +156,29 @@ public class Config {
|
|||
module = new PowerModule(ModularCommon.MODULE_PLASMA_CANNON, TOOLONLY, MuseIcon.WEAPON_ELECTRIC, ModularCommon.CATEGORY_WEAPON)
|
||||
.setDescription("Use electrical arcs in a containment field to superheat air to a plasma and launch it at enemies.")
|
||||
.setToggleable(true)
|
||||
.addBaseProperty(ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 10)
|
||||
.addBaseProperty(ModularCommon.PLASMA_CANNON_DAMAGE_AT_FULL_CHARGE, 2)
|
||||
.addTradeoffProperty("Voltage", ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 100)
|
||||
.addTradeoffProperty("Voltage", ModularCommon.PLASMA_CANNON_DAMAGE_AT_FULL_CHARGE, 10)
|
||||
.addTradeoffProperty("Amperage", ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 100)
|
||||
.addTradeoffProperty("Amperage", ModularCommon.PLASMA_CANNON_EXPLOSIVENESS, 2)
|
||||
.addBaseProperty(ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 10, "J")
|
||||
.addBaseProperty(ModularCommon.PLASMA_CANNON_DAMAGE_AT_FULL_CHARGE, 2, "pt")
|
||||
.addTradeoffProperty("Voltage", ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 100, "J")
|
||||
.addTradeoffProperty("Voltage", ModularCommon.PLASMA_CANNON_DAMAGE_AT_FULL_CHARGE, 10, "pt")
|
||||
.addTradeoffProperty("Amperage", ModularCommon.PLASMA_CANNON_ENERGY_PER_TICK, 100, "J")
|
||||
.addTradeoffProperty("Amperage", ModularCommon.PLASMA_CANNON_EXPLOSIVENESS, 2, "deciCreepers")
|
||||
.addInstallCost(copyAndResize(ItemComponent.fieldEmitter, 2))
|
||||
.addInstallCost(copyAndResize(ItemComponent.hvcapacitor, 2));
|
||||
ModuleManager.addModule(module);
|
||||
|
||||
module = new PowerModule(ModularCommon.MODULE_MELEE_ASSIST, TOOLONLY, MuseIcon.PUNCHY, ModularCommon.CATEGORY_WEAPON)
|
||||
.setDescription("A much simpler addon, makes your powertool punches hit harder.")
|
||||
.setToggleable(true)
|
||||
.addBaseProperty(ModularCommon.PUNCH_ENERGY, 10, "J")
|
||||
.addBaseProperty(ModularCommon.PUNCH_DAMAGE, 2, "pt")
|
||||
.addTradeoffProperty("Impact", ModularCommon.PUNCH_ENERGY, 100, "J")
|
||||
.addTradeoffProperty("Impact", ModularCommon.PUNCH_DAMAGE, 8, "pt")
|
||||
.addTradeoffProperty("Carry-through", ModularCommon.PUNCH_ENERGY, 20, "J")
|
||||
.addTradeoffProperty("Carry-through", ModularCommon.PUNCH_KNOCKBACK, 1, "P")
|
||||
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 2))
|
||||
.addInstallCost(copyAndResize(ItemComponent.lvcapacitor, 1));
|
||||
ModuleManager.addModule(module);
|
||||
|
||||
module = new PowerModule(ModularCommon.MODULE_BASIC_PLATING, ARMORONLY, MuseIcon.MODULE_IRON_PLATING, ModularCommon.CATEGORY_ARMOR)
|
||||
.setDescription("Basic plating is heavy but protective.")
|
||||
.addInstallCost(copyAndResize(ItemComponent.basicPlating, 1))
|
||||
|
@ -315,7 +328,7 @@ public class Config {
|
|||
.setDescription("A jetpack should allow you to jump indefinitely, or at least until you run out of power.")
|
||||
.setToggleable(true)
|
||||
.addInstallCost(copyAndResize(ItemComponent.ionThruster, 4))
|
||||
.addBaseProperty(ModularCommon.JET_ENERGY_CONSUMPTION, 0, "J/s")
|
||||
.addBaseProperty(ModularCommon.JET_ENERGY_CONSUMPTION, 0, "J/t")
|
||||
.addBaseProperty(ModularCommon.JET_THRUST, 0, "N")
|
||||
.addTradeoffProperty("Thrust", ModularCommon.JET_ENERGY_CONSUMPTION, 150)
|
||||
.addTradeoffProperty("Thrust", ModularCommon.JET_THRUST, 0.16);
|
||||
|
|
|
@ -22,6 +22,8 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import universalelectricity.core.electricity.ElectricInfo;
|
||||
|
@ -63,8 +65,8 @@ public class ItemPowerTool extends ItemTool
|
|||
setMaxDamage(0);
|
||||
this.damageVsEntity = 1;
|
||||
setCreativeTab(Config.getCreativeTab());
|
||||
setIconIndex(10);
|
||||
setTextureFile(MuseIcon.SEBK_ICON_PATH);
|
||||
setIconIndex(59);
|
||||
setTextureFile(MuseIcon.WC_ICON_PATH);
|
||||
setItemName(Config.Items.PowerTool.idName);
|
||||
LanguageRegistry.addName(this, Config.Items.PowerTool.englishName);
|
||||
}
|
||||
|
@ -125,9 +127,21 @@ public class ItemPowerTool extends ItemTool
|
|||
* entry argument beside stack. They just raise the damage on the stack.
|
||||
*/
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack,
|
||||
EntityLiving entityDoingHitting, EntityLiving entityBeingHit) {
|
||||
// stack.damageItem(2, entityBeingHit);
|
||||
public boolean hitEntity(ItemStack stack, EntityLiving entityBeingHit, EntityLiving entityDoingHitting) {
|
||||
if (entityDoingHitting instanceof EntityPlayer && ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_MELEE_ASSIST)) {
|
||||
EntityPlayer player = (EntityPlayer) entityDoingHitting;
|
||||
double drain = ModuleManager.computeModularProperty(stack, ModularCommon.PUNCH_ENERGY);
|
||||
if (ItemUtils.getPlayerEnergy(player) > drain) {
|
||||
ItemUtils.drainPlayerEnergy(player, drain);
|
||||
double damage = ModuleManager.computeModularProperty(stack, ModularCommon.PUNCH_DAMAGE);
|
||||
double knockback = ModuleManager.computeModularProperty(stack, ModularCommon.PUNCH_KNOCKBACK);
|
||||
DamageSource damageSource = DamageSource.causePlayerDamage(player);
|
||||
if (entityBeingHit.attackEntityFrom(damageSource, (int) damage)) {
|
||||
Vec3 lookVec = player.getLookVec();
|
||||
entityBeingHit.addVelocity(lookVec.xCoord * knockback, Math.abs(lookVec.yCoord + 0.2f) * knockback, lookVec.zCoord * knockback);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ public abstract class ModularCommon {
|
|||
public static final String PLASMA_CANNON_ENERGY_PER_TICK = "Plasma Energy Per Tick";
|
||||
public static final String PLASMA_CANNON_DAMAGE_AT_FULL_CHARGE = "Plasma Damage At Full Charge";
|
||||
public static final String PLASMA_CANNON_EXPLOSIVENESS = "Plasma Explosiveness";
|
||||
public static final String PUNCH_ENERGY = "Punch Energy Consumption";
|
||||
public static final String PUNCH_DAMAGE = "Melee Damage";
|
||||
public static final String PUNCH_KNOCKBACK = "Melee Knockback";
|
||||
|
||||
/**
|
||||
* Module names
|
||||
|
@ -78,6 +81,7 @@ public abstract class ModularCommon {
|
|||
public static final String MODULE_CLIMB_ASSIST = "Uphill Step Assist";
|
||||
public static final String MODULE_SWIM_BOOST = "Swim Boost";
|
||||
public static final String MODULE_PLASMA_CANNON = "Plasma Cannon";
|
||||
public static final String MODULE_MELEE_ASSIST = "Melee Assist";
|
||||
|
||||
/**
|
||||
* Categories for modules
|
||||
|
|
Loading…
Reference in a new issue