Skip to content

Commit 27a6e9a

Browse files
committed
MekaBow finish
1 parent eb05785 commit 27a6e9a

File tree

5 files changed

+95
-15
lines changed

5 files changed

+95
-15
lines changed

src/main/java/mekanism/common/moduleUpgrade.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public enum moduleUpgrade {
2424

2525
//mekaBow
2626
ARROWENERGY_UNIT("arrowenergy_unit",1),
27-
27+
ARROWVELOCITY_UNIT("arrowvelocity_unit",8),
28+
AUTOFIRE_UNIT("autofire_unit",1),
29+
DRAWSPEED_UNIT("drawspeed_unit",3),
30+
MultipleArrowsUnit("MultiplearrowsUnit",4),
2831
;
2932

3033

@@ -70,6 +73,9 @@ public static NBTTagCompound getTagFor(moduleUpgrade module, int amount) {
7073
public String getName() {
7174
return name;
7275
}
76+
public String getLangName() {
77+
return LangUtils.localize("item.module." + name + ".name");
78+
}
7379

7480
public String getDescription() {
7581
return LangUtils.localize("module." + name + ".desc");
@@ -79,4 +85,7 @@ public int getMax() {
7985
return maxStack;
8086
}
8187

88+
public boolean canMultiply() {
89+
return getMax() > 1;
90+
}
8291
}
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
package mekanism.weapons.common.item;
22

3-
import mekanism.common.moduleUpgrade;
4-
import mekanism.common.util.ItemDataUtils;
53
import mekanism.weapons.common.entity.EntityMekaArrow;
6-
import net.minecraft.enchantment.EnchantmentHelper;
74
import net.minecraft.entity.EntityLivingBase;
8-
import net.minecraft.entity.player.EntityPlayer;
9-
import net.minecraft.init.Enchantments;
105
import net.minecraft.item.ItemStack;
116
import net.minecraft.world.World;
127

13-
import java.util.Map;
14-
158
public class ItemMekaArrow extends ItemWeapons {
169

1710
public ItemMekaArrow() {
@@ -24,6 +17,4 @@ public EntityMekaArrow createArrow(World worldIn, ItemStack stack, EntityLivingB
2417
}
2518

2619

27-
28-
2920
}

src/main/java/mekanism/weapons/common/item/ItemMekaBow.java

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import net.minecraftforge.fml.common.Optional;
3838
import net.minecraftforge.fml.relauncher.Side;
3939
import net.minecraftforge.fml.relauncher.SideOnly;
40+
import org.lwjgl.input.Keyboard;
4041

4142
import javax.annotation.Nonnull;
4243
import javax.annotation.Nullable;
@@ -95,8 +96,13 @@ public void addInformation(ItemStack itemstack, World world, List<String> list,
9596
list.add(EnumColor.AQUA + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack), getMaxEnergy(itemstack)));
9697
if (ItemDataUtils.hasData(itemstack, "module")) {
9798
Map<moduleUpgrade, Integer> module = moduleUpgrade.buildMap(ItemDataUtils.getDataMap(itemstack));
98-
for (Entry<moduleUpgrade, Integer> entry : module.entrySet()) {
99-
list.add(entry.getKey().getName() + (entry.getKey().canMultiply() ? ": " + EnumColor.GREY + "x" + entry.getValue() : ""));
99+
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
100+
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails"));
101+
} else {
102+
list.add(EnumColor.ORANGE + LangUtils.localize("tooltip.hold_for_modules") + ": ");
103+
for (Entry<moduleUpgrade, Integer> entry : module.entrySet()) {
104+
list.add("- " + entry.getKey().getLangName() + (entry.getKey().canMultiply() ? ": " + EnumColor.GREY + "x" + entry.getValue() : ""));
105+
}
100106
}
101107
}
102108
}
@@ -147,7 +153,7 @@ public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityLivingB
147153
if (fire) {
148154
entityarrow.setFire(100);
149155
}
150-
if (noConsume || ArrowAmount > 0) {
156+
if (noConsume) {
151157
entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
152158
}
153159
world.spawnEntity(entityarrow);
@@ -177,7 +183,7 @@ public int getArrowNumber(ItemStack itemStack) {
177183
itemStack.setTagCompound(null);
178184
}
179185
}
180-
return clamp(quantity, 0, 10);
186+
return clamp(quantity * 2, 0, 10);
181187
}
182188

183189
public int getSpeed(ItemStack itemStack) {
@@ -268,11 +274,31 @@ public void getSubItems(@Nonnull CreativeTabs tabs, @Nonnull NonNullList<ItemSta
268274
}
269275
ItemStack discharged = new ItemStack(this);
270276
list.add(discharged);
277+
271278
ItemStack charged = new ItemStack(this);
272279
setEnergy(charged, ((IEnergizedItem) charged.getItem()).getMaxEnergy(charged));
273280
list.add(charged);
281+
282+
ItemStack fullupgrade = new ItemStack(this);
283+
for (moduleUpgrade upgrade : getValidModule(fullupgrade)) {
284+
upgrades.put(upgrade, upgrade.getMax());
285+
moduleUpgrade.saveMap(upgrades, ItemDataUtils.getDataMap(fullupgrade));
286+
}
287+
setEnergy(fullupgrade, ((IEnergizedItem) fullupgrade.getItem()).getMaxEnergy(fullupgrade));
288+
list.add(fullupgrade);
289+
290+
ItemStack full = new ItemStack(this);
291+
for (moduleUpgrade upgrade : getValidModule(full)) {
292+
upgrades.put(upgrade, upgrade.getMax());
293+
moduleUpgrade.saveMap(upgrades, ItemDataUtils.getDataMap(full));
294+
}
295+
setEnergy(full, ((IEnergizedItem) full.getItem()).getMaxEnergy(full));
296+
full.addEnchantment(Enchantments.POWER,5);
297+
full.addEnchantment(Enchantments.PUNCH,2);
298+
list.add(full);
274299
}
275300

