- Preparations for update

- Added some more aura effects
- Added recipes
- Added texts for all effects
This commit is contained in:
HellFirePvP committed 2015-12-18 16:04:37 +01:00
1 parent 2ffa945e5a
commit 18c3be54c7
7 files changed
+401 -9

No files matched your search

@@ -12,16 +12,22 @@ import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -39,6 +45,7 @@ import thaumcraft.common.lib.utils.EntityUtils;
import thaumcraft.common.lib.utils.Utils;
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
import java.lang.reflect.InvocationTargetException;
import java.util.Random;
import static makeo.gadomancy.common.utils.MiscUtils.*;
@@ -357,7 +364,7 @@ public class AuraEffects {
public static final AuraEffect HERBA = new AuraEffect.BlockAuraEffect() {
@Override
public int getBlockCount(Random random) {
return 90;
return 140;
}
@Override
@@ -373,7 +380,7 @@ public class AuraEffects {
public static final AuraEffect ARBOR = new AuraEffect.BlockAuraEffect() {
@Override
public int getBlockCount(Random random) {
return 60;
return 80;
}
@Override
@@ -452,7 +459,7 @@ public class AuraEffects {
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
EntityLiving mob = world.rand.nextBoolean() ? new EntitySkeleton(world) : new EntityZombie(world);
if(setAndCheckPosition(mob, selectedBlock, world, true)) {
if(setAndCheckPosition(mob, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL) {
int totalCount = (world.rand.nextInt(3) == 0 ? 1 : 0) + 2;
do {
@@ -477,6 +484,65 @@ public class AuraEffects {
}
}.register(Aspect.SOUL);
public static final AuraEffect PRAECANTATIO = new PotionDistributionEffect(RegisteredPotions.VIS_DISCOUNT, 4, 6, ticksForMinutes(5), 1).register(Aspect.MAGIC);
public static final AuraEffect LIMUS = new AuraEffect.BlockAuraEffect() {
@Override
public int getBlockCount(Random random) {
return random.nextInt(40) == 0 ? 1 : 0;
}
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
EntitySlime slime = new EntitySlime(world);
NBTTagCompound data = new NBTTagCompound();
slime.writeEntityToNBT(data);
data.setInteger("Size", 0);
slime.readEntityFromNBT(data);
boolean canSpawn = setAndCheckPosition(slime, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL;
if(canSpawn) {
ChunkCoordinates pos = new ChunkCoordinates((int) slime.posX, (int) slime.posY, (int) slime.posZ);
pos = iterateDown(pos, world);
slime.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
world.spawnEntityInWorld(slime);
}
}
@Override
public int getTickInterval() {
return 4;
}
}.register(Aspect.SLIME);
public static final AuraEffect BESTIA = new AuraEffect.BlockAuraEffect() {
private final Class[] animalClasses = new Class[] { EntitySheep.class, EntityCow.class, EntityChicken.class, EntityPig.class };
@Override
public int getBlockCount(Random random) {
return random.nextInt(60) == 0 ? 1 : 0;
}
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
Class animalClass = animalClasses[world.rand.nextInt(animalClasses.length)];
EntityLivingBase animal;
try {
animal = (EntityLivingBase) animalClass.getConstructor(World.class).newInstance(world);
} catch (Exception e) {
return;
}
boolean canSpawn = setAndCheckPosition(animal, selectedBlock, world, true);
if(canSpawn) {
ChunkCoordinates pos = new ChunkCoordinates((int) animal.posX, (int) animal.posY, (int) animal.posZ);
pos = iterateDown(pos, world);
animal.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
world.spawnEntityInWorld(animal);
}
}
@Override
public int getTickInterval() {
return 4;
}
}.register(Aspect.BEAST);
public static class PotionDistributionEffect extends AuraEffect.EntityAuraEffect {
@@ -513,7 +579,7 @@ public class AuraEffects {
private static void waterLocation(ChunkCoordinates coordinates, World world) {
Block block = world.getBlock(coordinates.posX, coordinates.posY, coordinates.posZ);
if (block.getTickRandomly()) {
world.scheduleBlockUpdate(coordinates.posX, coordinates.posY, coordinates.posZ, block, world.rand.nextInt(20)+10);
world.scheduleBlockUpdate(coordinates.posX, coordinates.posY, coordinates.posZ, block, world.rand.nextInt(10) + 5);
}
}
@@ -30,7 +30,6 @@ public class RegisteredPotions {
ACHROMATIC = registerPotion(PotionAchromatic.class);
ELDRITCH = registerPotion(PotionLetsGargamelItUp.class);
VIS_DISCOUNT = registerPotion(PotionVisAffinity.class);
System.out.println(VIS_DISCOUNT);
}
private static <T extends Potion> T registerPotion(Class<T> potionClass) {
@@ -10,6 +10,7 @@ import makeo.gadomancy.common.items.ItemAuraCore;
import makeo.gadomancy.common.items.baubles.ItemFamiliar;
import makeo.gadomancy.common.research.SimpleResearchItem;
import makeo.gadomancy.common.utils.NBTHelper;
import makeo.gadomancy.common.utils.RandomizedAspectList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -75,7 +76,10 @@ public class RegisteredRecipes {
public static CrucibleRecipe[] recipesWashAuraCore;
public static IRecipe[] recipesUndoAuraCore;
public static InfusionRecipe recipeAuraCore;
public static IArcaneRecipe recipeAuraPylon;
public static IArcaneRecipe recipeAuraPylonPeak;
public static IArcaneRecipe recipeArcanePackager;
public static void init() {
AdditionalGolemType typeSilverwood = RegisteredGolemStuff.typeSilverwood;
@@ -184,6 +188,33 @@ public class RegisteredRecipes {
RegisteredRecipes.recipesUndoAuraCore = recipesUndoAuraCore.toArray(new IRecipe[recipesUndoAuraCore.size()]);
ItemStack blankCore = new ItemStack(RegisteredItems.itemAuraCore);
RegisteredItems.itemAuraCore.setCoreType(blankCore, ItemAuraCore.AuraCoreType.BLANK);
recipeAuraCore = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AURA_CORE", blankCore, 10,
new RandomizedAspectList().setHalfCap(true).addAspectRandomBase(Aspect.AURA, 41).addAspectRandomBase(Aspect.MAGIC, 57).addAspectRandomBase(Aspect.ELDRITCH, 43).addAspectRandomBase(Aspect.VOID, 55),
new ItemStack(ConfigItems.itemResource, 1, 15),
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2)});
recipeAuraPylon = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AURA_PYLON", new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 0),
new AspectList().add(Aspect.ORDER, 110).add(Aspect.WATER, 80).add(Aspect.FIRE, 80).add(Aspect.AIR, 80),
"TST", "S S", "TJT", 'T', new ItemStack(ConfigBlocks.blockTube, 1, 6), 'S', new ItemStack(ConfigBlocks.blockMagicalLog, 1, 1), 'J', new ItemStack(ConfigBlocks.blockJar, 1, 0));
ItemStack ordoCore = new ItemStack(RegisteredItems.itemAuraCore);
RegisteredItems.itemAuraCore.setCoreType(ordoCore, ItemAuraCore.AuraCoreType.ORDER);
recipeAuraPylonPeak = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AURA_PYLON", new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 1),
new AspectList().add(Aspect.ORDER, 120).add(Aspect.FIRE, 90).add(Aspect.AIR, 70),
" N ", "ACA", " P ", 'A', new ItemStack(ConfigItems.itemResource, 1, 0), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'C', ordoCore, 'P', new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 0));
ItemStack aerCore = new ItemStack(RegisteredItems.itemAuraCore);
RegisteredItems.itemAuraCore.setCoreType(aerCore, ItemAuraCore.AuraCoreType.AIR);
recipeArcanePackager = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".ARCANE_PACKAGER", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 4),
new AspectList().add(Aspect.AIR, 120).add(Aspect.ORDER, 80).add(Aspect.ENTROPY, 80),
"PSP", "GCG", "JTJ", 'P', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'S', new ItemStack(Blocks.piston), 'G', new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 2),
'C', aerCore, 'J', new ItemStack(ConfigBlocks.blockJar), 'T', new ItemStack(ConfigBlocks.blockTable, 1, 15));
auraCoreRecipes = createAuraCoreRecipes();
}
@@ -258,7 +258,7 @@ public class RegisteredResearches {
.add(Aspect.EARTH, 8).add(Aspect.FIRE, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8),
cores)
.setConcealed().setAutoUnlock()
.setPages(new ResearchPage("gadomancy.research_page.AURA_CORE.1"), new MultiResearchPage(RegisteredRecipes.auraCoreRecipes)).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.AURA_CORE.1"), new ResearchPage(RegisteredRecipes.recipeAuraCore), new MultiResearchPage(RegisteredRecipes.auraCoreRecipes)).registerResearchItem();
researchCleanAuraCore = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".CLEAN_AURA_CORE", Gadomancy.MODID,
new AspectList().add(Aspect.HEAL, 8).add(Aspect.AURA, 6).add(Aspect.MAGIC, 8).add(Aspect.WATER, 10),
@@ -273,7 +273,7 @@ public class RegisteredResearches {
.setHidden()
.setParents(researchAuraCore.key)
.setItemTriggers(new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.ORDER.ordinal()))
.setPages(new ResearchPage("gadomancy.research_page.AURA_PYLON.1"), new ResearchPage(RegisteredRecipes.multiblockAuraPylon)).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.AURA_PYLON.1"), new ResearchPage(RegisteredRecipes.recipeAuraPylon), new ResearchPage(RegisteredRecipes.recipeAuraPylonPeak), new ResearchPage(RegisteredRecipes.multiblockAuraPylon)).registerResearchItem();
researchAuraEffects = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".AURA_EFFECTS", Gadomancy.MODID,
new AspectList().add(Aspect.AURA, 10).add(Aspect.MIND, 8).add(Aspect.MAGIC, 4).add(Aspect.MECHANISM, 8),
@@ -289,7 +289,7 @@ public class RegisteredResearches {
.setHidden()
.setParents(researchAuraCore.key)
.setItemTriggers(new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.AIR.ordinal()))
.setPages(new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.1"), new ResearchPage(RegisteredRecipes.recipeArcanePackager)).registerResearchItem();
//Warpy warpy
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".FAM_ATTACK_3", 2);
@@ -0,0 +1,82 @@
package makeo.gadomancy.common.utils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* This class is part of the CycloneEnchantments Plugin for the CycloneNetwork
*
* Created by HellFirePvP @ 18.12.2015 13:58
*/
public class RandomizedAspectList extends AspectList {
private static final Random RANDOM = new Random();
private Map<Aspect, Integer> aspectMap = new HashMap<Aspect, Integer>();
private long lastRandomization = 0;
private boolean halfCap = false;
public RandomizedAspectList addAspectRandomBase(Aspect aspect, int amount) {
aspectMap.put(aspect, amount);
return this;
}
public RandomizedAspectList setHalfCap(boolean halfCap) {
this.halfCap = halfCap;
return this;
}
private void checkRandomization() {
if((System.currentTimeMillis() - lastRandomization) > 500) {
super.aspects.clear();
for(Aspect a : aspectMap.keySet()) {
if(a == null) continue;
int am;
if(halfCap) {
int c = aspectMap.get(a);
am = (c / 2) + RANDOM.nextInt(c / 2);
} else {
am = RANDOM.nextInt(aspectMap.get(a));
}
if(am > 0) {
super.add(a, am);
}
}
lastRandomization = System.currentTimeMillis();
}
}
@Override
public Aspect[] getAspects() {
checkRandomization();
return super.getAspects();
}
@Override
public Aspect[] getAspectsSorted() {
checkRandomization();
return super.getAspectsSorted();
}
@Override
public Aspect[] getAspectsSortedAmount() {
checkRandomization();
return super.getAspectsSortedAmount();
}
@Override
public int getAmount(Aspect key) {
checkRandomization();
return super.getAmount(key);
}
@Override
public Aspect[] getPrimalAspects() {
checkRandomization();
return super.getPrimalAspects();
}
}