diff --git a/scripts/SimulationParameters/MicrobeStage/Biomes.json b/scripts/SimulationParameters/MicrobeStage/Biomes.json index 0df77457846..769d734f44a 100644 --- a/scripts/SimulationParameters/MicrobeStage/Biomes.json +++ b/scripts/SimulationParameters/MicrobeStage/Biomes.json @@ -27,6 +27,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -37,6 +52,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -53,6 +70,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -136,6 +155,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -146,12 +180,43 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 } } }, + "marineSnow": { + "name": "Marine snow", + "meshes": ["nucleus", "chloroplast", "oxytoxy","flagellum", + "chemoplast","nitrogenplastid","metabolosome","chromatophores", + "vacuole","mitochondrion","chemoproteins","nitrogenase","rusticyanin"], + "density": 0.00004, + "dissolves": true, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 2, + "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, + "compounds": { + "atp": { + "amount": 100.0 + }, + "ammonia": { + "amount": 100.0 + }, + "phosphates": { + "amount": 100.0 + }, + "glucose": { + "amount": 100.0 + } + } + }, "ironBigChunk": { "name": "Big Iron Chunk", "meshes": [ "iron_05" ], @@ -162,6 +227,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -244,6 +311,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -254,6 +336,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -270,6 +354,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -352,6 +438,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -362,6 +463,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -378,11 +481,42 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 } } + }, + "marineSnow": { + "name": "Marine snow", + "meshes": ["nucleus", "chloroplast", "oxytoxy","flagellum", + "chemoplast","nitrogenplastid","metabolosome","chromatophores", + "vacuole","mitochondrion","chemoproteins","nitrogenase","rusticyanin"], + "density": 0.00002, + "dissolves": true, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 2, + "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, + "compounds": { + "atp": { + "amount": 100.0 + }, + "ammonia": { + "amount": 100.0 + }, + "phosphates": { + "amount": 100.0 + }, + "glucose": { + "amount": 100.0 + } + } } }, @@ -460,6 +594,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -470,6 +619,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -486,11 +637,42 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 } } + }, + "marineSnow": { + "name": "Marine snow", + "meshes": ["nucleus", "chloroplast", "oxytoxy","flagellum", + "chemoplast","nitrogenplastid","metabolosome","chromatophores", + "vacuole","mitochondrion","chemoproteins","nitrogenase","rusticyanin"], + "density": 0.00002, + "dissolves": true, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 2, + "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, + "compounds": { + "atp": { + "amount": 100.0 + }, + "ammonia": { + "amount": 100.0 + }, + "phosphates": { + "amount": 100.0 + }, + "glucose": { + "amount": 100.0 + } + } } }, @@ -568,6 +750,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -578,6 +775,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -594,6 +793,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -676,16 +877,33 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.0002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], - "density": 0.00002, + "density": 0.00006, "dissolves": true, "radius": 1, "chunkScale": 1.0, "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -695,13 +913,15 @@ "ironBigChunk": { "name": "Big Iron Chunk", "meshes": [ "iron_05" ], - "density": 0.00002, + "density": 0.00006, "dissolves": true, "radius": 10, "chunkScale": 1.0, "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -784,6 +1004,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -794,6 +1029,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -810,6 +1047,8 @@ "mass": 100, "size": 1000, "ventAmount": 3.0, + "damages": 0.5, + "deleteOnTouch": false, "compounds": { } }, @@ -823,6 +1062,8 @@ "mass": 100, "size": 1000, "ventAmount": 3.0, + "damages": 0.5, + "deleteOnTouch": false, "compounds": { } }, @@ -836,6 +1077,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -919,6 +1162,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -929,6 +1187,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -945,6 +1205,8 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 @@ -1028,6 +1290,21 @@ }, "chunks":{ + "floatingToxin": { + "name": "Floating Hazard", + "meshes": ["oxytoxy"], + "density": 0.00002, + "dissolves": false, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 10000, + "ventAmount": 3.0, + "damages": 10.0, + "deleteOnTouch": true, + "compounds": { + } + }, "ironSmallChunk": { "name": "Small Iron Chunk", "meshes": ["iron_01", "iron_02", "iron_03","iron_04"], @@ -1038,6 +1315,8 @@ "mass": 100, "size": 2, "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 100.0 @@ -1054,11 +1333,42 @@ "mass": 100, "size": 100, "ventAmount": 10.0, + "damages": 0.0, + "deleteOnTouch": false, "compounds": { "iron": { "amount": 30000.0 } } + }, + "marineSnow": { + "name": "Marine snow", + "meshes": ["nucleus", "chloroplast", "oxytoxy","flagellum", + "chemoplast","nitrogenplastid","metabolosome","chromatophores", + "vacuole","mitochondrion","chemoproteins","nitrogenase","rusticyanin"], + "density": 0.00004, + "dissolves": true, + "radius": 1, + "chunkScale": 1.0, + "mass": 1, + "size": 2, + "ventAmount": 3.0, + "damages": 0.0, + "deleteOnTouch": false, + "compounds": { + "atp": { + "amount": 100.0 + }, + "ammonia": { + "amount": 100.0 + }, + "phosphates": { + "amount": 100.0 + }, + "glucose": { + "amount": 100.0 + } + } } }, diff --git a/scripts/gui/thrive_gui.html b/scripts/gui/thrive_gui.html index b4b2d2c2070..17202e5a357 100644 --- a/scripts/gui/thrive_gui.html +++ b/scripts/gui/thrive_gui.html @@ -304,8 +304,8 @@ Glucose makes ATP
Hydrogen Sulfide can be converted into glucose via chemoplasts and chemosynthesizing proteins
-Iron Ions can be converted via rusticyanin into ATP
-and Ammonia and Phosphates are crucial for reproduction.

+Iron can be converted via rusticyanin into ATP
+and Ammonia and Phosphate are crucial for reproduction.

Press E to release a dangerous agent, Oxytoxy NT, to kill other cells and then collect the spilled compounds if you have a toxin vacuole.

@@ -374,59 +374,120 @@
STRUCTURAL ORGANELLES
- Cytoplasm

Cost: 30 mutation points

- Performs Process: Cytoplasm Glycolysis
(0.06 glucose -> 5 ATP)/Second

- Storage Space: 4

- The material or protoplasm within a living cell.
The gooey innards of a cell.
+ +  
 30

+ Turns Glucose into ATP .

+ Fermentation
+ 0.06 5.00 /second

+ +4 Storage
+ +1 Osmoregulation Cost


