diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCondor.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCondor.java new file mode 100644 index 00000000..bc4232c0 --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCondor.java @@ -0,0 +1,89 @@ +package WayofTime.bloodmagic.ritual.types; + +import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.core.RegistrarBloodMagic; +import WayofTime.bloodmagic.ritual.*; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.List; +import java.util.function.Consumer; + +@RitualRegister("condor") +public class RitualCondor extends Ritual { + public static final String FLIGHT_RANGE = "flightRange"; + + public RitualCondor() { + super("ritualCondor", 0, 1000000, "ritual." + BloodMagic.MODID + ".condorRitual"); + addBlockRange(FLIGHT_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 0, 0), new BlockPos(10, 30, 10))); + setMaximumVolumeAndDistanceOfRange(FLIGHT_RANGE, 0, 100, 200); + } + + @Override + public void performRitual(IMasterRitualStone masterRitualStone) { + AxisAlignedBB aabb = getBlockRange(FLIGHT_RANGE).getAABB(masterRitualStone.getBlockPos()).expand(-10, 0, -10); + World world = masterRitualStone.getWorldObj(); + + int currentEssence = masterRitualStone.getOwnerNetwork().getCurrentEssence(); + + List entityPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, aabb); + int entityCount = entityPlayers.size(); + + if (currentEssence < getRefreshCost() * entityCount) { + masterRitualStone.getOwnerNetwork().causeNausea(); + return; + } else { + entityCount = 0; + for (EntityPlayer player : entityPlayers) { + player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.FLIGHT, 20, 0)); + } + } + + masterRitualStone.getOwnerNetwork().syphon(masterRitualStone.ticket(getRefreshCost() * entityCount)); + } + + @Override + public int getRefreshTime() { + return 10; + } + + @Override + public int getRefreshCost() { + return getBlockRange(FLIGHT_RANGE).getVolume() / 10000; // cost of 2 LP per second per player with default configuration + } + + @Override + public void gatherComponents(Consumer components) { + + addParallelRunes(components, 1, 0, EnumRuneType.DUSK); + addCornerRunes(components, 2, 0, EnumRuneType.AIR); + addOffsetRunes(components, 1, 3, 0, EnumRuneType.EARTH); + addParallelRunes(components, 3, 0, EnumRuneType.EARTH); + addOffsetRunes(components, 3, 4, 0, EnumRuneType.WATER); + addParallelRunes(components, 1, 1, EnumRuneType.FIRE); + addParallelRunes(components, 2, 1, EnumRuneType.BLANK); + addParallelRunes(components, 4, 1, EnumRuneType.BLANK); + addParallelRunes(components, 5, 1, EnumRuneType.AIR); + addParallelRunes(components, 5, 0, EnumRuneType.DUSK); + + for (int i = 2; i <= 4; i++) { + addParallelRunes(components, i, 2, EnumRuneType.EARTH); + } + + addOffsetRunes(components, 2, 1, 4, EnumRuneType.FIRE); + addCornerRunes(components, 2, 4, EnumRuneType.AIR); + addCornerRunes(components, 4, 2, EnumRuneType.FIRE); + + for (int i = -1; i <= 1; i++) { + addOffsetRunes(components, 3, i, 4, EnumRuneType.EARTH); + } + } + + @Override + public Ritual getNewCopy() { + return new RitualCondor(); + } +} diff --git a/src/main/resources/assets/bloodmagic/lang/en_US.lang b/src/main/resources/assets/bloodmagic/lang/en_US.lang index a1a159b0..03702e15 100644 --- a/src/main/resources/assets/bloodmagic/lang/en_US.lang +++ b/src/main/resources/assets/bloodmagic/lang/en_US.lang @@ -618,6 +618,7 @@ ritual.bloodmagic.altarBuilderRitual=The Assembly of the High Altar ritual.bloodmagic.portalRitual=The Gate of the Fold ritual.bloodmagic.downgradeRitual=Penance of the Leadened Soul ritual.bloodmagic.crystalSplitRitual=Resonance of the Faceted Crystal +ritual.bloodmagic.condorRitual=Reverence of the Condor ritual.bloodmagic.eternalSoulRitual=Cry of the Eternal Soul ritual.bloodmagic.waterRitual.info=Generates a source of water from the master ritual stone. @@ -749,6 +750,7 @@ ritual.bloodmagic.downgradeRitual.dialogue.slowHeal.100=Unlike my comrades, I of ritual.bloodmagic.downgradeRitual.dialogue.slowHeal.300=Although your wounds may heal, they will do so slowly if you accept my "offering," and the stings of battle will plague you even more. ritual.bloodmagic.downgradeRitual.dialogue.slowHeal.500=So think carefully before you rush into something that you may regret, since even though your cup may be empty it will be almost impossible to fill once more... +ritual.bloodmagic.condorRitual.info=Provides flight in an area around the ritual. ritual.bloodmagic.eternalSoulRitual.info=Capable of transferring Life Essence from a Network back into an Altar at a cost.