- Made it so peaceful animals provide more LP by default (to encourage creating your own farm).

- Increased the effectiveness of animals for the Gathering of the Forsaken Souls ritual by a factor of 4.
- Added the framework for the Purification Altar.
This commit is contained in:
WayofTime 2016-11-05 11:14:56 -04:00
parent da4de55c2e
commit faef980e59
14 changed files with 290 additions and 31 deletions

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -13,12 +14,12 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.AreaDescriptor;
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
import WayofTime.bloodmagic.api.ritual.Ritual;
import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.tile.TileDemonCrystal;
@ -127,8 +128,14 @@ public class RitualForsakenSoul extends Ritual
if (!entity.isEntityAlive())
{
int uniqueness = calculateUniqueness(entity);
willBuffer += getWillForUniqueness(uniqueness) / HEALTH_THRESHOLD * entity.getMaxHealth();
crystalBuffer += entity.getMaxHealth() / HEALTH_THRESHOLD;
double modifier = 1;
if (entity instanceof EntityAnimal && !entity.isCollided)
{
modifier = 4;
}
willBuffer += modifier * getWillForUniqueness(uniqueness) / HEALTH_THRESHOLD * entity.getMaxHealth();
crystalBuffer += modifier * entity.getMaxHealth() / HEALTH_THRESHOLD;
totalEffects++;
if (totalEffects >= maxEffects)

View file

@ -13,12 +13,17 @@ import WayofTime.bloodmagic.api.ritual.EnumRuneType;
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
import WayofTime.bloodmagic.api.ritual.Ritual;
import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
import WayofTime.bloodmagic.meteor.MeteorRegistry;
public class RitualMeteor extends Ritual
{
public static final String ITEM_RANGE = "itemRange";
public static final double destructiveWillDrain = 50;
public RitualMeteor()
{
@ -31,24 +36,66 @@ public class RitualMeteor extends Ritual
public void performRitual(IMasterRitualStone masterRitualStone)
{
World world = masterRitualStone.getWorldObj();
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
int currentEssence = network.getCurrentEssence();
BlockPos pos = masterRitualStone.getBlockPos();
List<EnumDemonWillType> willConfig = masterRitualStone.getActiveWillConfig();
double corrosiveWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.CORROSIVE, willConfig);
double destructiveWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.DESTRUCTIVE, willConfig);
double rawWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.DEFAULT, willConfig);
double steadfastWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.STEADFAST, willConfig);
double vengefulWill = this.getWillRespectingConfig(world, pos, EnumDemonWillType.VENGEFUL, willConfig);
AreaDescriptor itemDetectionRange = getBlockRange(ITEM_RANGE);
List<EntityItem> itemList = world.getEntitiesWithinAABB(EntityItem.class, itemDetectionRange.getAABB(pos));
double radiusModifier = getRadiusModifier(rawWill);
double explosionModifier = getExplosionModifier(steadfastWill);
double fillerChance = getFillerChance(corrosiveWill);
boolean successful = false;
for (EntityItem entityItem : itemList)
{
ItemStack stack = entityItem.getEntityItem();
if (MeteorRegistry.hasMeteorForItem(stack))
{
EntityMeteor meteor = new EntityMeteor(world, pos.getX(), 260, pos.getZ(), 0, -0.1, 0);
EntityMeteor meteor = new EntityMeteor(world, pos.getX(), 260, pos.getZ(), 0, -0.1, 0, radiusModifier, explosionModifier, fillerChance);
meteor.setMeteorStack(stack.copy());
world.spawnEntityInWorld(meteor);
entityItem.setDead();
masterRitualStone.setActive(false);
if (destructiveWill >= destructiveWillDrain && currentEssence >= 1000000000)
{
network.syphon(1000000);
} else
{
masterRitualStone.setActive(false);
}
successful = true;
break;
}
}
if (successful)
{
if (rawWill > 0)
{
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.DEFAULT, rawWill, true);
}
if (corrosiveWill > 0)
{
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.CORROSIVE, corrosiveWill, true);
}
if (steadfastWill > 0)
{
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.STEADFAST, steadfastWill, true);
}
}
}
@ -105,4 +152,19 @@ public class RitualMeteor extends Ritual
{
return new RitualMeteor();
}
public double getRadiusModifier(double rawWill)
{
return Math.pow(1 + rawWill / 100, 1 / 3);
}
public double getFillerChance(double corrosiveWill)
{
return corrosiveWill / 200;
}
public double getExplosionModifier(double steadfastWill)
{
return Math.max(Math.pow(0.4, steadfastWill / 100), 1);
}
}

View file

@ -23,7 +23,7 @@ public class RitualWellOfSuffering extends Ritual
public static final String ALTAR_RANGE = "altar";
public static final String DAMAGE_RANGE = "damage";
public static final int SACRIFICE_AMOUNT = 20;
public static final int SACRIFICE_AMOUNT = 25;
public BlockPos altarOffsetPos = new BlockPos(0, 0, 0); //TODO: Save!
@ -99,7 +99,17 @@ public class RitualWellOfSuffering extends Ritual
{
if (entity.attackEntityFrom(DamageSource.outOfWorld, 1))
{
tileAltar.sacrificialDaggerCall(SACRIFICE_AMOUNT, true);
String entityName = entity.getClass().getSimpleName();
int lifeEssenceRatio = SACRIFICE_AMOUNT;
if (ConfigHandler.entitySacrificeValues.containsKey(entityName))
lifeEssenceRatio = ConfigHandler.entitySacrificeValues.get(entityName);
if (BloodMagicAPI.getEntitySacrificeValues().containsKey(entityName))
lifeEssenceRatio = BloodMagicAPI.getEntitySacrificeValues().get(entityName);
tileAltar.sacrificialDaggerCall(lifeEssenceRatio, true);
totalEffects++;