+ The gooey innards of a cell. The cytoplasm is the basic mixture of ions, proteins, and other substances dissolved + in water that fill the interior of the cell. One of the functions it performs is Fermentation, the conversion of glucose into + ATP energy. For cells that lack organelles to have more advanced metabolisms, this is what they rely on for energy. It is also + used to store molecules in the cell and to grow the cell's size. +
+ + Cytoplasm +
Cytoplasm
30 MP
PROKARYOTIC STRUCTURES
+  
 55

+ Produces Glucose . Rate scales with concentration of Carbon Dioxide and intensity of Light .

+ Photosynthesis
+ +0.15/second @ 0.09%, 10,000 lux

+ Fermentation
+ 0.135.00/second

+ +1Storage
+ +1Osmoregulation Cost


+ Thylakoids are clusters of proteins and photosensitive pigments. The pigments are able to use the + energy of light to produce glucose from water and gaseous carbon dioxide in a process called Photosynthesis. + These pigments are also what give them a distinctive colour. The rate of their glucose production scales with + the concentration of carbon dioxide, and intensity of light. Since the thylakoids are suspended directly in the + cytoplasm, the surrounding fluid performs some fermentation. + + + Thylakoids + +
Thylakoid
55 MP + +  
 45



+ Turns Hydrogen Sulfide into Glucose . Rate scales with concentration of Carbon Dioxide  . Also turns Glucose into ATP .

+ Hydrogen Sulfide Chemosynthesis
+ 0.21 0.21 /second @ 0.09%

+ Fermentation
+ 0.13 5.00 /second

+ +1 Storage
+ +1 Osmoregulation Cost


+ Chemosynthesizing proteins are small clusters of protein in the cytoplasm that are able to + convert hydrogen sulfide, water, and gaseous carbon dioxide into glucose in a process called Hydrogen + Sulfide Chemosynthesis. The rate of its glucose production scales with the concentration of carbon dioxide. + Since the chemosynthesizing proteins are suspended directly in the cytoplasm, the surrounding fluid performs + some fermentation. +
+ + Chemosynth-
esizing Proteins
+
+
Chemosynthesizing Proteins
45 MP
- Metabolosomes

Cost: 45 mutation points

- Performs Process: Metabolsome Respiration (In real life they Ferment, but we dont have those compounds in the game yet)
(1 Oxygen + 1 Glucose -> 38 ATP)/Second (Depending On Environmental Oxygen)

- Storage Space: 1

- Organelle-like Bacterial microcompartments (BMCs) consisting of a protein shell that encloses enzymes used for fermentation. +  
 45

+ Turns Glucose into ATP . Rate scales with concentration of Oxygen  .

+ Aerobic Respiration
+ 0.21 7.98 /second @ 21.00%

+ Fermentation
+ 0.13 5.00 /second

+ +1 Storage
+ +1 Osmoregulation Cost


+ Metabolosomes are clusters of proteins wrapped in protein shells. They are able to convert glucose + into ATP at a much higher efficiency than can be done in the cytoplasm in a process called Aerobic Respiration. + It does, however, require oxygen to function, and lower levels of oxygen in the environment will slow down + the rate of its ATP production. Since the metabolosomes are suspended directly in the cytoplasm, the surrounding + fluid performs some fermentation.
+ + Metabolosomes +
Metabolosomes
45 MP
- Chromatophores

Cost: 55 mutation points

- Performs Process: Chromatophore Photosynthesis
(0.09 CO2 -> 0.15 glucose)/Second (Depending On Environmental C02)
- Performs Process: Glycolysis
(0.125 glucose -> 5 ATP)/Second (Depending On Environmental C02)

- Storage Space: 1

- Coloured, membrane-associated vesicles used by various prokaryotes perform photosynthesis. - Chromatophores contain bacteriochlorophyll pigments and carotenoids.
-
Chromatophores
55 MP
- - ChemosynthisizingProteins

Cost: 45 mutation points

- Performs Process: Bacterial Chemosynthesis
(1 CO2 + 1 Hydrogen Sulfide -> 1 Glucose)/Second (Depending On Environmental C02)
- Performs Process: Glycolysis
(0.125 glucose -> 5 ATP)/Second

- Storage Space: 1

- Small membrane-associated structures that convert the noxious soup containing hydrogen - sulfide from hydrothermal vents into usable energy in the form of glucose.
-
Chemosynthisizing Proteins
45 MP
+ +  
 45

+ Turns Iron into ATP . Rate scales with concentration of Carbon Dioxide and Oxygen   .

+ Iron Respiration
+ 0.18 10.00 /second @ 0.09% , 0.21%

+ +1 Storage
+ +1 Osmoregulation Cost


+ Rusticyanin is a protein able to use gaseous carbon dioxide and oxygen to oxidize iron from one + chemical state to another. This process, called Iron Respiration, releases energy which the cell can then + harvest. +
+ + Rusticyanin + +
Rusticyanin
45 MP
- - Rusticyanin

Cost: 45 mutation points

- Performs Process: Iron Chemolithotrophy
(0.21 Oxygen (Primary Electron acceptor) + 0.09 CO2 + 0.175 Iron Ion -> 10 ATP)/Second (Depending On Environmental C02 and O2)

- Storage Space: 1

- Siderophores and Rusticyanin for storing and using iron ions with oxygen as the primary electron acceptor and carbon from atmospheric carbon dioxide to produce ATP. - Iron Chemolithotrophy is a process by which organisms obtain their energy from the oxidation of reduced inorganic ions. -
-
Rusticyanin
45 MP
- - Nitrogenase

Cost: 55 mutation points

- Performs Process: Anaerobic Nitrogen Fixation
(2
+ 10 ATP -> 0.02 Ammonia)/Second (Depending On Environmental Nitrogen)
- Performs Process: Glycolysis
(0.125 glucose -> 5 ATP)/Second

- Storage Space: 2

- Allows for synthesis of ammonia from atmospheric nitrogen anaerobically. For easier cell growth. + +  
 55

+ Turns ATP into Ammonia . Rate scales with concentration of Nitrogen  .

+ Nitrogen Fixation
+ 3.91 0.01 /second @ 78.00%

+ Fermentation
+ 0.13 5.00 /second

+ +2 Storage
+ +1 Osmoregulation Cost


+ Nitrogenase is a protein able to use gaseous nitrogen and cellular energy in the form of ATP to + produce ammonia, a key growth nutrient for cells. This is a process referred to as Anaerobic Nitrogen Fixation. + Since the nitrogenase is suspended directly in the cytoplasm, the surrounding fluid performs some fermentation.
+ + Nitrogenase +
Nitrogenase
55 MP
@@ -434,93 +495,183 @@ + +  
 0

