Skip to content
Open
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
package com.petrolpark.destroy.chemistry.legacy.index;


import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AcylChlorideEsterification;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AcylChlorideFormation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AcylChlorideHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AlcoholDehydration;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AlcoholOxidation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AldehydeOxidation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AlkoxideProtonation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AmideHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.AminePhosgenation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.BoraneOxidation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.BorateEsterHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.BorateEsterification;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.CarboxylicAcidEsterification;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.CyanamideAddition;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.CyanideNucleophilicAddition;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicChlorination;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicChlorohydrination;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicHydroboration;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.BoraneElectrophilicHydroboration;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicHydrochlorination;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicHydroiodination;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ElectrophilicIodination;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.HalideAmineSubstitution;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.HalideAmmoniaSubstitution;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.HalideCyanideSubstitution;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.HalideHydroxideSubstitution;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.IsocyanateHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.NitrileHydrogenation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.NitrileHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.NitroHydrogenation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.SaturatedCarbonHydrogenation;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.SaturatedCarbonHydrolysis;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.WolffKishnerReduction;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.ThionylChlorideSubstitution;
import com.petrolpark.destroy.chemistry.legacy.index.genericreaction.*;


public class DestroyGenericReactions {
Expand All @@ -48,8 +15,9 @@ public class DestroyGenericReactions {
public static final ElectrophilicChlorination ALKENE_CHLORINATION = new ElectrophilicChlorination(false);
public static final ElectrophilicChlorohydrination ALKENE_CHLOROHYDRINATION = new ElectrophilicChlorohydrination(false);
public static final SaturatedCarbonHydrolysis ALKENE_HYDROLYSIS = new SaturatedCarbonHydrolysis(false);
//public static final ElectrophilicHydroboration ALKENE_HYDROBORATION = new ElectrophilicHydroboration(false); // causes a game freeze whenever it occurs, my guess is excessive esterification, alkyne is the same
public static final BoraneElectrophilicHydroboration ALKENE_HYDROBORATION_WITH_BORANE = new BoraneElectrophilicHydroboration(false);
//public static final ElectrophilicHydroboration ALKENE_HYDROBORATION = new ElectrophilicHydroboration(false); // causes a game freeze whenever it occurs, my guess is excessive esterification, alkyne is the same, added simplified Hydroboration Oxidation reaction to compensate
public static final AlkeneHydroborationOxidation ALKENE_HYDROBORATION_OXIDATION = new AlkeneHydroborationOxidation();
//public static final BoraneElectrophilicHydroboration ALKENE_HYDROBORATION_WITH_BORANE = new BoraneElectrophilicHydroboration(false);
public static final ElectrophilicHydrochlorination ALKENE_HYDROCHLORINATION = new ElectrophilicHydrochlorination(false);
public static final SaturatedCarbonHydrogenation ALKENE_HYDROGENATION = new SaturatedCarbonHydrogenation(false);
public static final ElectrophilicHydroiodination ALKENE_HYDROIODINATION = new ElectrophilicHydroiodination(false);
Expand All @@ -58,19 +26,20 @@ public class DestroyGenericReactions {
public static final ElectrophilicChlorination ALKYNE_CHLORINATION = new ElectrophilicChlorination(true);
public static final ElectrophilicChlorohydrination ALKYNE_CHLOROHYDRINATION = new ElectrophilicChlorohydrination(true);
public static final SaturatedCarbonHydrolysis ALKYNE_HYDROLYSIS = new SaturatedCarbonHydrolysis(true);
//public static final ElectrophilicHydroboration ALKYNE_HYDROBORATION = new ElectrophilicHydroboration(true);
public static final BoraneElectrophilicHydroboration ALKYNE_HYDROBORATION_WITH_BORANE = new BoraneElectrophilicHydroboration(true);
//public static final ElectrophilicHydroboration ALKYNE_HYDROBORATION = new ElectrophilicHydroboration(true); // see alkene hydroboration
public static final AlkyneHydroborationOxidation ALKYNE_HYDROBORATION_OXIDATION = new AlkyneHydroborationOxidation();
//public static final BoraneElectrophilicHydroboration ALKYNE_HYDROBORATION_WITH_BORANE = new BoraneElectrophilicHydroboration(true); // unneeded thanks to simplified Hydroboration Oxidation reaction
public static final ElectrophilicHydrochlorination ALKYNE_HYDROCHLORINATION = new ElectrophilicHydrochlorination(true);
public static final SaturatedCarbonHydrogenation ALKYNE_HYDROGENATION = new SaturatedCarbonHydrogenation(true);
public static final ElectrophilicHydroiodination ALKYNE_HYDROIODINATION = new ElectrophilicHydroiodination(true);
public static final ElectrophilicIodination ALKYNE_IODINATION = new ElectrophilicIodination(true);
public static final AmideHydrolysis AMIDE_HYDROLYSIS = new AmideHydrolysis();
public static final AminePhosgenation AMINE_PHOSGENATION = new AminePhosgenation();
public static final BoraneOxidation BORANE_OXIDATION = new BoraneOxidation();
public static final BorateEsterHydrolysis BORATE_ESTER_HYDROLYSIS = new BorateEsterHydrolysis();
//public static final BorateEsterification BORATE_ESTERIFICATION = new BorateEsterification(); // any solution containing boron compounds, even just boric acid or trace borate ions, becomes a disgusting mess of constantly esterifying generics
//public static final BorohydrideCarbonylReduction BOROHYDRIDE_CARBONYL_REDUCTION = new BorohydrideCarbonylReduction();
//public static final CarboxylicAcidReduction CARBOXYLIC_ACID_REDUCTION = new CarboxylicAcidReduction();
//public static final BoraneOxidation BORANE_OXIDATION = new BoraneOxidation(); // unneeded thanks to simplified Hydroboration Oxidation reaction
//public static final BorateEsterHydrolysis BORATE_ESTER_HYDROLYSIS = new BorateEsterHydrolysis(); // unneeded thanks to reverse reaction
//public static final BorateEsterification BORATE_ESTERIFICATION = new BorateEsterification(); // any solution containing boron compounds, even just boric acid or trace borate ions, becomes a disgusting mess of constantly esterifying generics, replaced w/ non-generic trimethyl borate synthesis reaction
public static final BorohydrideCarbonylReduction BOROHYDRIDE_CARBONYL_REDUCTION = new BorohydrideCarbonylReduction();
public static final CarboxylicAcidReduction CARBOXYLIC_ACID_REDUCTION = new CarboxylicAcidReduction();
public static final CyanamideAddition CYANAMIDE_ADDITION = new CyanamideAddition();
public static final CarboxylicAcidEsterification CARBOXYLIC_ACID_ESTERIFICATION = new CarboxylicAcidEsterification();
public static final CyanideNucleophilicAddition CYANIDE_NUCLEOPHILIC_ADDITION = new CyanideNucleophilicAddition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,11 @@ public final class DestroyMolecules {
.tag(Tags.SOLVENT)
.build(),

METHOXIDE = builder()
.id("methoxide")
.structure(LegacyMolecularStructure.deserialize("destroy:linear:CO^-1"))
.build(),

METHYLAMINE = builder()
.id("methylamine")
.structure(LegacyMolecularStructure.deserialize("destroy:linear:CN"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public class DestroyReactions {
.addReactant(DestroyMolecules.TRIMETHYL_BORATE)
.addSimpleItemReactant(DestroyItems.SODIUM_HYDRIDE::get, 2.4f)
.addProduct(DestroyMolecules.BOROHYDRIDE)
.addProduct(DestroyMolecules.ETHOXIDE, 3)
.addProduct(DestroyMolecules.METHOXIDE, 3)
.addProduct(DestroyMolecules.SODIUM_ION, 4)
.build(),

Expand Down Expand Up @@ -1113,6 +1113,15 @@ public class DestroyReactions {
.addProduct(DestroyMolecules.CARBON_TETRACHLORIDE)
.addProduct(DestroyMolecules.HYDROCHLORIC_ACID)
.activationEnergy(30f)
.build(),

METHANOL_BORATE_ESTERIFICATION = builder()
.id("methanol_borate_esterification")
.addReactant(DestroyMolecules.METHANOL, 3)
.addReactant(DestroyMolecules.BORIC_ACID)
.addProduct(DestroyMolecules.TRIMETHYL_BORATE)
.addProduct(DestroyMolecules.WATER, 3)
.displayAsReversible()
.build();

// Acids
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.petrolpark.destroy.chemistry.legacy.index.genericreaction;

import com.petrolpark.destroy.Destroy;
import com.petrolpark.destroy.chemistry.legacy.*;
import com.petrolpark.destroy.chemistry.legacy.LegacyBond.BondType;
import com.petrolpark.destroy.chemistry.legacy.LegacyReaction.ReactionBuilder;
import com.petrolpark.destroy.chemistry.legacy.genericreaction.GenericReactant;
import com.petrolpark.destroy.chemistry.legacy.genericreaction.SingleGroupGenericReaction;
import com.petrolpark.destroy.chemistry.legacy.index.DestroyGroupTypes;
import com.petrolpark.destroy.chemistry.legacy.index.DestroyMolecules;
import com.petrolpark.destroy.chemistry.legacy.index.group.SaturatedCarbonGroup;


public class AlkeneHydroborationOxidation extends SingleGroupGenericReaction<SaturatedCarbonGroup> {

public AlkeneHydroborationOxidation() {
super(Destroy.asResource("alkene_hydroboration_oxidation"), DestroyGroupTypes.ALKENE);
};

@Override
public boolean isPossibleIn(ReadOnlyMixture mixture) {
return mixture.getConcentrationOf(DestroyMolecules.DIBORANE) > 0f;
};

@Override
public LegacyReaction generateReaction(GenericReactant<SaturatedCarbonGroup> reactant) {
SaturatedCarbonGroup group = reactant.getGroup();
LegacySpecies substrate = reactant.getMolecule();

LegacySpecies product = moleculeBuilder().structure(substrate
.shallowCopyStructure()
.moveTo(group.highDegreeCarbon)
.replaceBondTo(group.lowDegreeCarbon, BondType.SINGLE)
.addAtom(LegacyElement.HYDROGEN)
.moveTo(group.lowDegreeCarbon)
.addGroup(LegacyMolecularStructure.alcohol(), true)
).build();

ReactionBuilder builder = reactionBuilder()
.addReactant(reactant.getMolecule(), 6)
.addReactant(DestroyMolecules.HYDROGEN_PEROXIDE, 6)
.addReactant(DestroyMolecules.DIBORANE)
.addCatalyst(DestroyMolecules.HYDROXIDE, 1)
.addProduct(product, 6)
.addProduct(DestroyMolecules.BORIC_ACID, 2)
.activationEnergy(25f);
transform(builder);
return builder.build();
};

public void transform(ReactionBuilder builder) {};

};
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.petrolpark.destroy.chemistry.legacy.index.genericreaction;

import com.petrolpark.destroy.Destroy;
import com.petrolpark.destroy.chemistry.legacy.LegacyBond.BondType;
import com.petrolpark.destroy.chemistry.legacy.*;
import com.petrolpark.destroy.chemistry.legacy.LegacyReaction.ReactionBuilder;
import com.petrolpark.destroy.chemistry.legacy.genericreaction.GenericReactant;
import com.petrolpark.destroy.chemistry.legacy.genericreaction.SingleGroupGenericReaction;
import com.petrolpark.destroy.chemistry.legacy.index.DestroyGroupTypes;
import com.petrolpark.destroy.chemistry.legacy.index.DestroyMolecules;
import com.petrolpark.destroy.chemistry.legacy.index.group.SaturatedCarbonGroup;


public class AlkyneHydroborationOxidation extends SingleGroupGenericReaction<SaturatedCarbonGroup> {

public AlkyneHydroborationOxidation() {
super(Destroy.asResource("alkyne_hydroboration_oxidation"), DestroyGroupTypes.ALKYNE);
};

@Override
public boolean isPossibleIn(ReadOnlyMixture mixture) {
return mixture.getConcentrationOf(DestroyMolecules.DIBORANE) > 0f;
};

@Override
public LegacyReaction generateReaction(GenericReactant<SaturatedCarbonGroup> reactant) {
SaturatedCarbonGroup group = reactant.getGroup();
LegacySpecies substrate = reactant.getMolecule();

LegacySpecies product = moleculeBuilder().structure(substrate
.shallowCopyStructure()
.moveTo(group.highDegreeCarbon)
.replaceBondTo(group.lowDegreeCarbon, BondType.SINGLE)
.addAtom(LegacyElement.HYDROGEN)
.addAtom(LegacyElement.HYDROGEN)
.moveTo(group.lowDegreeCarbon)
.addCarbonyl()
).build();

ReactionBuilder builder = reactionBuilder()
.addReactant(reactant.getMolecule(), 6)
.addReactant(DestroyMolecules.HYDROGEN_PEROXIDE, 6)
.addReactant(DestroyMolecules.DIBORANE)
.addCatalyst(DestroyMolecules.HYDROXIDE, 1)
.addProduct(product, 6)
.addProduct(DestroyMolecules.BORIC_ACID, 2)
.activationEnergy(25f);
transform(builder);
return builder.build();
};

public void transform(ReactionBuilder builder) {};

};
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,19 @@ public boolean isPossibleIn(ReadOnlyMixture mixture) {
public LegacyReaction generateReaction(GenericReactant<CarbonylGroup> reactant) {
CarbonylGroup carbonyl = reactant.getGroup();

LegacyMolecularStructure alkoxideStructure = reactant.getMolecule().shallowCopyStructure();
alkoxideStructure.moveTo(carbonyl.carbon)
LegacyMolecularStructure structure = reactant.getMolecule().shallowCopyStructure();
structure.moveTo(carbonyl.carbon)
.addAtom(LegacyElement.HYDROGEN)
.replaceBondTo(carbonyl.oxygen, BondType.SINGLE)
.remove(carbonyl.oxygen)
.addAtom(new LegacyAtom(LegacyElement.OXYGEN, -1d));

LegacyMolecularStructure borateEsterStructure = reactant.getMolecule().shallowCopyStructure();
borateEsterStructure.moveTo(carbonyl.carbon)
.addAtom(LegacyElement.HYDROGEN)
.replaceBondTo(carbonyl.oxygen, BondType.SINGLE)
.moveTo(carbonyl.oxygen)
.addGroup(LegacyMolecularStructure.borane());
.addGroup(LegacyMolecularStructure.alcohol());

return reactionBuilder()
.addReactant(reactant.getMolecule(), 2)
.addReactant(reactant.getMolecule(), 4)
.addReactant(DestroyMolecules.WATER, 4) // workup included in reaction
.addReactant(DestroyMolecules.BOROHYDRIDE)
.addProduct(moleculeBuilder().structure(alkoxideStructure).build())
.addProduct(moleculeBuilder().structure(borateEsterStructure).build())
.addProduct(moleculeBuilder().structure(structure).build(), 4)
.addProduct(DestroyMolecules.TETRAHYDROXYBORATE)
.activationEnergy(50f)
.build();
};
Expand Down
Loading