301+
276302
@Override
277303
public int getItemEnchantability() {
278304
return 5;

src/main/resources/assets/mekanism/lang/en_us.lang

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,4 +1689,32 @@ holiday.mekanism.christmas.4=family :)
16891689
holiday.mekanism.may_4.1=May the 4th be with you,
16901690
holiday.mekanism.new_year.1=Happy New Year
16911691
holiday.mekanism.new_year.2=Best wishes to you as we enter this
1692-
holiday.mekanism.new_year.3=new and exciting year of %s
1692+
holiday.mekanism.new_year.3=new and exciting year of %s
1693+
1694+
1695+
tooltip.hold_for_modules=hold for modules
1696+
item.module.EnergyUnit.name=Energy Unit
1697+
module.EnergyUnit.desc=Increases maximum energy capacity.
1698+
item.module.attack_damage.name=Attack Amplification Unit
1699+
module.attack_damage.desc=Bonus Attack Damage
1700+
item.module.SolarRechargingUnit.name=Solar Recharging Unit
1701+
module.SolarRechargingUnit.desc=Harnesses the power of the sun to charge your MekaSuit.
1702+
item.module.ElectrolyticBreathingUnit.name=Electrolytic Breathing Unit
1703+
module.ElectrolyticBreathingUnit.desc=Uses electrolysis to create breathable oxygen from water.
1704+
item.module.VisionEnhancementUnit.name=Vision Enhancement Unit
1705+
module.VisionEnhancementUnit.desc=Brightens the surrounding environment, allowing the user to see through darkness.
1706+
item.module.InhalationPurificationUnit.name=Inhalation Purification Unit
1707+
module.InhalationPurificationUnit.desc=Applies a miniature electromagnetic field around the breathing apparatus, preventing selected potion effect types.
1708+
item.module.NutritionalInjectionUnit.name=Nutritional Injection Unit
1709+
module.NutritionalInjectionUnit.desc=Automatically feeds the player Nutritional Paste when hungry.
1710+
item.module.arrowenergy_unit.name=Energy Arrows Unit
1711+
module.arrowenergy_unit.desc=Fire arrows made of pure energy. Removes the need for ammunition.
1712+
item.module.arrowvelocity_unit.name=Arrow Velocity Unit
1713+
module.arrowvelocity_unit.desc=Multiply the velocity of the arrows.
1714+
item.module.autofire_unit.name=Auto Fire Unit
1715+
module.autofire_unit.desc=Fires automatically when the Meka-Bow is fully charged.
1716+
item.module.drawspeed_unit.name=Draw Speed Unit
1717+
module.drawspeed_unit.desc=Increases the draw speed of the Meka-Bow.
1718+
item.module.MultiplearrowsUnit.name=Compound arrow unit
1719+
module.MultiplearrowsUnit.desc=More arrows are fired with each shot
1720+

src/main/resources/assets/mekanism/lang/zh_cn.lang

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,3 +1668,29 @@ cmd.mekceu.performance_report.task_used_time=并行操作总耗时: %s 毫秒
16681668

16691669
cmd.mekceu.performance_report.task_used_time_avg=并行操作平均耗时: %s 毫秒
16701670
cmd.mekceu.performance_report.used_time_avg=单个任务平均耗时: %s 微秒
1671+
1672+
tooltip.hold_for_modules=已安装的模块
1673+
item.module.EnergyUnit.name=能量单元
1674+
module.EnergyUnit.desc=增加最大能量容量
1675+
item.module.attack_damage.name=攻击增强单元
1676+
module.attack_damage.desc=额外攻击伤害
1677+
item.module.SolarRechargingUnit.name=太阳能充电单元
1678+
module.SolarRechargingUnit.desc=利用太阳能为你的MekaSuit充电。安装多个以加快充电速度。
1679+
item.module.ElectrolyticBreathingUnit.name=电解呼吸装置
1680+
module.ElectrolyticBreathingUnit.desc=利用电解从水中产生可呼吸的氧气。
1681+
item.module.VisionEnhancementUnit.name=视觉增强单元
1682+
module.VisionEnhancementUnit.desc=照亮周围环境,让玩家透过黑暗看到世界。
1683+
item.module.InhalationPurificationUnit.name=吸入净化单元
1684+
module.InhalationPurificationUnit.desc=在呼吸器周围施加一个微型电磁场,防止所选药水效果类型。
1685+
item.module.NutritionalInjectionUnit.name=营养注射单元
1686+
module.NutritionalInjectionUnit.desc=当玩家饿的时候,自动给玩家提供营养糊剂。
1687+
item.module.arrowenergy_unit.name=能量箭单元
1688+
module.arrowenergy_unit.desc=Meka科技弓使用由能量产生的箭矢,而无需实体箭矢。
1689+
item.module.arrowvelocity_unit.name=破风单元
1690+
module.arrowvelocity_unit.desc=减少空气阻力,提高Meka科技弓射出的箭矢飞行速度。
1691+
item.module.autofire_unit.name=自动射击单元
1692+
module.autofire_unit.desc=Meka科技弓完全充能后将自动持续射击。
1693+
item.module.drawspeed_unit.name=快速充能单元
1694+
module.drawspeed_unit.desc=提高Meka科技弓的蓄力速度。
1695+
item.module.MultiplearrowsUnit.name=复合箭头单元
1696+
module.MultiplearrowsUnit.desc=每次射击时会射出更多箭矢

0 commit comments

Comments
 (0)