perpetual agony mechanism

This commit is contained in:
Boblet 2025-12-01 16:54:04 +01:00
parent 03e7db5d92
commit 1fcfa136be
4 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,6 @@
## Added
* Precision assembler
## Changed
* New fusion reactor and particle accelerator parts now have OpenComputers compat
* Irradiation recipe config now has the `fusionOnly` flag, preventing the recipe from being done in the RBMK irradiation channel
@ -19,6 +22,7 @@
* The recipes are lengthy, require a lot of power and have a low chance of succeeding
* Recipes require the divine pufferfish, driver of all innovation
* Where can you get this much pufferfish? Go figure it out
* Chance output stacks no longer do an RNG call to determine if the whole stack is provided or none, rather, each single item of the stack has its own RNG call
## Fixed
* Fixed gamebreaking issue causing crashes and world corruption where the multi detonator had its tooltip misspelled

View File

@ -232,6 +232,8 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
this.register(new GenericRecipe("ass.purex").setup(300, 100).outputItems(new ItemStack(ModBlocks.machine_purex, 1))
.inputItems(new OreDictStack(STEEL.shell(), 4), new OreDictStack(RUBBER.pipe(), 8), new OreDictStack(PB.plateCast(), 4), new ComparableStack(ModItems.motor_desh, 1), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 2, EnumExpensiveType.LEAD_PLATING), new OreDictStack(STEEL.shell(), 4), new OreDictStack(RUBBER.pipe(), 12), new ComparableStack(ModItems.motor_desh, 3), new ComparableStack(ModItems.item_expensive, 2, EnumExpensiveType.CIRCUIT)));
this.register(new GenericRecipe("ass.precass").setup(1_200, 100).outputItems(new ItemStack(ModBlocks.machine_precass, 1))
.inputItems(new OreDictStack(STEEL.plateCast(), 8), new OreDictStack(ZR.ingot(), 8), new ComparableStack(ModItems.motor, 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.CAPACITOR_BOARD)));
this.register(new GenericRecipe("ass.centrifuge").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_centrifuge, 1))
.inputItems(new ComparableStack(ModItems.centrifuge_element, 1), new OreDictStack(ANY_PLASTIC.ingot(), 4), new OreDictStack(STEEL.plate528(), 8), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ANALOG))
.inputItemsEx(new ComparableStack(ModItems.centrifuge_element, 1), new OreDictStack(ANY_PLASTIC.ingot(), 4), new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.STEEL_PLATING), new OreDictStack(CU.plateCast(), 4), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ANALOG)));

View File

@ -32,6 +32,8 @@ public class PrecAssRecipes extends GenericRecipes<GenericRecipe> {
@Override
public void registerDefaults() {
int min = 1_200;
registerPair(new GenericRecipe("precass.controller").setup(400, 15_000L)
.inputItems(new ComparableStack(ModItems.circuit, 32, EnumCircuitType.CHIP),
@ -44,7 +46,7 @@ public class PrecAssRecipes extends GenericRecipes<GenericRecipe> {
DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CONTROLLER), 10, 25);
// all hail the pufferfish, driver of all innovation
this.register(new GenericRecipe("precass.blueprints").setup(5 * 60 * 20, 20_000L)
this.register(new GenericRecipe("precass.blueprints").setup(5 * min, 20_000L)
.inputItems(new ComparableStack(Items.paper, 16),
new OreDictStack(KEY_BLUE, 16),
new ComparableStack(Items.fish, 16, FishType.PUFFERFISH))
@ -52,7 +54,7 @@ public class PrecAssRecipes extends GenericRecipes<GenericRecipe> {
new ChanceOutput(new ItemStack(ModItems.blueprint_folder, 1, 0), 10),
new ChanceOutput(new ItemStack(Items.paper, 16, 0), 90))
));
this.register(new GenericRecipe("precass.beigeprints").setup(5 * 60 * 20, 50_000L)
this.register(new GenericRecipe("precass.beigeprints").setup(5 * min, 50_000L)
.inputItems(new ComparableStack(Items.paper, 24),
new OreDictStack(CINNABAR.gem(), 24),
new ComparableStack(Items.fish, 32, FishType.PUFFERFISH))
@ -76,14 +78,7 @@ public class PrecAssRecipes extends GenericRecipes<GenericRecipe> {
IOutput[] recycle = new IOutput[recipe.inputItem.length];
for(int i = 0; i < recycle.length; i++) {
ItemStack stack = recipe.inputItem[i].extractForNEI().get(0).copy();
int stackSize = (int) (recipe.inputItem[i].stacksize * fReclaim);
// if the resulting stack size is >= 1, use that, otherwise use the original stack size but a chance output percentage
if(stackSize > 0) {
stack.stackSize = stackSize;
recycle[i] = new ChanceOutput(stack);
} else {
recycle[i] = new ChanceOutput(stack, fReclaim);
}
recycle[i] = new ChanceOutput(stack, fReclaim);
}
FluidStack[] fluid = recipe.inputFluid != null ? new FluidStack[1] : null;

View File

@ -239,7 +239,12 @@ public abstract class GenericRecipes<T extends GenericRecipe> extends Serializab
@Override
public ItemStack collapse() {
if(this.chance >= 1F) return getSingle();
return RNG.nextFloat() <= chance ? getSingle() : null;
int finalSize = 0;
for(int i = 0; i < this.stack.stackSize; i++) if(RNG.nextFloat() <= chance) finalSize++;
if(finalSize <= 0) return null;
ItemStack finalStack = getSingle();
finalStack.stackSize = finalSize;
return finalStack;
}
@Override public ItemStack getSingle() { return this.stack.copy(); }