Added demon limit to config - maximum number of demons that may spawn for a Demon Portal
This commit is contained in:
parent
316a79fab8
commit
8315dcf864
6 changed files with 29 additions and 64 deletions
|
@ -113,9 +113,8 @@ import WayofTime.alchemicalWizardry.common.harvest.PamHarvestCompatRegistry;
|
||||||
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
|
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
|
||||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||||
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
|
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
|
||||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWater;
|
||||||
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
||||||
import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration;
|
|
||||||
import WayofTime.alchemicalWizardry.common.potion.PotionBoost;
|
import WayofTime.alchemicalWizardry.common.potion.PotionBoost;
|
||||||
import WayofTime.alchemicalWizardry.common.potion.PotionDeaf;
|
import WayofTime.alchemicalWizardry.common.potion.PotionDeaf;
|
||||||
import WayofTime.alchemicalWizardry.common.potion.PotionDemonCloak;
|
import WayofTime.alchemicalWizardry.common.potion.PotionDemonCloak;
|
||||||
|
@ -1311,7 +1310,7 @@ public class AlchemicalWizardry
|
||||||
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(ReagentRegistry.reductusReagent, 1000));
|
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(ReagentRegistry.reductusReagent, 1000));
|
||||||
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000));
|
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000));
|
||||||
|
|
||||||
OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater, new ReagentRegenConfiguration(20, 10, 1)));
|
OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigmWater(ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initDemonPacketRegistiry()
|
public static void initDemonPacketRegistiry()
|
||||||
|
|
|
@ -151,6 +151,7 @@ public class BloodMagicConfiguration
|
||||||
DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean();
|
DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean();
|
||||||
|
|
||||||
TEDemonPortal.limit = config.get(tempDemonConfigs, "demonGridSpaceLimit", 100).getInt();
|
TEDemonPortal.limit = config.get(tempDemonConfigs, "demonGridSpaceLimit", 100).getInt();
|
||||||
|
TEDemonPortal.demonLimit = config.get(tempDemonConfigs, "demonHoardLimit", 100).getInt();
|
||||||
|
|
||||||
AlchemicalWizardry.isDemonRitualCreativeOnly = config.get(tempDemonConfigs, "IsDemonRitualCreativeOnly", false).getBoolean();
|
AlchemicalWizardry.isDemonRitualCreativeOnly = config.get(tempDemonConfigs, "IsDemonRitualCreativeOnly", false).getBoolean();
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ public class TEDemonPortal extends TileEntity
|
||||||
|
|
||||||
public static int limit = 100;
|
public static int limit = 100;
|
||||||
|
|
||||||
|
public static int demonLimit = 100;
|
||||||
|
|
||||||
public static int buildingGridDelay = 25;
|
public static int buildingGridDelay = 25;
|
||||||
public static int roadGridDelay = 10;
|
public static int roadGridDelay = 10;
|
||||||
public static int demonHoardDelay = 40;
|
public static int demonHoardDelay = 40;
|
||||||
|
@ -412,12 +414,15 @@ public class TEDemonPortal extends TileEntity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.demonHoardCooldown <= 0)
|
if(this.demonHoardCooldown <= 0) //TODO
|
||||||
{
|
{
|
||||||
int complexityCost = this.createRandomDemonHoard(this, tier, this.type, this.isLockedDown());
|
if(this.hoardList.size() <= demonLimit)
|
||||||
if(complexityCost > 0)
|
|
||||||
{
|
{
|
||||||
this.demonHoardCooldown = TEDemonPortal.demonHoardDelay * complexityCost;
|
int complexityCost = this.createRandomDemonHoard(this, tier, this.type, this.isLockedDown());
|
||||||
|
if(complexityCost > 0)
|
||||||
|
{
|
||||||
|
this.demonHoardCooldown += TEDemonPortal.demonHoardDelay * complexityCost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,17 +39,11 @@ public abstract class OmegaArmour extends BoundArmour
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
|
||||||
{
|
{
|
||||||
super.onArmorTick(world, player, itemStack);
|
super.onArmorTick(world, player, itemStack);
|
||||||
//
|
|
||||||
// if(world.getWorldTime() % 20 == 0 && !world.isRemote)
|
if(this.armorType == 1)
|
||||||
// {
|
{
|
||||||
// NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(ReagentRegistry.aquasalusReagent, this.getDuration(itemStack), 100), (EntityPlayerMP)player);
|
paradigm.onUpdate(world, player, itemStack);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// if(!this.decrementDuration(itemStack))
|
|
||||||
// {
|
|
||||||
// ItemStack stack = this.getContainedArmourStack(itemStack);
|
|
||||||
// player.inventory.armorInventory[3-this.armorType] = stack;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void revertArmour(EntityPlayer player, ItemStack itemStack)
|
public void revertArmour(EntityPlayer player, ItemStack itemStack)
|
||||||
|
@ -63,7 +57,6 @@ public abstract class OmegaArmour extends BoundArmour
|
||||||
ItemStack omegaStack = new ItemStack(this);
|
ItemStack omegaStack = new ItemStack(this);
|
||||||
this.setContainedArmourStack(omegaStack, boundStack);
|
this.setContainedArmourStack(omegaStack, boundStack);
|
||||||
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
|
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
|
||||||
this.setItemDuration(omegaStack, 100);
|
|
||||||
return omegaStack;
|
return omegaStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,49 +94,6 @@ public abstract class OmegaArmour extends BoundArmour
|
||||||
return armourStack;
|
return armourStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemDuration(ItemStack omegaStack, int duration)
|
|
||||||
{
|
|
||||||
NBTTagCompound tag = omegaStack.getTagCompound();
|
|
||||||
if(tag == null)
|
|
||||||
{
|
|
||||||
tag = new NBTTagCompound();
|
|
||||||
omegaStack.setTagCompound(tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
tag.setInteger("duration", duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDuration(ItemStack omegaStack)
|
|
||||||
{
|
|
||||||
if(omegaStack.hasTagCompound())
|
|
||||||
{
|
|
||||||
return omegaStack.getTagCompound().getInteger("duration");
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param omegaStack
|
|
||||||
* @return true if there is duration left (duration > 0)
|
|
||||||
*/
|
|
||||||
public boolean decrementDuration(ItemStack omegaStack)
|
|
||||||
{
|
|
||||||
int duration = this.getDuration(omegaStack);
|
|
||||||
|
|
||||||
if(duration > 0)
|
|
||||||
{
|
|
||||||
this.setItemDuration(omegaStack, duration - 1);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.omega;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import WayofTime.alchemicalWizardry.ModItems;
|
import WayofTime.alchemicalWizardry.ModItems;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
|
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
|
||||||
|
@ -83,4 +84,9 @@ public class OmegaParadigm
|
||||||
|
|
||||||
return helmetStack != null && helmetStack.getItem() == helmet && chestStack != null && chestStack.getItem() == chestPiece && leggingsStack != null && leggingsStack.getItem() == leggings && bootsStack != null && bootsStack.getItem() == boots;
|
return helmetStack != null && helmetStack.getItem() == helmet && chestStack != null && chestStack.getItem() == chestPiece && leggingsStack != null && leggingsStack.getItem() == leggings && bootsStack != null && bootsStack.getItem() == boots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onUpdate(World world, EntityPlayer player, ItemStack stack)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,12 @@ public class SpellLightningBolt extends HomSpell
|
||||||
double yCoord = par3EntityPlayer.posY;
|
double yCoord = par3EntityPlayer.posY;
|
||||||
double zCoord = par3EntityPlayer.posZ;
|
double zCoord = par3EntityPlayer.posZ;
|
||||||
par2World.getWorldInfo().setRaining(true);
|
par2World.getWorldInfo().setRaining(true);
|
||||||
par2World.setRainStrength(1.0f);
|
if(par2World.isRemote)
|
||||||
par2World.setThunderStrength(1.0f);
|
{
|
||||||
|
par2World.setRainStrength(1.0f);
|
||||||
|
par2World.setThunderStrength(1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
par2World.getWorldInfo().setThunderTime(0);
|
par2World.getWorldInfo().setThunderTime(0);
|
||||||
par2World.getWorldInfo().setThundering(true);
|
par2World.getWorldInfo().setThundering(true);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue