mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94129319ab | ||
|
|
2ee65a298c | ||
|
|
73bf026fc0 | ||
|
|
0aad75919e |
No files matched your search
@@ -14,15 +14,12 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.armor;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -45,7 +42,6 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
|
||||
|
||||
public ItemGemLegs() {
|
||||
super(2);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,18 +49,11 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
void tickPlayer(EntityPlayer player) {
|
||||
ItemStack armor = player.getCurrentArmor(1);
|
||||
if (armor.getItemDamage() == 1 || !ThaumicTinkerer.proxy.armorStatus(player))
|
||||
return;
|
||||
PotionEffect effect=player.getActivePotionEffect(Potion.fireResistance);
|
||||
if (effect != null && effect.duration <= 202)
|
||||
effect.duration = 202;
|
||||
else
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 202, 10, true));
|
||||
|
||||
private void setNearBrightNitor(EntityPlayer player) {
|
||||
|
||||
ItemBrightNitor.meta = 1;
|
||||
((ItemBrightNitor)ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)).onUpdate(null, player.worldObj, player, 0, false);
|
||||
((ItemBrightNitor) ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)).onUpdate(null, player.worldObj, player, 0, false);
|
||||
ItemBrightNitor.meta = 0;
|
||||
|
||||
int x = (int) Math.floor(player.posX);
|
||||
@@ -84,6 +73,29 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
|
||||
}
|
||||
}
|
||||
|
||||
private void addPotionEffect(EntityPlayer player, Potion potion, int duration, int level) {
|
||||
PotionEffect effect = player.getActivePotionEffect(potion);
|
||||
if (effect != null && effect.duration < duration)
|
||||
effect.duration = duration;
|
||||
else
|
||||
player.addPotionEffect(new PotionEffect(potion.id, duration, level, true));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void tickPlayer(EntityPlayer player) {
|
||||
if (player.ticksExisted % 5 == 0) {
|
||||
ItemStack armor = player.getCurrentArmor(1);
|
||||
if (armor.getItemDamage() == 1 || !ThaumicTinkerer.proxy.armorStatus(player))
|
||||
return;
|
||||
|
||||
if (player.isBurning()) player.heal(0.5F);
|
||||
addPotionEffect(player, Potion.fireResistance, 119, 10);
|
||||
setNearBrightNitor(player);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_LEGS_GEM;
|
||||
@@ -91,28 +103,16 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
if(!ConfigHandler.enableKami)
|
||||
if (!ConfigHandler.enableKami)
|
||||
return null;
|
||||
return (IRegisterableResearch) new KamiResearchItem(LibResearch.KEY_ICHORCLOTH_LEGS_GEM, new AspectList().add(Aspect.FIRE, 2).add(Aspect.HEAL, 1).add(Aspect.GREED, 1).add(Aspect.ENERGY, 1), 17, 9, 5, new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ARMOR)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_LEGS_GEM), new ResearchPage("1"));
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_LEGS_GEM), new ResearchPage("1"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_ICHORCLOTH_LEGS_GEM, new ItemStack(this), 13, new AspectList().add(Aspect.FIRE, 50).add(Aspect.ARMOR, 32).add(Aspect.HEAL, 32).add(Aspect.ENERGY, 32).add(Aspect.LIGHT, 64).add(Aspect.GREED, 16).add(Aspect.ELDRITCH, 16), (new ItemStack(ThaumicTinkerer.registry.getItemFromClassAndName(ItemIchorclothArmor.class, LibItemNames.ICHOR_LEGS))),
|
||||
new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ConfigItems.itemFocusPrimal), new ItemStack(ConfigItems.itemThaumonomicon), new ItemStack(Items.golden_chestplate), new ItemStack(Items.potionitem, 1, 8195), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusSmelt.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)), new ItemStack(Items.lava_bucket), new ItemStack(Items.fire_charge), new ItemStack(Items.blaze_rod));
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onDamageTaken(LivingHurtEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == this && event.source.isFireDamage() && ThaumicTinkerer.proxy.armorStatus(player)) {
|
||||
event.setCanceled(true);
|
||||
player.heal(event.ammount);
|
||||
}
|
||||
}
|
||||
new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ConfigItems.itemFocusPrimal), new ItemStack(ConfigItems.itemThaumonomicon), new ItemStack(Items.golden_chestplate), new ItemStack(Items.potionitem, 1, 8195), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusSmelt.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)), new ItemStack(Items.lava_bucket), new ItemStack(Items.fire_charge), new ItemStack(Items.blaze_rod));
|
||||
}
|
||||
}
|
||||
@@ -36,14 +36,16 @@ import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
|
||||
public class ItemFocusShadowbeam extends ItemModKamiFocus {
|
||||
|
||||
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 25).add(Aspect.ENTROPY, 25).add(Aspect.AIR, 15);
|
||||
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500).add(Aspect.AIR, 300);
|
||||
|
||||
private static final int DAMAGE = 100;
|
||||
|
||||
public ItemFocusShadowbeam() {
|
||||
super();
|
||||
|
||||
EntityRegistry.registerModEntity(Beam.class, "ShadowbeamStaffBeam", 0, ThaumicTinkerer.instance, 0, 0, false);
|
||||
}
|
||||
|
||||
|
||||
public String getSortingHelper(ItemStack itemstack)
|
||||
{
|
||||
return "TTKSH" + super.getSortingHelper(itemstack);
|
||||
@@ -52,7 +54,7 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus {
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
int potency = wand.getFocusPotency(stack); //TODO verify effect
|
||||
int potency = wand.getFocusPotency(stack);
|
||||
|
||||
if (!player.worldObj.isRemote && wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {
|
||||
|
||||
@@ -83,22 +85,22 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus {
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visUsage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -180,7 +182,7 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus {
|
||||
private int initialOffset = 2;
|
||||
private int length = 298;
|
||||
private int maxTicks = initialOffset + length;
|
||||
private int size = 4;
|
||||
private int size = 2;
|
||||
|
||||
private int potency;
|
||||
private Vector3 movementVector;
|
||||
@@ -234,8 +236,10 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus {
|
||||
return;
|
||||
|
||||
if (movingobjectposition.entityHit != null) {
|
||||
if ((MinecraftServer.getServer().isPVPEnabled() || !(movingobjectposition.entityHit instanceof EntityPlayer)) && movingobjectposition.entityHit != getThrower() && getThrower() instanceof EntityPlayer && !movingobjectposition.entityHit.worldObj.isRemote)
|
||||
movingobjectposition.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), 8 + potency);
|
||||
if ((MinecraftServer.getServer().isPVPEnabled() || !(movingobjectposition.entityHit instanceof EntityPlayer)) && movingobjectposition.entityHit != getThrower() && getThrower() instanceof EntityPlayer && !movingobjectposition.entityHit.worldObj.isRemote) {
|
||||
int fullDamage = (potency>0)? (int) (DAMAGE + DAMAGE * (0.2 * potency)): DAMAGE;
|
||||
movingobjectposition.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), fullDamage);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user