- 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

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