Work on the Lava Ritual's demon Will shenanigans
This commit is contained in:
parent
acde7ceccd
commit
c5f6495859
|
@ -17,6 +17,7 @@ public class ModPotions
|
|||
public static Potion planarBinding;
|
||||
public static Potion soulSnare;
|
||||
public static Potion soulFray;
|
||||
public static Potion fireFuse;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
@ -34,11 +35,13 @@ public class ModPotions
|
|||
// new ResourceLocation(resourceLocation +
|
||||
// boost.getName().toLowerCase())
|
||||
|
||||
whirlwind = registerPotion("Whirlwind", new ResourceLocation("whirlwind"), false, 0, 0, 0);
|
||||
planarBinding = registerPotion("Planar Binding", new ResourceLocation("planarBinding"), false, 0, 0, 0);
|
||||
soulSnare = registerPotion("Soul Snare", new ResourceLocation("soulSnare"), false, 0xFFFFFF, 0, 0);
|
||||
soulFray = registerPotion("Soul Fray", new ResourceLocation("soulFray"), true, 0xFFFFFF, 0, 0);
|
||||
whirlwind = registerPotion("Whirlwind", new ResourceLocation("whirlwind"), false, 0, 1, 0);
|
||||
planarBinding = registerPotion("Planar Binding", new ResourceLocation("planarBinding"), false, 0, 2, 0);
|
||||
soulSnare = registerPotion("Soul Snare", new ResourceLocation("soulSnare"), false, 0xFFFFFF, 3, 0);
|
||||
soulFray = registerPotion("Soul Fray", new ResourceLocation("soulFray"), true, 0xFFFFFF, 4, 0);
|
||||
PlayerSacrificeHelper.soulFrayId = soulFray;
|
||||
|
||||
fireFuse = registerPotion("Fire Fuse", new ResourceLocation("fireFuse"), true, 0xFF3333, 5, 0);
|
||||
// heavyHeart = new PotionBloodMagic("Heavy Heart", new
|
||||
// ResourceLocation(resourceLocation +
|
||||
// heavyHeart.getName().toLowerCase()), true, 0, 0, 0);
|
||||
|
|
|
@ -4,7 +4,11 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
@ -18,18 +22,22 @@ import WayofTime.bloodmagic.api.soul.DemonWillHolder;
|
|||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class RitualLava extends Ritual
|
||||
{
|
||||
public static final String LAVA_RANGE = "lavaRange";
|
||||
public static int destructiveWillDrain = 10;
|
||||
public static final String FIRE_FUSE_RANGE = "fireFuse";
|
||||
public static final double vengefulWillDrain = 1;
|
||||
|
||||
public RitualLava()
|
||||
{
|
||||
super("ritualLava", 0, 10000, "ritual." + Constants.Mod.MODID + ".lavaRitual");
|
||||
addBlockRange(LAVA_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||
addBlockRange(FIRE_FUSE_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-2, -2, -2), 5));
|
||||
setMaximumVolumeAndDistanceOfRange(LAVA_RANGE, 9, 3, 3);
|
||||
setMaximumVolumeAndDistanceOfRange(FIRE_FUSE_RANGE, 0, 10, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +64,6 @@ public class RitualLava extends Ritual
|
|||
int maxLavaVolume = getMaxVolumeForRange(LAVA_RANGE, willConfig, holder);
|
||||
if (!lavaRange.isWithinRange(getMaxVerticalRadiusForRange(LAVA_RANGE, willConfig, holder), getMaxHorizontalRadiusForRange(LAVA_RANGE, willConfig, holder)) || (maxLavaVolume != 0 && lavaRange.getVolume() > maxLavaVolume))
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -76,6 +83,42 @@ public class RitualLava extends Ritual
|
|||
}
|
||||
|
||||
network.syphon(getRefreshCost() * totalEffects);
|
||||
|
||||
double vengefulWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.VENGEFUL, willConfig);
|
||||
if (vengefulWill >= vengefulWillDrain)
|
||||
{
|
||||
double vengefulDrained = 0;
|
||||
AreaDescriptor fuseRange = getBlockRange(FIRE_FUSE_RANGE);
|
||||
|
||||
AxisAlignedBB fuseArea = fuseRange.getAABB(pos);
|
||||
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, fuseArea);
|
||||
|
||||
for (EntityLivingBase entity : entities)
|
||||
{
|
||||
if (vengefulWill < vengefulWillDrain)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
// continue;
|
||||
}
|
||||
|
||||
if (!entity.isPotionActive(ModPotions.fireFuse))
|
||||
{
|
||||
entity.addPotionEffect(new PotionEffect(ModPotions.fireFuse, 100, 0));
|
||||
|
||||
vengefulDrained += vengefulWillDrain;
|
||||
vengefulWill -= vengefulWillDrain;
|
||||
}
|
||||
}
|
||||
|
||||
if (vengefulDrained > 0)
|
||||
{
|
||||
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.VENGEFUL, vengefulDrained, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.init.Enchantments;
|
|||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
@ -53,6 +54,7 @@ import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrific
|
|||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||
import WayofTime.bloodmagic.network.DemonAuraPacketProcessor;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
|
@ -96,7 +98,22 @@ public class GenericHandler
|
|||
{
|
||||
sendPlayerDemonWillAura((EntityPlayer) entity);
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
EntityLivingBase entity = event.getEntityLiving();
|
||||
|
||||
if (entity.isPotionActive(ModPotions.fireFuse))
|
||||
{
|
||||
entity.worldObj.spawnParticle(EnumParticleTypes.FLAME, entity.posX + entity.worldObj.rand.nextDouble() * 0.3, entity.posY + entity.worldObj.rand.nextDouble() * 0.3, entity.posZ + entity.worldObj.rand.nextDouble() * 0.3, 0, 0.06d, 0);
|
||||
|
||||
int r = entity.getActivePotionEffect(ModPotions.fireFuse).getAmplifier();
|
||||
int radius = 1 * r + 1;
|
||||
|
||||
if (entity.getActivePotionEffect(ModPotions.fireFuse).getDuration() <= 3)
|
||||
{
|
||||
entity.worldObj.createExplosion(null, entity.posX, entity.posY, entity.posZ, radius, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -498,6 +498,7 @@ ritual.BloodMagic.portalRitual.info=Creates a portal network based on the activa
|
|||
|
||||
ritual.BloodMagic.waterRitual.waterRange.info=(Water) The area that the ritual will place water source blocks.
|
||||
ritual.BloodMagic.lavaRitual.lavaRange.info=(Lava) The area that the ritual will place lava source blocks.
|
||||
ritual.BloodMagic.lavaRitual.fireFuse.info=(Vengeful) Entities in this range are afflicted by Fire Fuse.
|
||||
ritual.BloodMagic.greenGroveRitual.growing.info=(Growth) The area that the ritual will grow plants in.
|
||||
ritual.BloodMagic.jumpRitual.jumpRange.info=(Jumping) Entities in this range will be launched in the air.
|
||||
ritual.BloodMagic.wellOfSufferingRitual.altar.info=(Altar) This range defines the area that the ritual searches for the blood altar. Changing this will either expand or limit the range to a certain region.
|
||||
|
|
BIN
src/main/resources/assets/bloodmagic/textures/misc/potions.png
Normal file
BIN
src/main/resources/assets/bloodmagic/textures/misc/potions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in a new issue