+ To be implemented. +
+ + Predatory Pilus + +
Predatory Pilus
30 MP + +  
 0

+ To be implemented. +
+ + Cilia + +
Cilia
40 MP
- Flagellum

Cost: 55 mutation points

- Performs Process: Movement
(7atp -> Faster movement speed)/Second

- Storage Space: 1

- A whip like structure used by microbes for movement.
+  
 55

+ Uses ATP to increase the movement speed of the cell.

+ +0.7 Speed
+ +1 Storage
+ +1 Osmoregulation Cost


+ The flagellum (plural: flagella) is a whip-like bundle of protein fibers extending from the + cell's membrane which can use ATP to undulate and propel the cell in a direction. + + + Flagellum +
Flagellum
55 MP
-
Predatory Pilus
30 MP
-
Cilia
40 MP
INTERNAL ORGANELLES
+ + Nitrogen Fixing
Plastid
+
+
Nitrogen Fixing
Plastid
50 MP + +  
 0  Bioluminescent Vacuole  

+ To be implemented. +
+
Bioluminescent Vacuole
N/A MP
- Nucleus

Cost: 100 mutation points

- Performs Process: Eukaryote Evolution

- Storage Space: 15

- Allows for synthesis of RNA and MRNA, allows cell to evolve membrane bound organelles. -

Warning! The nucleus will slow you down significantly and has an upkeep cost of 11 ATP per second due to osmoregulation! It is also irreversible.

+  
 100

+ Allows for the evolution of more complex, membrane-bound organelles. Costs a lot of ATP to maintain. This is an irreversible evolution.

+ +15 Storage
+ +10 Osmoregulation Cost


+ The defining feature of eukaryotic cells. The nucleus also includes the endoplasmic reticulum and the golgi body. + It is an evolution of prokaryotic cells to develop a system of internal membranes, done by assimilating another prokaryote + inside of themselves. This allows them to compartmentalize, or ward off, the different processes happening inside the cell and + prevent them from overlapping. This allows their new membrane bound organelles to be much more complex, efficient, and specialized + than if they were free-floating in the cytoplasm. However, this comes at the cost of making the cell much larger and requiring + a lot of the cell's energy to maintain.
+ + Nucleus +
Nucleus
100 MP
- - Mitochondria

Cost: 45 mutation points

- Performs Process: Respiration
(1 Oxygen + 0.2 glucose -> 45 ATP)/Second (Depending On Environmental Oxygen)

- Storage Space: 2

- A captured prokaryote used by eukaryotic cells to perform respiration.
- - The Mitochondria is the powerhouse of the cell + +  
 55

+ Turns Glucose into ATP . Rate scales with concentration of Oxygen  .

+ Aerobic Respiration
+ 0.04 9.45 /second @ 21.00%

+ +2 Storage
+ +2 Osmoregulation Cost


+ The powerhouse of the cell. The mitochondrion (plural: mitochondria) is a double membrane structure filled + with proteins and enzymes. It is a prokaryote that has been assimilated for use by its eukaryotic host. It is able to + convert glucose into ATP at a much higher efficiency than can be done in the cytoplasm in a process called Aerobic Respiration. + It does, however, require oxygen to function, and lower levels of oxygen in the environment will slow down the rate of its ATP + production.
+ + Mitochondrion +
Mitochondrion
45 MP
- - Chloroplast

Cost: 55 mutation points

- Performs Process: Photosynthesis
( 0.09 CO2 -> 1 glucose)/Second (Depending On Environmental C02)

- Storage Space: 2

- A captured prokaryote used by eukaryotic cells to perform photosynthesis.
- The chloroplast is used primarily by plant cells on earth, but some ciliates and other organisms use it too. + +  
 55

+ Produces Glucose . Rate scales with concentration of Carbon Dioxide and intensity of Light  .

+ Photosynthesis
+ +1.00 /second @ 0.09% , 10,000 lux

+ +2 Storage
+ +2 Osmoregulation Cost


+ The chloroplast is a double membrane structure containing photosensitive pigments stacked together in membranous sacs. + It is a prokaryote that has been assimilated for use by its eukaryotic host. The pigments in the chloroplast are able to use the + energy of light to produce glucose from water and gaseous carbon dioxide in a process called Photosynthesis. These pigments are + also what give it a distinctive colour. The rate of its glucose production scales with the concentration of carbon dioxide, and + intensity of light.
+ + Chloroplast +
Chloroplast
55 MP
- Thermoplast

Cost: 40 mutation points

- Performs Process: Thermosynthesis
(Heat -> 1 glucose)/Second (Depending On Environmental Heat)

- Storage Space: 2

- A captured prokaryote used by eukaryotic cells to perform thermosynthesis.
- The thermoplast is a theoretical organelle that takes environmental heat gradients and generates energy from them. +  
 40

+ Produces Glucose . Rate scales with concentration of Carbon Dioxide and Temperature  .

+ Thermosynthesis
+ +1.00 /second @ 0.09% , 50 ℃

+ +2 Storage
+ +2 Osmoregulation Cost


+ The thermoplast is a double membrane structure containing thermosensitive pigments stacked together + in membranous sacs. It is a prokaryote that has been assimilated for use by its eukaryotic host. The pigments + in the thermoplast are able to use the energy of heat differences in the surroundings to produce glucose from + water and gaseous carbon dioxide in a process called Thermosynthesis. The rate of its glucose production scales + with the concentration of carbon dioxide, and temperature.
+ + Thermoplast +
Thermoplast
40 MP
- Chemoplast

Cost: 45 mutation points

- Performs Process: Chemosynthesis
(0.09 CO2 + 1 Hydrogen Sulfide -> 2 Glucose)/Second (Depending On Environmental C02)

- Storage Space: 2

- Allows for synthesis of glucose from hydrogen sulfide and atmospheric carbon dioxide. -
- Can be used to process the normally toxic soup containing hydrogen sulfide that comes out of hydrothermal vents at the bottom of the ocean. Into glucose. +  
 45

+ Turns Hydrogen Sulfide into Glucose . Rate scales with concentration of Carbon Dioxide  .

+ Hydrogen Sulfide Chemosynthesis
+ 1.00 2.00 /second @ 0.09%

+ +2 Storage
+ +2 Osmoregulation Cost


+ The chemoplast is a double membrane structure containing proteins able to convert hydrogen sulfide, + water, and gaseous carbon dioxide into glucose in a process called Hydrogen Sulfide Chemosynthesis. The rate + of its glucose production scales with the concentration of water and carbon dioxide.
+ + Chemoplast +
Chemoplast
45 MP
- Nitrogen Fixing Plastid

Cost: 50 mutation points

