Added more to the upgrades
Added a lot of the regular upgrades, as well as added the recipe for the Binding Reagent. The rituals used for upgrading/removing upgrades for the Living Armour were also added, as well as the Ellipsoid ritual. Complete for BM 3.0.2
This commit is contained in:
parent
953bac9298
commit
7b938c28b4
14 changed files with 766 additions and 42 deletions
|
@ -0,0 +1,110 @@
|
|||
package wayoftime.bloodmagic.ritual.types;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.effect.LightningBoltEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.core.living.LivingStats;
|
||||
import wayoftime.bloodmagic.core.living.LivingUtil;
|
||||
import wayoftime.bloodmagic.ritual.AreaDescriptor;
|
||||
import wayoftime.bloodmagic.ritual.EnumRuneType;
|
||||
import wayoftime.bloodmagic.ritual.IMasterRitualStone;
|
||||
import wayoftime.bloodmagic.ritual.Ritual;
|
||||
import wayoftime.bloodmagic.ritual.RitualComponent;
|
||||
import wayoftime.bloodmagic.ritual.RitualRegister;
|
||||
|
||||
@RitualRegister("armour_evolve")
|
||||
public class RitualArmourEvolve extends Ritual
|
||||
{
|
||||
public static final String CHECK_RANGE = "fillRange";
|
||||
|
||||
public RitualArmourEvolve()
|
||||
{
|
||||
super("ritualArmourEvolve", 2, 50000, "ritual." + BloodMagic.MODID + ".armourEvolveRitual");
|
||||
addBlockRange(CHECK_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1, 2, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performRitual(IMasterRitualStone masterRitualStone)
|
||||
{
|
||||
World world = masterRitualStone.getWorldObj();
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BlockPos pos = masterRitualStone.getBlockPos();
|
||||
|
||||
AreaDescriptor checkRange = masterRitualStone.getBlockRange(CHECK_RANGE);
|
||||
|
||||
List<PlayerEntity> playerList = world.getEntitiesWithinAABB(PlayerEntity.class, checkRange.getAABB(pos));
|
||||
|
||||
for (PlayerEntity player : playerList)
|
||||
{
|
||||
if (LivingUtil.hasFullSet(player))
|
||||
{
|
||||
ItemStack chestStack = player.getItemStackFromSlot(EquipmentSlotType.CHEST);
|
||||
LivingStats stats = LivingStats.fromPlayer(player);
|
||||
|
||||
if (stats.getMaxPoints() < 300)
|
||||
{
|
||||
stats.setMaxPoints(300);
|
||||
LivingStats.toPlayer(player, stats);
|
||||
// ((ItemLivingArmour) chestStack.getItem()).setLivingArmour(chestStack, armour, true);
|
||||
|
||||
masterRitualStone.setActive(false);
|
||||
|
||||
LightningBoltEntity lightningboltentity = EntityType.LIGHTNING_BOLT.create(world);
|
||||
// LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
||||
// lightningboltentity.setEffectOnly(true);
|
||||
world.addEntity(lightningboltentity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshTime()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshCost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gatherComponents(Consumer<RitualComponent> components)
|
||||
{
|
||||
addCornerRunes(components, 1, 0, EnumRuneType.DUSK);
|
||||
addCornerRunes(components, 2, 0, EnumRuneType.FIRE);
|
||||
addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE);
|
||||
addCornerRunes(components, 1, 1, EnumRuneType.DUSK);
|
||||
addParallelRunes(components, 4, 0, EnumRuneType.EARTH);
|
||||
addCornerRunes(components, 1, 3, EnumRuneType.DUSK);
|
||||
addParallelRunes(components, 1, 4, EnumRuneType.EARTH);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
addCornerRunes(components, 3, i, EnumRuneType.EARTH);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ritual getNewCopy()
|
||||
{
|
||||
return new RitualArmourEvolve();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,272 @@
|
|||
package wayoftime.bloodmagic.ritual.types;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.ritual.AreaDescriptor;
|
||||
import wayoftime.bloodmagic.ritual.EnumRuneType;
|
||||
import wayoftime.bloodmagic.ritual.IMasterRitualStone;
|
||||
import wayoftime.bloodmagic.ritual.Ritual;
|
||||
import wayoftime.bloodmagic.ritual.RitualComponent;
|
||||
import wayoftime.bloodmagic.ritual.RitualRegister;
|
||||
|
||||
@RitualRegister("ellipsoid")
|
||||
public class RitualEllipsoid extends Ritual
|
||||
{
|
||||
public static final String SPHEROID_RANGE = "spheroidRange";
|
||||
public static final String CHEST_RANGE = "chest";
|
||||
|
||||
private boolean cached = false;
|
||||
private BlockPos currentPos; // Offset
|
||||
|
||||
public RitualEllipsoid()
|
||||
{
|
||||
super("ritualEllipsoid", 0, 20000, "ritual." + BloodMagic.MODID + ".ellipseRitual");
|
||||
addBlockRange(SPHEROID_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-10, -10, -10), new BlockPos(11, 11, 11)));
|
||||
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||
|
||||
setMaximumVolumeAndDistanceOfRange(SPHEROID_RANGE, 0, 32, 32);
|
||||
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performRitual(IMasterRitualStone masterRitualStone)
|
||||
{
|
||||
World world = masterRitualStone.getWorldObj();
|
||||
int currentEssence = masterRitualStone.getOwnerNetwork().getCurrentEssence();
|
||||
|
||||
BlockPos masterPos = masterRitualStone.getBlockPos();
|
||||
AreaDescriptor chestRange = masterRitualStone.getBlockRange(CHEST_RANGE);
|
||||
TileEntity tileInventory = world.getTileEntity(chestRange.getContainedPositions(masterPos).get(0));
|
||||
|
||||
if (currentEssence < getRefreshCost())
|
||||
{
|
||||
masterRitualStone.getOwnerNetwork().causeNausea();
|
||||
return;
|
||||
}
|
||||
|
||||
AreaDescriptor sphereRange = masterRitualStone.getBlockRange(SPHEROID_RANGE);
|
||||
AxisAlignedBB sphereBB = sphereRange.getAABB(masterPos);
|
||||
int minX = (int) (masterPos.getX() - sphereBB.minX);
|
||||
int maxX = (int) (sphereBB.maxX - masterPos.getX()) - 1;
|
||||
int minY = (int) (masterPos.getY() - sphereBB.minY);
|
||||
int maxY = (int) (sphereBB.maxY - masterPos.getY()) - 1;
|
||||
int minZ = (int) (masterPos.getZ() - sphereBB.minZ);
|
||||
int maxZ = (int) (sphereBB.maxZ - masterPos.getZ()) - 1;
|
||||
|
||||
if (tileInventory != null)
|
||||
{
|
||||
// System.out.println("Tile");
|
||||
if (tileInventory.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN).isPresent())
|
||||
{
|
||||
// System.out.println("Have inv");
|
||||
IItemHandler itemHandler = tileInventory.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN).resolve().get();
|
||||
|
||||
if (itemHandler.getSlots() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int blockSlot = -1;
|
||||
for (int invSlot = 0; invSlot < itemHandler.getSlots(); invSlot++)
|
||||
{
|
||||
ItemStack stack = itemHandler.extractItem(invSlot, 1, true);
|
||||
if (stack.isEmpty() || !(stack.getItem() instanceof BlockItem))
|
||||
continue;
|
||||
|
||||
blockSlot = invSlot;
|
||||
break;
|
||||
}
|
||||
|
||||
// System.out.println("Block slot: " + blockSlot);
|
||||
|
||||
if (blockSlot == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int xR = Math.max(maxX, minX);
|
||||
int yR = Math.max(maxY, minY);
|
||||
int zR = Math.max(maxZ, minZ);
|
||||
|
||||
int j = -minX;
|
||||
int i = -minY;
|
||||
int k = -minZ;
|
||||
|
||||
if (currentPos != null)
|
||||
{
|
||||
j = currentPos.getY();
|
||||
i = Math.min(xR, Math.max(-minX, currentPos.getX()));
|
||||
k = Math.min(zR, Math.max(-minZ, currentPos.getZ()));
|
||||
}
|
||||
int checks = 0;
|
||||
int maxChecks = 100;
|
||||
|
||||
while (j <= maxY)
|
||||
{
|
||||
while (i <= maxX)
|
||||
{
|
||||
while (k <= maxZ)
|
||||
{
|
||||
checks++;
|
||||
if (checks >= maxChecks)
|
||||
{
|
||||
this.currentPos = new BlockPos(i, j, k);
|
||||
// System.out.println(this.currentPos);
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkIfEllipsoidShell(xR, yR, zR, i, j, k))
|
||||
{
|
||||
BlockPos newPos = masterPos.add(i, j, k);
|
||||
//
|
||||
if (!world.isAirBlock(newPos))
|
||||
{
|
||||
k++;
|
||||
continue;
|
||||
}
|
||||
|
||||
BlockState placeState = Block.getBlockFromItem(itemHandler.getStackInSlot(blockSlot).getItem()).getDefaultState();
|
||||
world.setBlockState(newPos, placeState);
|
||||
|
||||
itemHandler.extractItem(blockSlot, 1, false);
|
||||
tileInventory.markDirty();
|
||||
// TODO:
|
||||
masterRitualStone.getOwnerNetwork().syphon(masterRitualStone.ticket(getRefreshCost()));
|
||||
k++;
|
||||
this.currentPos = new BlockPos(i, j, k);
|
||||
// System.out.println(this.currentPos);
|
||||
return;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
i++;
|
||||
k = -minZ;
|
||||
}
|
||||
j++;
|
||||
i = -minX;
|
||||
this.currentPos = new BlockPos(i, j, k);
|
||||
return;
|
||||
}
|
||||
|
||||
j = -minY;
|
||||
this.currentPos = new BlockPos(i, j, k);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkIfEllipsoidShell(int xR, int yR, int zR, int xOff, int yOff, int zOff)
|
||||
{
|
||||
// Checking shell in the x-direction
|
||||
if (!checkIfEllipsoid(xR, yR, zR, xOff, yOff, zOff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !((checkIfEllipsoid(xR, yR, zR, xOff + 1, yOff, zOff) && checkIfEllipsoid(xR, yR, zR, xOff - 1, yOff, zOff)) && (checkIfEllipsoid(xR, yR, zR, xOff, yOff + 1, zOff) && checkIfEllipsoid(xR, yR, zR, xOff, yOff - 1, zOff)) && (checkIfEllipsoid(xR, yR, zR, xOff, yOff, zOff + 1) && checkIfEllipsoid(xR, yR, zR, xOff, yOff, zOff - 1)));
|
||||
// if (xOff * xOff + yOff * yOff + zOff * zOff >= (xR - 0.5) * (xR - 0.5) && xOff * xOff + yOff * yOff + zOff * zOff <= (xR + 0.5) * (xR + 0.5))
|
||||
// if (checkIfEllipsoid(xR, yR, zR, xOff, yOff, zOff))
|
||||
// {
|
||||
// if (xOff * xOff / ((xR - 0.5) * (xR - 0.5)) + yOff * yOff / ((yR - 0.5) * (yR - 0.5)) >= 1 - zOff * zOff / ((zR + possOffset) * (zR + possOffset)))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// if (xOff * xOff / ((xR - 0.5) * (xR - 0.5)) + zOff * zOff / ((zR - 0.5) * (zR - 0.5)) >= 1 - yOff * yOff / ((yR + possOffset) * (yR + possOffset)))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// if (zOff * zOff / ((zR - 0.5) * (zR - 0.5)) + yOff * yOff / ((yR - 0.5) * (yR - 0.5)) >= 1 - xOff * xOff / ((xR + possOffset) * (xR + possOffset)))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
|
||||
public boolean checkIfEllipsoid(float xR, float yR, float zR, float xOff, float yOff, float zOff)
|
||||
{
|
||||
float possOffset = 0.5f;
|
||||
return xOff * xOff / ((xR + possOffset) * (xR + possOffset)) + yOff * yOff / ((yR + possOffset) * (yR + possOffset)) + zOff * zOff / ((zR + possOffset) * (zR + possOffset)) <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshCost()
|
||||
{
|
||||
return 10;// Temporary
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshTime()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void readFromNBT(NBTTagCompound tag)
|
||||
// {
|
||||
// super.readFromNBT(tag);
|
||||
// tag
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void gatherComponents(Consumer<RitualComponent> components)
|
||||
{
|
||||
addCornerRunes(components, 1, 0, EnumRuneType.DUSK);
|
||||
|
||||
addRune(components, 4, 0, 0, EnumRuneType.FIRE);
|
||||
addRune(components, 5, 0, 0, EnumRuneType.FIRE);
|
||||
addRune(components, 5, 0, -1, EnumRuneType.FIRE);
|
||||
addRune(components, 5, 0, -2, EnumRuneType.FIRE);
|
||||
addRune(components, -4, 0, 0, EnumRuneType.FIRE);
|
||||
addRune(components, -5, 0, 0, EnumRuneType.FIRE);
|
||||
addRune(components, -5, 0, 1, EnumRuneType.FIRE);
|
||||
addRune(components, -5, 0, 2, EnumRuneType.FIRE);
|
||||
|
||||
addRune(components, 0, 0, 4, EnumRuneType.AIR);
|
||||
addRune(components, 0, 0, 5, EnumRuneType.AIR);
|
||||
addRune(components, 1, 0, 5, EnumRuneType.AIR);
|
||||
addRune(components, 2, 0, 5, EnumRuneType.AIR);
|
||||
addRune(components, 0, 0, -4, EnumRuneType.AIR);
|
||||
addRune(components, 0, 0, -5, EnumRuneType.AIR);
|
||||
addRune(components, -1, 0, -5, EnumRuneType.AIR);
|
||||
addRune(components, -2, 0, -5, EnumRuneType.AIR);
|
||||
|
||||
addRune(components, 3, 0, 1, EnumRuneType.EARTH);
|
||||
addRune(components, 3, 0, 2, EnumRuneType.EARTH);
|
||||
addRune(components, 3, 0, 3, EnumRuneType.EARTH);
|
||||
addRune(components, 2, 0, 3, EnumRuneType.EARTH);
|
||||
addRune(components, -3, 0, -1, EnumRuneType.EARTH);
|
||||
addRune(components, -3, 0, -2, EnumRuneType.EARTH);
|
||||
addRune(components, -3, 0, -3, EnumRuneType.EARTH);
|
||||
addRune(components, -2, 0, -3, EnumRuneType.EARTH);
|
||||
|
||||
addRune(components, 1, 0, -3, EnumRuneType.WATER);
|
||||
addRune(components, 2, 0, -3, EnumRuneType.WATER);
|
||||
addRune(components, 3, 0, -3, EnumRuneType.WATER);
|
||||
addRune(components, 3, 0, -2, EnumRuneType.WATER);
|
||||
addRune(components, -1, 0, 3, EnumRuneType.WATER);
|
||||
addRune(components, -2, 0, 3, EnumRuneType.WATER);
|
||||
addRune(components, -3, 0, 3, EnumRuneType.WATER);
|
||||
addRune(components, -3, 0, 2, EnumRuneType.WATER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ritual getNewCopy()
|
||||
{
|
||||
return new RitualEllipsoid();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
package wayoftime.bloodmagic.ritual.types;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.effect.LightningBoltEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.core.living.ILivingContainer;
|
||||
import wayoftime.bloodmagic.core.living.LivingStats;
|
||||
import wayoftime.bloodmagic.core.living.LivingUpgrade;
|
||||
import wayoftime.bloodmagic.core.living.LivingUtil;
|
||||
import wayoftime.bloodmagic.ritual.AreaDescriptor;
|
||||
import wayoftime.bloodmagic.ritual.EnumRuneType;
|
||||
import wayoftime.bloodmagic.ritual.IMasterRitualStone;
|
||||
import wayoftime.bloodmagic.ritual.Ritual;
|
||||
import wayoftime.bloodmagic.ritual.RitualComponent;
|
||||
import wayoftime.bloodmagic.ritual.RitualRegister;
|
||||
|
||||
@RitualRegister("upgrade_remove")
|
||||
public class RitualUpgradeRemove extends Ritual
|
||||
{
|
||||
public static final String CHECK_RANGE = "fillRange";
|
||||
|
||||
public RitualUpgradeRemove()
|
||||
{
|
||||
super("ritualUpgradeRemove", 2, 25000, "ritual." + BloodMagic.MODID + ".upgradeRemoveRitual");
|
||||
addBlockRange(CHECK_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1, 2, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performRitual(IMasterRitualStone masterRitualStone)
|
||||
{
|
||||
World world = masterRitualStone.getWorldObj();
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BlockPos pos = masterRitualStone.getBlockPos();
|
||||
|
||||
AreaDescriptor checkRange = masterRitualStone.getBlockRange(CHECK_RANGE);
|
||||
|
||||
List<PlayerEntity> playerList = world.getEntitiesWithinAABB(PlayerEntity.class, checkRange.getAABB(pos));
|
||||
|
||||
for (PlayerEntity player : playerList)
|
||||
{
|
||||
if (LivingUtil.hasFullSet(player))
|
||||
{
|
||||
boolean removedUpgrade = false;
|
||||
|
||||
ItemStack chestStack = player.getItemStackFromSlot(EquipmentSlotType.CHEST);
|
||||
LivingStats stats = LivingStats.fromPlayer(player);
|
||||
if (stats != null)
|
||||
{
|
||||
Map<LivingUpgrade, Double> upgrades = stats.getUpgrades();
|
||||
|
||||
for (Entry<LivingUpgrade, Double> entry : upgrades.entrySet())
|
||||
{
|
||||
int exp = entry.getValue().intValue();
|
||||
LivingUpgrade upgrade = entry.getKey();
|
||||
int level = upgrade.getLevel(exp);
|
||||
if (level >= 1)
|
||||
{
|
||||
ItemStack upgradeStack = new ItemStack(BloodMagicItems.LIVING_TOME.get());
|
||||
// int expForLevel = upgrade.getNextRequirement(upgrade.getLevel(exp) - 1);
|
||||
((ILivingContainer) BloodMagicItems.LIVING_TOME.get()).updateLivingStats(upgradeStack, new LivingStats().setMaxPoints(upgrade.getLevelCost(exp)).addExperience(upgrade.getKey(), exp));
|
||||
ItemEntity item = new ItemEntity(world, player.getPosX(), player.getPosY(), player.getPosZ(), upgradeStack);
|
||||
world.addEntity(item);
|
||||
removedUpgrade = true;
|
||||
}
|
||||
stats.resetExperience(upgrade.getKey());
|
||||
}
|
||||
|
||||
// @SuppressWarnings("unchecked")
|
||||
// HashMap<String, LivingArmourUpgrade> upgradeMap = (HashMap<String, LivingArmourUpgrade>) armour.upgradeMap.clone();
|
||||
//
|
||||
// for (Entry<String, LivingArmourUpgrade> entry : upgradeMap.entrySet())
|
||||
// {
|
||||
// LivingArmourUpgrade upgrade = entry.getValue();
|
||||
// String upgradeKey = entry.getKey();
|
||||
//
|
||||
// ItemStack upgradeStack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
// LivingUpgrades.setKey(upgradeStack, upgradeKey);
|
||||
// LivingUpgrades.setLevel(upgradeStack, upgrade.getUpgradeLevel());
|
||||
//
|
||||
// boolean successful = armour.removeUpgrade(player, upgrade);
|
||||
//
|
||||
// if (successful)
|
||||
// {
|
||||
// removedUpgrade = true;
|
||||
// world.spawnEntity(new ItemEntity(world, player.posX, player.posY, player.posZ, upgradeStack));
|
||||
// for (Entry<String, StatTracker> trackerEntry : armour.trackerMap.entrySet())
|
||||
// {
|
||||
// StatTracker tracker = trackerEntry.getValue();
|
||||
// if (tracker != null)
|
||||
// {
|
||||
// if (tracker.providesUpgrade(upgradeKey))
|
||||
// {
|
||||
// tracker.resetTracker(); // Resets the tracker if the upgrade corresponding to it
|
||||
// // was removed.
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (removedUpgrade)
|
||||
{
|
||||
LivingStats.toPlayer(player, stats);
|
||||
|
||||
masterRitualStone.setActive(false);
|
||||
|
||||
LightningBoltEntity lightningboltentity = EntityType.LIGHTNING_BOLT.create(world);
|
||||
// LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
||||
lightningboltentity.setEffectOnly(true);
|
||||
world.addEntity(lightningboltentity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshTime()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshCost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gatherComponents(Consumer<RitualComponent> components)
|
||||
{
|
||||
addCornerRunes(components, 1, 0, EnumRuneType.DUSK);
|
||||
addCornerRunes(components, 2, 0, EnumRuneType.FIRE);
|
||||
addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE);
|
||||
addCornerRunes(components, 1, 1, EnumRuneType.WATER);
|
||||
addParallelRunes(components, 4, 0, EnumRuneType.EARTH);
|
||||
addCornerRunes(components, 1, 3, EnumRuneType.WATER);
|
||||
addParallelRunes(components, 1, 4, EnumRuneType.AIR);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
addCornerRunes(components, 3, i, EnumRuneType.EARTH);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ritual getNewCopy()
|
||||
{
|
||||
return new RitualUpgradeRemove();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue