Updated the hp/damage/etc logic of the corrupted mobs in general, and made it so the sheep will cast resistance on hurt allies when nearby on a cooldown.

Added an alchemy array layer (WIP) for the sheep when it is casting a "spell".
This commit is contained in:
WayofTime 2016-09-18 18:44:18 -04:00
parent cbd2609fe2
commit d6c1d59e5d
11 changed files with 652 additions and 31 deletions

View file

@ -60,8 +60,47 @@ public class CorruptionHandler
return false;
}
public static boolean corruptSurroundingBlocks(World world, EnumDemonWillType type, BlockPos centerPos, int radius)
/**
*
* @param world
* @param type
* @param centerPos
* @param radius
* @param featheringChance
* Chance that the block within the featheringDepth is NOT altered.
* @param featheringDepth
* @return
*/
public static boolean corruptSurroundingBlocks(World world, EnumDemonWillType type, BlockPos centerPos, int radius, double featheringChance, double featheringDepth)
{
for (int i = -radius; i <= radius; i++)
{
for (int j = -radius; j <= radius; j++)
{
for (int k = -radius; k <= radius; k++)
{
if (i * i + j * j + k * k > (radius + 0.5) * (radius + 0.5))
{
continue;
}
if (featheringChance > 0 && i * i + j * j + k * k > (radius - featheringDepth + 0.5) * (radius - featheringDepth + 0.5) && world.rand.nextDouble() < featheringChance)
{
continue;
}
if (world.isAirBlock(centerPos))
{
continue;
}
BlockPos offsetPos = centerPos.add(i, j, k);
IBlockState offsetState = world.getBlockState(offsetPos);
Block offsetBlock = offsetState.getBlock();
corruptBlock(world, type, offsetPos, offsetState, offsetBlock);
}
}
}
return false;
}
}