- Performs Process: Aerobic Nitrogen Fixation
(1 Oxygen + 1 Nitrogen + 5 ATP -> 0.5 Ammonia)/Second (Depending On Environmental Oxygen/Nitrogen)

- Storage Space: 2

- Allows for synthesis of ammonia from atmospheric nitrogen and oxygen. For easier cell growth. +  
 50


+ Turns ATP into Ammonia . Rate scales with concentration of Nitrogen and Oxygen  .

+ Nitrogen Fixation
+ 1.05 0.11 /second @ 78.00% , 21.00%

+ +2 Storage
+ +2 Osmoregulation Cost


+ The Nitrogen Fixing Plastid is a protein able to use gaseous nitrogen and oxygen and + cellular energy in the form of ATP to produce ammonia, a key growth nutrient for cells. This is + a process referred to as Aerobic Nitrogen Fixation.
-
-
Nitrogen Fixing
Plastid
50 MP
- Vacuole

Cost: 50 mutation points

- Storage Space: 15

- A space or vesicle within the cytoplasm of a cell, enclosed by a membrane and used to hold compounds.
+  
 50

+ Increases the storage space of the cell.

+ +15 Storage
+ +1 Osmoregulation Cost


+ The vacuole is an internal membranous organelle used for storage in the cell. They are composed + of several vesicles, smaller membranous structures widely used in cells for storage, that have fused together. + It is filled with water which is used to contain molecules, enzymes, solids, and other substances. Their shape + is fluid and can vary between cells. + + + Vacuole +
Vacuole
50 MP
- Toxin Vacuole

Cost: 70 mutation points

- Performs Process: OxytoxyNT Production
(1 Oxygen + 5 ATP -> 5 Oxytoxy)/Second (Depending On Environmental Oxygen)

- Storage Space: 5

- Allows for production and storage of OxytoxyNT which can be shot at enemy cells using E. The more of this organelle you have the faster your toxin fire rate will be. +  
 70

+ Turns ATP into Oxytoxy . Can release toxins by pressing E. Rate scales with concentration of Oxygen  .

+ Agent Synthesis
+ 1.05 1.05 /second @ 21.00%

+ +5 Storage
+ +1 Osmoregulation Cost


