mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-24 05:44:34 +00:00
Creation shard changes
This commit is contained in:
1 parent
df2d97bd55
commit
a839993345
2 files changed
+77
-72
No files matched your search
@@ -22,6 +22,7 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import taintedmagic.client.handler.HUDHandler;
|
||||
import taintedmagic.common.items.equipment.ItemLumosRing;
|
||||
import taintedmagic.common.items.tools.ItemHollowDagger;
|
||||
import taintedmagic.common.items.wand.foci.ItemFocusMageMace;
|
||||
@@ -111,75 +112,76 @@ public class TMEventHandler {
|
||||
* Some hacky code to make the Mage's Mace work...
|
||||
*/
|
||||
public void modifyAttackDamage (final EntityPlayer player) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
final IInventory inv = player.inventory;
|
||||
if (player.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack stack = inv.getStackInSlot(i);
|
||||
final ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem();
|
||||
final IInventory inv = player.inventory;
|
||||
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof WandRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack stack = inv.getStackInSlot(i);
|
||||
final ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem();
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof WandRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof WandRod) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof WandRod) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
stack.stackTagCompound.removeTag("AttributeModifiers");
|
||||
}
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
stack.stackTagCompound.removeTag("AttributeModifiers");
|
||||
}
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
5.0D + ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
5.0D + ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier", 6.0D, 0);
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier", 6.0D, 0);
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,21 +253,24 @@ public class TMEventHandler {
|
||||
* Give the player the Creation research upon crafting the Shard of Creation
|
||||
*/
|
||||
public void giveResearch (final EntityPlayer player) {
|
||||
if (!player.worldObj.isRemote && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
// CREATION
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "CREATION");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player);
|
||||
player.addChatMessage(
|
||||
new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.creation")));
|
||||
player.playSound("thaumcraft:wind", 1.0F, 5.0F);
|
||||
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player);
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 80, 0));
|
||||
player.addPotionEffect(new PotionEffect(Config.potionBlurredID, 200, 0));
|
||||
// effects
|
||||
HUDHandler.displayString(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.creation"), 3200,
|
||||
false);
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:egidle", 1.0F, 1.0F);
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:heartbeat", 1.0F, 1.0F);
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200, -1));
|
||||
}
|
||||
// OUTERREV
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,12 +279,14 @@ public class TMEventHandler {
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void itemTooltip (final ItemTooltipEvent event) {
|
||||
// mage mace attack dmg
|
||||
if (event.itemStack.getItem() instanceof ItemFocusMageMace
|
||||
&& event.toolTip.contains(StatCollector.translateToLocal("item.Focus.cost1"))) {
|
||||
event.toolTip.remove(StatCollector.translateToLocal("item.Focus.cost1"));
|
||||
event.toolTip.add(1, StatCollector.translateToLocal("item.Focus.cost3"));
|
||||
}
|
||||
|
||||
// voidtouched items
|
||||
if (event.itemStack.stackTagCompound != null && event.itemStack.stackTagCompound.getBoolean("voidtouched")) {
|
||||
event.toolTip.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.voidtouched"));
|
||||
}
|
||||
|
||||
@@ -132,10 +132,8 @@ public class RecipeRegistry {
|
||||
|
||||
// Shard of Creation
|
||||
ResearchRegistry.recipes.put("ItemMaterial:5",
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 8, TaintedMagicHelper.getPrimals(50)
|
||||
.add(Aspect.AURA, 40).add(Aspect.VOID, 40).add(Aspect.MAGIC, 40).add(Aspect.ELDRITCH, 40),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
ThaumcraftApi.addInfusionCraftingRecipe("CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 8,
|
||||
TaintedMagicHelper.getPrimals(55), new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
new ItemStack[]{ new ItemStack(ConfigItems.itemEldritchObject, 1, 3),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(ConfigItems.itemShard, 1, 1),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 2), new ItemStack(Items.nether_star),
|
||||
|
||||
Reference in new issue
Block a user