From 16e87bcc94153b7748e07725d0ad79dabf2b04a7 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sun, 11 Oct 2015 16:49:53 +0100 Subject: [PATCH] The dandelifeon produces a lot more mana per cell now, however, whenever a cell is eaten, the board is wiped. Also added an "warning: experimental" page to the entry. --- .../subtile/generating/SubTileDandelifeon.java | 15 +++++++++++---- .../botania/common/lexicon/LexiconData.java | 2 +- src/main/resources/assets/botania/lang/en_US.lang | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java index 0b0dd51f3..36f79a969 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java @@ -28,7 +28,7 @@ public class SubTileDandelifeon extends SubTileGenerating { private static final int RANGE = 12; private static final int SPEED = 10; private static final int MAX_GENERATIONS = 60; - private static final int MANA_PER_GEN = 35; + private static final int MANA_PER_GEN = 150; private static final int[][] ADJACENT_BLOCKS = new int[][] { { -1, -1 }, @@ -52,6 +52,7 @@ public class SubTileDandelifeon extends SubTileGenerating { void runSimulation() { int[][] table = getCellTable(); List changes = new ArrayList(); + boolean wipe = false; for(int i = 0; i < table.length; i++) for(int j = 0; j < table[0].length; j++) { @@ -70,24 +71,30 @@ public class SubTileDandelifeon extends SubTileGenerating { int xdist = Math.abs(i - RANGE); int zdist = Math.abs(j - RANGE); - int allowDist = newVal == 1 && gen == 0 ? 3 : 1; + int allowDist = 1; if(xdist <= allowDist && zdist <= allowDist && newVal > -1) { gen = newVal; newVal = gen == 1 ? -1 : -2; } - if(newVal != gen) + if(newVal != gen) { changes.add(new int[] { i, j, newVal, gen }); + if(newVal == -2) + wipe = true; + } } int x = supertile.xCoord; int y = supertile.yCoord; int z = supertile.zCoord; - + for(int[] change : changes) { int px = x - RANGE + change[0]; int pz = z - RANGE + change[1]; int val = change[2]; + if(val != -2 && wipe) + val = -1; + int old = change[3]; setBlockForGeneration(px, y, pz, val, old); diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 906000416..fb2d0ddaf 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -571,7 +571,7 @@ public final class LexiconData { spectrolus.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.spectrolusRecipe)); dandelifeon = new ALexiconEntry(LibLexicon.GFLOWER_DANDELIFEON, categoryGenerationFlowers); - dandelifeon.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("10"), new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock)); + dandelifeon.setLexiconPages(new PageText("_w"), new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("10"), new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock)); // DEVICES ENTRIES pylon = new BLexiconEntry(LibLexicon.DEVICE_PYLON, categoryDevices); diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 25b20773f..a539c2c05 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -2446,6 +2446,7 @@ botania.page.spectrolus2=&oTaste the Rainbow&r. # -- DANDELIFEON botania.entry.dandelifeon=Dandelifeon +botania.page.dandelifeon_w=Warning: This feature is experimental.
It may, and probably will change in the future. Do not get too attached to it. botania.page.dandelifeon0=The &1Dandelifeon&0 is a flower not recommended for those faint of heart.
While it's possibly the strongest available generating flower within the botanist's toolbelt, it's also one of the less straightforward to put to work. botania.page.dandelifeon1=This flower makes use of a cellular automata known as &4Conway's Game of Life&0. The area for this procedure is a 25x25 square centered around the &1Dandelifeon&0 itself.
While the flower has a redstone signal, twice every second it'll step the game once. botania.page.dandelifeon2=The game is executed with the concept of &4Cells&0. The 25x25 area can be seen as a grid of 25 by 25 cells
Cells may be live or dead, live if the block in that position is a &1Cellular Block&0 (read on) or dead if it's anything else. &4Neighbours&0 are the eight blocks in the same plane around any one cell. @@ -2453,7 +2454,7 @@ botania.page.dandelifeon3=Every step of the game, the following transitions migh botania.page.dandelifeon4=All of the transitions happen at the same time.
Aside from those, a few aditional rules not present in a typical simulation of &4Conway's Game of Life&0 are also present in the &1Dadelifeon&0 procedures, listed in the following pages. botania.page.dandelifeon5=All cells have an age, starting at zero. Whenever a cell lives on, by having two or three neighbours, its age inreases by one. Whenever a dead cell becomes a live cell, the age of the new live cell is equal to the age of the oldest neighbour, plus one. Any cells older than sixty generations will die during the next step. botania.page.dandelifeon6=Second off, the 3x3 zone centered around the &1Dandelifeon&0 itself is not habitable by cells. Any live cells that would exist in that area are turned into &4Mana&0 instead. The older the cell that would be created, the more &4Mana&0 it makes. Age zero cells produce no &4Mana&0. -botania.page.dandelifeon10=The 7x7 zone centered around the &1Dandelifeon&0, excluding the 3x3 zone mentioned in the previous page can also not be habited by Age zero cells.
A few other restrictions apply to cells, having two different &1Dandelifeon&0 flowers affect the same cell will kill it. Lastly, any cell will die if moved by any other means than the &1Dandelifeon&0 itself. +botania.page.dandelifeon10=Whenever any live cells are absorbed by the 3x3 zone in the center, all other cells in the board die.
A few other restrictions apply to cells, such as having two different &1Dandelifeon&0 flowers affect the same cell will kill it. Lastly, any cell will die if moved by any other means than the &1Dandelifeon&0 itself. botania.page.dandelifeon7=&1Cellular Blocks&0 are crafted with &1Cactus&0, &1Carrots&0 and &1Potatoes&0, and are extremely fragile, they may not be picked once placed down or moved by &1Pistons&0 and may not be created (through having 3 live neighbours on a dead cell) on any block that isn't air.
If not within the range of a &1Dandelifeon&0 they work as normal building blocks. botania.page.dandelifeon8=&oCellCraft^2&r. botania.page.dandelifeon9=Creating &1Cellular Blocks&0