Reverence of the Condor port (#1490)

* Ported Reverence of the Condor from 1.7.10.

* Ported Reverence of the Condor from 1.7.10.

* Removed my shame
This commit is contained in:
Tobias Gremeyer 2018-12-31 01:13:13 +01:00 committed by Nick Ignoffo
parent 7435d49824
commit 03d087595f
2 changed files with 91 additions and 0 deletions

View file

@ -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<EntityPlayer> 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<RitualComponent> 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();
}
}

View file

@ -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.