2015-01-10 12:23:41 -05:00
|
|
|
package WayofTime.alchemicalWizardry.common.rituals;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-01-11 21:05:28 -05:00
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
2015-01-10 12:23:41 -05:00
|
|
|
import net.minecraft.world.World;
|
2015-01-10 14:31:24 -05:00
|
|
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
2015-01-10 12:23:41 -05:00
|
|
|
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
|
|
|
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
|
|
|
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
|
|
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
2015-01-11 21:05:28 -05:00
|
|
|
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
|
|
|
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
2015-01-10 12:23:41 -05:00
|
|
|
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
2015-01-11 21:05:28 -05:00
|
|
|
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
2015-01-10 12:23:41 -05:00
|
|
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
|
|
|
|
|
|
|
public class RitualEffectOmegaTest extends RitualEffect
|
|
|
|
{
|
2015-01-11 21:05:28 -05:00
|
|
|
public static final int tickDuration = 1 * 60 * 20;
|
2015-01-10 12:23:41 -05:00
|
|
|
@Override
|
|
|
|
public void performEffect(IMasterRitualStone ritualStone)
|
|
|
|
{
|
|
|
|
String owner = ritualStone.getOwner();
|
|
|
|
|
|
|
|
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
|
|
|
|
World world = ritualStone.getWorld();
|
|
|
|
int x = ritualStone.getXCoord();
|
|
|
|
int y = ritualStone.getYCoord();
|
|
|
|
int z = ritualStone.getZCoord();
|
|
|
|
|
|
|
|
if (world.getWorldTime() % 200 != 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
double range = 2;
|
|
|
|
|
|
|
|
List<EntityPlayer> playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range);
|
|
|
|
|
|
|
|
for(EntityPlayer player : playerList)
|
|
|
|
{
|
2015-01-11 21:05:28 -05:00
|
|
|
// OmegaParadigm waterParadigm = new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater, new ReagentRegenConfiguration(1, 1, 1));
|
|
|
|
|
|
|
|
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(ReagentRegistry.aquasalusReagent);
|
2015-01-10 12:23:41 -05:00
|
|
|
waterParadigm.convertPlayerArmour(player);
|
2015-01-11 21:05:28 -05:00
|
|
|
|
|
|
|
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
|
|
|
|
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
|
|
|
|
APISpellHelper.setPlayerReagentType(player, ReagentRegistry.aquasalusReagent);
|
|
|
|
APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth());
|
|
|
|
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(ReagentRegistry.aquasalusReagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
|
2015-01-10 12:23:41 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getCostPerRefresh()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<RitualComponent> getRitualComponentList()
|
|
|
|
{
|
|
|
|
ArrayList<RitualComponent> animalGrowthRitual = new ArrayList();
|
|
|
|
animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(0, 0, -1, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(1, 0, 2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(1, 0, -2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.WATER));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR));
|
|
|
|
animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR));
|
|
|
|
return animalGrowthRitual;
|
|
|
|
}
|
|
|
|
}
|