Makes the One Ring add warp to the player as well

This commit is contained in:
Prometheus0000 authored and GitHub committed 2020-10-12 11:09:19 -04:00
1 parent 399cbe76aa
commit 228508a755
1 file changed
+16 -2
+16 -2
View File
@@ -17,6 +17,7 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IWarpingGear;
@@ -164,11 +165,24 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 4, false));
}
if (corruption >= 300) {
if (random.nextInt(100) == 0) {
if (corruption >= 300) { //worn more than 5 minutes
if (random.nextInt(100) == 0) { //every 100 seconds
getItemWarpLevel(stack, true);
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
}
if (random.nextInt(300) == 0) { //randomly every 5 minutes
ThaumcraftApiHelper.addWarpToPlayer(player, 1, false); //adds 1 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer(player, random.nextInt(1)); //adds 0-1 sticky warp
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
}
if (corruption >= 3600) { //if you wear it for more than an hour total
if (random.nextInt(300) == 0) {
ThaumcraftApiHelper.addWarpToPlayer(player, 5 + random.nextInt(5), false); //adds 5-10 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer(player, 5 + random.nextInt(5)); //adds 5-10 sticky warp
ThaumcraftApiHelper.addWarpToPlayer(player, 10 + random.nextInt(40), true); //adds 10-50 temp warp, but this is ultra easy to remove
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
}
}
}
}
forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, ++corruption);