Crumbling, Transmuting bees & their (crappy) effects.

This commit is contained in:
MysteriousAges committed 2013-08-28 17:46:38 -07:00
1 parent 7513ba1255
commit 533d7d55a8
10 files changed
+289 -8

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
2.1.3
Added a new mini bee branch: Polymorphic. It is said Unusual bees can have some unusual effects on the world if they are advanced...
Crumbling effect ages the area around the hive.
Transmutation effect will turn blocks into other blocks. (It's still a bit rough though.)
2.1.2
Fixed issue with mob spawning effects incorrectly checking for effect data variables.
Updating localization files (RU, DE)
@@ -266,6 +266,13 @@
<entry key="magicbees.speciesEmerald.description">It is said they have been to a land ruled by a Great Wizard, and have taken the aspect of his city.|Apinomicon</entry>
<entry key="magicbees.speciesApatite">Apatine</entry>
<entry key="magicbees.speciesApatite.description">Day and night the whining droned on. I barricaded the windows and hid in the cellar, but everywhere the high-pitched noise of the apatine bees penetrated the walls and drove me to distraction.|Beekeeping 101</entry>
<entry key="magicbees.speciesMutable">Mutable</entry>
<entry key="magicbees.speciesMutable.description">Changeable in nature, mercurial in personality.|Apinomicon</entry>
<entry key="magicbees.speciesTransmuting">Transmuting</entry>
<entry key="magicbees.speciesTransmuting.description">"I could've sworn this was made out of stone yesterday!"|Sengir, Mad Apiarist</entry>
<entry key="magicbees.speciesCrumbling">Crumbling</entry>
<entry key="magicbees.speciesCrumbling.description">They have a corrosive effect on their surroundings, rapidly aging them.|Apinomicon</entry>
<entry key="magicbees.speciesTCStark">Stark</entry>
<entry key="magicbees.speciesTCStark.description">"These are unusually attracted to shards. This warrents further investigation."|Azanor, Master Thaumaturge</entry>
@@ -350,6 +357,8 @@
<entry key="magicbees.effectMoveSpeed">Swiftness</entry>
<entry key="magicbees.effectSlowSpeed">Time Warp</entry>
<entry key="magicbees.effectWithering">Withering</entry>
<entry key="magicbees.effectTransmuting">Transmuting</entry>
<entry key="magicbees.effectCrumbling">Crumbling</entry>
<entry key="magicbees.effectNodeAttract">Aura Attract</entry>
<entry key="magicbees.effectNodePurify">Purify Aura</entry>
<entry key="magicbees.effectNodeFlux">Aura Flux</entry>
@@ -392,6 +401,8 @@
<entry key="classification.metallic.description">They collect fragments of metal and combine them into larger portions.|Apinomicon</entry>
<entry key="classification.gem">Gem</entry>
<entry key="classification.gem.description">They collect fragments of precious gems in their combs.|Apinomicon</entry>
<entry key="classification.transmuting">Polymorphic</entry>
<entry key="classification.transmuting.description">Reality seems to be somewhat volatile around bees of this family.|Apinomicon</entry>
<entry key="classification.thaumic">Thaumic</entry>
<entry key="classification.thaumic.description">These bees have an increased affinity to magic and aura.|Apinomicon</entry>
<entry key="classification.fleshy">Fleshy</entry>
+13 -6
View File
@@ -26,6 +26,8 @@ public class Allele implements IAllele
public static IAlleleEffect effectMoveSpeed;
public static IAlleleEffect effectSlowSpeed;
public static IAlleleEffect effectWithering;
public static IAlleleEffect effectTransmuting;
public static IAlleleEffect effectCrumbling;
public static IAlleleEffect spawnBrainyZombie;
public static IAlleleEffect spawnWisp;
@@ -60,11 +62,18 @@ public class Allele implements IAllele
Allele.spawnWisp = new AlleleEffectSpawnWisp("Wispy", false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
.setThrottle(1800).setChanceToSpawn(79);
Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);
}
else
{
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
Allele.spawnBrainyZombie = Allele.spawnBats = Allele.spawnWisp = (IAlleleEffect)Allele.getBaseAllele("effectNone");
Allele.spawnBrainyZombie = Allele.spawnBats = Allele.spawnWisp =
Allele.effectNodeAttract = Allele.effectNodePurify =
Allele.effectNodeFlux = Allele.effectNodeCharge = (IAlleleEffect)Allele.getBaseAllele("effectNone");
}
if (ArsMagicaHelper.isActive())
@@ -85,16 +94,14 @@ public class Allele implements IAllele
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect)Allele.getBaseAllele("effectNone");
}
Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);
Allele.effectCleansing = new AlleleEffectCure("Curative", false);
Allele.effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
Allele.effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
Allele.effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
Allele.effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
Allele.effectTransmuting = new AlleleEffectTransmuting("Transmuting", true);
Allele.effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
@@ -0,0 +1,75 @@
package magicbees.bees;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectCrumbling extends AlleleEffect
{
private HashMap<ItemStack, ItemStack> crumbleMap;
public AlleleEffectCrumbling(String id, boolean isDominant)
{
super(id, isDominant, 200);
crumbleMap = new HashMap<ItemStack, ItemStack>();
crumbleMap.put(new ItemStack(Block.stone), new ItemStack(Block.cobblestone));
crumbleMap.put(new ItemStack(Block.cobblestone), new ItemStack(Block.cobblestoneMossy));
crumbleMap.put(new ItemStack(Block.stoneBrick, 1, 0), new ItemStack(Block.stoneBrick, 1, 2));
crumbleMap.put(new ItemStack(Block.stoneBrick, 1, 2), new ItemStack(Block.stoneBrick, 1, 1));
crumbleMap.put(new ItemStack(Block.cobblestoneWall), new ItemStack(Block.cobblestoneWall, 1, 1));
crumbleMap.put(new ItemStack(Block.gravel), new ItemStack(Block.sand));
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
storedData = new magicbees.bees.EffectData(1, 0, 0);
}
return storedData;
}
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
World world = housing.getWorld();
// Get random coords within territory
int xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
boolean success = false;
Block block = Block.blocksList[world.getBlockId(xCoord, yCoord, zCoord)];
if (block != null)
{
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
for (ItemStack key : crumbleMap.keySet())
{
if (OreDictionary.itemMatches(source, key, false))
{
ItemStack target = crumbleMap.get(key);
world.setBlock(xCoord, yCoord, zCoord, target.itemID, target.getItemDamage(), 2);
break;
}
}
}
storedData.setInteger(0, 0);
return storedData;
}
}
@@ -0,0 +1,118 @@
package magicbees.bees;
import java.util.Locale;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectTransmuting extends AlleleEffect
{
public AlleleEffectTransmuting(String id, boolean isDominant)
{
super(id, isDominant, 200);
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
storedData = new magicbees.bees.EffectData(1, 0, 0);
}
return storedData;
}
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
World world = housing.getWorld();
// Get random coords within territory
int xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
// Check if == stone
boolean doTransmute = false;
Block block = Block.blocksList[world.getBlockId(xCoord, yCoord, zCoord)];
if (block == null || block == Block.stone || block == Block.cobblestone)
{
doTransmute = true;
}
else if (block != null)
{
ItemStack cobbleItem = new ItemStack(Block.cobblestone);
ItemStack stoneItem = new ItemStack(Block.stone);
ItemStack testItem = new ItemStack(block);
doTransmute = OreDictionary.itemMatches(cobbleItem, testItem, false) || OreDictionary.itemMatches(stoneItem, cobbleItem, false);
}
// Transmute to something.
if (doTransmute)
{
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
// Gogo shortcutting logic operators!
boolean tryThis = trySpawnAbyssalStone(world, biome, xCoord, yCoord, zCoord) ||
trySpawnQuarriedStone(world, biome, xCoord, yCoord, zCoord) ||
trySpawnSandstone(world, biome, xCoord, yCoord, zCoord);
}
storedData.setInteger(0, 0);
return storedData;
}
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FROZEN))
{
ItemStack item = GameRegistry.findItemStack("Railcraft", "stone.abyssal", 1);
if (item != null)
{
world.setBlock(x, y, z, item.itemID, item.getItemDamage(), 2);
flag = true;
}
}
return flag;
}
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) &&
biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river"))
{
ItemStack item = GameRegistry.findItemStack("Railcraft", "stone.quarried", 1);
if (item != null)
{
world.setBlock(x, y, z, item.itemID, item.getItemDamage(), 2);
flag = true;
}
}
return flag;
}
private boolean trySpawnSandstone(World world, BiomeGenBase biome, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.DESERT))
{
world.setBlock(x, y, z, Block.sandStone.blockID);
flag = true;
}
return flag;
}
}
@@ -27,6 +27,7 @@ public enum BeeClassification implements IClassification
METALLIC("Metallic", "Metalliapis"),
GEM("Gem", "Lapidapis"),
TRANSMUTING("Transmuting", "Transmutapis"),
THAUMIC("Thaumic", "Thaumiapis"),
FLESHY("Fleshy", "Carnosapis"),
@@ -718,6 +718,46 @@ public class BeeGenomeManager
return genome;
}
public static IAllele[] getTemplateMutableBase()
{
IAllele[] genome = getTemplateModBase();
genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest");
genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1");
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2");
return genome;
}
public static IAllele[] getTemplateMutable()
{
IAllele[] genome = getTemplateMutableBase();
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MUTABLE;
return genome;
}
public static IAllele[] getTemplateTransmuting()
{
IAllele[] genome = getTemplateMutableBase();
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TRANSMUTING;
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting;
return genome;
}
public static IAllele[] getTemplateCrumbling()
{
IAllele[] genome = getTemplateMutableBase();
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CRUMBLING;
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCrumbling;
return genome;
}
private static IAllele[] getTemplateTCBase()
{
IAllele[] genome = getTemplateModBase();
@@ -116,6 +116,10 @@ public class BeeMutation implements IBeeMutation
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED, BeeSpecies.DRACONIC, 6)
.setBiomeRequired(BiomeDictionary.Type.END);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.ELDRITCH, BeeSpecies.MUTABLE, 12);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.TRANSMUTING, 9);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.CRUMBLING, 9);
if (BeeSpecies.COPPER.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
@@ -252,7 +256,7 @@ public class BeeMutation implements IBeeMutation
if (EquivalentExchangeHelper.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.ELDRITCH, BeeSpecies.EE_MINIUM, 8);
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
}
}
@@ -159,6 +159,13 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
BeeClassification.GEM, 0x005300, 0x17DD62, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
APATITE("Apatite", "apatite",
BeeClassification.GEM, 0x2EA7EC, 0x001D51, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
MUTABLE("Mutable", "mutable",
BeeClassification.TRANSMUTING, 0xDBB24C, 0xE0D5A6, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
TRANSMUTING("Transmuting", "transmuting",
BeeClassification.TRANSMUTING, 0xDBB24C, 0xA2D2D8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
CRUMBLING("Crumbling", "crumbling",
BeeClassification.TRANSMUTING, 0xDBB24C, 0xDBA4A4, EnumTemperature.HOT, EnumHumidity.ARID, false, false),
// --------- Thaumcraft Bees ---------------------------------------------------------------------------------------
TC_STARK("TCStark", "torridae", // Stark
@@ -577,6 +584,19 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
.setGenome(BeeGenomeManager.getTemplateApatite())
.register();
MUTABLE.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 30)
.setGenome(BeeGenomeManager.getTemplateMutable())
.register();
TRANSMUTING.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 10)
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 10)
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 10)
.setGenome(BeeGenomeManager.getTemplateTransmuting())
.register();
CRUMBLING.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 20)
.addProduct(new ItemStack(Config.fBeeComb, 1 , ForestryHelper.Comb.COCOA.ordinal()), 20)
.setGenome(BeeGenomeManager.getTemplateCrumbling())
.register();
TC_STARK.addProduct(Config.combs.getStackForType(CombType.HARMONIZING), 10)
.setGenome(BeeGenomeManager.getTemplateTCStark())
@@ -18,7 +18,7 @@ import net.minecraftforge.client.ForgeHooksClient;
public class BeeRenderEffect extends EntityFX
{
public int blendmode = 1;
private static String texture = "/mods/forestry/textures/items/particles/swarm_bee";
private static String texture = "forestry:textures/items/particles/swarm_bee.png";
public BeeRenderEffect(World world, double x, double y, double z, float motionScaleX, float motionScaleY, float motionScaleZ, int color)
{