Skip to content

Commit

Permalink
Venter now only vents compounds the compound bag component has and ta…
Browse files Browse the repository at this point in the history
…kes compounds from the bag. If not, it skips them.

Iron chunks' compound bag components now have an appropriate amount of iron ions for the  venters, that takes about 1000 seconds to run out, and they do.

ran formatter script

plastid actually only costs 50, so fixed typo in editor.
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Feb 15, 2019
1 parent 997a574 commit 452be0a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/gui/thrive_gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@
<div id="ChemoplastIcon"></div>Chemoplast<br>45 MP</td>
<td id="addNitrogenFixingPlastid" class="OrganelleListItem">
<span class="tooltiptext">
Nitrogen Fixing Plastid<hr><br> Cost: 80 mutation points<hr><br>
Nitrogen Fixing Plastid<hr><br> Cost: 50 mutation points<hr><br>
Performs Process: Nitrogen Fixation<br>(1 Oxygen + 5 ATP -> 0.5 Ammonia)/Second (Depending On Environmental Oxygen)<hr><br>
Allows for synthesis of ammonia from atmospheric nitrogen and oxygen. For easier cell growth.
</span>
Expand Down
5 changes: 5 additions & 0 deletions scripts/microbe_stage/configs.as
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ const float OXY_TOXY_DAMAGE = 10.0f;
// Cooldown between agent emissions, in milliseconds.
const uint AGENT_EMISSION_COOLDOWN = 2000;

// Iron amounts per chunk.
// big iron ejects ten per 20 clicks , so about 30 per second, so ill give it enough for 1000 seconds)
const double IRON_PER_BIG_CHUNK = 30000.0f;
// small iron ejects 3 per 20 clicks , so about 9 per second, so ill give it enough for 1000 seconds aswell
const double IRON_PER_SMALL_CHUNK = 9000.0f;
//Auto Evo Values
const int CREATURE_DEATH_POPULATION_LOSS = -60;
const int CREATURE_KILL_POPULATION_GAIN = 50;
Expand Down
6 changes: 5 additions & 1 deletion scripts/microbe_stage/setup.as
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ ObjectID createIron(CellStageWorld@ world, Float3 pos)
int ironSize = 1;
// 5 is the default
float ironAmount = 3.0f;
double ironBagAmount= IRON_PER_SMALL_CHUNK;
// There are four kinds
switch (GetEngine().GetRandom().GetNumber(0, 4))
{
Expand All @@ -653,14 +654,17 @@ ObjectID createIron(CellStageWorld@ world, Float3 pos)
mesh="iron_05.mesh";
ironSize=10;
ironAmount=10.0f;
ironBagAmount=IRON_PER_BIG_CHUNK;
break;
}


auto venter = world.Create_CompoundVenterComponent(ironEntity);
// So that larger iron chunks give out more compounds
venter.setVentAmount(ironAmount);
world.Create_CompoundBagComponent(ironEntity);
auto bag = world.Create_CompoundBagComponent(ironEntity);

bag.setCompound(SimulationParameters::compoundRegistry().getTypeId("iron"),ironBagAmount);
auto model = world.Create_Model(ironEntity, renderNode.Node, mesh);
// Need to set the tint
model.GraphicalObject.setCustomParameter(1, Ogre::Vector4(1, 1, 1, 1));
Expand Down
15 changes: 11 additions & 4 deletions src/microbe_stage/compound_venter_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ void
for(auto& value : CachedComponents.GetIndex()) {
CompoundBagComponent& bag = std::get<0>(*value.second);
CompoundVenterComponent& venter = std::get<1>(*value.second);
Leviathan::Position& position = std::get<2>(*value.second);
venter.ventCompound(position,
SimulationParameters::compoundRegistry.getTypeId("iron"),
venter.ventAmount, world);
// Loop through all the compounds in the storage bag and eject them
for(const auto& compound : bag.compounds) {
double compoundAmount = compound.second.amount;
CompoundId compoundId = compound.first;
if(venter.ventAmount <= compoundAmount) {
Leviathan::Position& position = std::get<2>(*value.second);
venter.ventCompound(
position, compoundId, venter.ventAmount, world);
bag.takeCompound(compoundId, venter.ventAmount);
}
}
}
}
}
Expand Down

0 comments on commit 452be0a

Please sign in to comment.