+ The toxin vacuole is a vacuole that has been modified for the specific production, storage, + and secretion of oxytoxy toxins. More toxin vacuoles will increase the rate at which toxins can be + released.
+ + Toxin Vacuole +
Toxin Vacuole
70 MP
-
Bioluminescent Vacuole
N/A MP
@@ -585,7 +736,7 @@ Chromatophores: Produces 1/3rd the amount of glucose as a normal chloroplast, but also performs glycolysis, and takes up 1 Hex.
-Rusticyanin: Converts iron ions into ATP, and takes up 1 Hex.
+Rusticyanin: Converts iron into ATP, and takes up 1 Hex.
Nitrogenase: Converts atmospheric nitrogen and ATP into ammonia anaerobically
diff --git a/scripts/gui/thrive_style.css b/scripts/gui/thrive_style.css index 01009c8601a..cacc4da1557 100644 --- a/scripts/gui/thrive_style.css +++ b/scripts/gui/thrive_style.css @@ -464,7 +464,7 @@ video { .tooltiptext .compoundIcon { position: relative; display: inline-block; - top: 5px; + top: 4px; left: 1px; } @@ -1190,30 +1190,54 @@ video { background-image: url("../../Textures/gui/bevel/CytoplasmIcon.png"); } -/* Tooltip text */ -.tooltiptext { +/* TOOLTIP ENTRIES */ + +/* The following few entries are for elements regarding tooltips. */ + +/* Used to place the headers as a second, transparent background tooltip on top of the actual text containing tooltip. This way the headers can be center aligned while the rest of the tooltip is left aligned. */ + +.tooltipheader { visibility: hidden; - width: 320px; + width: 400px; height: 30%; right: 5%; top: 10%; - font-size: 10pt; - background-color: rgba(0, 139, 139, 0.5); + background-color: rgba(0, 89, 89, 0); color: #fff; - text-align: center-left; + text-align: center; border-radius: 25px; - padding: 5px 0; + padding: 20px 20px 20px 20px; position: fixed; z-index: 1; + font-size: 190%; } +.OrganelleListItem:hover .tooltipheader { + visibility: visible; +} +/* Regular tooltip text aside from the header. */ + +.tooltiptext { + visibility: hidden; + width: 400px; + height: auto; + right: 5%; + top: 10%; + background-color: rgba(0, 89, 89, 0.75); + border-radius: 25px; + padding: 20px 20px 20px 20px; + position: fixed; + z-index: 1; + color: #d3d3d3; + text-align: left; + font-size: 190%; +} .OrganelleListItem:hover .tooltiptext { visibility: visible; } - #PlastidIcon { position: relative; left: calc(50% - 30px); @@ -1262,6 +1286,12 @@ video { background-image: url("../../Textures/gui/bevel/VacuoleIcon.png"); } +/* Used to place the vacuole's icon inside tooltips as an icon for storage. */ + +#VacuoleTooltipIcon { + background-image: url("../../Textures/gui/bevel/VacuoleIcon.png"); +} + #ToxinVacuoleIcon { position: relative; left: calc(50% - 30px); @@ -1299,6 +1329,12 @@ video { background-image: url("../../Textures/gui/bevel/FlagellumIcon.png"); } +/* Used to place the flagellum's icon inside tooltips as an icon for storage. */ + +#FlagellumTooltipIcon { + background-image: url("../../Textures/gui/bevel/FlagellumIcon.png"); +} + #MetabolosomeIcon { position: relative; left: calc(50% - 30px); @@ -1317,7 +1353,6 @@ video { background-image: url("../../Textures/gui/bevel/NitrogenaseIcon.png"); } - #ChromatophorIcon { position: relative; left: calc(50% - 30px); @@ -1362,3 +1397,76 @@ video { background-size: contain; background-image: url("../../Textures/gui/bevel/CiliaIcon.png"); } + +/* Used in formulas in tooltips. */ + +#WhiteArrow { + background-image: url("../../Textures/gui/bevel/WhiteArrow.png"); +} + +#TemperatureIcon { + background-image: url("../../Textures/gui/bevel/Temperature.png"); +} + +#LightIcon { + background-image: url("../../Textures/gui/bevel/Light.png"); +} + +#PressureIcon { + background-image: url("../../Textures/gui/bevel/Pressure.png"); +} + +/* Used for the headers of tooltips. */ + +.thead { + color: white; + font-size: 150%; + font-weight: 1000; + text-align: center; +} + +/* Used everytime an input or output is mentioned in the initial blurb of the tooltip. */ + +.tkey { + color: white; + font-size: 100%; + font-weight: 1000; +} + +/* Used for formula names in tooltips. */ + +.tgold { + color: #ffd700; + font-size: 100%; + font-weight: 1000; +} + +/* Used for highlighting beneficial values. */ + +.tbonus { + color: #0f0; + font-size: 100%; + font-weight: 1000; +} + +/* Used for highlighting deleterious values. */ + +.tmalus { + color: #ff4d4d; + font-size: 100%; + font-weight: 1000; +} + +/* Used for the regular text in the initial blurb. */ + +.tbody { + color: #d3d3d3; + font-size: 100%; +} + +/* Used for the scientific description text in the final blurb. */ + +.tdesc { + color: #d3d3d3; + font-size: 85%; +} diff --git a/scripts/microbe_stage/biome.as b/scripts/microbe_stage/biome.as index 99a1863b552..40cb60f3bd0 100644 --- a/scripts/microbe_stage/biome.as +++ b/scripts/microbe_stage/biome.as @@ -111,12 +111,10 @@ ObjectID createChunk(CellStageWorld@ world, uint chunkId, Float3 pos) for(uint i = 0; i < chunkCompounds.length(); ++i){ auto compoundId = SimulationParameters::compoundRegistry().getTypeData(chunkCompounds[i]).id; //LOG_INFO("got here:"); - if(SimulationParameters::compoundRegistry().getTypeData(compoundId).isCloud){ - // And register new - const double amount = chunk.getCompound(chunkCompounds[i]).amount; - //LOG_INFO("amount:"+amount); - bag.setCompound(compoundId,amount); - } + // And register new + const double amount = chunk.getCompound(chunkCompounds[i]).amount; + //LOG_INFO("amount:"+amount); + bag.setCompound(compoundId,amount); } auto model = world.Create_Model(chunkEntity, renderNode.Node, mesh); @@ -126,12 +124,26 @@ ObjectID createChunk(CellStageWorld@ world, uint chunkId, Float3 pos) // Rigid Body auto rigidBody = world.Create_Physics(chunkEntity, position); + + //chunk properties + if (chunk.damages > 0.0f || chunk.deleteOnTouch){ + auto damager = world.Create_DamageOnTouchComponent(chunkEntity); + damager.setDamage(chunk.damages); + damager.setDeletes(chunk.deleteOnTouch); + //Damage + auto body = rigidBody.CreatePhysicsBody(world.GetPhysicalWorld(), + world.GetPhysicalWorld().CreateSphere(radius),mass, + world.GetPhysicalMaterial("chunkDamageMaterial")); + + body.ConstraintMovementAxises(); + } + else { auto body = rigidBody.CreatePhysicsBody(world.GetPhysicalWorld(), world.GetPhysicalWorld().CreateSphere(radius),mass, //engulfable - world.GetPhysicalMaterial("iron")); - + world.GetPhysicalMaterial("engulfableMaterial")); body.ConstraintMovementAxises(); + } rigidBody.JumpTo(position); diff --git a/scripts/microbe_stage/configs.as b/scripts/microbe_stage/configs.as index 5390a708cb1..22f36a593e7 100644 --- a/scripts/microbe_stage/configs.as +++ b/scripts/microbe_stage/configs.as @@ -98,7 +98,7 @@ const auto DEFAULT_HEALTH = 100; const auto REGENERATION_RATE = 1.0f; // Movement stuff -const auto FLAGELLA_ENERGY_COST = 7.0f; +const auto FLAGELLA_ENERGY_COST = 7.1f; const auto FLAGELLA_BASE_FORCE = 0.7f; const auto CELL_BASE_THRUST = 1.6f; // is set by this and modified by applyCellMovement like the player later diff --git a/scripts/microbe_stage/microbe.as b/scripts/microbe_stage/microbe.as index b13a964d904..b82eeaf4df6 100644 --- a/scripts/microbe_stage/microbe.as +++ b/scripts/microbe_stage/microbe.as @@ -377,21 +377,6 @@ class MicrobeSystem : ScriptSystem{ MicrobeOperations::applyMembraneColour(world, microbeEntity); } } - - microbeComponent.compoundCollectionTimer = - microbeComponent.compoundCollectionTimer + logicTime; - - while(microbeComponent.compoundCollectionTimer > - EXCESS_COMPOUND_COLLECTION_INTERVAL) - { - // For every COMPOUND_DISTRIBUTION_INTERVAL passed - microbeComponent.compoundCollectionTimer = - microbeComponent.compoundCollectionTimer - - EXCESS_COMPOUND_COLLECTION_INTERVAL; - MicrobeOperations::purgeCompounds(world, microbeEntity); - atpDamage(microbeEntity); - } - // Handle hitpoints if((microbeComponent.hitpoints < microbeComponent.maxHitpoints)) { @@ -511,10 +496,25 @@ class MicrobeSystem : ScriptSystem{ MicrobeOperations::takeCompound(world, microbeEntity, SimulationParameters::compoundRegistry().getTypeId("atp"), atpAmount); } + compoundAbsorberComponent.setAbsorbtionCapacity(microbeComponent.capacity); + microbeComponent.compoundCollectionTimer = + microbeComponent.compoundCollectionTimer + logicTime; + + //Moved this to right before atpDamage applyCellMovement(components, logicTime); - compoundAbsorberComponent.setAbsorbtionCapacity(microbeComponent.capacity); + while(microbeComponent.compoundCollectionTimer > + EXCESS_COMPOUND_COLLECTION_INTERVAL) + { + // For every COMPOUND_DISTRIBUTION_INTERVAL passed + atpDamage(microbeEntity); + + microbeComponent.compoundCollectionTimer = + microbeComponent.compoundCollectionTimer - + EXCESS_COMPOUND_COLLECTION_INTERVAL; + MicrobeOperations::purgeCompounds(world, microbeEntity); + } if(microbeComponent.hitpoints != microbeComponent.previousHitpoints) membraneComponent.setHealthFraction(microbeComponent.hitpoints / microbeComponent.maxHitpoints); @@ -601,7 +601,7 @@ class MicrobeSystem : ScriptSystem{ // Rotate the 'thrust' based on our orientation // Halve speed if out of ATP if (MicrobeOperations::getCompoundAmount(world, microbeEntity, - SimulationParameters::compoundRegistry().getTypeId("atp")) <= 1.0){ + SimulationParameters::compoundRegistry().getTypeId("atp")) <= 0.0f){ microbeComponent.queuedMovementForce += pos._Orientation.RotateVector( microbeComponent.movementDirection * (CELL_BASE_THRUST/2.0f) * microbeComponent.movementFactor); @@ -928,7 +928,7 @@ class MicrobeSystem : ScriptSystem{ world.GetScriptComponentHolder("MicrobeComponent").Find(microbeEntity)); if(MicrobeOperations::getCompoundAmount(world, microbeEntity, - SimulationParameters::compoundRegistry().getTypeId("atp")) < 1.0f) + SimulationParameters::compoundRegistry().getTypeId("atp")) <= 0.0f) { // TODO: put this on a GUI notification. // if(microbeComponent.isPlayerMicrobe and not this.playerAlreadyShownAtpDamage){ diff --git a/scripts/microbe_stage/microbe_operations.as b/scripts/microbe_stage/microbe_operations.as index 7771ec9d461..6f1549160e4 100644 --- a/scripts/microbe_stage/microbe_operations.as +++ b/scripts/microbe_stage/microbe_operations.as @@ -1217,7 +1217,7 @@ void kill(CellStageWorld@ world, ObjectID microbeEntity) auto body = rigidBody.CreatePhysicsBody(world.GetPhysicalWorld(), world.GetPhysicalWorld().CreateSphere(1), 10, //engulfable - world.GetPhysicalMaterial("iron")); + world.GetPhysicalMaterial("engulfableMaterial")); body.ConstraintMovementAxises(); rigidBody.JumpTo(chunkPosition); auto venter = world.Create_CompoundVenterComponent(chunkEntity); diff --git a/scripts/microbe_stage/organelle_components/movement_organelle.as b/scripts/microbe_stage/organelle_components/movement_organelle.as index 162d7df41ae..aaeb013803d 100644 --- a/scripts/microbe_stage/organelle_components/movement_organelle.as +++ b/scripts/microbe_stage/organelle_components/movement_organelle.as @@ -133,7 +133,7 @@ class MovementOrganelle : OrganelleComponent{ microbeEntity, SimulationParameters::compoundRegistry().getTypeId("atp"), energy); - if(availableEnergy < energy){ + if(availableEnergy <= 0.0f){ forceMagnitude = sign(forceMagnitude) * availableEnergy * 1000.f / milliseconds; this.movingTail = false; diff --git a/scripts/microbe_stage/setup.as b/scripts/microbe_stage/setup.as index 2453e0d31f4..137d94c36d8 100644 --- a/scripts/microbe_stage/setup.as +++ b/scripts/microbe_stage/setup.as @@ -305,10 +305,10 @@ void cellHitFloatingOrganelle(GameWorld@ world, ObjectID firstEntity, ObjectID s } -// Will use this for food chunks now -void cellHitIron(GameWorld@ world, ObjectID firstEntity, ObjectID secondEntity) +// Used for chunks +void cellHitEngulfable(GameWorld@ world, ObjectID firstEntity, ObjectID secondEntity) { - // Determine which is the iron + // Determine which is the chunk CellStageWorld@ asCellWorld = cast(world); auto model = asCellWorld.GetComponent_Model(firstEntity); @@ -349,6 +349,64 @@ void cellHitIron(GameWorld@ world, ObjectID firstEntity, ObjectID secondEntity) } } +// Used for chunks that also can damage +void cellHitDamageChunk(GameWorld@ world, ObjectID firstEntity, ObjectID secondEntity) +{ + // Determine which is the chunk + CellStageWorld@ asCellWorld = cast(world); + + auto model = asCellWorld.GetComponent_Model(firstEntity); + auto floatingEntity = firstEntity; + auto cellEntity = secondEntity; + bool disappear=false; + // Cell doesn't have a model + if(model is null){ + @model = asCellWorld.GetComponent_Model(secondEntity); + floatingEntity = secondEntity; + cellEntity = firstEntity; + } + auto damage = asCellWorld.GetComponent_DamageOnTouchComponent(floatingEntity); + MicrobeComponent@ microbeComponent = MicrobeOperations::getMicrobeComponent(asCellWorld,cellEntity); + + if (damage !is null && microbeComponent !is null){ + if (damage.getDeletes() && !microbeComponent.dead){ + MicrobeOperations::damage(asCellWorld, cellEntity, double(damage.getDamage()), "toxin"); + disappear=true; + } + else if (!damage.getDeletes() && !microbeComponent.dead){ + MicrobeOperations::damage(asCellWorld, cellEntity, double(damage.getDamage()), "toxin"); + } + } + + // Do engulfing stuff in the case that we have an engulfable component + auto engulfableComponent = asCellWorld.GetComponent_EngulfableComponent(floatingEntity); + auto compoundBagComponent = asCellWorld.GetComponent_CompoundBagComponent(cellEntity); + auto floatBag = asCellWorld.GetComponent_CompoundBagComponent(floatingEntity); + + if (microbeComponent !is null && engulfableComponent !is null + && compoundBagComponent !is null && floatBag !is null) + { + if (microbeComponent.engulfMode && microbeComponent.totalHexCountCache >= + engulfableComponent.getSize()*ENGULF_HP_RATIO_REQ) + { + uint64 compoundCount = SimulationParameters::compoundRegistry().getSize(); + for(uint compoundId = 0; compoundId < compoundCount; ++compoundId){ + CompoundId realCompoundId = compoundId; + double amountToTake = + floatBag.takeCompound(realCompoundId,floatBag.getCompoundAmount(realCompoundId)); + // Right now you get way too much compounds for engulfing the things but hey + compoundBagComponent.giveCompound(realCompoundId, (amountToTake/CHUNK_ENGULF_COMPOUND_DIVISOR)); + } + disappear=true; + } + } + + if (disappear){ + world.QueueDestroyEntity(floatingEntity); + } +} + + // Cell Hit Oxytoxy // We can make this generic using the dictionary in agents.as // eventually, but for now all we have is oxytoxy @@ -626,46 +684,6 @@ class PlayerSpeciesSpawner{ } } - -ObjectID createToxin(CellStageWorld@ world, Float3 pos) -{ - // Toxins - ObjectID toxinEntity = world.CreateEntity(); - - auto position = world.Create_Position(toxinEntity, pos, - Ogre::Quaternion(Ogre::Degree(GetEngine().GetRandom().GetNumber(0, 360)), - Ogre::Vector3(0,1,0))); - auto renderNode = world.Create_RenderNode(toxinEntity); - renderNode.Scale = Float3(1, 1, 1); - renderNode.Marked = true; - renderNode.Node.setOrientation(Ogre::Quaternion( - Ogre::Degree(GetEngine().GetRandom().GetNumber(0, 360)), Ogre::Vector3(0,1,1))); - renderNode.Node.setPosition(pos); - // Ogre::Quaternion(Ogre::Degree(GetEngine().GetRandom().GetNumber(0, 360)), - // Ogre::Vector3(0, 1, 0))); - - // Agent - auto agentProperties = world.Create_AgentProperties(toxinEntity); - agentProperties.setSpeciesName(""); - agentProperties.setParentEntity(NULL_OBJECT); - agentProperties.setAgentType("oxytoxy"); - - auto model = world.Create_Model(toxinEntity, renderNode.Node, "oxytoxy.mesh"); - // Need to set the tint - model.GraphicalObject.setCustomParameter(1, Ogre::Vector4(1, 1, 1, 1)); - - auto rigidBody = world.Create_Physics(toxinEntity, position); - auto body = rigidBody.CreatePhysicsBody(world.GetPhysicalWorld(), - world.GetPhysicalWorld().CreateSphere(1), 1, - world.GetPhysicalMaterial("agentCollision")); - - body.ConstraintMovementAxises(); - - rigidBody.JumpTo(position); - - return toxinEntity; -} - // TODO: the player species handling would be more logically placed if // it was in SpeciesSystem, so move it there void setupSpawnSystem(CellStageWorld@ world){ @@ -673,11 +691,6 @@ void setupSpawnSystem(CellStageWorld@ world){ SpawnSystem@ spawnSystem = world.GetSpawnSystem(); // Clouds are handled by biome.as - - LOG_INFO("setting up spawn information"); - - setupFloatingOrganelles(world); - LOG_INFO("setting up player species to spawn"); auto keys = STARTER_MICROBES.getKeys(); for(uint n = 0; n < keys.length(); n++) @@ -698,15 +711,3 @@ void setupSpawnSystem(CellStageWorld@ world){ } } - -// moved this over here for now, its probabbly good to put "free -// spawning organelles" in their own function -void setupFloatingOrganelles(CellStageWorld@ world){ - LOG_INFO("setting up free floating organelles"); - SpawnSystem@ spawnSystem = world.GetSpawnSystem(); - - // toxins - const auto toxinId = spawnSystem.addSpawnType( - @createToxin, DEFAULT_SPAWN_DENSITY, - MICROBE_SPAWN_RADIUS); -} diff --git a/src/engine/component_types.h b/src/engine/component_types.h index e97b5c81a2d..84cd0a763c1 100644 --- a/src/engine/component_types.h +++ b/src/engine/component_types.h @@ -23,6 +23,7 @@ enum class THRIVE_COMPONENT : uint16_t { PROPERTIES, COMPOUND_VENTER, ENGULFABLE, + DAMAGETOUCH, // TODO: check is this needed for anything // INVALID }; diff --git a/src/general/properties_component.cpp b/src/general/properties_component.cpp index 47321190827..93ca3f27e0f 100644 --- a/src/general/properties_component.cpp +++ b/src/general/properties_component.cpp @@ -41,4 +41,31 @@ void AgentProperties::setParentEntity(ObjectID parentId) { this->parentId = parentId; -} \ No newline at end of file +} + +// DamageOnTouch component +DamageOnTouchComponent::DamageOnTouchComponent() : Leviathan::Component(TYPE) {} + +void + DamageOnTouchComponent::setDamage(double damage) +{ + this->damage = damage; +} + +double + DamageOnTouchComponent::getDamage() +{ + return this->damage; +} + +void + DamageOnTouchComponent::setDeletes(bool deletes) +{ + this->deletes = deletes; +} + +bool + DamageOnTouchComponent::getDeletes() +{ + return this->deletes; +} diff --git a/src/general/properties_component.h b/src/general/properties_component.h index 55b4f51e8d5..3528e9b157b 100644 --- a/src/general/properties_component.h +++ b/src/general/properties_component.h @@ -51,4 +51,30 @@ class AgentProperties : public Leviathan::Component { std::string agentType; ObjectID parentId = NULL_OBJECT; }; + +class DamageOnTouchComponent : public Leviathan::Component { +public: + DamageOnTouchComponent(); + + float damage = 0.0f; + bool deletes = false; + + REFERENCE_HANDLE_UNCOUNTED_TYPE(DamageOnTouchComponent); + + static constexpr auto TYPE = + componentTypeConvert(THRIVE_COMPONENT::DAMAGETOUCH); + + void + setDamage(double damage); + + double + getDamage(); + void + setDeletes(bool deletes); + + bool + getDeletes(); +}; + + } // namespace thrive diff --git a/src/microbe_stage/biomes.cpp b/src/microbe_stage/biomes.cpp index 08bfdae0094..a4aad4e06a4 100644 --- a/src/microbe_stage/biomes.cpp +++ b/src/microbe_stage/biomes.cpp @@ -90,6 +90,11 @@ Biome::Biome(Json::Value value) chunk.ventAmount = chunkData[chunkInternalName]["ventAmount"].asDouble(); + // Does it damge? If so how much? + chunk.damages = chunkData[chunkInternalName]["damages"].asDouble(); + chunk.deleteOnTouch = + chunkData[chunkInternalName]["deleteOnTouch"].asBool(); + // Get compound info // Getting the compound information. Json::Value chunkCompoundData = diff --git a/src/microbe_stage/biomes.h b/src/microbe_stage/biomes.h index 18448dda799..c08547332c0 100644 --- a/src/microbe_stage/biomes.h +++ b/src/microbe_stage/biomes.h @@ -55,6 +55,8 @@ struct ChunkData { unsigned int mass = 0; unsigned int size = 0; double ventAmount = 3.0f; + double damages = 0.0f; + bool deleteOnTouch = false; std::vector meshes; std::map chunkCompounds; @@ -64,7 +66,8 @@ struct ChunkData { name(std::move(other.name)), density(other.density), dissolves(other.dissolves), radius(other.radius), chunkScale(other.chunkScale), mass(other.mass), size(other.size), - ventAmount(other.ventAmount), meshes(std::move(other.meshes)), + ventAmount(other.ventAmount), damages(other.damages), + deleteOnTouch(other.deleteOnTouch), meshes(std::move(other.meshes)), chunkCompounds(std::move(other.chunkCompounds)) {} @@ -72,7 +75,8 @@ struct ChunkData { ChunkData(const ChunkData& other) : name(other.name), density(other.density), dissolves(other.dissolves), radius(other.radius), chunkScale(other.chunkScale), mass(other.mass), - size(other.size), ventAmount(other.ventAmount), meshes(other.meshes), + size(other.size), ventAmount(other.ventAmount), damages(other.damages), + deleteOnTouch(other.deleteOnTouch), meshes(other.meshes), chunkCompounds(other.chunkCompounds) {} diff --git a/src/microbe_stage/generate_cell_stage_world.rb b/src/microbe_stage/generate_cell_stage_world.rb index c94fe5b4501..1222a022f44 100644 --- a/src/microbe_stage/generate_cell_stage_world.rb +++ b/src/microbe_stage/generate_cell_stage_world.rb @@ -105,6 +105,7 @@ ])], nosynchronize: true), EntityComponent.new("AgentProperties", [ConstructorInfo.new([])]), + EntityComponent.new("DamageOnTouchComponent", [ConstructorInfo.new([])]), ], systems: [ diff --git a/src/scripting/script_initializer.cpp b/src/scripting/script_initializer.cpp index a560f565cf0..b86ad835db6 100644 --- a/src/scripting/script_initializer.cpp +++ b/src/scripting/script_initializer.cpp @@ -344,6 +344,16 @@ bool ANGELSCRIPT_REGISTERFAIL; } + if(engine->RegisterObjectProperty( + "ChunkData", "double damages", asOFFSET(ChunkData, damages)) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + + if(engine->RegisterObjectProperty("ChunkData", "bool deleteOnTouch", + asOFFSET(ChunkData, deleteOnTouch)) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + if(engine->RegisterObjectProperty("ChunkData", "double chunkScale", asOFFSET(ChunkData, chunkScale)) < 0) { ANGELSCRIPT_REGISTERFAIL; @@ -554,6 +564,8 @@ static uint16_t CompoundVenterTYPEProxy = static_cast(CompoundVenterComponent::TYPE); static uint16_t EngulfableComponentTYPEProxy = static_cast(EngulfableComponent::TYPE); +static uint16_t DamageOnTouchComponentTYPEProxy = + static_cast(DamageOnTouchComponent::TYPE); static uint16_t SpawnedComponentTYPEProxy = static_cast(SpawnedComponent::TYPE); static uint16_t AgentCloudComponentTYPEProxy = @@ -686,6 +698,39 @@ bool ANGELSCRIPT_REGISTERFAIL; } + // ------------------------------------ // + if(engine->RegisterObjectType( + "DamageOnTouchComponent", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + + if(!bindComponentTypeId( + engine, "DamageOnTouchComponent", &DamageOnTouchComponentTYPEProxy)) + return false; + + if(engine->RegisterObjectMethod("DamageOnTouchComponent", + "double getDamage()", asMETHOD(DamageOnTouchComponent, getDamage), + asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + + if(engine->RegisterObjectMethod("DamageOnTouchComponent", + "void setDamage(double damage)", + asMETHOD(DamageOnTouchComponent, setDamage), asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + if(engine->RegisterObjectMethod("DamageOnTouchComponent", + "bool getDeletes()", asMETHOD(DamageOnTouchComponent, getDeletes), + asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + + if(engine->RegisterObjectMethod("DamageOnTouchComponent", + "void setDeletes(bool deletes)", + asMETHOD(DamageOnTouchComponent, setDeletes), asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + // ------------------------------------ // if(engine->RegisterObjectType( "SpawnedComponent", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) { diff --git a/src/thrive_common.cpp b/src/thrive_common.cpp index 66706e4a394..96bf582937c 100644 --- a/src/thrive_common.cpp +++ b/src/thrive_common.cpp @@ -147,13 +147,13 @@ void } void - cellHitIron(Leviathan::PhysicalWorld& physicalWorld, + cellHitEngulfable(Leviathan::PhysicalWorld& physicalWorld, Leviathan::PhysicsBody& first, Leviathan::PhysicsBody& second) { GameWorld* gameWorld = physicalWorld.GetGameWorld(); - ScriptRunningSetup setup("cellHitIron"); + ScriptRunningSetup setup("cellHitEngulfable"); auto result = ThriveCommon::get()->getMicrobeScripts()->ExecuteOnModule(setup, @@ -161,9 +161,28 @@ void second.GetOwningEntity()); if(result.Result != SCRIPT_RUN_RESULT::Success) - LOG_ERROR("Failed to run script side cellHitIron"); + LOG_ERROR("Failed to run script side cellHitEngulfable"); } +void + cellHitDamageChunk(Leviathan::PhysicalWorld& physicalWorld, + Leviathan::PhysicsBody& first, + Leviathan::PhysicsBody& second) +{ + GameWorld* gameWorld = physicalWorld.GetGameWorld(); + + ScriptRunningSetup setup("cellHitDamageChunk"); + + auto result = + ThriveCommon::get()->getMicrobeScripts()->ExecuteOnModule(setup, + false, gameWorld, first.GetOwningEntity(), + second.GetOwningEntity()); + + if(result.Result != SCRIPT_RUN_RESULT::Success) + LOG_ERROR("Failed to run script side cellHitDamageChunk"); +} + + //! \todo This should return false when either cell is engulfing and apply the //! damaging effect bool @@ -264,8 +283,10 @@ std::unique_ptr std::make_unique("floatingOrganelle", 2); auto agentMaterial = std::make_unique("agentCollision", 3); - auto ironMaterial = - std::make_unique("iron", 4); + auto engulfableMaterial = + std::make_unique("engulfableMaterial", 4); + auto chunkDamageMaterial = + std::make_unique("chunkDamageMaterial", 5); // Set callbacks // @@ -273,10 +294,11 @@ std::unique_ptr cellMaterial->FormPairWith(*floatingOrganelleMaterial) .SetCallbacks(nullptr, cellHitFloatingOrganelle); - // Iron - cellMaterial->FormPairWith(*ironMaterial) - .SetCallbacks(nullptr, cellHitIron); - + // Chunks + cellMaterial->FormPairWith(*engulfableMaterial) + .SetCallbacks(nullptr, cellHitEngulfable); + cellMaterial->FormPairWith(*chunkDamageMaterial) + .SetCallbacks(nullptr, *cellHitDamageChunk); // Agents cellMaterial->FormPairWith(*agentMaterial) .SetCallbacks(agentCallback, agentCollided); @@ -290,7 +312,8 @@ std::unique_ptr manager->LoadedMaterialAdd(std::move(cellMaterial)); manager->LoadedMaterialAdd(std::move(floatingOrganelleMaterial)); manager->LoadedMaterialAdd(std::move(agentMaterial)); - manager->LoadedMaterialAdd(std::move(ironMaterial)); + manager->LoadedMaterialAdd(std::move(engulfableMaterial)); + manager->LoadedMaterialAdd(std::move(chunkDamageMaterial)); return manager; }