use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.
the class ModBlocks method init.
public static void init() {
blockAltar = new BlockAltar();
bloodRune = new BloodRune();
speedRune = new SpeedRune();
efficiencyRune = new EfficiencyRune();
runeOfSacrifice = new RuneOfSacrifice();
runeOfSelfSacrifice = new RuneOfSelfSacrifice();
blockTeleposer = new BlockTeleposer();
spectralBlock = new SpectralBlock();
ritualStone = new RitualStone();
blockMasterStone = new BlockMasterStone();
imperfectRitualStone = new ImperfectRitualStone();
bloodSocket = new BlockSocket();
armourForge = new ArmourForge();
emptySocket = new EmptySocket();
largeBloodStoneBrick = new LargeBloodStoneBrick();
bloodStoneBrick = new BloodStoneBrick();
blockWritingTable = new BlockWritingTable();
blockHomHeart = new BlockHomHeart();
blockPedestal = new BlockPedestal();
blockPlinth = new BlockPlinth();
blockConduit = new BlockConduit();
blockBloodLight = new BlockBloodLightSource();
blockSpellEffect = new BlockSpellEffect();
blockSpellParadigm = new BlockSpellParadigm();
blockSpellModifier = new BlockSpellModifier();
blockSpellEnhancement = new BlockSpellEnhancement();
blockSpectralContainer = new BlockSpectralContainer();
blockDemonPortal = new BlockDemonPortal();
blockBuildingSchematicSaver = new BlockSchematicSaver();
blockReagentConduit = new BlockReagentConduit();
blockAlchemicCalcinator = new BlockAlchemicCalcinator();
blockCrystalBelljar = new BlockBelljar();
blockDemonChest = new BlockDemonChest();
blockCrystal = new BlockCrystal();
blockMimic = new MimicBlock();
blockLifeEssence = new LifeEssenceBlock();
blockEnchantmentGlyph = new BlockEnchantmentGlyph();
blockStabilityGlyph = new BlockStabilityGlyph();
blockCrucible = new BlockCrucible();
}
use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.
the class RitualEffectLava method performEffect.
@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 (this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost)) {
boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
boolean drainReductus = world.getWorldTime() % 100 == 0;
int range = 5;
List<EntityLivingBase> entityList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range);
EntityPlayer player = SpellHelper.getPlayerForUsername(owner);
for (EntityLivingBase entity : entityList) {
if (entity != player && this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost) && !entity.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) {
if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) {
if (entity instanceof EntityPlayer) {
if (drainReductus) {
this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
}
continue;
}
}
entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id, 100, 0));
this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true);
SoulNetworkHandler.syphonFromNetwork(owner, fireFuseCost);
}
}
}
Block block = world.getBlock(x, y + 1, z);
if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) {
if (currentEssence < this.getCostPerRefresh()) {
SoulNetworkHandler.causeNauseaToPlayer(owner);
} else {
for (int i = 0; i < 10; i++) {
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
}
world.setBlock(x, y + 1, z, Blocks.lava, 0, 3);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
} else {
boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
if (!hasSanctus) {
return;
}
TileEntity tile = world.getTileEntity(x, y + 1, z);
if (tile instanceof IFluidHandler) {
int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false);
if (amount >= 1000) {
((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true);
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}
}
}
use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.
the class RitualEffectWater method performEffect.
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();
boolean hasCrystallos = this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false);
boolean hasAquasalus = this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false);
boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false);
if (hasAquasalus) {
int hydrationRange = 4;
int vertRange = 3;
for (int i = -hydrationRange; i <= hydrationRange; i++) {
for (int j = -vertRange; j <= vertRange; j++) {
for (int k = -hydrationRange; k <= hydrationRange; k++) {
if (SpellHelper.hydrateSoil(world, x + i, y + j, z + k)) {
this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
}
}
}
}
}
if (hasOffensa) {
boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
boolean drainReductus = world.getWorldTime() % 100 == 0;
int range = 10;
List<Entity> list = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range);
for (Entity entity : list) {
if (entity instanceof EntityLivingBase) {
EntityLivingBase livingEntity = (EntityLivingBase) entity;
if (livingEntity == SpellHelper.getPlayerForUsername(owner)) {
continue;
}
if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) {
if (livingEntity instanceof EntityPlayer) {
if (drainReductus) {
this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
}
continue;
}
}
if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionDrowning)) {
livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 0));
this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true);
}
}
}
}
Block block = world.getBlock(x, y + 1, z);
if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) {
if (currentEssence < this.getCostPerRefresh()) {
SoulNetworkHandler.causeNauseaToPlayer(owner);
} else {
for (int i = 0; i < 10; i++) {
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
}
world.setBlock(x, y + 1, z, Blocks.water, 0, 3);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
} else {
boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
if (!hasSanctus) {
return;
}
TileEntity tile = world.getTileEntity(x, y + 1, z);
if (tile instanceof IFluidHandler) {
int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false);
if (amount >= 1000) {
((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true);
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}
}
if (hasCrystallos) {
int range = 2;
for (int i = -range; i <= range; i++) {
for (int j = -range; j <= range; j++) {
for (int k = -range; k <= range; k++) {
hasCrystallos = hasCrystallos && this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false);
if (hasCrystallos) {
boolean success = false;
if (!world.isAirBlock(x + i, y + j, z + k) && SpellHelper.freezeWaterBlock(world, x + i, y + j, z + k)) {
success = true;
} else {
if (world.rand.nextInt(100) == 0 && world.isSideSolid(x + i, y + j - 1, z + k, ForgeDirection.UP)) {
success = true;
}
}
if (success) {
this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true);
}
}
}
}
}
}
}
Aggregations